Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
settingsdialog.cpp
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // xdialog.cpp
3 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
4 // (c) 2010-2012
5 // Yves Sablonier, Pete Morgan
6 // Geoff McLane
7 // GNU GPLv2, see main.cpp and shipped licence.txt for further information
8 
9 
10 #include <QHBoxLayout>
11 #include <QVBoxLayout>
12 #include <QGroupBox>
13 #include <QLineEdit>
14 #include <QPushButton>
15 #include <QToolButton>
16 #include <QMenu>
17 #include <QAction>
18 #include <QFileDialog>
19 #include <QTreeWidget>
20 #include <QMessageBox>
21 
22 #include "settingsdialog.h"
24 
25 
27  QDialog(parent)
28 {
29  mainObject = mOb;
30 
31  setProperty("settings_namespace", QVariant("settings_dialog"));
33 
34  setWindowTitle(tr("Settings"));
35  setWindowIcon(QIcon(":/icon/settings"));
36 
37  setMinimumWidth(400);
38 
39  //* Main Layout
40  QVBoxLayout *mainLayout = new QVBoxLayout();
41  setLayout(mainLayout);
42  mainLayout->setSpacing(20);
43  int m = 20;
44  mainLayout->setContentsMargins(m,m,m,m);
45 
46  //================================================================
47  //** Tab Widget
48  tabWidget = new QTabWidget();
49  mainLayout->addWidget(tabWidget);
50 
51 
52 
53 
54  //================================================================
55  //** Tab Widget
56 
57 
58 
59  //*** Bottom Button Box
60  QHBoxLayout *buttonBox = new QHBoxLayout();
61  mainLayout->addLayout(buttonBox);
62  buttonBox->addStretch(10);
63 
64  QPushButton *buttCancel = new QPushButton();
65  buttonBox->addWidget(buttCancel);
66  buttCancel->setText("Cancel");
67  buttCancel->setIcon(QIcon(":/icon/cancel"));
68  connect(buttCancel, SIGNAL(clicked()), this, SLOT(reject()));
69 
70  QPushButton *buttSave = new QPushButton();
71  buttonBox->addWidget(buttSave);
72  buttSave->setText("Save");
73  buttSave->setIcon(QIcon(":/icon/save"));
74  connect(buttSave, SIGNAL(clicked()), this, SLOT(on_save_clicked()));
75 
76 
77  load_settings();
78 }
79 
80 //=================================================================================
81 //** Settings
83 
84 }
85 
86 
87 
88 //=================================================================================
89 // closeEvent
90 void SettingsDialog::closeEvent(QCloseEvent *event){
91  Q_UNUSED(event);
93 }
94 
95 
96 
97 
98 //=================================================================================
99 // Save Clicked
101 
102  accept();
103 }
104 
105 
SettingsDialog(MainObject *mOb, QWidget *parent=0)
The MainObject is an extended QObject, and the main "controller" for FGx.
Definition: mainobject.h:66
QTabWidget * tabWidget
void saveWindow(QWidget *widget)
Saves a window's size and position.
Definition: xsettings.cpp:90
MainObject * mainObject
void closeEvent(QCloseEvent *event)
void restoreWindow(QWidget *widget)
Restores a size window position.
Definition: xsettings.cpp:101
XSettings * settings
Definition: mainobject.h:85