From 7d66dcd12d42db7c9e3f18be21615204588a66e3 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 11 Feb 2015 13:32:29 -0200 Subject: Enable the location edit widget on mainwindow Clicking on the 'Manage' button now brings you to the widget to manage it. Nothing has been added on it yet. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 2 ++ qt-ui/maintab.h | 2 +- qt-ui/maintab.ui | 8 ++++---- qt-ui/mainwindow.cpp | 5 +++++ 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 @@ - + manage @@ -400,7 +400,7 @@ 0 0 - 454 + 443 752 @@ -456,7 +456,7 @@ 0 0 - 454 + 443 752 @@ -773,7 +773,7 @@ 0 0 - 454 + 443 752 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(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 *); -- cgit v1.2.3-70-g09d2