mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #475, menus to call load/save DB data
This commit is contained in:
committed by
Mathew Sutcliffe
parent
aa653e0d85
commit
5147031ec2
@@ -77,7 +77,7 @@ void CSwiftData::ps_onStyleSheetsChanged()
|
|||||||
void CSwiftData::init()
|
void CSwiftData::init()
|
||||||
{
|
{
|
||||||
this->setWindowIcon(CIcons::swiftDatabase24());
|
this->setWindowIcon(CIcons::swiftDatabase24());
|
||||||
this->setWindowTitle(QString("swiftdata %1").arg(CProject::version()));
|
this->setWindowTitle(QString("Mapping tool %1").arg(CProject::swiftVersionStringDevInfo()));
|
||||||
this->setObjectName("CSwiftData");
|
this->setObjectName("CSwiftData");
|
||||||
this->initStyleSheet();
|
this->initStyleSheet();
|
||||||
this->initLogDisplay();
|
this->initLogDisplay();
|
||||||
|
|||||||
@@ -10,10 +10,12 @@
|
|||||||
#include "swiftdata.h"
|
#include "swiftdata.h"
|
||||||
#include "ui_swiftdata.h"
|
#include "ui_swiftdata.h"
|
||||||
#include "blackgui/components/dbmappingcomponent.h"
|
#include "blackgui/components/dbmappingcomponent.h"
|
||||||
|
#include "blackgui/components/datainfoareacomponent.h"
|
||||||
#include "blackgui/components/logcomponent.h"
|
#include "blackgui/components/logcomponent.h"
|
||||||
#include "blackgui/stylesheetutility.h"
|
#include "blackgui/stylesheetutility.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
|
#include "blackmisc/project.h"
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
@@ -81,4 +83,16 @@ void CSwiftData::initDynamicMenus()
|
|||||||
Q_ASSERT(this->ui->menu_InfoAreas);
|
Q_ASSERT(this->ui->menu_InfoAreas);
|
||||||
Q_ASSERT(this->ui->comp_MainInfoArea);
|
Q_ASSERT(this->ui->comp_MainInfoArea);
|
||||||
this->ui->menu_InfoAreas->addActions(this->ui->comp_MainInfoArea->getInfoAreaSelectActions(this->ui->menu_InfoAreas));
|
this->ui->menu_InfoAreas->addActions(this->ui->comp_MainInfoArea->getInfoAreaSelectActions(this->ui->menu_InfoAreas));
|
||||||
|
|
||||||
|
QString resourceDir(CProject::getSwiftResourceDir());
|
||||||
|
if (!resourceDir.isEmpty())
|
||||||
|
{
|
||||||
|
Q_ASSERT_X(this->ui->comp_MainInfoArea, Q_FUNC_INFO, "Missing main info area");
|
||||||
|
Q_ASSERT_X(this->ui->comp_MainInfoArea->getDataInfoAreaComponent(), Q_FUNC_INFO, "Missing DB info area");
|
||||||
|
this->ui->menu_Mapping->addAction(CIcons::load16(), "Load DB data", this->ui->comp_MainInfoArea->getDataInfoAreaComponent(), SLOT(readDbDataFromResourceDir()));
|
||||||
|
if (CProject::isRunningInDeveloperEnvironment() && this->ui->comp_MainInfoArea->getDataInfoAreaComponent()->canConnectSwiftDb())
|
||||||
|
{
|
||||||
|
this->ui->menu_Mapping->addAction(CIcons::save16(), "Save DB data", this->ui->comp_MainInfoArea->getDataInfoAreaComponent(), SLOT(writeDbDataToResourceDir()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ CIntroWindow::CIntroWindow(QWidget *parent) :
|
|||||||
ui(new Ui::CIntroWindow)
|
ui(new Ui::CIntroWindow)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowTitle(BlackMisc::CProject::swiftVersionString());
|
this->setWindowTitle(BlackMisc::CProject::swiftVersionStringDevInfo());
|
||||||
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::sessionDBusServer());
|
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::sessionDBusServer());
|
||||||
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::systemDBusServer());
|
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::systemDBusServer());
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
|||||||
|
|
||||||
// init window
|
// init window
|
||||||
this->setWindowIcon(CIcons::swift24());
|
this->setWindowIcon(CIcons::swift24());
|
||||||
this->setWindowTitle(CProject::swiftVersionString());
|
this->setWindowTitle(CProject::swiftVersionStringDevInfo());
|
||||||
this->setObjectName("SwiftGuiStd");
|
this->setObjectName("SwiftGuiStd");
|
||||||
this->initStyleSheet();
|
this->initStyleSheet();
|
||||||
QPoint pos = CGuiUtility::introWindowPosition();
|
QPoint pos = CGuiUtility::introWindowPosition();
|
||||||
|
|||||||
Reference in New Issue
Block a user