From ec02737eda780284562692168569d9dd3837a1a9 Mon Sep 17 00:00:00 2001 From: "Joseph W. Joshua" Date: Thu, 29 May 2014 18:54:19 +0300 Subject: Create Dive Computer configuration dialog Create a dialog for reading and writing settings to and from dive computers, with a menu entry in MainWindow to open the dialog. I will build up on this dialog and change it as needed. Signed-off-by: Joseph W. Joshua Signed-off-by: Thiago Macieira --- qt-ui/configuredivecomputerdialog.cpp | 14 ++++ qt-ui/configuredivecomputerdialog.h | 22 ++++++ qt-ui/configuredivecomputerdialog.ui | 125 ++++++++++++++++++++++++++++++++++ qt-ui/mainwindow.cpp | 7 ++ qt-ui/mainwindow.h | 2 + qt-ui/mainwindow.ui | 7 ++ subsurface.pro | 9 ++- 7 files changed, 183 insertions(+), 3 deletions(-) create mode 100644 qt-ui/configuredivecomputerdialog.cpp create mode 100644 qt-ui/configuredivecomputerdialog.h create mode 100644 qt-ui/configuredivecomputerdialog.ui diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp new file mode 100644 index 000000000..9aa2cfb94 --- /dev/null +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -0,0 +1,14 @@ +#include "configuredivecomputerdialog.h" +#include "ui_configuredivecomputerdialog.h" + +ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::ConfigureDiveComputerDialog) +{ + ui->setupUi(this); +} + +ConfigureDiveComputerDialog::~ConfigureDiveComputerDialog() +{ + delete ui; +} diff --git a/qt-ui/configuredivecomputerdialog.h b/qt-ui/configuredivecomputerdialog.h new file mode 100644 index 000000000..b1f3924cf --- /dev/null +++ b/qt-ui/configuredivecomputerdialog.h @@ -0,0 +1,22 @@ +#ifndef CONFIGUREDIVECOMPUTERDIALOG_H +#define CONFIGUREDIVECOMPUTERDIALOG_H + +#include + +namespace Ui { +class ConfigureDiveComputerDialog; +} + +class ConfigureDiveComputerDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ConfigureDiveComputerDialog(QWidget *parent = 0); + ~ConfigureDiveComputerDialog(); + +private: + Ui::ConfigureDiveComputerDialog *ui; +}; + +#endif // CONFIGUREDIVECOMPUTERDIALOG_H diff --git a/qt-ui/configuredivecomputerdialog.ui b/qt-ui/configuredivecomputerdialog.ui new file mode 100644 index 000000000..25d63007f --- /dev/null +++ b/qt-ui/configuredivecomputerdialog.ui @@ -0,0 +1,125 @@ + + + ConfigureDiveComputerDialog + + + + 0 + 0 + 362 + 375 + + + + Configure Dive Computer + + + + + + + + Vendor + + + + + + + Dive Computer + + + + + + + + + + + + + + + + + Device or Mount Point + + + + + + + + + true + + + + + + + ... + + + + + + + + + + + + + Retrieve available details: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + + + + + + diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 1a4594bab..85b31608c 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -41,6 +41,7 @@ #include "worldmap-save.h" #include "updatemanager.h" #include "planner.h" +#include "configuredivecomputerdialog.h" #ifndef NO_PRINTING #include #include "printdialog.h" @@ -1287,6 +1288,12 @@ void MainWindow::on_actionExport_triggered() diveLogExport.exec(); } +void MainWindow::on_actionConfigure_Dive_Computer_triggered() +{ + ConfigureDiveComputerDialog *dcConfig = new ConfigureDiveComputerDialog(this); + dcConfig->show(); +} + void MainWindow::setEnabledToolbar(bool arg1) { QList toolBar; toolBar << ui.profCalcAllTissues << ui.profCalcCeiling diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 5c0ec8efa..b9c8e4682 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -143,6 +143,8 @@ slots: void on_profTogglePicture_clicked(bool triggered); void on_actionExport_triggered(); + void on_actionConfigure_Dive_Computer_triggered(); + protected: void closeEvent(QCloseEvent *); diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index ac72673c8..bd5581f64 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -681,6 +681,8 @@ p, li { white-space: pre-wrap; } + + @@ -1023,6 +1025,11 @@ p, li { white-space: pre-wrap; } Ctrl+E + + + Configure Dive Computer + + diff --git a/subsurface.pro b/subsurface.pro index 1857f8405..ca3c8abdf 100644 --- a/subsurface.pro +++ b/subsurface.pro @@ -86,7 +86,8 @@ HEADERS = \ qt-ui/updatemanager.h \ qt-ui/divelogexportdialog.h \ qt-ui/usersurvey.h \ - subsurfacesysinfo.h + subsurfacesysinfo.h \ + qt-ui/configuredivecomputerdialog.h android: HEADERS -= \ qt-ui/usermanual.h \ @@ -165,7 +166,8 @@ SOURCES = \ qt-ui/updatemanager.cpp \ qt-ui/divelogexportdialog.cpp \ qt-ui/usersurvey.cpp \ - subsurfacesysinfo.cpp + subsurfacesysinfo.cpp \ + qt-ui/configuredivecomputerdialog.cpp android: SOURCES += android.cpp else: linux*: SOURCES += linux.c @@ -196,7 +198,8 @@ FORMS = \ qt-ui/searchbar.ui \ qt-ui/divelogexportdialog.ui \ qt-ui/plannerSettings.ui \ - qt-ui/usersurvey.ui + qt-ui/usersurvey.ui \ + qt-ui/configuredivecomputerdialog.ui # Nether usermanual or printing is supported on android right now android: FORMS -= qt-ui/printoptions.ui -- cgit v1.2.3-70-g09d2