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 <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
Joseph W. Joshua 2014-05-29 18:54:19 +03:00 committed by Thiago Macieira
parent af1d77056e
commit ec02737eda
7 changed files with 183 additions and 3 deletions

View file

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

View file

@ -0,0 +1,22 @@
#ifndef CONFIGUREDIVECOMPUTERDIALOG_H
#define CONFIGUREDIVECOMPUTERDIALOG_H
#include <QDialog>
namespace Ui {
class ConfigureDiveComputerDialog;
}
class ConfigureDiveComputerDialog : public QDialog
{
Q_OBJECT
public:
explicit ConfigureDiveComputerDialog(QWidget *parent = 0);
~ConfigureDiveComputerDialog();
private:
Ui::ConfigureDiveComputerDialog *ui;
};
#endif // CONFIGUREDIVECOMPUTERDIALOG_H

View file

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConfigureDiveComputerDialog</class>
<widget class="QDialog" name="ConfigureDiveComputerDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>362</width>
<height>375</height>
</rect>
</property>
<property name="windowTitle">
<string>Configure Dive Computer</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Vendor</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Dive Computer</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QComboBox" name="vendor"/>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="product"/>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Device or Mount Point</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="device">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="search">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="retrieveDetails">
<property name="text">
<string>Retrieve available details:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTextBrowser" name="availableDetails"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -41,6 +41,7 @@
#include "worldmap-save.h"
#include "updatemanager.h"
#include "planner.h"
#include "configuredivecomputerdialog.h"
#ifndef NO_PRINTING
#include <QPrintDialog>
#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<QToolButton*> toolBar; toolBar << ui.profCalcAllTissues << ui.profCalcCeiling

View file

@ -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 *);

View file

@ -681,6 +681,8 @@ p, li { white-space: pre-wrap; }
<addaction name="actionPrint"/>
<addaction name="actionPreferences"/>
<addaction name="separator"/>
<addaction name="actionConfigure_Dive_Computer"/>
<addaction name="separator"/>
<addaction name="actionRecent1"/>
<addaction name="actionRecent2"/>
<addaction name="actionRecent3"/>
@ -1023,6 +1025,11 @@ p, li { white-space: pre-wrap; }
<string>Ctrl+E</string>
</property>
</action>
<action name="actionConfigure_Dive_Computer">
<property name="text">
<string>Configure Dive Computer</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View file

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