aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/divelogexportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2014-06-02 18:38:35 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-03 21:09:44 -0700
commit197bd76f16ccca0ebdfae7dba0a19993e278485b (patch)
tree93ebeb72fd02c4aec65362e6a14c69c19f28709e /qt-ui/divelogexportdialog.cpp
parent4ec4c84ea9a21fe6b0f9bd645e097216051e34ea (diff)
downloadsubsurface-197bd76f16ccca0ebdfae7dba0a19993e278485b.tar.gz
Remember selection of export HTML settings
Add a new QSettings group "HTML" to save the HTML exporting settings and restore them later. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelogexportdialog.cpp')
-rw-r--r--qt-ui/divelogexportdialog.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp
index e8dabc131..938a19d85 100644
--- a/qt-ui/divelogexportdialog.cpp
+++ b/qt-ui/divelogexportdialog.cpp
@@ -31,6 +31,19 @@ DiveLogExportDialog::DiveLogExportDialog(QWidget *parent) : QDialog(parent),
ui->fontSelection->addItem("Georgia", "Georgia, serif");
ui->fontSelection->addItem("Courier", "Courier, monospace");
ui->fontSelection->addItem("Verdana", "Verdana, Geneva, sans-serif");
+
+ QSettings settings;
+ settings.beginGroup("HTML");
+ if (settings.contains("fontSelection")) {
+ ui->fontSelection->setCurrentIndex(settings.value("fontSelection").toInt());
+ }
+ if (settings.contains("fontSizeSelection")) {
+ ui->fontSizeSelection->setCurrentIndex(settings.value("fontSizeSelection").toInt());
+ }
+ if (settings.contains("themeSelection")) {
+ ui->themeSelection->setCurrentIndex(settings.value("themeSelection").toInt());
+ }
+ settings.endGroup();
}
DiveLogExportDialog::~DiveLogExportDialog()
@@ -102,6 +115,13 @@ void DiveLogExportDialog::exportHtmlInit(QString filename)
void DiveLogExportDialog::exportHTMLsettings(QString filename)
{
+ QSettings settings;
+ settings.beginGroup("HTML");
+ settings.setValue("fontSelection", ui->fontSelection->currentIndex());
+ settings.setValue("fontSizeSelection", ui->fontSizeSelection->currentIndex());
+ settings.setValue("themeSelection", ui->themeSelection->currentIndex());
+ settings.endGroup();
+
QString fontSize = ui->fontSizeSelection->currentText();
QString fontFamily = ui->fontSelection->itemData(ui->fontSelection->currentIndex()).toString();
QFile file(filename);