aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-08-26 08:43:37 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-08-26 08:43:37 -0300
commit0a043528f72a47b14cfe3708a8f133a29ad17d55 (patch)
tree80f88141bd2f9a9264ce48735f26c74446040074
parent2fb2918607ffb857543b9060fd9f18f0d07ab780 (diff)
downloadsubsurface-0a043528f72a47b14cfe3708a8f133a29ad17d55.tar.gz
Added a new widget to control the Planner
Added a new widget to control the DivePlanner, now we have two widgets, a graphics one and a qt sidget based one. the Technical divers will most likely use the QtWidget one while the hobbists will most likely use the QGraphicsView one. there's not a option to choose one, they both will appear at the same time. Next step: make the screens to work. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r--qt-ui/diveplanner.cpp5
-rw-r--r--qt-ui/diveplanner.h12
-rw-r--r--qt-ui/diveplanner.ui128
-rw-r--r--qt-ui/mainwindow.cpp2
-rw-r--r--qt-ui/mainwindow.ui57
5 files changed, 143 insertions, 61 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 95b6c211c..5e79f0b89 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -799,3 +799,8 @@ void Button::mousePressEvent(QGraphicsSceneMouseEvent* event)
event->ignore();
emit clicked();
}
+
+DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidget(parent, f), ui(new Ui::DivePlanner())
+{
+ ui->setupUi(this);
+}
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index 2239e013d..fa3f83766 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -5,6 +5,10 @@
#include <QGraphicsPathItem>
#include <QDialog>
+namespace Ui{
+ class DivePlanner;
+};
+
class QListView;
class QStringListModel;
class QModelIndex;
@@ -145,4 +149,12 @@ private:
int dpMaxTime; // this is the time of the dive calculated by the deco.
};
+class DivePlannerWidget : public QWidget {
+ Q_OBJECT
+public:
+ explicit DivePlannerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
+private:
+ Ui::DivePlanner *ui;
+};
+
#endif
diff --git a/qt-ui/diveplanner.ui b/qt-ui/diveplanner.ui
index e4903f0f8..d2d52172b 100644
--- a/qt-ui/diveplanner.ui
+++ b/qt-ui/diveplanner.ui
@@ -1,27 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DivePlanner</class>
- <widget class="QDialog" name="DivePlanner">
+ <widget class="QWidget" name="DivePlanner">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>575</width>
- <height>451</height>
+ <width>400</width>
+ <height>352</height>
</rect>
</property>
<property name="windowTitle">
- <string>Dialog</string>
+ <string>Form</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="DivePlannerGraphics" name="graphicsView"/>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Start Time</string>
+ </property>
+ </widget>
</item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <item row="0" column="1">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>ATM Pressure</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QTimeEdit" name="startTime"/>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="ATMPressure"/>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="decoStopSAC"/>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Low GF</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLineEdit" name="lowGF"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Bottom SAC</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>High GF</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>SAC on DECO Stop</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLineEdit" name="bottomSAC"/>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLineEdit" name="highGF"/>
+ </item>
+ <item row="6" column="0">
+ <widget class="QCheckBox" name="lastStop">
+ <property name="text">
+ <string>Last Stop at 6m</string>
</property>
+ </widget>
+ </item>
+ <item row="7" column="0" colspan="2">
+ <widget class="QTableView" name="tablePoints"/>
+ </item>
+ <item row="8" column="0" colspan="2">
+ <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
@@ -29,46 +93,6 @@
</item>
</layout>
</widget>
- <customwidgets>
- <customwidget>
- <class>DivePlannerGraphics</class>
- <extends>QGraphicsView</extends>
- <header>diveplanner.h</header>
- </customwidget>
- </customwidgets>
<resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>DivePlanner</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>DivePlanner</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
+ <connections/>
</ui>
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index a78b84565..252b1bdb6 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -238,12 +238,14 @@ void MainWindow::on_actionDivePlanner_triggered()
{
disableDcShortcuts();
ui->stackedWidget->setCurrentIndex(1);
+ ui->infoPane->setCurrentIndex(1);
}
void MainWindow::showProfile()
{
enableDcShortcuts();
ui->stackedWidget->setCurrentIndex(0);
+ ui->infoPane->setCurrentIndex(0);
}
diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui
index 731013538..445d121df 100644
--- a/qt-ui/mainwindow.ui
+++ b/qt-ui/mainwindow.ui
@@ -24,17 +24,44 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <widget class="MainTab" name="InfoWidget" native="true"/>
+ <widget class="QStackedWidget" name="infoPane">
+ <property name="currentIndex">
+ <number>1</number>
+ </property>
+ <widget class="QWidget" name="page">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="MainTab" name="InfoWidget" native="true"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="page_2">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="DivePlannerWidget" name="widget" native="true"/>
+ </item>
+ </layout>
+ </widget>
+ </widget>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="page_5">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
- <property name="margin">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
<number>0</number>
</property>
<item>
@@ -47,7 +74,16 @@
<property name="spacing">
<number>0</number>
</property>
- <property name="margin">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
<number>0</number>
</property>
<item>
@@ -123,10 +159,7 @@
</widget>
</item>
<item>
- <widget class="KMessageWidget" name="mainErrorMessage" native="true">
- <zorder>mainSplitter</zorder>
- <zorder>mainSplitter</zorder>
- </widget>
+ <widget class="KMessageWidget" name="mainErrorMessage" native="true"/>
</item>
</layout>
</widget>
@@ -136,7 +169,7 @@
<x>0</x>
<y>0</y>
<width>763</width>
- <height>20</height>
+ <height>19</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -443,6 +476,12 @@
<extends>QGraphicsView</extends>
<header>diveplanner.h</header>
</customwidget>
+ <customwidget>
+ <class>DivePlannerWidget</class>
+ <extends>QWidget</extends>
+ <header>diveplanner.h</header>
+ <container>1</container>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>