diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-02-09 19:51:31 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-10 10:45:45 -0800 |
commit | 6b038c2a9aa16410b614a7febaa3a856a7f7cd6f (patch) | |
tree | 0dd2f7b61742a240ecad4a126df1b2e0871add5b | |
parent | 2992d78f83ce121b5a34a566026c6068416c2557 (diff) | |
download | subsurface-6b038c2a9aa16410b614a7febaa3a856a7f7cd6f.tar.gz |
Remove the ProfileWidget from mainwindow.ui
It is now in mainwindo.cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | main.cpp | 1 | ||||
-rw-r--r-- | qt-ui/configuredivecomputerdialog.cpp | 2 | ||||
-rw-r--r-- | qt-ui/divelistview.cpp | 1 | ||||
-rw-r--r-- | qt-ui/divelogimportdialog.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 | 1 | ||||
-rw-r--r-- | qt-ui/globe.cpp | 1 | ||||
-rw-r--r-- | qt-ui/maintab.cpp | 2 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 49 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 1 | ||||
-rw-r--r-- | qt-ui/mainwindow.ui | 12 | ||||
-rw-r--r-- | qt-ui/modeldelegates.cpp | 1 | ||||
-rw-r--r-- | qt-ui/models.cpp | 1 | ||||
-rw-r--r-- | qt-ui/printlayout.cpp | 1 | ||||
-rw-r--r-- | qt-ui/profile/divecartesianaxis.cpp | 2 | ||||
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 1 | ||||
-rw-r--r-- | qt-ui/profile/divetextitem.cpp | 1 | ||||
-rw-r--r-- | qt-ui/profile/ruleritem.cpp | 2 | ||||
-rw-r--r-- | qt-ui/simplewidgets.cpp | 3 | ||||
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 2 |
21 files changed, 50 insertions, 38 deletions
@@ -10,6 +10,7 @@ #include "subsurfacestartup.h" #include "qt-ui/mainwindow.h" #include "qt-ui/diveplanner.h" +#include "qt-ui/graphicsview-common.h" #include <QStringList> #include <git2.h> diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index 95bc0f882..172a1a480 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -2,6 +2,8 @@ #include "helpers.h" #include "mainwindow.h" +#include "display.h" + #include <QFileDialog> #include <QMessageBox> #include <QSettings> diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 3e001166c..b1c00ec1c 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -9,6 +9,7 @@ #include "modeldelegates.h" #include "mainwindow.h" #include "divepicturewidget.h" +#include "display.h" #include <QSettings> #include <QKeyEvent> #include <QFileDialog> diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index bb4701ce3..ce12ef7ec 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -1,5 +1,6 @@ #include "divelogimportdialog.h" #include "mainwindow.h" +#include "color.h" #include "ui_divelogimportdialog.h" #include <QShortcut> #include <QDrag> diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 6741d9c7c..f535a6a98 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -4,6 +4,7 @@ #include "planner.h" #include "helpers.h" #include "models.h" +#include "profile/profilewidget2.h" #include <QGraphicsSceneMouseEvent> #include <QMessageBox> diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 14ba7f234..456c7e208 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -2,6 +2,8 @@ #include "helpers.h" #include "mainwindow.h" #include "divelistview.h" +#include "display.h" + #include <QTimer> #include <QFileDialog> #include <QMessageBox> diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp index 3585065da..378f46735 100644 --- a/qt-ui/filtermodels.cpp +++ b/qt-ui/filtermodels.cpp @@ -2,6 +2,7 @@ #include "mainwindow.h" #include "models.h" #include "divelistview.h" +#include "display.h" #define CREATE_INSTANCE_METHOD( CLASS ) \ CLASS *CLASS::instance() \ diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index a8586ebd0..cda408ddc 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -4,6 +4,7 @@ #include "helpers.h" #include "divelistview.h" #include "maintab.h" +#include "display.h" #include <QTimer> #include <QContextMenuEvent> diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 78e68ec2d..3463ec796 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -12,6 +12,8 @@ #include "modeldelegates.h" #include "models.h" #include "divelistview.h" +#include "display.h" +#include "profile/profilewidget2.h" #if defined(FBSUPPORT) #include "socialnetworks.h" diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 22d7fd386..9caa5d3c3 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -21,6 +21,7 @@ #include "updatemanager.h" #include "planner.h" #include "filtermodels.h" +#include "profile/profilewidget2.h" #include "globe.h" #include "maintab.h" #ifndef NO_PRINTING @@ -96,7 +97,7 @@ MainWindow::MainWindow() : QMainWindow(), connect(ui.actionRecent2, SIGNAL(triggered(bool)), this, SLOT(recentFileTriggered(bool))); connect(ui.actionRecent3, SIGNAL(triggered(bool)), this, SLOT(recentFileTriggered(bool))); connect(ui.actionRecent4, SIGNAL(triggered(bool)), this, SLOT(recentFileTriggered(bool))); - connect(information(), SIGNAL(addDiveFinished()), ui.newProfile, SLOT(setProfileState())); + connect(information(), SIGNAL(addDiveFinished()), graphics(), SLOT(setProfileState())); connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated())); connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled())); connect(ui.printPlan, SIGNAL(pressed()), divePlannerWidget(), SLOT(printDecoPlan())); @@ -107,7 +108,7 @@ MainWindow::MainWindow() : QMainWindow(), #endif ui.mainErrorMessage->hide(); - ui.newProfile->setEmptyState(); + graphics()->setEmptyState(); initialUiSetup(); readSettings(); diveListView->reload(DiveTripModel::TREE); @@ -139,9 +140,12 @@ MainWindow::MainWindow() : QMainWindow(), // has no concept of "toolbar" for a non-mainwindow widget (...) // I need to take the current item that's in the toolbar Position // and reposition it alongside the grid layout. - QLayoutItem *p = ui.profileInnerLayout->takeAt(0); - ui.profileInnerLayout->addWidget(toolBar, 0, 0); - ui.profileInnerLayout->addItem(p, 0, 1); + // TODO: FIX THIS + // QLayoutItem *p = ui.profileInnerLayout->takeAt(0); + // ui.profileInnerLayout->addWidget(toolBar, 0, 0); + // ui.profileInnerLayout->addItem(p, 0, 1); + // ui.profileInnerLayout->setContentsMargins(QMargins(0, 5, 5, 5)); + // ui.profileInnerLayout->setSpacing(0); // and now for some layout hackery // this gets us consistent margins everywhere and a much more balanced look @@ -168,9 +172,6 @@ MainWindow::MainWindow() : QMainWindow(), else layout->setContentsMargins(margins); } - margins = QMargins(0, 5, 5, 5); - ui.profileInnerLayout->setContentsMargins(margins); - ui.profileInnerLayout->setSpacing(0); toolBar->setContentsMargins(zeroMargins); updateManager = new UpdateManager(this); @@ -234,7 +235,7 @@ void MainWindow::current_dive_changed(int divenr) select_dive(divenr); globe()->centerOnCurrentDive(); } - ui.newProfile->plotDive(); + graphics()->plotDive(); information()->updateDiveInfo(); } @@ -278,7 +279,7 @@ void MainWindow::on_actionSaveAs_triggered() ProfileWidget2 *MainWindow::graphics() const { - return ui.newProfile; + return qobject_cast<ProfileWidget2*>(applicationState["Default"].topRight); } void MainWindow::cleanUpEmpty() @@ -287,7 +288,7 @@ void MainWindow::cleanUpEmpty() information()->clearInfo(); information()->clearEquipment(); information()->updateDiveInfo(true); - ui.newProfile->setEmptyState(); + graphics()->setEmptyState(); dive_list()->reload(DiveTripModel::TREE); globe()->reload(); if (!existing_filename) @@ -310,7 +311,7 @@ bool MainWindow::okToClose(QString message) void MainWindow::closeCurrentFile() { - ui.newProfile->setEmptyState(); + graphics()->setEmptyState(); /* free the dives and trips */ clear_git_id(); while (dive_table.nr) @@ -386,7 +387,7 @@ void MainWindow::enableShortcuts() void MainWindow::showProfile() { enableShortcuts(); - ui.newProfile->setProfileState(); + graphics()->setProfileState(); setApplicationState("Default"); } @@ -457,16 +458,16 @@ void MainWindow::planCanceled() // while planning we might have modified the displayed_dive // let's refresh what's shown on the profile showProfile(); - ui.newProfile->replot(); + graphics()->replot(); refreshDisplay(false); - ui.newProfile->plotDive(get_dive(selected_dive)); + graphics()->plotDive(get_dive(selected_dive)); DivePictureModel::instance()->updateDivePictures(); } void MainWindow::planCreated() { // get the new dive selected and assign a number if reasonable - ui.newProfile->setProfileState(); + graphics()->setProfileState(); if (displayed_dive.id == 0) { // we might have added a new dive (so displayed_dive was cleared out by clone_dive() dive_list()->unselectDives(); @@ -527,8 +528,8 @@ void MainWindow::on_actionReplanDive_triggered() DivePlannerPointsModel::instance()->clear(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); - ui.newProfile->setPlanState(); - ui.newProfile->clearHandlers(); + graphics()->setPlanState(); + graphics()->clearHandlers(); setApplicationState("PlanDive"); divePlannerWidget()->setReplanButton(true); DivePlannerPointsModel::instance()->loadFromDive(current_dive); @@ -549,7 +550,7 @@ void MainWindow::on_actionDivePlanner_triggered() DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); setApplicationState("PlanDive"); - ui.newProfile->setPlanState(); + graphics()->setPlanState(); // create a simple starting dive, using the first gas from the just copied cylidners setupForAddAndPlan("planned dive"); // don't translate, stored in XML file @@ -593,9 +594,9 @@ void MainWindow::on_actionAddDive_triggered() information()->addDiveStarted(); - ui.newProfile->setAddState(); + graphics()->setAddState(); DivePlannerPointsModel::instance()->createSimpleDive(); - ui.newProfile->plotDive(); + graphics()->plotDive(); } void MainWindow::on_actionRenumber_triggered() @@ -750,7 +751,7 @@ void MainWindow::on_actionPreviousDC_triggered() { unsigned nrdc = number_of_computers(current_dive); dc_number = (dc_number + nrdc - 1) % nrdc; - ui.newProfile->plotDive(); + graphics()->plotDive(); information()->updateDiveInfo(); } @@ -758,7 +759,7 @@ void MainWindow::on_actionNextDC_triggered() { unsigned nrdc = number_of_computers(current_dive); dc_number = (dc_number + 1) % nrdc; - ui.newProfile->plotDive(); + graphics()->plotDive(); information()->updateDiveInfo(); } @@ -1396,7 +1397,7 @@ void MainWindow::editCurrentDive() if (defaultDC == "manually added dive") { disableShortcuts(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); - ui.newProfile->setAddState(); + graphics()->setAddState(); setApplicationState("EditDive"); DivePlannerPointsModel::instance()->loadFromDive(d); information()->enableEdition(MainTab::MANUALLY_ADDED_DIVE); diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index c3eb18a29..0bb024079 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -31,6 +31,7 @@ class QSettings; class UpdateManager; class UserManual; class DivePlannerWidget; +class ProfileWidget2; class UndoBuffer; enum MainWindowTitleFormat { diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index aa9ca314c..4bc74f20c 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -27,13 +27,6 @@ <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <widget class="QWidget" name="ProfileWidget"> - <layout class="QGridLayout" name="profileInnerLayout"> - <item row="0" column="0" rowspan="3"> - <widget class="ProfileWidget2" name="newProfile"/> - </item> - </layout> - </widget> </widget> <widget class="QSplitter" name="bottomSplitter"> <property name="orientation"> @@ -805,11 +798,6 @@ p, li { white-space: pre-wrap; } <container>1</container> </customwidget> <customwidget> - <class>ProfileWidget2</class> - <extends>QGraphicsView</extends> - <header>qt-ui/profile/profilewidget2.h</header> - </customwidget> - <customwidget> <class>PlannerSettingsWidget</class> <extends>QWidget</extends> <header>diveplanner.h</header> diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 415cedb2c..d8776d06d 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -4,6 +4,7 @@ #include "mainwindow.h" #include "models.h" #include "starwidget.h" +#include "profile/profilewidget2.h" #include <QCompleter> #include <QKeyEvent> diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index f0c15d486..ac2f7d899 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -14,6 +14,7 @@ #include "qthelper.h" #include "gettextfromc.h" #include "display.h" +#include "color.h" #include <QCoreApplication> #include <QDebug> diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index eef5144dc..aa3ef95bc 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -9,6 +9,7 @@ #include "printlayout.h" #include "modeldelegates.h" #include "models.h" +#include "profile/profilewidget2.h" PrintLayout::PrintLayout(PrintDialog *dialogPtr, QPrinter *printerPtr, struct print_options *optionsPtr) { diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 467a8b978..41d94a9a0 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -5,6 +5,8 @@ #include "diveplotdatamodel.h" #include "animationfunctions.h" #include "mainwindow.h" +#include "divelineitem.h" +#include "profilewidget2.h" static QPen gridPen() { diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 7384e5a65..2878049e5 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -10,6 +10,7 @@ #include "libdivecomputer/parser.h" #include "mainwindow.h" #include "maintab.h" +#include "profile/profilewidget2.h" #include <QSettings> diff --git a/qt-ui/profile/divetextitem.cpp b/qt-ui/profile/divetextitem.cpp index 85e046638..4c0137177 100644 --- a/qt-ui/profile/divetextitem.cpp +++ b/qt-ui/profile/divetextitem.cpp @@ -1,5 +1,6 @@ #include "divetextitem.h" #include "mainwindow.h" +#include "profilewidget2.h" DiveTextItem::DiveTextItem(QGraphicsItem *parent) : QGraphicsItemGroup(parent), internalAlignFlags(Qt::AlignHCenter | Qt::AlignVCenter), diff --git a/qt-ui/profile/ruleritem.cpp b/qt-ui/profile/ruleritem.cpp index c88a3353d..ddd8f4620 100644 --- a/qt-ui/profile/ruleritem.cpp +++ b/qt-ui/profile/ruleritem.cpp @@ -1,6 +1,8 @@ #include "ruleritem.h" #include "preferences.h" #include "mainwindow.h" +#include "profilewidget2.h" +#include "display.h" #include <qgraphicssceneevent.h> diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 6d7ce67d0..5c08a3f7e 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -12,6 +12,8 @@ #include "helpers.h" #include "libdivecomputer/parser.h" #include "divelistview.h" +#include "display.h" +#include "profile/profilewidget2.h" class MinMaxAvgWidgetPrivate { public: @@ -170,7 +172,6 @@ void SetpointDialog::buttonClicked(QAbstractButton *button) add_event(dc, time, SAMPLE_EVENT_PO2, 0, (int)(1000.0 * ui.spinbox->value()), "SP change"); mark_divelist_changed(true); MainWindow::instance()->graphics()->replot(); - } SetpointDialog::SetpointDialog(QWidget *parent) : QDialog(parent) diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 04dde3a0f..72e7e3d27 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -5,7 +5,7 @@ #include "divelist.h" #include "globe.h" #include "maintab.h" - +#include "display.h" #include <errno.h> #include <QDir> |