author | ulf69 <ulf69> | 2004-09-23 19:35:13 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-23 19:35:13 (UTC) |
commit | ae069aa892b29a96a923e49254cc89e65d0393eb (patch) (side-by-side diff) | |
tree | 2336ca51394e2b5d52f630d53087c489cadca505 /pwmanager/pwmanager/addentrywnd_emb.cpp | |
parent | 15c6615421bc50d6d54dc334c90944749c347d9e (diff) | |
download | kdepimpi-ae069aa892b29a96a923e49254cc89e65d0393eb.zip kdepimpi-ae069aa892b29a96a923e49254cc89e65d0393eb.tar.gz kdepimpi-ae069aa892b29a96a923e49254cc89e65d0393eb.tar.bz2 |
added implementation of dialogs to fit on embedded devices screens
Diffstat (limited to 'pwmanager/pwmanager/addentrywnd_emb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/addentrywnd_emb.cpp | 213 |
1 files changed, 213 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/addentrywnd_emb.cpp b/pwmanager/pwmanager/addentrywnd_emb.cpp new file mode 100644 index 0000000..3a40cfc --- a/dev/null +++ b/pwmanager/pwmanager/addentrywnd_emb.cpp @@ -0,0 +1,213 @@ +/* + 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 "addentrywnd_emb.h" + +#include <qlayout.h> +#include <qlabel.h> +#include <qtabwidget.h> +#include <qgroupbox.h> +#include <klocale.h> +#include <kcombobox.h> +#include <klineedit.h> +#include <qpushbutton.h> + +/* + * Constructs a addEntryWnd as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +addEntryWnd::addEntryWnd( QWidget* parent, const char* name) + : KDialogBase( KDialogBase::Plain, i18n( "Edit Password" ), + KDialogBase::Ok | KDialogBase::Cancel, + KDialogBase::Ok, parent, name, true ) +{ + QWidget *page = plainPage(); + QVBoxLayout *pageLayout = new QVBoxLayout( page ); + + QTabWidget* mTabWidget = new QTabWidget( page ); + pageLayout->addWidget( mTabWidget ); + + //////////////////////////////////////////////////////////////////// + // This is the Password tab + QWidget *tab1 = new QWidget( mTabWidget ); + + QGridLayout *layout = new QGridLayout( tab1, 3, 1 ); + layout->setMargin( KDialogBase::marginHint() ); + layout->setSpacing( KDialogBase::spacingHint() ); + + + + int i = 0; + descLineEdit = new KLineEdit( tab1, "descLineEdit" ); + QLabel* label = new QLabel( descLineEdit, i18n("Description:"), tab1 ); + layout->addWidget( label, i, 0 ); + layout->addWidget( descLineEdit, i, 1 ); + i++; + + categoryComboBox = new KComboBox( tab1 ); + label = new QLabel( categoryComboBox, i18n("Category:"), tab1 ); + layout->addWidget( label, i, 0 ); + layout->addWidget( categoryComboBox, i, 1 ); + i++; + categoryComboBox->setEditable( TRUE ); + categoryComboBox->setSizeLimit( 100 ); + categoryComboBox->setAutoCompletion( TRUE ); + categoryComboBox->setDuplicatesEnabled( FALSE ); + + usernameLineEdit = new KLineEdit( tab1, "usernameLineEdit" ); + label = new QLabel( usernameLineEdit, i18n("Username:"), tab1 ); + layout->addWidget( label, i, 0 ); + layout->addWidget( usernameLineEdit, i, 1 ); + i++; + + pwLineEdit = new KLineEdit( tab1, "pwLineEdit" ); + pwLineEdit->setEchoMode( QLineEdit::Password ); + label = new QLabel( pwLineEdit, i18n("Password:"), tab1 ); + layout->addWidget( label, i, 0 ); + layout->addWidget( pwLineEdit, i, 1 ); + i++; + + revealButton = new QPushButton( i18n("&Reveal"), tab1, "revealButton" ); + revealButton->setToggleButton( TRUE ); + layout->addWidget( revealButton, i, 0 ); + + generateButton = new QPushButton( i18n("&Generate"), tab1, "generateButton" ); + layout->addWidget( generateButton, i, 1 ); + i++; + + urlLineEdit = new KLineEdit( tab1, "urlLineEdit" ); + label = new QLabel( urlLineEdit, i18n("URL:"), tab1 ); + layout->addWidget( label, i, 0 ); + layout->addWidget( urlLineEdit, i, 1 ); + i++; + + mTabWidget->addTab( tab1, i18n( "&Password" ) ); + + + //////////////////////////////////////////////////////////////////// + // This is the Comment tab + QWidget *tab2 = new QWidget( mTabWidget ); + + layout = new QGridLayout( tab2, 3, 1 ); + layout->setMargin( KDialogBase::marginHintSmall() ); + layout->setSpacing( KDialogBase::spacingHintSmall() ); + i = 0; + + + + groupBox1 = new QGroupBox( tab2, "groupBox1" ); + commentDummy = new QLabel( groupBox1, "commentDummy" ); + commentDummy->setText( QString::null ); + + groupBox1->setTitle( i18n( "Comment:" ) ); + + layout->addMultiCellWidget( groupBox1, i, i, 0, 1 ); + i++; + + + advancedCommentButton = new QPushButton( i18n("advanced comment"), groupBox1, "advancedCommentButton" ); + advancedCommentButton->setToggleButton( FALSE ); + layout->addMultiCellWidget( advancedCommentButton, i, i, 0, 1 ); + i++; + + + mTabWidget->addTab( tab2, i18n( "&Comments" ) ); + + + //////////////////////////////////////////////////////////////////// + // This is the Launcher tab + QWidget *tab3 = new QWidget( mTabWidget ); + + layout = new QGridLayout( tab3, 3, 1 ); + layout->setMargin( KDialogBase::marginHintSmall() ); + layout->setSpacing( KDialogBase::spacingHintSmall() ); + i = 0; + + launcherLineEdit = new KLineEdit( tab3, "launcherLineEdit" ); + label = new QLabel( launcherLineEdit, i18n("Launcher:"), tab3 ); + + QLabel* label1 = new QLabel( launcherLineEdit, i18n("$d = Description"), tab3 ); + QLabel* label2 = new QLabel( launcherLineEdit, i18n("$n = Username"), tab3 ); + QLabel* label3 = new QLabel( launcherLineEdit, i18n("$c = Comment"), tab3 ); + QLabel* label4 = new QLabel( launcherLineEdit, i18n("$u = URL"), tab3 ); + QLabel* label5 = new QLabel( launcherLineEdit, i18n("$p = Password"), tab3 ); + + label = new QLabel( launcherLineEdit, i18n("Launcher:"), tab3 ); + + layout->addWidget( label1, i, 0 ); + layout->addWidget( label2, i, 1 ); + i++; + layout->addWidget( label3, i, 0 ); + layout->addWidget( label4, i, 1 ); + i++; + layout->addWidget( label5, i, 0 ); + i++; + + layout->addWidget( label, i, 0 ); + layout->addWidget( launcherLineEdit, i, 1 ); + i++; + + + mTabWidget->addTab( tab3, i18n( "&Launcher" ) ); + + // signals and slots connections + connect( generateButton, SIGNAL( clicked() ), this, SLOT( generateButton_slot() ) ); + connect( revealButton, SIGNAL( toggled(bool) ), this, SLOT( revealButton_slot() ) ); + connect( advancedCommentButton, SIGNAL( toggled(bool) ), this, SLOT( advancedCommentButton_slot(bool) ) ); + +} + +/* + * Destroys the object and frees any allocated resources + */ +addEntryWnd::~addEntryWnd() +{ + // no need to delete child widgets, Qt does it all for us +} + +void addEntryWnd::slotOk() +{ + qWarning( "addEntryWnd::slotOk(): Not implemented yet" ); +} + +void addEntryWnd::revealButton_slot() +{ + qWarning( "addEntryWnd::revealButton_slot(): Not implemented yet" ); +} + +void addEntryWnd::generateButton_slot() +{ + qWarning( "addEntryWnd::generateButton_slot(): Not implemented yet" ); +} + +void addEntryWnd::advancedCommentButton_slot(bool) +{ + qWarning( "addEntryWnd::advancedCommentButton_slot(bool): Not implemented yet" ); +} + + |