summaryrefslogtreecommitdiff
path: root/noncore/securityplugins/blueping/bluepingplugin.cpp
Unidiff
Diffstat (limited to 'noncore/securityplugins/blueping/bluepingplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/securityplugins/blueping/bluepingplugin.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/noncore/securityplugins/blueping/bluepingplugin.cpp b/noncore/securityplugins/blueping/bluepingplugin.cpp
index 05fd3c2..f5d9ad6 100644
--- a/noncore/securityplugins/blueping/bluepingplugin.cpp
+++ b/noncore/securityplugins/blueping/bluepingplugin.cpp
@@ -16,17 +16,16 @@ using Opie::Security::MultiauthPluginObject;
16using Opie::Security::MultiauthConfigWidget; 16using Opie::Security::MultiauthConfigWidget;
17 17
18 18
19/// creates and initializes the m_config Config object 19/// standard c'tor
20BluepingPlugin::BluepingPlugin() : MultiauthPluginObject(), m_ping(0) { 20BluepingPlugin::BluepingPlugin() : MultiauthPluginObject(), m_ping(0), m_bluepingW(0) {
21 m_config = new Config("Security");
22 m_config->setGroup("BluepingPlugin");
23 bluetoothAlreadyRestarted = false; 21 bluetoothAlreadyRestarted = false;
24} 22}
25 23
26/// deletes the m_config Config object and noticeW if necessary 24/// cleans m_ping if we need to
27BluepingPlugin::~BluepingPlugin() { 25BluepingPlugin::~BluepingPlugin() {
28 delete m_config;
29 delete m_ping; 26 delete m_ping;
27 if (m_bluepingW != 0)
28 delete m_bluepingW;
30} 29}
31 30
32/// Simply return its name (Blueping plugin) 31/// Simply return its name (Blueping plugin)
@@ -34,15 +33,17 @@ QString BluepingPlugin::pluginName() const {
34 return "Blueping plugin"; 33 return "Blueping plugin";
35} 34}
36 35
37/// no configuration widget for the moment 36/// returns a BluepingConfigWidget
38MultiauthConfigWidget * BluepingPlugin::configWidget(QWidget * parent) { 37MultiauthConfigWidget * BluepingPlugin::configWidget(QWidget * parent) {
39 return 0l; 38 if (m_bluepingW == 0)
39 m_bluepingW = new BluepingConfigWidget(parent, "Blueping configuration widget");
40 return m_bluepingW;
40} 41}
41QString BluepingPlugin::pixmapNameWidget() const { 42QString BluepingPlugin::pixmapNameWidget() const {
42 return "security/bluepingplugin"; 43 return "security/bluepingplugin";
43} 44}
44QString BluepingPlugin::pixmapNameConfig() const { 45QString BluepingPlugin::pixmapNameConfig() const {
45 return 0l; 46 return "security/bluepingplugin";
46} 47}
47 48
48/// Emit the MultiauthPluginObject::Success emitCode 49/// Emit the MultiauthPluginObject::Success emitCode
@@ -106,7 +107,7 @@ int BluepingPlugin::authenticate() {
106 if (!macToPing.isEmpty()) 107 if (!macToPing.isEmpty())
107 { 108 {
108 /* Standard, inescapable authentication dialog 109 /* Standard, inescapable authentication dialog
109 */ 110 */
110 QDialog bluepingDialog(0, 111 QDialog bluepingDialog(0,
111 "Blueping dialog", 112 "Blueping dialog",
112 TRUE, 113 TRUE,
@@ -135,6 +136,8 @@ int BluepingPlugin::authenticate() {
135 // connect the signal emitting functions to the bluepingDialog done(int) finishing function 136 // connect the signal emitting functions to the bluepingDialog done(int) finishing function
136 QObject::connect(this, SIGNAL(emitCode(int)), &bluepingDialog, SLOT(done(int))); 137 QObject::connect(this, SIGNAL(emitCode(int)), &bluepingDialog, SLOT(done(int)));
137 138
139 // we can uncomment the following when testing
140 //bluetoothAlreadyRestarted = true;
138 if (!bluetoothAlreadyRestarted) 141 if (!bluetoothAlreadyRestarted)
139 { 142 {
140 // we have just started or resumed the device, so Bluetooth has to be (re)started 143 // we have just started or resumed the device, so Bluetooth has to be (re)started