summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-02-11 13:32:29 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-11 16:34:02 -0800
commit7d66dcd12d42db7c9e3f18be21615204588a66e3 (patch)
treeaa718c906fa516ad7471646bbd12525ec399b848
parente3d800885f9b5814f88235f49982635f7644da8e (diff)
downloadsubsurface-7d66dcd12d42db7c9e3f18be21615204588a66e3.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/maintab.cpp2
-rw-r--r--qt-ui/maintab.h2
-rw-r--r--qt-ui/maintab.ui8
-rw-r--r--qt-ui/mainwindow.cpp5
-rw-r--r--qt-ui/mainwindow.h1
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 *);