summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/servicesdialog.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/servicesdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/servicesdialog.cpp120
1 files changed, 120 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/servicesdialog.cpp b/noncore/net/opietooth/manager/servicesdialog.cpp
new file mode 100644
index 0000000..114c360
--- a/dev/null
+++ b/noncore/net/opietooth/manager/servicesdialog.cpp
@@ -0,0 +1,120 @@
1/* $Id$ */
2/* Bluetooth services configuration dialog */
3/***************************************************************************
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 ***************************************************************************/
11#include "servicesdialog.h"
12#include "btconfhandler.h"
13#include <opie2/odebug.h>
14#include <qstring.h>
15#include <qcheckbox.h>
16#include <qlineedit.h>
17#include <qcombobox.h>
18using namespace Opie::Core;
19
20using namespace OpieTooth;
21
22ServicesDialog::ServicesDialog(const QString& conf,
23 QWidget* parent, const char* name, bool modal, WFlags fl) :
24 ServicesDialogBase(parent, name, modal, fl),
25 cfg(conf)
26{
27 int i; //just an index
28 QString role;
29 hcidEnableCBox->setChecked(cfg.getHcidEnable());
30 hiddEnableCBox->setChecked(cfg.getHiddEnable());
31 sdpdEnableCBox->setChecked(cfg.getSdpdEnable());
32 rfcommEnableCBox->setChecked(cfg.getRfcommEnable());
33 dundEnableCBox->setChecked(cfg.getDundEnable());
34 dundDisableSDPCBox->setChecked(cfg.getDunDisableSDP());
35 dundPersistCBox->setChecked(cfg.getDunPersist());
36 dundPersistEdit->setText(cfg.getDunPersistPeriod());
37 dundCacheCBox->setChecked(cfg.getDunCache());
38 dundCacheEdit->setText(cfg.getDunCachePeriod());
39 for (i = 1; i < 32; i++)
40 dundChannelCBox->insertItem(QString::number(i));
41 role = cfg.getDunChannel();
42 for (i = 0; i < dundChannelCBox->count(); i++) {
43 if (role == dundChannelCBox->text(i)) {
44 dundChannelCBox->setCurrentItem(i);
45 break;
46 }
47 }
48 dundMsdunCBox->setChecked(cfg.getDunMsdun());
49 dundMsdunTimeoutEdit->setText(cfg.getDunMsdunTimeout());
50 dundPPPdCBox->setChecked(cfg.getDunPPPd());
51 dundPPPdPathEdit->setText(cfg.getDunPPPdPath());
52 dundPPPdOptionsEdit->setText(cfg.getDunPPPdOptions());
53
54 pandEnableCBox->setChecked(cfg.getPanEnable());
55 pandEncryptCBox->setChecked(cfg.getPanEncrypt());
56 pandSecureCBox->setChecked(cfg.getPanSecure());
57 pandMasterCBox->setChecked(cfg.getPanMaster());
58 role = cfg.getPanRole();
59 for (i = 0; i < pandRoleComboBox->count(); i++) {
60 if (role == pandRoleComboBox->text(i)) {
61 pandRoleComboBox->setCurrentItem(i);
62 break;
63 }
64 }
65 pandDisableSDPCBox->setChecked(cfg.getPanDisableSDP());
66 pandPersistCBox->setChecked(cfg.getPanPersist());
67 pandPersistEdit->setText(cfg.getPanPersistPeriod());
68 pandCacheCBox->setChecked(cfg.getPanCache());
69 pandCacheEdit->setText(cfg.getPanCachePeriod());
70}
71
72ServicesDialog::~ServicesDialog()
73{
74}
75
76void ServicesDialog::accept()
77{
78 QString tmp;
79 odebug << "save configuration" << oendl;
80 cfg.setHcidEnable(hcidEnableCBox->isChecked());
81 cfg.setHiddEnable(hiddEnableCBox->isChecked());
82 cfg.setSdpdEnable(sdpdEnableCBox->isChecked());
83 cfg.setRfcommEnable(rfcommEnableCBox->isChecked());
84 cfg.setDundEnable(dundEnableCBox->isChecked());
85 cfg.setDunDisableSDP(dundDisableSDPCBox->isChecked());
86 cfg.setDunPersist(dundPersistCBox->isChecked());
87 tmp = dundPersistEdit->text();
88 cfg.setDunPersistPeriod(tmp);
89 cfg.setDunCache(dundCacheCBox->isChecked());
90 tmp = dundCacheEdit->text();
91 cfg.setDunCachePeriod(tmp);
92 tmp = dundChannelCBox->currentText();
93 cfg.setDunChannel(tmp);
94 cfg.setDunMsdun(dundMsdunCBox->isChecked());
95 tmp = dundMsdunTimeoutEdit->text();
96 cfg.setDunMsdunTimeout(tmp);
97 cfg.setDunPPPd(dundPPPdCBox->isChecked());
98 tmp = dundPPPdPathEdit->text();
99 cfg.setDunPPPdPath(tmp);
100 tmp = dundPPPdOptionsEdit->text();
101 cfg.setDunPPPdOptions(tmp);
102
103 cfg.setPanEnable(pandEnableCBox->isChecked());
104 cfg.setPanEncrypt(pandEncryptCBox->isChecked());
105 cfg.setPanSecure(pandSecureCBox->isChecked());
106 cfg.setPanMaster(pandMasterCBox->isChecked());
107 cfg.setPanDisableSDP(pandDisableSDPCBox->isChecked());
108 tmp = pandRoleComboBox->currentText();
109 cfg.setPanRole(tmp);
110 cfg.setPanPersist(pandPersistCBox->isChecked());
111 tmp = pandPersistEdit->text();
112 cfg.setPanPersistPeriod(tmp);
113 cfg.setPanCache(pandCacheCBox->isChecked());
114 tmp = pandCacheEdit->text();
115 cfg.setPanCachePeriod(tmp);
116 cfg.saveConfig();
117 ServicesDialogBase::accept();
118}
119
120//eof