refs #475, menus to call load/save DB data

This commit is contained in:
Klaus Basan
2015-09-30 05:07:36 +02:00
committed by Mathew Sutcliffe
parent aa653e0d85
commit 5147031ec2
4 changed files with 17 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ void CSwiftData::ps_onStyleSheetsChanged()
void CSwiftData::init()
{
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->initStyleSheet();
this->initLogDisplay();

View File

@@ -10,10 +10,12 @@
#include "swiftdata.h"
#include "ui_swiftdata.h"
#include "blackgui/components/dbmappingcomponent.h"
#include "blackgui/components/datainfoareacomponent.h"
#include "blackgui/components/logcomponent.h"
#include "blackgui/stylesheetutility.h"
#include "blackmisc/statusmessagelist.h"
#include "blackmisc/logmessage.h"
#include "blackmisc/project.h"
#include <QPoint>
#include <QMenu>
#include <QDesktopServices>
@@ -81,4 +83,16 @@ void CSwiftData::initDynamicMenus()
Q_ASSERT(this->ui->menu_InfoAreas);
Q_ASSERT(this->ui->comp_MainInfoArea);
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()));
}
}
}

View File

@@ -28,7 +28,7 @@ CIntroWindow::CIntroWindow(QWidget *parent) :
ui(new Ui::CIntroWindow)
{
ui->setupUi(this);
this->setWindowTitle(BlackMisc::CProject::swiftVersionString());
this->setWindowTitle(BlackMisc::CProject::swiftVersionStringDevInfo());
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::sessionDBusServer());
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::systemDBusServer());

View File

@@ -38,7 +38,7 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
// init window
this->setWindowIcon(CIcons::swift24());
this->setWindowTitle(CProject::swiftVersionString());
this->setWindowTitle(CProject::swiftVersionStringDevInfo());
this->setObjectName("SwiftGuiStd");
this->initStyleSheet();
QPoint pos = CGuiUtility::introWindowPosition();