diff options
-rw-r--r-- | qt-ui/maintab.cpp | 2 | ||||
-rw-r--r-- | qt-ui/maintab.h | 2 | ||||
-rw-r--r-- | qt-ui/maintab.ui | 8 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 5 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 1 |
5 files changed, 13 insertions, 5 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index e0da97a2d..385b0e2e2 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -49,6 +49,8 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), ui.extraData->setModel(extraDataModel); closeMessage(); + connect(ui.manageDiveSite, SIGNAL(clicked()), this, SIGNAL(requestDiveSiteEdit())); + QAction *action = new QAction(tr("Apply changes"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges())); addMessageAction(action); diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index a279baf7a..acbb8f14f 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -55,7 +55,7 @@ public: signals: void addDiveFinished(); void dateTimeChanged(); - + void requestDiveSiteEdit(); public slots: void addCylinder_clicked(); diff --git a/qt-ui/maintab.ui b/qt-ui/maintab.ui index 48bad01aa..cdaab8386 100644 --- a/qt-ui/maintab.ui +++ b/qt-ui/maintab.ui @@ -131,7 +131,7 @@ </widget> </item> <item> - <widget class="QPushButton" name="pushButton"> + <widget class="QPushButton" name="manageDiveSite"> <property name="text"> <string>manage</string> </property> @@ -400,7 +400,7 @@ <rect> <x>0</x> <y>0</y> - <width>454</width> + <width>443</width> <height>752</height> </rect> </property> @@ -456,7 +456,7 @@ <rect> <x>0</x> <y>0</y> - <width>454</width> + <width>443</width> <height>752</height> </rect> </property> @@ -773,7 +773,7 @@ <rect> <x>0</x> <y>0</y> - <width>454</width> + <width>443</width> <height>752</height> </rect> </property> diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index c763f8e58..c3226c0d0 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -111,6 +111,7 @@ MainWindow::MainWindow() : QMainWindow(), connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated())); connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled())); connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget(), SLOT(printDecoPlan())); + connect(mainTab, SIGNAL(requestDiveSiteEdit()), this, SLOT(enableDiveSiteEdit())); #ifdef NO_PRINTING ui.printPlan->hide(); ui.menuFile->removeAction(ui.actionPrint); @@ -212,6 +213,10 @@ LocationInformationWidget *MainWindow::locationInformationWidget() { return qobject_cast<LocationInformationWidget*>(applicationState["EditDiveSite"].topLeft); } +void MainWindow::enableDiveSiteEdit() { + setApplicationState("EditDiveSite"); +} + void MainWindow::setLoadedWithFiles(bool f) { filesAsArguments = f; diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 6d4c05acc..69ee44217 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -159,6 +159,7 @@ slots: void on_paste_triggered(); void on_actionFilterTags_triggered(); void on_actionConfigure_Dive_Computer_triggered(); + void enableDiveSiteEdit(); protected: void closeEvent(QCloseEvent *); |