mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-12 13:16:16 +00:00
Moved the DivePlanner to the MainWindow.
Now, activating the dive planner will hide the profile and show the planner on the same place. we still need a way to 'cancel' or 'accept' the profile created. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
de7506b44d
commit
1244438b01
5 changed files with 53 additions and 45 deletions
|
@ -170,13 +170,13 @@ void DivePlannerGraphics::createDecoStops()
|
||||||
void DivePlannerGraphics::resizeEvent(QResizeEvent* event)
|
void DivePlannerGraphics::resizeEvent(QResizeEvent* event)
|
||||||
{
|
{
|
||||||
QGraphicsView::resizeEvent(event);
|
QGraphicsView::resizeEvent(event);
|
||||||
fitInView(sceneRect(), Qt::KeepAspectRatio);
|
fitInView(sceneRect(), Qt::IgnoreAspectRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivePlannerGraphics::showEvent(QShowEvent* event)
|
void DivePlannerGraphics::showEvent(QShowEvent* event)
|
||||||
{
|
{
|
||||||
QGraphicsView::showEvent(event);
|
QGraphicsView::showEvent(event);
|
||||||
fitInView(sceneRect(), Qt::KeepAspectRatio);
|
fitInView(sceneRect(), Qt::IgnoreAspectRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivePlannerGraphics::mouseMoveEvent(QMouseEvent* event)
|
void DivePlannerGraphics::mouseMoveEvent(QMouseEvent* event)
|
||||||
|
@ -349,22 +349,6 @@ qreal Ruler::posAtValue(qreal value)
|
||||||
return retValue;
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DivePlanner::DivePlanner() : ui(new Ui::DivePlanner())
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct dive* DivePlanner::getDive()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DivePlanner* DivePlanner::instance()
|
|
||||||
{
|
|
||||||
static DivePlanner *self = new DivePlanner();
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
double Ruler::maximum() const
|
double Ruler::maximum() const
|
||||||
{
|
{
|
||||||
return max;
|
return max;
|
||||||
|
|
|
@ -90,18 +90,4 @@ private:
|
||||||
QPointF lastValidPos;
|
QPointF lastValidPos;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Ui{
|
|
||||||
class DivePlanner;
|
|
||||||
}
|
|
||||||
|
|
||||||
class DivePlanner : public QDialog{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
static DivePlanner *instance();
|
|
||||||
struct dive* getDive();
|
|
||||||
|
|
||||||
private:
|
|
||||||
DivePlanner();
|
|
||||||
Ui::DivePlanner *ui;
|
|
||||||
};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -223,11 +223,12 @@ void MainWindow::on_actionPrint_triggered()
|
||||||
|
|
||||||
void MainWindow::on_actionDivePlanner_triggered()
|
void MainWindow::on_actionDivePlanner_triggered()
|
||||||
{
|
{
|
||||||
DivePlanner *planner = DivePlanner::instance();
|
ui->stackedWidget->setCurrentIndex(1);
|
||||||
if (planner->exec() == QDialog::Accepted){
|
}
|
||||||
struct dive *d = planner->getDive();
|
|
||||||
qDebug() << "Finish me.";
|
void MainWindow::showProfile()
|
||||||
}
|
{
|
||||||
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,6 @@ public:
|
||||||
void setTitle(enum MainWindowTitleFormat format);
|
void setTitle(enum MainWindowTitleFormat format);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|
||||||
/* file menu action */
|
/* file menu action */
|
||||||
void on_actionNew_triggered();
|
void on_actionNew_triggered();
|
||||||
void on_actionOpen_triggered();
|
void on_actionOpen_triggered();
|
||||||
|
@ -100,6 +98,7 @@ protected:
|
||||||
public slots:
|
public slots:
|
||||||
void readSettings();
|
void readSettings();
|
||||||
void refreshDisplay();
|
void refreshDisplay();
|
||||||
|
void showProfile();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
<string>MainWindow</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QSplitter" name="mainSplitter">
|
<widget class="QSplitter" name="mainSplitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -25,7 +25,37 @@
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="MainTab" name="InfoWidget" native="true"/>
|
<widget class="MainTab" name="InfoWidget" native="true"/>
|
||||||
<widget class="ProfileGraphicsView" name="ProfileWidget"/>
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="page_5">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="ProfileGraphicsView" name="ProfileWidget"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_6">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="DivePlannerGraphics" name="divePlanner"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QSplitter" name="listGlobeSplitter">
|
<widget class="QSplitter" name="listGlobeSplitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -92,8 +122,11 @@
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="KMessageWidget" name="mainErrorMessage" native="true"/>
|
<widget class="KMessageWidget" name="mainErrorMessage" native="true">
|
||||||
|
<zorder>mainSplitter</zorder>
|
||||||
|
<zorder>mainSplitter</zorder>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -103,7 +136,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>763</width>
|
<width>763</width>
|
||||||
<height>18</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
@ -405,6 +438,11 @@
|
||||||
<header>globe.h</header>
|
<header>globe.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>DivePlannerGraphics</class>
|
||||||
|
<extends>QGraphicsView</extends>
|
||||||
|
<header>diveplanner.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue