Diffstat (limited to 'noncore/net/opiestumbler/stumblersettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opiestumbler/stumblersettings.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/noncore/net/opiestumbler/stumblersettings.cpp b/noncore/net/opiestumbler/stumblersettings.cpp new file mode 100644 index 0000000..f033e34 --- a/dev/null +++ b/noncore/net/opiestumbler/stumblersettings.cpp | |||
@@ -0,0 +1,35 @@ | |||
1 | #include <qlineedit.h> | ||
2 | #include <qlabel.h> | ||
3 | #include <qlayout.h> | ||
4 | |||
5 | #include <qpe/config.h> | ||
6 | |||
7 | #include "stumblersettings.h" | ||
8 | |||
9 | StumblerSettings::StumblerSettings(QWidget* parent, const char* name, bool modal, WFlags f) | ||
10 | : QDialog(parent, name, modal, WStyle_ContextHelp), m_config(new Config("OpieStumbler")) | ||
11 | { | ||
12 | setCaption(tr("Settings")); | ||
13 | m_config->setGroup("General"); | ||
14 | QBoxLayout *l = new QHBoxLayout(this); | ||
15 | QLabel *lb = new QLabel(tr("Interface"), this); | ||
16 | m_interface = new QLineEdit(this); | ||
17 | m_interface->setText(m_config->readEntry("interface", "wlan0")); | ||
18 | connect(m_interface, SIGNAL(returnPressed()), this, SLOT(accept())); | ||
19 | l->addWidget(lb); | ||
20 | l->addWidget(m_interface); | ||
21 | } | ||
22 | |||
23 | StumblerSettings::~StumblerSettings() | ||
24 | { | ||
25 | delete m_config; | ||
26 | delete m_interface; | ||
27 | } | ||
28 | |||
29 | void StumblerSettings::accept() | ||
30 | { | ||
31 | m_config->writeEntry("interface", m_interface->text()); | ||
32 | m_config->write(); | ||
33 | |||
34 | QDialog::accept(); | ||
35 | } | ||