summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/securityplugins/notice/noticeplugin.cpp12
-rw-r--r--noncore/securityplugins/notice/noticeplugin.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/noncore/securityplugins/notice/noticeplugin.cpp b/noncore/securityplugins/notice/noticeplugin.cpp
index 1da260a..5617855 100644
--- a/noncore/securityplugins/notice/noticeplugin.cpp
+++ b/noncore/securityplugins/notice/noticeplugin.cpp
@@ -1,84 +1,84 @@
1#include "noticeplugin.h" 1#include "noticeplugin.h"
2 2
3#include <opie2/oapplication.h> 3#include <opie2/oapplication.h>
4 4
5#include <qmessagebox.h> 5#include <qmessagebox.h>
6#include <qregexp.h> 6#include <qregexp.h>
7 7
8using Opie::Security::MultiauthPluginObject; 8using Opie::Security::MultiauthPluginObject;
9using Opie::Security::MultiauthConfigWidget; 9using Opie::Security::MultiauthConfigWidget;
10 10
11/// creates and initializes the m_config Config object 11/// creates and initializes the m_config Config object
12NoticePlugin::NoticePlugin() : MultiauthPluginObject(), noticeW(0) { 12NoticePlugin::NoticePlugin() : MultiauthPluginObject(), m_noticeW(0) {
13 m_config = new Config("Security"); 13 m_config = new Config("Security");
14 m_config->setGroup("NoticePlugin"); 14 m_config->setGroup("NoticePlugin");
15} 15}
16 16
17/// deletes the m_config Config object and noticeW if necessary 17/// deletes the m_config Config object and noticeW if necessary
18NoticePlugin::~NoticePlugin() { 18NoticePlugin::~NoticePlugin() {
19 delete m_config; 19 delete m_config;
20 if (noticeW != 0) 20 if (m_noticeW != 0)
21 delete noticeW; 21 delete m_noticeW;
22} 22}
23 23
24/// Simply return its name (Notice plugin) 24/// Simply return its name (Notice plugin)
25QString NoticePlugin::pluginName() const { 25QString NoticePlugin::pluginName() const {
26 return "Notice plugin"; 26 return "Notice plugin";
27} 27}
28 28
29/// return the Notice widget configuration widget 29/// return the Notice widget configuration widget
30/** 30/**
31 * \return noticeW, the NoticeConfigWidget 31 * \return noticeW, the NoticeConfigWidget
32 */ 32 */
33MultiauthConfigWidget * NoticePlugin::configWidget(QWidget * parent) { 33MultiauthConfigWidget * NoticePlugin::configWidget(QWidget * parent) {
34 if (noticeW == 0) 34 if (m_noticeW == 0)
35 noticeW = new NoticeConfigWidget(parent, "Notice configuration widget"); 35 m_noticeW = new NoticeConfigWidget(parent, "Notice configuration widget");
36 return noticeW; 36 return m_noticeW;
37} 37}
38 38
39/// return the path of the small tab icon 39/// return the path of the small tab icon
40QString NoticePlugin::pixmapNameConfig() const { 40QString NoticePlugin::pixmapNameConfig() const {
41 return "security/noticeplugin_small"; 41 return "security/noticeplugin_small";
42} 42}
43 43
44/// return the path of the big icon for the active/order checklist 44/// return the path of the big icon for the active/order checklist
45QString NoticePlugin::pixmapNameWidget() const { 45QString NoticePlugin::pixmapNameWidget() const {
46 return "security/noticeplugin"; 46 return "security/noticeplugin";
47} 47}
48 48
49/// Displays the configured message and an 'Accept' button 49/// Displays the configured message and an 'Accept' button
50/** 50/**
51 * \return the outcome code of this authentication (can be only success) 51 * \return the outcome code of this authentication (can be only success)
52 */ 52 */
53int NoticePlugin::authenticate() { 53int NoticePlugin::authenticate() {
54 QMessageBox noticeDialog("Notice plugin", 54 QMessageBox noticeDialog("Notice plugin",
55 getNoticeText(), 55 getNoticeText(),
56 QMessageBox::Warning, 56 QMessageBox::Warning,
57 QMessageBox::Yes, 57 QMessageBox::Yes,
58 0, 58 0,
59 0, 59 0,
60 0, 60 0,
61 "notice plugin dialog", 61 "notice plugin dialog",
62 true, 62 true,
63 Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop); 63 Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop);
64 64
65 noticeDialog.setButtonText(QMessageBox::Yes, tr("I accept")); 65 noticeDialog.setButtonText(QMessageBox::Yes, tr("I accept"));
66 66
67 QRect desk = oApp->desktop()->geometry(); 67 QRect desk = oApp->desktop()->geometry();
68 noticeDialog.setGeometry( 0, 0, desk.width(), desk.height() ); 68 noticeDialog.setGeometry( 0, 0, desk.width(), desk.height() );
69 69
70 switch (noticeDialog.exec()) 70 switch (noticeDialog.exec())
71 { 71 {
72 case QMessageBox::Yes: 72 case QMessageBox::Yes:
73 return MultiauthPluginObject::Success; 73 return MultiauthPluginObject::Success;
74 } 74 }
75 return 255; //should not be returned anyway 75 return 255; //should not be returned anyway
76} 76}
77 77
78/// get the notice text from our m_config config file (with true new lines) 78/// get the notice text from our m_config config file (with true new lines)
79/** 79/**
80 * if no text has been defined yet returns defaultNoticeText 80 * if no text has been defined yet returns defaultNoticeText
81 */ 81 */
82QString NoticePlugin::getNoticeText() { 82QString NoticePlugin::getNoticeText() {
83 // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp 83 // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp
84 return m_config->readEntry("noticeText", QObject::tr(defaultNoticeText)).replace( QRegExp("\\\\n"), "\n" ); 84 return m_config->readEntry("noticeText", QObject::tr(defaultNoticeText)).replace( QRegExp("\\\\n"), "\n" );
diff --git a/noncore/securityplugins/notice/noticeplugin.h b/noncore/securityplugins/notice/noticeplugin.h
index 4aa6f02..2828f58 100644
--- a/noncore/securityplugins/notice/noticeplugin.h
+++ b/noncore/securityplugins/notice/noticeplugin.h
@@ -11,54 +11,54 @@
11.> <`_, > . <= redistribute it and/or modify it under 11.> <`_, > . <= redistribute it and/or modify it under
12:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 12:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
13.="- .-=="i, .._ License as published by the Free Software 13.="- .-=="i, .._ License as published by the Free Software
14 - . .-<_> .<> Foundation; either version 2 of the License, 14 - . .-<_> .<> Foundation; either version 2 of the License,
15 ._= =} : or (at your option) any later version. 15 ._= =} : or (at your option) any later version.
16 .%`+i> _;_. 16 .%`+i> _;_.
17 .i_,=:_. -<s. This library is distributed in the hope that 17 .i_,=:_. -<s. This library is distributed in the hope that
18 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 18 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
19 : .. .:, . . . without even the implied warranty of 19 : .. .:, . . . without even the implied warranty of
20 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 20 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
21 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 21 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.= = ; Library General Public License for more 22..}^=.= = ; Library General Public License for more
23++= -. .` .: details. 23++= -. .` .: details.
24 : = ...= . :.=- 24 : = ...= . :.=-
25 -. .:....=;==+<; You should have received a copy of the GNU 25 -. .:....=;==+<; You should have received a copy of the GNU
26 -_. . . )=. = Library General Public License along with 26 -_. . . )=. = Library General Public License along with
27 -- :-=` this library; see the file COPYING.LIB. 27 -- :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#ifndef NOTICE_PLUGIN_H 34#ifndef NOTICE_PLUGIN_H
35#define NOTICE_PLUGIN_H 35#define NOTICE_PLUGIN_H
36 36
37#include <qstring.h> 37#include <qstring.h>
38#include <qpe/config.h> 38#include <qpe/config.h>
39#include <opie2/multiauthplugininterface.h> 39#include <opie2/multiauthplugininterface.h>
40#include "noticeConfigWidget.h" 40#include "noticeConfigWidget.h"
41 41
42/// Multi-authentication plugin, having the user accept a (legal, etc.) notice text. 42/// Multi-authentication plugin, having the user accept a (legal, etc.) notice text.
43/** 43/**
44 * The plugin itself, implementing the main authenticate() function. 44 * The plugin itself, implementing the main authenticate() function.
45 */ 45 */
46class NoticePlugin : public QObject, public Opie::Security::MultiauthPluginObject { 46class NoticePlugin : public QObject, public Opie::Security::MultiauthPluginObject {
47 47
48 Q_OBJECT; 48 Q_OBJECT;
49 49
50public: 50public:
51 NoticePlugin(); 51 NoticePlugin();
52 virtual ~NoticePlugin(); 52 virtual ~NoticePlugin();
53 int authenticate(); 53 int authenticate();
54 Opie::Security::MultiauthConfigWidget * configWidget(QWidget * parent); 54 Opie::Security::MultiauthConfigWidget * configWidget(QWidget * parent);
55 QString pixmapNameConfig() const; 55 QString pixmapNameConfig() const;
56 QString pixmapNameWidget() const; 56 QString pixmapNameWidget() const;
57 QString pluginName() const; 57 QString pluginName() const;
58private: 58private:
59 NoticeConfigWidget * noticeW; 59 NoticeConfigWidget * m_noticeW;
60 Config * m_config; 60 Config * m_config;
61 QString getNoticeText(); 61 QString getNoticeText();
62}; 62};
63 63
64#endif 64#endif