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>
This commit is contained in:
Tomaz Canabrava 2015-02-09 18:27:59 -02:00 committed by Dirk Hohndel
parent c69aab04f4
commit cf4d55c470
15 changed files with 32 additions and 29 deletions

View file

@ -19,6 +19,7 @@
#include "qt-ui/mainwindow.h"
#include "helpers.h"
#include "qthelper.h"
#include "divecomputer.h"
#include <QApplication>
#include <QFileDialog>

View file

@ -1,6 +1,7 @@
#include "divecomputermanagementdialog.h"
#include "mainwindow.h"
#include "helpers.h"
#include "models.h"
#include <QMessageBox>
#include <QShortcut>

View file

@ -3,6 +3,7 @@
#include "mainwindow.h"
#include "planner.h"
#include "helpers.h"
#include "models.h"
#include <QGraphicsSceneMouseEvent>
#include <QMessageBox>

View file

@ -1,7 +1,7 @@
#include "downloadfromdivecomputer.h"
#include "helpers.h"
#include "mainwindow.h"
#include "divelistview.h"
#include <QTimer>
#include <QFileDialog>
#include <QMessageBox>

View file

@ -1,5 +1,7 @@
#include "filtermodels.h"
#include "mainwindow.h"
#include "models.h"
#include "divelistview.h"
#define CREATE_INSTANCE_METHOD( CLASS ) \
CLASS *CLASS::instance() \

View file

@ -2,6 +2,7 @@
#ifndef NO_MARBLE
#include "mainwindow.h"
#include "helpers.h"
#include "divelistview.h"
#include <QTimer>
#include <marble/AbstractFloatItem.h>

View file

@ -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"

View file

@ -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()

View file

@ -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>
@ -851,11 +843,6 @@ p, li { white-space: pre-wrap; }
<header>qt-ui/maintab.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>DiveListView</class>
<extends>QTreeView</extends>
<header>divelistview.h</header>
</customwidget>
<customwidget>
<class>GlobeGPS</class>
<extends>QWidget</extends>

View file

@ -2,6 +2,7 @@
#include "dive.h"
#include "gettextfromc.h"
#include "mainwindow.h"
#include "models.h"
#include <QCompleter>

View file

@ -1,5 +1,7 @@
#include "preferences.h"
#include "mainwindow.h"
#include "models.h"
#include <QSettings>
#include <QFileDialog>
#include <QMessageBox>

View file

@ -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)
{

View file

@ -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>

View file

@ -10,7 +10,7 @@
#include "mainwindow.h"
#include "helpers.h"
#include "libdivecomputer/parser.h"
#include "divelistview.h"
class MinMaxAvgWidgetPrivate {
public:

View file

@ -2,6 +2,7 @@
#include "webservice.h"
#include "mainwindow.h"
#include "usersurvey.h"
#include "divelist.h"
#include <errno.h>
#include <QDir>