summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-10-16 01:13:54 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-16 11:09:15 +0200
commit882986dfdf7da5861d0037f7bc54d75c0356ac40 (patch)
tree7ec4de268a926a5b8bd7a67dd137c0e032c12aa5
parent5a394aaff633da9df64fe0750b68f2b96bd3699e (diff)
downloadsubsurface-882986dfdf7da5861d0037f7bc54d75c0356ac40.tar.gz
Save columnwith of Ostc3 settings tables
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/configuredivecomputerdialog.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp
index 346d0b1ca..f4c5a6123 100644
--- a/qt-ui/configuredivecomputerdialog.cpp
+++ b/qt-ui/configuredivecomputerdialog.cpp
@@ -8,6 +8,7 @@
#include "configuredivecomputer.h"
#include <QFileDialog>
#include <QMessageBox>
+#include <QSettings>
struct product {
const char *product;
dc_descriptor_t *descriptor;
@@ -50,10 +51,50 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) :
ui.DiveComputerList->setCurrentRow(0);
on_DiveComputerList_currentRowChanged(0);
+
+ QSettings settings;
+ settings.beginGroup("ConfigureDiveComputerDialog");
+ settings.beginGroup("ostc3GasTable");
+ for (int i = 0; i < ui.ostc3GasTable->columnCount(); i++) {
+ QVariant width = settings.value(QString("colwidth%1").arg(i));
+ if (width.isValid())
+ ui.ostc3GasTable->setColumnWidth(i, width.toInt());
+ }
+ settings.endGroup();
+ settings.beginGroup("ostc3DilTable");
+ for (int i = 0; i < ui.ostc3DilTable->columnCount(); i++) {
+ QVariant width = settings.value(QString("colwidth%1").arg(i));
+ if (width.isValid())
+ ui.ostc3DilTable->setColumnWidth(i, width.toInt());
+ }
+ settings.endGroup();
+ settings.beginGroup("ostc3SetPointTable");
+ for (int i = 0; i < ui.ostc3SetPointTable->columnCount(); i++) {
+ QVariant width = settings.value(QString("colwidth%1").arg(i));
+ if (width.isValid())
+ ui.ostc3SetPointTable->setColumnWidth(i, width.toInt());
+ }
+ settings.endGroup();
+ settings.endGroup();
}
ConfigureDiveComputerDialog::~ConfigureDiveComputerDialog()
{
+ QSettings settings;
+ settings.beginGroup("ConfigureDiveComputerDialog");
+ settings.beginGroup("ostc3GasTable");
+ for (int i = 0; i < ui.ostc3GasTable->columnCount(); i++)
+ settings.setValue(QString("colwidth%1").arg(i), ui.ostc3GasTable->columnWidth(i));
+ settings.endGroup();
+ settings.beginGroup("ostc3DilTable");
+ for (int i = 0; i < ui.ostc3DilTable->columnCount(); i++)
+ settings.setValue(QString("colwidth%1").arg(i), ui.ostc3DilTable->columnWidth(i));
+ settings.endGroup();
+ settings.beginGroup("ostc3SetPointTable");
+ for (int i = 0; i < ui.ostc3SetPointTable->columnCount(); i++)
+ settings.setValue(QString("colwidth%1").arg(i), ui.ostc3SetPointTable->columnWidth(i));
+ settings.endGroup();
+ settings.endGroup();
}