dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
systemhealthgadgetoptionspage.cpp
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
29 #include "ui_systemhealthgadgetoptionspage.h"
30 
31 #include <QtAlgorithms>
32 #include <QStringList>
33 
35  SystemHealthGadgetConfiguration *config, QObject *parent)
36  : IOptionsPage(parent)
37  , m_config(config)
38 {
39 }
40 
41 // creates options page widget (uses the UI file)
43 {
44 
45  Q_UNUSED(parent);
46  options_page = new Ui::SystemHealthGadgetOptionsPage();
47  // main widget
48  QWidget *optionsPageWidget = new QWidget;
49  // main layout
50  options_page->setupUi(optionsPageWidget);
51 
52  // Restore the contents from the settings:
53  options_page->svgFilePathChooser->setExpectedKind(Utils::PathChooser::File);
54  options_page->svgFilePathChooser->setPromptDialogFilter(tr("SVG image (*.svg)"));
55  options_page->svgFilePathChooser->setPromptDialogTitle(tr("Choose SVG image"));
56  options_page->svgFilePathChooser->setPath(m_config->getSystemFile());
57 
58  return optionsPageWidget;
59 }
67 {
68  m_config->setSystemFile(options_page->svgFilePathChooser->path());
69 }
70 
72 {
73  delete options_page;
74 }
SystemHealthGadgetOptionsPage(SystemHealthGadgetConfiguration *config, QObject *parent=nullptr)