From: Rene Gassmoeller Date: Fri, 23 Jun 2017 19:58:50 +0000 (-0600) Subject: Use global settings instead of settings file X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18%2Fhead;p=parameter_gui.git Use global settings instead of settings file --- diff --git a/info_message.cpp b/info_message.cpp index 20ce137..06e685a 100644 --- a/info_message.cpp +++ b/info_message.cpp @@ -23,7 +23,8 @@ namespace dealii { namespace ParameterGui { - InfoMessage::InfoMessage(QWidget *parent) + InfoMessage::InfoMessage(QSettings *parent_settings, + QWidget *parent) : QDialog(parent, 0) { // this variable stores, if the @@ -72,10 +73,7 @@ namespace dealii grid->setColumnStretch(1, 42); grid->setRowStretch(0, 42); - // load settings from an ini-file - QString settings_file = QDir::currentPath() + "/settings.ini"; - - settings = new QSettings (settings_file, QSettings::IniFormat); + settings = parent_settings; // we store settings of this class in the group infoMessage settings->beginGroup("infoMessage"); diff --git a/info_message.h b/info_message.h index 09a00a2..aec1159 100644 --- a/info_message.h +++ b/info_message.h @@ -54,7 +54,8 @@ namespace dealii /** * Constructor */ - InfoMessage (QWidget *parent = 0); + InfoMessage (QSettings *settings, + QWidget *parent = 0); /** * With this function the @p message which will be shown in the diff --git a/mainwindow.cpp b/mainwindow.cpp index 24d0077..109e51c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -286,7 +286,7 @@ namespace dealii { QString title = "parameterGUI"; - info_message = new InfoMessage(this); + info_message = new InfoMessage(gui_settings,this); info_message->setWindowTitle(title); info_message->setInfoMessage(tr("Start Editing by double-clicking on the parameter value or"