diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-02-09 18:27:59 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-10 10:45:45 -0800 |
commit | cf4d55c4702ded9d57fa7d6aeeebd0bfb2476a29 (patch) | |
tree | bd50d1e2fb20f0d2251fa6cf620149f953031d7f /qt-ui | |
parent | c69aab04f4d548a4e640bccba1e6d91770b7811d (diff) | |
download | subsurface-cf4d55c4702ded9d57fa7d6aeeebd0bfb2476a29.tar.gz |
Remove the DiveList from the mainwindow.ui
It's now set up from the mainwindow.cpp file.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divecomputermanagementdialog.cpp | 1 | ||||
-rw-r--r-- | qt-ui/diveplanner.cpp | 1 | ||||
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 2 | ||||
-rw-r--r-- | qt-ui/filtermodels.cpp | 2 | ||||
-rw-r--r-- | qt-ui/globe.cpp | 1 | ||||
-rw-r--r-- | qt-ui/maintab.cpp | 2 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 27 | ||||
-rw-r--r-- | qt-ui/mainwindow.ui | 15 | ||||
-rw-r--r-- | qt-ui/modeldelegates.cpp | 1 | ||||
-rw-r--r-- | qt-ui/preferences.cpp | 2 | ||||
-rw-r--r-- | qt-ui/printlayout.cpp | 1 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 2 | ||||
-rw-r--r-- | qt-ui/simplewidgets.cpp | 2 | ||||
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 1 |
14 files changed, 31 insertions, 29 deletions
diff --git a/qt-ui/divecomputermanagementdialog.cpp b/qt-ui/divecomputermanagementdialog.cpp index 742facdcb..552f6058f 100644 --- a/qt-ui/divecomputermanagementdialog.cpp +++ b/qt-ui/divecomputermanagementdialog.cpp @@ -1,6 +1,7 @@ #include "divecomputermanagementdialog.h" #include "mainwindow.h" #include "helpers.h" +#include "models.h" #include <QMessageBox> #include <QShortcut> diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 3587d3c22..6741d9c7c 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -3,6 +3,7 @@ #include "mainwindow.h" #include "planner.h" #include "helpers.h" +#include "models.h" #include <QGraphicsSceneMouseEvent> #include <QMessageBox> diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index cd3dd90d0..14ba7f234 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -1,7 +1,7 @@ #include "downloadfromdivecomputer.h" #include "helpers.h" #include "mainwindow.h" - +#include "divelistview.h" #include <QTimer> #include <QFileDialog> #include <QMessageBox> diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp index e2597a634..3585065da 100644 --- a/qt-ui/filtermodels.cpp +++ b/qt-ui/filtermodels.cpp @@ -1,5 +1,7 @@ #include "filtermodels.h" #include "mainwindow.h" +#include "models.h" +#include "divelistview.h" #define CREATE_INSTANCE_METHOD( CLASS ) \ CLASS *CLASS::instance() \ diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 1e4639d5c..6bfd98734 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -2,6 +2,7 @@ #ifndef NO_MARBLE #include "mainwindow.h" #include "helpers.h" +#include "divelistview.h" #include <QTimer> #include <marble/AbstractFloatItem.h> diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 88cfd8849..263ea9a4b 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -9,6 +9,8 @@ #include "helpers.h" #include "statistics.h" #include "modeldelegates.h" +#include "models.h" +#include "divelistview.h" #if defined(FBSUPPORT) #include "socialnetworks.h" diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index a993667f9..64f31ccf8 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -12,6 +12,7 @@ #include <QShortcut> #include <QToolBar> #include "ssrf-version.h" +#include "divelistview.h" #include "downloadfromdivecomputer.h" #include "preferences.h" #include "subsurfacewebservices.h" @@ -79,10 +80,10 @@ MainWindow::MainWindow() : QMainWindow(), if (!QIcon::hasThemeIcon("window-close")) { QIcon::setThemeName("subsurface"); } - connect(ui.ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int))); + connect(dive_list(), SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int))); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings())); - connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.ListWidget, SLOT(update())); - connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.ListWidget, SLOT(reloadHeaderActions())); + connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveListView, SLOT(update())); + connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveListView, SLOT(reloadHeaderActions())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.InfoWidget, SLOT(updateDiveInfo())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.divePlannerWidget, SLOT(settingsChanged())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.plannerSettingsWidget, SLOT(settingsChanged())); @@ -105,12 +106,12 @@ MainWindow::MainWindow() : QMainWindow(), ui.newProfile->setEmptyState(); initialUiSetup(); readSettings(); - ui.ListWidget->reload(DiveTripModel::TREE); - ui.ListWidget->reloadHeaderActions(); - ui.ListWidget->setFocus(); + diveListView->reload(DiveTripModel::TREE); + diveListView->reloadHeaderActions(); + diveListView->setFocus(); ui.globe->reload(); - ui.ListWidget->expand(ui.ListWidget->model()->index(0, 0)); - ui.ListWidget->scrollTo(ui.ListWidget->model()->index(0, 0), QAbstractItemView::PositionAtCenter); + diveListView->expand(dive_list()->model()->index(0, 0)); + diveListView->scrollTo(dive_list()->model()->index(0, 0), QAbstractItemView::PositionAtCenter); ui.divePlannerWidget->settingsChanged(); ui.plannerSettingsWidget->settingsChanged(); #ifdef NO_MARBLE @@ -207,8 +208,8 @@ void MainWindow::refreshDisplay(bool doRecreateDiveList) ui.globePane->hide(); #endif ui.globePane->setCurrentIndex(0); - ui.ListWidget->setEnabled(true); - ui.ListWidget->setFocus(); + dive_list()->setEnabled(true); + dive_list()->setFocus(); WSInfoModel::instance()->updateInfo(); if (amount_selected == 0) cleanUpEmpty(); @@ -216,7 +217,7 @@ void MainWindow::refreshDisplay(bool doRecreateDiveList) void MainWindow::recreateDiveList() { - ui.ListWidget->reload(DiveTripModel::CURRENT); + dive_list()->reload(DiveTripModel::CURRENT); TagFilterModel::instance()->repopulate(); BuddyFilterModel::instance()->repopulate(); LocationFilterModel::instance()->repopulate(); @@ -283,7 +284,7 @@ void MainWindow::cleanUpEmpty() ui.InfoWidget->clearEquipment(); ui.InfoWidget->updateDiveInfo(true); ui.newProfile->setEmptyState(); - ui.ListWidget->reload(DiveTripModel::TREE); + dive_list()->reload(DiveTripModel::TREE); ui.globe->reload(); if (!existing_filename) setTitle(MWTF_DEFAULT); @@ -1013,7 +1014,7 @@ void MainWindow::closeEvent(QCloseEvent *event) DiveListView *MainWindow::dive_list() { - return ui.ListWidget; + return qobject_cast<DiveListView*>(applicationState["Default"].bottomLeft); } GlobeGPS *MainWindow::globe() diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 9140e8951..c43b9af87 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -73,15 +73,7 @@ <number>0</number> </property> <widget class="QWidget" name="page_3"> - <layout class="QVBoxLayout" name="diveListLayout"> - <item> - <widget class="DiveListView" name="ListWidget"> - <property name="selectionMode"> - <enum>QAbstractItemView::ExtendedSelection</enum> - </property> - </widget> - </item> - </layout> + <layout class="QVBoxLayout" name="diveListLayout"/> </widget> <widget class="PlannerSettingsWidget" name="plannerSettingsWidget"/> </widget> @@ -852,11 +844,6 @@ p, li { white-space: pre-wrap; } <container>1</container> </customwidget> <customwidget> - <class>DiveListView</class> - <extends>QTreeView</extends> - <header>divelistview.h</header> - </customwidget> - <customwidget> <class>GlobeGPS</class> <extends>QWidget</extends> <header>globe.h</header> diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index ee7dc6cf5..d60b0ea93 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -2,6 +2,7 @@ #include "dive.h" #include "gettextfromc.h" #include "mainwindow.h" +#include "models.h" #include <QCompleter> diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index ab241f358..e4f97002e 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -1,5 +1,7 @@ #include "preferences.h" #include "mainwindow.h" +#include "models.h" + #include <QSettings> #include <QFileDialog> #include <QMessageBox> diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 6b88f0d29..eef5144dc 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -8,6 +8,7 @@ #include "printdialog.h" #include "printlayout.h" #include "modeldelegates.h" +#include "models.h" PrintLayout::PrintLayout(PrintDialog *dialogPtr, QPrinter *printerPtr, struct print_options *optionsPtr) { diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index f04d16b3f..89ab62db7 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -10,6 +10,8 @@ #include "ruleritem.h" #include "tankitem.h" #include "pref.h" +#include "models.h" + #include <libdivecomputer/parser.h> #include <QScrollBar> #include <QtCore/qmath.h> diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index d258fe7af..42f00fbb0 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -10,7 +10,7 @@ #include "mainwindow.h" #include "helpers.h" #include "libdivecomputer/parser.h" - +#include "divelistview.h" class MinMaxAvgWidgetPrivate { public: diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 597fe03b6..6498f432a 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -2,6 +2,7 @@ #include "webservice.h" #include "mainwindow.h" #include "usersurvey.h" +#include "divelist.h" #include <errno.h> #include <QDir> |