author | ulf69 <ulf69> | 2004-09-24 19:51:43 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-24 19:51:43 (UTC) |
commit | a884dac6f756b3702a10ae97aa8782e4d2a84b20 (patch) (side-by-side diff) | |
tree | 08e50146a3176848455db29e0c0ff0309c6f7b4c | |
parent | ae069aa892b29a96a923e49254cc89e65d0393eb (diff) | |
download | kdepimpi-a884dac6f756b3702a10ae97aa8782e4d2a84b20.zip kdepimpi-a884dac6f756b3702a10ae97aa8782e4d2a84b20.tar.gz kdepimpi-a884dac6f756b3702a10ae97aa8782e4d2a84b20.tar.bz2 |
*** empty log message ***
21 files changed, 699 insertions, 38 deletions
diff --git a/pwmanager/pwmanager/addentrywnd_emb.cpp b/pwmanager/pwmanager/addentrywnd_emb.cpp index 3a40cfc..ed02e6d 100644 --- a/pwmanager/pwmanager/addentrywnd_emb.cpp +++ b/pwmanager/pwmanager/addentrywnd_emb.cpp @@ -43,5 +43,5 @@ $Id$ */ addEntryWnd::addEntryWnd( QWidget* parent, const char* name) - : KDialogBase( KDialogBase::Plain, i18n( "Edit Password" ), + : KDialogBase( KDialogBase::Plain, i18n( "edit/add a password entry" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name, true ) diff --git a/pwmanager/pwmanager/findwnd_emb.cpp b/pwmanager/pwmanager/findwnd_emb.cpp new file mode 100644 index 0000000..6db2684 --- a/dev/null +++ b/pwmanager/pwmanager/findwnd_emb.cpp @@ -0,0 +1,123 @@ +/* + This file is part of PwManager/Platform independent. + Copyright (c) 2004 Ulf Schenk + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + +$Id$ +*/ + +#include "findwnd_emb.h" + +#include <klocale.h> + +#include <qcheckbox.h> +#include <qbuttongroup.h> +#include <qradiobutton.h> +#include <qlayout.h> +#include <klineedit.h> +#include <qlabel.h> + +/* +#include <qvariant.h> +#include <qlabel.h> +#include <qlineedit.h> +#include <qpushbutton.h> +#include <qcheckbox.h> +#include <qbuttongroup.h> +#include <qradiobutton.h> +#include <qlayout.h> +#include <qtooltip.h> +#include <qwhatsthis.h> +*/ + +/* + * Constructs a findWnd as a child of 'parent', with the + * name 'name'. + */ +findWnd::findWnd( QWidget* parent, const char* name ) + : KDialogBase( KDialogBase::Plain, i18n( "Find" ), + KDialogBase::Ok | KDialogBase::Cancel, + KDialogBase::Ok, parent, name, true ) +{ + QWidget *page = plainPage(); + QVBoxLayout *layout = new QVBoxLayout( page ); + layout->setMargin( KDialogBase::marginHint() ); + layout->setSpacing( KDialogBase::spacingHint() ); + + exactCheckBox = new QCheckBox( i18n( "&Exact match" ), page ); + layout->addWidget( exactCheckBox ); + + caseSensCheckBox = new QCheckBox( i18n( "&Case sensitive" ), page ); + layout->addWidget( caseSensCheckBox ); + + + QButtonGroup* buttonGroup1 = new QButtonGroup(1, Qt::Horizontal, i18n( "Search in Column" ), page ); + layout->addWidget( buttonGroup1 ); + + descRadioButton = new QRadioButton( i18n( "&Description" ), buttonGroup1 ); + pwRadioButton = new QRadioButton( i18n( "&Password" ), buttonGroup1 ); + commentRadioButton = new QRadioButton( i18n( "C&omment" ), buttonGroup1 ); + nameRadioButton = new QRadioButton( i18n( "&Username" ), buttonGroup1 ); + urlRadioButton = new QRadioButton( i18n( "U&RL" ), buttonGroup1 ); + launcherRadioButton = new QRadioButton( i18n( "&Launcher" ), buttonGroup1 ); + descRadioButton->setChecked( TRUE ); + + findLineEdit = new KLineEdit( page ); + QLabel* label = new QLabel( findLineEdit, i18n( "Find:" ), page ); + layout->addWidget( label ); + layout->addWidget( findLineEdit ); + + setButtonText( KDialogBase::Ok, "&Find" ); + setButtonText( KDialogBase::Cancel, "&Close" ); + + + // resize( QSize(200, 150) ); + + + connect( buttonGroup1, SIGNAL( clicked(int) ), this, SLOT( selectionChanged_slot() ) ); + connect( findLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( selectionChanged_slot() ) ); + connect( caseSensCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) ); + connect( exactCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) ); + +} + +/* + * Destroys the object and frees any allocated resources + */ +findWnd::~findWnd() +{ + // no need to delete child widgets, Qt does it all for us +} + +void findWnd::findButton_slot() +{ + qWarning( "findWnd::findButton_slot(): Not implemented yet" ); +} + +void findWnd::selectionChanged_slot() +{ + qWarning( "findWnd::selectionChanged_slot(): Not implemented yet" ); +} + +void findWnd::closeButton_slot() +{ + qWarning( "findWnd::closeButton_slot(): Not implemented yet" ); +} + diff --git a/pwmanager/pwmanager/findwnd_emb.h b/pwmanager/pwmanager/findwnd_emb.h new file mode 100644 index 0000000..9ad5a73 --- a/dev/null +++ b/pwmanager/pwmanager/findwnd_emb.h @@ -0,0 +1,62 @@ +/* + This file is part of PwManager/Platform independent. + Copyright (c) 2004 Ulf Schenk + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + +$Id$ +*/ + + +#ifndef FINDWND_EMB_H +#define FINDWND_EMB_H + +#include <kdialogbase.h> + + +class QLineEdit; +class QCheckBox; +class QRadioButton; + + +class findWnd : public KDialogBase +{ + Q_OBJECT + +public: + findWnd( QWidget* parent = 0, const char* name = 0 ); + ~findWnd(); + + QLineEdit* findLineEdit; + QCheckBox* exactCheckBox; + QCheckBox* caseSensCheckBox; + QRadioButton* descRadioButton; + QRadioButton* pwRadioButton; + QRadioButton* commentRadioButton; + QRadioButton* nameRadioButton; + QRadioButton* urlRadioButton; + QRadioButton* launcherRadioButton; + +public slots: + virtual void findButton_slot(); + virtual void selectionChanged_slot(); + virtual void closeButton_slot(); +}; + +#endif // FINDWND_H diff --git a/pwmanager/pwmanager/findwndimpl.cpp b/pwmanager/pwmanager/findwndimpl.cpp index fec1a6a..059219f 100644 --- a/pwmanager/pwmanager/findwndimpl.cpp +++ b/pwmanager/pwmanager/findwndimpl.cpp @@ -109,7 +109,20 @@ void FindWndImpl::findButton_slot() } + +#ifdef PWM_EMBEDDED +void FindWndImpl::slotOk() +{ + findButton_slot(); + + //do not call KDialogBase::slotOk() here + // user should press the close button instead +} +#endif + void FindWndImpl::closeButton_slot() { +#ifndef PWM_EMBEDDED done(0); +#endif } diff --git a/pwmanager/pwmanager/findwndimpl.h b/pwmanager/pwmanager/findwndimpl.h index d8cb65d..b601390 100644 --- a/pwmanager/pwmanager/findwndimpl.h +++ b/pwmanager/pwmanager/findwndimpl.h @@ -21,5 +21,9 @@ #define FINDWNDIMPL_H +#ifndef PWM_EMBEDDED #include "findwnd.h" +#else +#include "findwnd_emb.h" +#endif class PwMView; @@ -44,4 +48,8 @@ public slots: void selectionChanged_slot(); +#ifdef PWM_EMBEDDED + virtual void slotOk(); +#endif + protected: /** parent view */ diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp new file mode 100644 index 0000000..3519de8 --- a/dev/null +++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp @@ -0,0 +1,86 @@ +/* + This file is part of PwManager/Platform independent. + Copyright (c) 2004 Ulf Schenk + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + +$Id$ +*/ + +#include "getmasterpwwnd_emb.h" + +#include "klocale.h" +/* +#include <qvariant.h> +#include <qpushbutton.h> +#include <qlabel.h> +#include <qlineedit.h> +#include <qlayout.h> +#include <qtooltip.h> +#include <qwhatsthis.h> +*/ + +#include <qwidget.h> +#include <qlayout.h> +#include <qlabel.h> +#include <qlineedit.h> + +/* + * Constructs a getMasterPwWnd as a child of 'parent', with the + * name 'name' + */ +getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) + : KDialogBase( KDialogBase::Plain, i18n( "Master-password" ), + KDialogBase::Ok | KDialogBase::Cancel, + KDialogBase::Ok, parent, name, true ) +{ + QWidget *page = plainPage(); + QVBoxLayout *pageLayout = new QVBoxLayout( page ); + + pwLineEdit = new QLineEdit( page, "pwLineEdit" ); + pwLineEdit->setEchoMode( QLineEdit::Password ); + + QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" ); + textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); + pageLayout->addWidget(textLabel1); + pageLayout->addWidget(pwLineEdit); + + + resize( QSize(200, 100) ); + +} + +/* + * Destroys the object and frees any allocated resources + */ +getMasterPwWnd::~getMasterPwWnd() +{ + // no need to delete child widgets, Qt does it all for us +} + +void getMasterPwWnd::okButton_slot() +{ + qWarning( "getMasterPwWnd::okButton_slot(): Not implemented yet" ); +} + +void getMasterPwWnd::cancelButton_slot() +{ + qWarning( "getMasterPwWnd::cancelButton_slot(): Not implemented yet" ); +} + diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.h b/pwmanager/pwmanager/getmasterpwwnd_emb.h new file mode 100644 index 0000000..64121c4 --- a/dev/null +++ b/pwmanager/pwmanager/getmasterpwwnd_emb.h @@ -0,0 +1,48 @@ +/* + This file is part of PwManager/Platform independent. + Copyright (c) 2004 Ulf Schenk + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + +$Id$ +*/ + +#ifndef GETMASTERPWWND_EMB_H +#define GETMASTERPWWND_EMB_H + +#include <kdialogbase.h> + +class QLineEdit; + +class getMasterPwWnd : public KDialogBase +{ + Q_OBJECT + +public: + getMasterPwWnd( QWidget* parent = 0, const char* name = 0); + ~getMasterPwWnd(); + + QLineEdit* pwLineEdit; + +public slots: + virtual void okButton_slot(); + virtual void cancelButton_slot(); +}; + +#endif // GETMASTERPWWND_H diff --git a/pwmanager/pwmanager/getmasterpwwndimpl.cpp b/pwmanager/pwmanager/getmasterpwwndimpl.cpp index db0223e..6be9618 100644 --- a/pwmanager/pwmanager/getmasterpwwndimpl.cpp +++ b/pwmanager/pwmanager/getmasterpwwndimpl.cpp @@ -33,12 +33,26 @@ GetMasterPwWndImpl::~GetMasterPwWndImpl() void GetMasterPwWndImpl::okButton_slot() { +#ifndef PWM_EMBEDDED if (pwLineEdit->text() != "") done(1); +#endif } void GetMasterPwWndImpl::cancelButton_slot() { +#ifndef PWM_EMBEDDED done(2); +#endif +} + +#ifdef PWM_EMBEDDED +void GetMasterPwWndImpl::slotOk() +{ + if (pwLineEdit->text() != "") + getMasterPwWnd::slotOk(); + else + return; } +#endif #ifndef PWM_EMBEDDED diff --git a/pwmanager/pwmanager/getmasterpwwndimpl.h b/pwmanager/pwmanager/getmasterpwwndimpl.h index 28aa427..8a4c03e 100644 --- a/pwmanager/pwmanager/getmasterpwwndimpl.h +++ b/pwmanager/pwmanager/getmasterpwwndimpl.h @@ -21,5 +21,9 @@ #define GETMASTERPWWNDIMPL_H +#ifndef PWM_EMBEDDED #include "getmasterpwwnd.h" +#else +#include "getmasterpwwnd_emb.h" +#endif /** set master pw wnd */ @@ -36,4 +40,7 @@ public slots: /** cancel button pressed */ void cancelButton_slot(); +#ifdef PWM_EMBEDDED + virtual void slotOk(); +#endif }; diff --git a/pwmanager/pwmanager/listviewpwm.cpp b/pwmanager/pwmanager/listviewpwm.cpp index b987c9e..c53cfd7 100644 --- a/pwmanager/pwmanager/listviewpwm.cpp +++ b/pwmanager/pwmanager/listviewpwm.cpp @@ -26,4 +26,7 @@ #include <kiconloader.h> +#ifdef PWM_EMBEDDED +#include <kglobal.h> +#endif ListViewPwM::ListViewPwM(QWidget *parent, const char *name) @@ -49,8 +52,16 @@ ListViewItemPwM::ListViewItemPwM(QListView *parent) if (!onPix) { PWM_ASSERT(!offPix); + KIconLoader* picons; +#ifndef PWM_EMBEDDED + KIconLoader il; + picons = &il; +#else + picons = KGlobal::iconLoader(); +#endif + KIconLoader il; - static QPixmap onP(il.loadIcon("button_ok", KIcon::Small)); + static QPixmap onP(picons->loadIcon("button_ok", KIcon::Small)); onPix = &onP; - static QPixmap offP(il.loadIcon("encrypted", KIcon::Small)); + static QPixmap offP(picons->loadIcon("encrypted", KIcon::Small)); offPix = &offP; } diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp index d720e1f..3ae4d55 100644 --- a/pwmanager/pwmanager/main.cpp +++ b/pwmanager/pwmanager/main.cpp @@ -23,4 +23,5 @@ #else #include <qdir.h> +#include <kpimglobalprefs.h> #endif @@ -186,4 +187,5 @@ int main(int argc, char *argv[]) #endif KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); + KPimGlobalPrefs::instance()->setGlobalConfig(); a.newInstance(); diff --git a/pwmanager/pwmanager/pwgenwnd_emb.cpp b/pwmanager/pwmanager/pwgenwnd_emb.cpp index 9655e9f..429904c 100644 --- a/pwmanager/pwmanager/pwgenwnd_emb.cpp +++ b/pwmanager/pwmanager/pwgenwnd_emb.cpp @@ -46,7 +46,4 @@ pwGenWnd::pwGenWnd( QWidget* parent, const char* name) KDialogBase::Ok, parent, name, true ) { - if ( !name ) - setName( "pwGenWnd" ); - QWidget *page = plainPage(); QVBoxLayout* pwGenWndLayout = new QVBoxLayout( page, 11, 6, "pwGenWndLayout"); diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index 107e845..bd07c80 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp @@ -358,4 +358,8 @@ void PwM::initToolbar() #endif +#ifdef PWM_EMBEDDED + if ( QApplication::desktop()->width() > 320 ) +#endif + { toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar), BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this, @@ -365,4 +369,5 @@ void PwM::initToolbar() SLOT(open_slot()), true, i18n("Open")); toolBar()->insertSeparator(); + } toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar), BUTTON_TOOL_SAVE, SIGNAL(clicked(int)), this, @@ -726,6 +731,6 @@ void PwM::deletePwd_slot() questionYesNo(this, i18n - ("Do you really want to delete the selected entry") + - " \"" + QString(currItem.desc.c_str()) + ("Do you really want to delete\nthe selected entry") + + " \n\"" + QString(currItem.desc.c_str()) + "\" ?", i18n("delete?")) == KMessageBox::Yes) { @@ -1283,19 +1288,15 @@ void PwM::createAboutData_slot() "(c) 2004 Ulf Schenk\n" "(c) 2004 Lutz Rogowski\n" - "(c) 1997-2003, The KDE PIM Team\n" - - "Michael Buesch - main programming and current maintainer\nmbuesch@freenet.de\n" - "Matt Scifo - original implementaion of \n" - "\"categories\" and the password-tree \n" - "in the system-tray. Original implementations of \n" - "numerous view-improvements.\n" - "mscifo@o1.com\n" - "Elias Probst - Gentoo ebuild maintainer.\nelias.probst@gmx.de\n" - "George Staikos - KWallet\nstaikos@kde.org\n" - "Matthew Palmer - rc2 code\nmjp16@uow.edu.au\n" - "Olivier Sessink - gpasman\ngpasman@nl.linux.org\n" - "The libgcrypt developers - Blowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" - "Troy Engel - kpasman\n tengel@sonic.net\n" - "Wickey - graphics-design in older versions\nwickey@gmx.at\n" + "(c) 1997-2004, The KDE PIM Team\n" + + "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n" + "Matt Scifo - mscifo@o1.com\n" + "Elias Probst - elias.probst@gmx.de\n" + "George Staikos - staikos@kde.org\n" + "Matthew Palmer - mjp16@uow.edu.au\n" + "Olivier Sessink - gpasman@nl.linux.org\n" + "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" + "Troy Engel - tengel@sonic.net\n" + "Wickey - wickey@gmx.at\n" "Ian MacGregor - original documentation author.\n" ); diff --git a/pwmanager/pwmanager/pwmanagerE.pro b/pwmanager/pwmanager/pwmanagerE.pro index 87142b7..b0c9236 100644 --- a/pwmanager/pwmanager/pwmanagerE.pro +++ b/pwmanager/pwmanager/pwmanagerE.pro @@ -49,9 +49,9 @@ compiler.h \ compressbzip2.h \ compressgzip.h \ -findwnd.h \ +findwnd_emb.h \ findwndimpl.h \ genpasswd.h \ getkeycardwnd.h \ -getmasterpwwnd.h \ +getmasterpwwnd_emb.h \ getmasterpwwndimpl.h \ globalstuff.h \ @@ -81,5 +81,5 @@ rc2.h \ rencatwnd.h \ serializer.h \ -setmasterpwwnd.h \ +setmasterpwwnd_emb.h \ setmasterpwwndimpl.h \ sha1.h \ @@ -112,9 +112,9 @@ commentbox.cpp \ compressbzip2.cpp \ compressgzip.cpp \ -findwnd.cpp \ +findwnd_emb.cpp \ findwndimpl.cpp \ genpasswd.cpp \ getkeycardwnd.cpp \ -getmasterpwwnd.cpp \ +getmasterpwwnd_emb.cpp \ getmasterpwwndimpl.cpp \ globalstuff.cpp \ @@ -142,5 +142,5 @@ rc2.cpp \ rencatwnd.cpp \ serializer.cpp \ -setmasterpwwnd.cpp \ +setmasterpwwnd_emb.cpp \ setmasterpwwndimpl.cpp \ sha1.cpp \ diff --git a/pwmanager/pwmanager/pwmdocui.cpp b/pwmanager/pwmanager/pwmdocui.cpp index 3993fa8..e42dd9d 100644 --- a/pwmanager/pwmanager/pwmdocui.cpp +++ b/pwmanager/pwmanager/pwmdocui.cpp @@ -80,7 +80,9 @@ QString PwMDocUi::requestMpw(bool chipcard) #endif // CONFIG_KEYCARD } else { - GetMasterPwWndImpl pwWnd; #ifndef PWM_EMBEDDED + GetMasterPwWndImpl pwWnd; KWin::setState(pwWnd.winId(), NET::StaysOnTop); +#else + GetMasterPwWndImpl pwWnd; #endif if (pwWnd.exec() != 1) @@ -97,11 +99,11 @@ QString PwMDocUi::requestNewMpw(bool *chipcard) SetMasterPwWndImpl pwWnd(currentView); pwWnd.setPwMKeyCard(keyCard); -#ifndef PWM_EMBEDDED if (!chipcard) { +#ifndef PWM_EMBEDDED pwWnd.mainTab->removePage(pwWnd.mainTab->page(1)); - } #else - qDebug("PwMDocUi::requestNewMpw must be implemented"); + pwWnd.mainTab->removePage(pwWnd.tab_2); #endif + } if (pwWnd.exec() != 1) @@ -138,5 +140,5 @@ void PwMDocUi::wrongMpwMsgBox(bool chipcard, QString prefix, QString postfix) if (chipcard) { msg += i18n("Wrong key-card!\n" - "Please try again with the " + "Please try again with the\n" "correct key-card."); } else { @@ -164,5 +166,5 @@ void PwMDocUi::noMpwMsgBox(bool chipcard, QString prefix, QString postfix) if (chipcard) { msg += i18n("No key-card found!\n" - "Please insert the " + "Please insert the\n" "correct key-card."); } else { @@ -361,4 +363,5 @@ bool PwMDocUi::openDocUi(PwMDoc *doc, } ret = doc->openDoc(&filename, lockStat); + qDebug("pwmdocui::OpenDocui %i", ret); if (ret != e_success) { if (ret == e_readFile || ret == e_openFile) { diff --git a/pwmanager/pwmanager/pwmviewstyle.cpp b/pwmanager/pwmanager/pwmviewstyle.cpp index 67b5197..51d8f6c 100644 --- a/pwmanager/pwmanager/pwmviewstyle.cpp +++ b/pwmanager/pwmanager/pwmviewstyle.cpp @@ -26,5 +26,9 @@ #include "pwmview.h" #include "commentbox.h" - +#ifndef PWM_EMBEDDED +#include "configuration.h" +#else +#include "pwmprefs.h" +#endif PwMViewStyle::PwMViewStyle(QWidget *parent, const char *name) @@ -38,4 +42,8 @@ PwMViewStyle::PwMViewStyle(QWidget *parent, const char *name) PwMViewStyle::~PwMViewStyle() { + //US ENH : load and store the size of the listviewcolumns + lv->saveLayout(conf()->getConfig(), "listview"); + conf()->getConfig()->sync(); + delete_ifnot_null(s0); delete_ifnot_null(s1); @@ -80,4 +88,8 @@ void PwMViewStyle::initStyle(style_t style) lv->addColumn(i18n("Launcher"), 120); v->tmpReEnableSort(); + + //US ENH : load and store the size of the listviewcolumns + lv->restoreLayout(conf()->getConfig(), "listview"); + resizeView(v->size()); v->updateView(); diff --git a/pwmanager/pwmanager/serializer.cpp b/pwmanager/pwmanager/serializer.cpp index f29ef6c..2810b48 100644 --- a/pwmanager/pwmanager/serializer.cpp +++ b/pwmanager/pwmanager/serializer.cpp @@ -28,5 +28,5 @@ /* enable/disable serializer debugging (0/1) */ -#define SERIALIZER_DEBUG 0 +#define SERIALIZER_DEBUG 1 /* use the old xml tags for writing (0/1) */ #define USE_OLD_TAGS 0 diff --git a/pwmanager/pwmanager/setmasterpwwnd_emb.cpp b/pwmanager/pwmanager/setmasterpwwnd_emb.cpp new file mode 100644 index 0000000..e6471e6 --- a/dev/null +++ b/pwmanager/pwmanager/setmasterpwwnd_emb.cpp @@ -0,0 +1,163 @@ +/* + This file is part of PwManager/Platform independent. + Copyright (c) 2004 Ulf Schenk + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + +$Id$ +*/ + +#include "setmasterpwwnd_emb.h" + +#include <qpushbutton.h> +#include <qtabwidget.h> +#include <qwidget.h> +#include <qlabel.h> +#include <qlineedit.h> +#include <qlayout.h> + +#include <klocale.h> + +/*US +#include <qvariant.h> +#include <qpushbutton.h> +#include <qtabwidget.h> +#include <qwidget.h> +#include <qlabel.h> +#include <qlineedit.h> +#include <qlayout.h> +#include <qtooltip.h> +#include <qwhatsthis.h> +*/ + +/* + * Constructs a setMasterPwWnd as a child of 'parent', with the + * name 'name' + * + */ +setMasterPwWnd::setMasterPwWnd( QWidget* parent, const char* name ) + : KDialogBase( KDialogBase::Plain, i18n( "Set master-password" ), + KDialogBase::Ok | KDialogBase::Cancel, + KDialogBase::Ok, parent, name, true ) +{ + QWidget *page = plainPage(); + QVBoxLayout *pageLayout = new QVBoxLayout( page ); + + mainTab = new QTabWidget( page ); + pageLayout->addWidget( mainTab ); + + + if ( !name ) + setName( "setMasterPwWnd" ); + + //////////////////////////////////////////////////////////////////// + // This is the Password tab1 + tab = new QWidget( mainTab ); + + QGridLayout *layout = new QGridLayout( tab, 5, 1 ); + layout->setMargin( KDialogBase::marginHint() ); + layout->setSpacing( KDialogBase::spacingHint() ); + + QLabel* label = new QLabel( i18n( "Using a normal password-string to encrypt the data." ), tab ); + label->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); + layout->addWidget(label, 0, 0); + + pwEdit_1 = new QLineEdit( tab, "pwEdit_1" ); + pwEdit_1->setEchoMode( QLineEdit::Password ); + + label = new QLabel( pwEdit_1, i18n( "Please enter the new master-password:" ), tab ); + layout->addWidget(label, 1, 0); + layout->addWidget(pwEdit_1, 2, 0); + + pwEdit_2 = new QLineEdit( tab, "pwEdit_2" ); + pwEdit_2->setEchoMode( QLineEdit::Password ); + + label = new QLabel( pwEdit_2, i18n( "Please enter the password again:" ), tab ); + layout->addWidget(label, 3, 0); + layout->addWidget(pwEdit_2, 4, 0); + + mainTab->insertTab( tab, i18n("Normal password") ); + + + //////////////////////////////////////////////////////////////////// + // This is the Password tab2 + tab_2 = new QWidget( mainTab ); + + layout = new QGridLayout( tab_2, 5, 1 ); + layout->setMargin( KDialogBase::marginHint() ); + layout->setSpacing( KDialogBase::spacingHint() ); + + label = new QLabel( i18n( "Using a PwM key-card to encrypt the data." ), tab_2 ); + label->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); + layout->addWidget(label, 0, 0); + + label = new QLabel( i18n( "selected card:" ), tab_2 ); + label->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + layout->addWidget(label, 1, 0); + + selCardButton = new QPushButton( i18n( "&Select the currently inserted card as key-card" ), tab_2 ); + layout->addWidget(selCardButton, 2, 0); + + genCardButton = new QPushButton( i18n( "&generate new key-card") , tab_2 ); + layout->addWidget(genCardButton, 3, 0); + + curCardIdLabel = new QLabel( QString("") , tab_2 ); + layout->addWidget(curCardIdLabel, 4, 0); + + mainTab->insertTab( tab_2, i18n("Key-card (chipcard)" ) ); + + + // resize( QSize(411, 313).expandedTo(minimumSizeHint()) ); + + // signals and slots connections + // connect( okButton, SIGNAL( clicked() ), this, SLOT( okButton_slot() ) ); + // connect( cancelButton, SIGNAL( clicked() ), this, SLOT( cancelButton_slot() ) ); + connect( genCardButton, SIGNAL( clicked() ), this, SLOT( genCardButton_slot() ) ); + connect( selCardButton, SIGNAL( clicked() ), this, SLOT( selCardButton_slot() ) ); + +} + +/* + * Destroys the object and frees any allocated resources + */ +setMasterPwWnd::~setMasterPwWnd() +{ + // no need to delete child widgets, Qt does it all for us +} + +void setMasterPwWnd::okButton_slot() +{ + qWarning( "setMasterPwWnd::okButton_slot(): Not implemented yet" ); +} + +void setMasterPwWnd::cancelButton_slot() +{ + qWarning( "setMasterPwWnd::cancelButton_slot(): Not implemented yet" ); +} + +void setMasterPwWnd::genCardButton_slot() +{ + qWarning( "setMasterPwWnd::genCardButton_slot(): Not implemented yet" ); +} + +void setMasterPwWnd::selCardButton_slot() +{ + qWarning( "setMasterPwWnd::selCardButton_slot(): Not implemented yet" ); +} + diff --git a/pwmanager/pwmanager/setmasterpwwnd_emb.h b/pwmanager/pwmanager/setmasterpwwnd_emb.h new file mode 100644 index 0000000..c8ddec6 --- a/dev/null +++ b/pwmanager/pwmanager/setmasterpwwnd_emb.h @@ -0,0 +1,62 @@ +/* + This file is part of PwManager/Platform independent. + Copyright (c) 2004 Ulf Schenk + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + +$Id$ +*/ + +#ifndef SETMASTERPWWND_EMB_H +#define SETMASTERPWWND_EMB_H + +#include <kdialogbase.h> + +class QLineEdit; +class QPushButton; +class QLabel; +class QTabWidget; +class QWidget; + +class setMasterPwWnd : public KDialogBase +{ + Q_OBJECT + +public: + setMasterPwWnd( QWidget* parent = 0, const char* name = 0 ); + ~setMasterPwWnd(); + + QTabWidget* mainTab; + QWidget* tab; + QWidget* tab_2; + QLineEdit* pwEdit_1; + QLineEdit* pwEdit_2; + QPushButton* selCardButton; + QPushButton* genCardButton; + QLabel* curCardIdLabel; + +public slots: + virtual void okButton_slot(); + virtual void cancelButton_slot(); + virtual void genCardButton_slot(); + virtual void selCardButton_slot(); + +}; + +#endif // SETMASTERPWWND_H diff --git a/pwmanager/pwmanager/setmasterpwwndimpl.cpp b/pwmanager/pwmanager/setmasterpwwndimpl.cpp index aac0408..3482643 100644 --- a/pwmanager/pwmanager/setmasterpwwndimpl.cpp +++ b/pwmanager/pwmanager/setmasterpwwndimpl.cpp @@ -47,6 +47,7 @@ SetMasterPwWndImpl::SetMasterPwWndImpl(QWidget * parent, const char *name) mainTab->removePage(mainTab->page(1)); #else - qDebug("SetMasterPwWndImpl::SetMasterPwWndImpl has to be fixed"); + mainTab->removePage(tab_2); #endif + #endif // CONFIG_KEYCARD keyCard = 0; @@ -59,4 +60,5 @@ SetMasterPwWndImpl::~SetMasterPwWndImpl() void SetMasterPwWndImpl::okButton_slot() { +#ifndef PWM_EMBEDDED int index = mainTab->currentPageIndex(); if (index == 0) { @@ -89,11 +91,50 @@ void SetMasterPwWndImpl::okButton_slot() } done(1); +#endif } void SetMasterPwWndImpl::cancelButton_slot() { +#ifndef PWM_EMBEDDED done(2); +#endif +} + +void SetMasterPwWndImpl::slotOk() +{ + int index = mainTab->currentPageIndex(); + if (index == 0) { + // normal password + if (pwEdit_1->text() != pwEdit_2->text()) { + KMessageBox::error(this, + i18n + ("The two passwords you have entered\ndon't match.\n" + "Please try entering them again."), + i18n("Different passwords")); + return; + } + if (pwEdit_1->text() == "") { + KMessageBox::error(this, + i18n("No password entered.\n" + "Please type in a password,\nthat " + "you want to use for\nthe encryption."), + i18n("no password")); + return; + } + } else { + // key-card + if (curCardIdLabel->text() == STRING_CARD_NONE) { + KMessageBox::error(this, + i18n("You didn't select a card as\n" + "PwM-key-card."), + i18n("no card")); + return; + } + } + + setMasterPwWnd::slotOk(); } + void SetMasterPwWndImpl::genCardButton_slot() { diff --git a/pwmanager/pwmanager/setmasterpwwndimpl.h b/pwmanager/pwmanager/setmasterpwwndimpl.h index 56effc1..3203d4d 100644 --- a/pwmanager/pwmanager/setmasterpwwndimpl.h +++ b/pwmanager/pwmanager/setmasterpwwndimpl.h @@ -22,5 +22,9 @@ #define SETMASTERPWWNDIMPL_H +#ifndef PWM_EMBEDDED #include "setmasterpwwnd.h" +#else +#include "setmasterpwwnd_emb.h" +#endif #include <klocale.h> @@ -59,4 +63,8 @@ public slots: void selCardButton_slot(); +#ifdef PWM_EMBEDDED + virtual void slotOk(); +#endif + protected slots: /** key from PwMKeyCard is available */ |