summaryrefslogtreecommitdiff
path: root/noncore/securityplugins/pin
authorzecke <zecke>2004-07-17 16:46:58 (UTC)
committer zecke <zecke>2004-07-17 16:46:58 (UTC)
commite917f3763a0beb6d540adbfa5f59e478d3baec64 (patch) (side-by-side diff)
treec2cf3f13559d9693a4f66cd3f65e419b571377bd /noncore/securityplugins/pin
parentd6a4bf47ef7dfaabd08fb8d514cde1832a055816 (diff)
downloadopie-e917f3763a0beb6d540adbfa5f59e478d3baec64.zip
opie-e917f3763a0beb6d540adbfa5f59e478d3baec64.tar.gz
opie-e917f3763a0beb6d540adbfa5f59e478d3baec64.tar.bz2
Addjust to the namespace changes of OMAF
Diffstat (limited to 'noncore/securityplugins/pin') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/securityplugins/pin/pin.cpp17
-rw-r--r--noncore/securityplugins/pin/pin.h4
-rw-r--r--noncore/securityplugins/pin/pinConfigWidget.cpp6
-rw-r--r--noncore/securityplugins/pin/pinConfigWidget.h16
-rw-r--r--noncore/securityplugins/pin/pinpluginimpl.cpp3
-rw-r--r--noncore/securityplugins/pin/pinpluginimpl.h5
6 files changed, 29 insertions, 22 deletions
diff --git a/noncore/securityplugins/pin/pin.cpp b/noncore/securityplugins/pin/pin.cpp
index 37dc5be..c21ffcd 100644
--- a/noncore/securityplugins/pin/pin.cpp
+++ b/noncore/securityplugins/pin/pin.cpp
@@ -38,14 +38,17 @@
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
extern "C" char *crypt(const char *key, const char *salt);
+using Opie::Security::MultiauthConfigWidget;
+using Opie::Security::MultiauthPluginObject;
+
/// set to TRUE when we press the 'Skip' button
-bool isSkip = FALSE;
+static bool isSkip = FALSE;
/// PIN input graphical widget.
/**
* Inherits the PinDialogBase class defined originally in pinDialogBase.ui interface file.
* \sa PinDlg and PinDialog (the class generated from the .ui file)
* It comes from the original PIN locking code in Opie :
@@ -229,16 +232,16 @@ bool PinPlugin::verify(const QString& pin, const QString& hash)
* dialog).
*/
QString PinPlugin::getPIN( const QString& prompt )
{
PinDlg pd(0,0,TRUE);
pd.pinD->setPrompt( prompt );
-
+
pd.showMaximized();
int r = pd.exec();
-
+
if ( r == QDialog::Accepted ) {
if (pd.pinD->text.isEmpty())
return "";
else
return pd.pinD->text;
}
@@ -299,19 +302,19 @@ int PinPlugin::authenticate()
if (!hashedPin.isEmpty())
{
// prompt for the PIN in a fullscreen modal dialog
PinDlg pd(0,0,TRUE,TRUE);
pd.reset();
pd.exec();
-
+
// analyse the result
if (isSkip == TRUE)
return MultiauthPluginObject::Skip;
else if (verify(pd.pinD->text, hashedPin))
return MultiauthPluginObject::Success;
- else
+ else
return MultiauthPluginObject::Failure;
}
owarn << "No PIN has been defined! We consider it as a successful authentication though." << oendl;
return MultiauthPluginObject::Success;
}
@@ -328,15 +331,15 @@ QString PinPlugin::pixmapNameConfig() const {
return "security/pinplugin";
}
/// returns a PinConfigWidget
MultiauthConfigWidget * PinPlugin::configWidget(QWidget * parent) {
PinConfigWidget * pinw = new PinConfigWidget(parent, "PIN configuration widget");
-
+
connect(pinw->changePIN, SIGNAL( clicked() ), this, SLOT( changePIN() ));
connect(pinw->clearPIN, SIGNAL( clicked() ), this, SLOT( clearPIN() ));
-
+
return pinw;
}
#include "pin.moc"
diff --git a/noncore/securityplugins/pin/pin.h b/noncore/securityplugins/pin/pin.h
index 6cd328a..1832210 100644
--- a/noncore/securityplugins/pin/pin.h
+++ b/noncore/securityplugins/pin/pin.h
@@ -40,19 +40,19 @@
#include "pinConfigWidget.h"
/// Multi-authentication plugin, implementing a PIN verification.
/**
* The plugin itself, implementing the main authenticate() function.
*/
-class PinPlugin : public QObject, public MultiauthPluginObject {
+class PinPlugin : public QObject, public Opie::Security::MultiauthPluginObject {
Q_OBJECT
public:
int authenticate();
- MultiauthConfigWidget * configWidget(QWidget * parent);
+ Opie::Security::MultiauthConfigWidget * configWidget(QWidget * parent);
QString pixmapNameConfig() const;
QString pixmapNameWidget() const;
QString pluginName() const;
private slots:
QString getPIN( const QString& prompt );
diff --git a/noncore/securityplugins/pin/pinConfigWidget.cpp b/noncore/securityplugins/pin/pinConfigWidget.cpp
index 53e1a20..b34db8b 100644
--- a/noncore/securityplugins/pin/pinConfigWidget.cpp
+++ b/noncore/securityplugins/pin/pinConfigWidget.cpp
@@ -2,20 +2,22 @@
#include <qlayout.h>
#include <qlabel.h>
#include <qgroupbox.h>
#include "pinConfigWidget.h"
+using Opie::Security::MultiauthConfigWidget;
+
PinConfigWidget::PinConfigWidget(QWidget* parent = 0, const char* name = "PIN configuration widget")
: MultiauthConfigWidget(parent, name)
{
QVBoxLayout * baseLayout = new QVBoxLayout( this);
baseLayout->setSpacing(11);
baseLayout->setMargin(11);
baseLayout->setAlignment( Qt::AlignTop );
-
+
QGroupBox * configBox = new QGroupBox(0, Qt::Vertical, tr("Configure your PIN here"), this);
baseLayout->addWidget(configBox);
QVBoxLayout *boxLayout = new QVBoxLayout( configBox->layout() );
QLabel * description = new QLabel("<p>" + tr("PIN protection provides a minimal level of protection from casual access to this device.") + "</p>", configBox);
boxLayout->addWidget(description);
@@ -24,13 +26,13 @@ PinConfigWidget::PinConfigWidget(QWidget* parent = 0, const char* name = "PIN co
buttonLayout->setSpacing(6);
changePIN = new QPushButton( tr("Change PIN"), configBox, "changePIN" );
clearPIN = new QPushButton( tr("Clear PIN"), configBox, "clearPIN" );
buttonLayout->addWidget(changePIN);
buttonLayout->addWidget(clearPIN);
boxLayout->addLayout(buttonLayout);
-
+
}
/// nothing to do
PinConfigWidget::~PinConfigWidget()
{}
diff --git a/noncore/securityplugins/pin/pinConfigWidget.h b/noncore/securityplugins/pin/pinConfigWidget.h
index 3242ad0..6d5edff 100644
--- a/noncore/securityplugins/pin/pinConfigWidget.h
+++ b/noncore/securityplugins/pin/pinConfigWidget.h
@@ -4,48 +4,48 @@
* \author Clément Séveillac (clement . seveillac (at) via . ecp . fr)
*/
/*
=. This file is part of the Opie Project
.=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
.>+-=
- _;:, .> :=|. This library is free software; you can
+ _;:, .> :=|. This library is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
- .%`+i> _;_.
- .i_,=:_. -<s. This library is distributed in the hope that
+ .%`+i> _;_.
+ .i_,=:_. -<s. This library is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
- : = ...= . :.=-
+ : = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
- -- :-=` this library; see the file COPYING.LIB.
+ -- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef PINCONFIGWIDGET_H
#define PINCONFIGWIDGET_H
#include <qpushbutton.h>
#include <opie2/multiauthconfigwidget.h>
-class PinConfigWidget : public MultiauthConfigWidget {
+class PinConfigWidget : public Opie::Security::MultiauthConfigWidget {
public:
PinConfigWidget(QWidget* parent, const char* name);
virtual ~PinConfigWidget();
virtual void writeConfig();
///\todo to protect?
QPushButton *changePIN;
- QPushButton *clearPIN;
-
+ QPushButton *clearPIN;
+
};
#endif // PINCONFIGWIDGET_H
diff --git a/noncore/securityplugins/pin/pinpluginimpl.cpp b/noncore/securityplugins/pin/pinpluginimpl.cpp
index 1c32f81..6cd2467 100644
--- a/noncore/securityplugins/pin/pinpluginimpl.cpp
+++ b/noncore/securityplugins/pin/pinpluginimpl.cpp
@@ -1,8 +1,11 @@
#include "pinpluginimpl.h"
+using Opie::Security::MultiauthPluginObject;
+using Opie::Security::MultiauthPluginInterface;
+
PinPluginImpl::PinPluginImpl() {
pinPlugin = new PinPlugin();
}
PinPluginImpl::~PinPluginImpl() {
delete pinPlugin;
diff --git a/noncore/securityplugins/pin/pinpluginimpl.h b/noncore/securityplugins/pin/pinpluginimpl.h
index e604b64..cbb9ef0 100644
--- a/noncore/securityplugins/pin/pinpluginimpl.h
+++ b/noncore/securityplugins/pin/pinpluginimpl.h
@@ -34,25 +34,24 @@
#ifndef PIN_PLUGIN_IMPL_H
#define PIN_PLUGIN_IMPL_H
#include "pin.h"
/// Standard multiauth plugin class
-class PinPluginImpl : public MultiauthPluginInterface{
+class PinPluginImpl : public Opie::Security::MultiauthPluginInterface{
public:
PinPluginImpl();
virtual ~PinPluginImpl();
QRESULT queryInterface( const QUuid &, QUnknownInterface** );
// defines standard addRef() and release() functions
Q_REFCOUNT;
- virtual MultiauthPluginObject *plugin();
+ virtual Opie::Security::MultiauthPluginObject *plugin();
private:
/// the plugin itself
PinPlugin *pinPlugin;
- ulong ref;
};
#endif