dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
pfdqmlgadgetoptionspage.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10  * for more details.
11  *
12  * You should have received a copy of the GNU General Public License along
13  * with this program; if not, see <http://www.gnu.org/licenses/>
14  */
15 
18 #include "ui_pfdqmlgadgetoptionspage.h"
22 
23 #include <QtAlgorithms>
24 #include <QStringList>
25 
27  : IOptionsPage(parent)
28  , m_config(config)
29 {
30 }
31 
32 // creates options page widget (uses the UI file)
33 QWidget *PfdQmlGadgetOptionsPage::createPage(QWidget *parent)
34 {
35  options_page = new Ui::PfdQmlGadgetOptionsPage();
36  // main widget
37  QWidget *optionsPageWidget = new QWidget(parent);
38  // main layout
39  options_page->setupUi(optionsPageWidget);
40 
41  // Restore the contents from the settings:
42  options_page->qmlSourceFile->setExpectedKind(Utils::PathChooser::File);
43  options_page->qmlSourceFile->setPromptDialogFilter(tr("QML file (*.qml)"));
44  options_page->qmlSourceFile->setPromptDialogTitle(tr("Choose QML file"));
45  options_page->qmlSourceFile->setPath(m_config->qmlFile());
46 
47  return optionsPageWidget;
48 }
49 
57 {
58  m_config->setQmlFile(options_page->qmlSourceFile->path());
59 }
60 
62 {
63 }
void setQmlFile(const QString &fileName)
PfdQmlGadgetOptionsPage(PfdQmlGadgetConfiguration *config, QObject *parent=nullptr)
QWidget * createPage(QWidget *parent)