aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp9
-rw-r--r--qt-ui/mainwindow.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index de7cdbdc1..4e35ad9ee 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -39,6 +39,7 @@
#include "usersurvey.h"
#include "divesitehelpers.h"
#include "locationinformation.h"
+#include "windowtitleupdate.h"
#ifndef NO_USERMANUAL
#include "usermanual.h"
#endif
@@ -148,7 +149,8 @@ MainWindow::MainWindow() : QMainWindow(),
connect(locationInformation, SIGNAL(startEditDiveSite(uint32_t)), globeGps, SLOT(prepareForGetDiveCoordinates()));
connect(locationInformation, SIGNAL(endEditDiveSite()), globeGps, SLOT(prepareForGetDiveCoordinates()));
connect(information(), SIGNAL(diveSiteChanged(uint32_t)), globeGps, SLOT(centerOnDiveSite(uint32_t)));
-
+ wtu = new WindowTitleUpdate();
+ connect(WindowTitleUpdate::instance(), SIGNAL(updateTitle()), this, SLOT(setAutomaticTitle()));
#ifdef NO_PRINTING
plannerDetails->printPlan()->hide();
ui.menuFile->removeAction(ui.actionPrint);
@@ -1439,6 +1441,11 @@ QString MainWindow::displayedFilename(QString fullFilename)
return fileName;
}
+void MainWindow::setAutomaticTitle()
+{
+ setTitle();
+}
+
void MainWindow::setTitle(enum MainWindowTitleFormat format)
{
switch (format) {
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 8469f5737..0d9f61098 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -14,6 +14,7 @@
#include "ui_mainwindow.h"
#include "notificationwidget.h"
+#include "windowtitleupdate.h"
struct DiveList;
class QSortFilterProxyModel;
@@ -171,6 +172,7 @@ slots:
void on_actionConfigure_Dive_Computer_triggered();
void enableDiveSiteEdit(uint32_t id);
void setDefaultState();
+ void setAutomaticTitle();
protected:
void closeEvent(QCloseEvent *);
@@ -228,6 +230,7 @@ private:
};
QHash<QByteArray, WidgetForQuadrant> applicationState;
QByteArray currentApplicationState;
+ WindowTitleUpdate *wtu;
};
#endif // MAINWINDOW_H