author | ulf69 <ulf69> | 2004-09-25 01:22:55 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-25 01:22:55 (UTC) |
commit | 57c00cdf5002e90603e0e1cfb5ac5c2c8bf19fe7 (patch) (side-by-side diff) | |
tree | 4c20dcb83f6f107e3d2458ec9d25d2df2ca01110 | |
parent | 1a3db02f855f800898f617e3318f98c8c65d6dbb (diff) | |
download | kdepimpi-57c00cdf5002e90603e0e1cfb5ac5c2c8bf19fe7.zip kdepimpi-57c00cdf5002e90603e0e1cfb5ac5c2c8bf19fe7.tar.gz kdepimpi-57c00cdf5002e90603e0e1cfb5ac5c2c8bf19fe7.tar.bz2 |
*** empty log message ***
-rw-r--r-- | pwmanager/pwmanager/getmasterpwwnd_emb.cpp | 112 | ||||
-rw-r--r-- | pwmanager/pwmanager/getmasterpwwnd_emb.h | 16 | ||||
-rw-r--r-- | pwmanager/pwmanager/listviewpwm.cpp | 17 |
3 files changed, 143 insertions, 2 deletions
diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp index 3519de8..ff4c28a 100644 --- a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp +++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp @@ -28,2 +28,3 @@ $Id$ #include "klocale.h" + /* @@ -42,2 +43,3 @@ $Id$ #include <qlineedit.h> +#include <qpushbutton.h> @@ -63,4 +65,54 @@ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) + QWidget* numberBox = new QWidget( page ); + numberBox->setFixedHeight(100); + numberBox->setFixedWidth(100); + + QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 ); + numberLayout->setMargin( 0 ); + numberLayout->setSpacing( 0 ); + + QPushButton* p1 = new QPushButton( i18n("1"), numberBox ); + numberLayout->addWidget( p1, 0, 0 ); + QPushButton* p2 = new QPushButton( i18n("2"), numberBox ); + numberLayout->addWidget( p2, 0, 1 ); + QPushButton* p3 = new QPushButton( i18n("3"), numberBox ); + numberLayout->addWidget( p3, 0, 2 ); + QPushButton* p4 = new QPushButton( i18n("4"), numberBox ); + numberLayout->addWidget( p4, 1, 0 ); + QPushButton* p5 = new QPushButton( i18n("5"), numberBox ); + numberLayout->addWidget( p5, 1, 1 ); + QPushButton* p6 = new QPushButton( i18n("6"), numberBox ); + numberLayout->addWidget( p6, 1, 2 ); + QPushButton* p7 = new QPushButton( i18n("7"), numberBox ); + numberLayout->addWidget( p7, 2, 0 ); + QPushButton* p8 = new QPushButton( i18n("8"), numberBox ); + numberLayout->addWidget( p8, 2, 1 ); + QPushButton* p9 = new QPushButton( i18n("9"), numberBox ); + numberLayout->addWidget( p9, 2, 2 ); + QPushButton* clear = new QPushButton( i18n("x"), numberBox ); + numberLayout->addWidget( clear, 3, 0 ); + QPushButton* p0 = new QPushButton( i18n("0"), numberBox ); + numberLayout->addWidget( p0, 3, 1 ); + QPushButton* backspace = new QPushButton( i18n("-"), numberBox ); + numberLayout->addWidget( backspace, 3, 2 ); + + + pageLayout->addWidget(numberBox); + + resize( QSize(200, 180) ); + + connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) ); + connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) ); + connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) ); + connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) ); + connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) ); + connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) ); + connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) ); + connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) ); + connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) ); + connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) ); + connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) ); + connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) ); + - resize( QSize(200, 100) ); @@ -86 +138,59 @@ void getMasterPwWnd::cancelButton_slot() +void getMasterPwWnd::add0() +{ + addCharacter("0"); +} +void getMasterPwWnd::add1() +{ + addCharacter("1"); +} +void getMasterPwWnd::add2() +{ + addCharacter("2"); +} +void getMasterPwWnd::add3() +{ + addCharacter("3"); +} +void getMasterPwWnd::add4() +{ + addCharacter("4"); +} +void getMasterPwWnd::add5() +{ + addCharacter("5"); +} +void getMasterPwWnd::add6() +{ + addCharacter("6"); +} +void getMasterPwWnd::add7() +{ + addCharacter("7"); +} +void getMasterPwWnd::add8() +{ + addCharacter("8"); +} +void getMasterPwWnd::add9() +{ + addCharacter("9"); +} +void getMasterPwWnd::backspace() +{ + QString old = pwLineEdit->text(); + old.truncate(old.length()-1); + pwLineEdit->setText(old); +} + +void getMasterPwWnd::clear() +{ + pwLineEdit->setText(""); +} + +void getMasterPwWnd::addCharacter(const QString& s) +{ + QString old = pwLineEdit->text(); + pwLineEdit->setText(old + s); +} + diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.h b/pwmanager/pwmanager/getmasterpwwnd_emb.h index 64121c4..90204d3 100644 --- a/pwmanager/pwmanager/getmasterpwwnd_emb.h +++ b/pwmanager/pwmanager/getmasterpwwnd_emb.h @@ -45,2 +45,18 @@ public slots: virtual void cancelButton_slot(); + + void add0(); + void add1(); + void add2(); + void add3(); + void add4(); + void add5(); + void add6(); + void add7(); + void add8(); + void add9(); + void backspace(); + void clear(); + + private: + void addCharacter(const QString &s); }; diff --git a/pwmanager/pwmanager/listviewpwm.cpp b/pwmanager/pwmanager/listviewpwm.cpp index c53cfd7..9f351d6 100644 --- a/pwmanager/pwmanager/listviewpwm.cpp +++ b/pwmanager/pwmanager/listviewpwm.cpp @@ -21,2 +21,3 @@ #include "pwmexception.h" +#include "pwmview.h" @@ -62,3 +63,7 @@ ListViewItemPwM::ListViewItemPwM(QListView *parent) KIconLoader il; +#ifndef PWM_EMBEDDED static QPixmap onP(picons->loadIcon("button_ok", KIcon::Small)); +#else + static QPixmap onP(picons->loadIcon("decrypted", KIcon::Small)); +#endif onPix = &onP; @@ -72,5 +77,7 @@ void ListViewItemPwM::paintCell(QPainter *p, const QColorGroup &cg, { + // qDebug("ListViewItemPwM::paintCell column=%i", column); if (!p) return; - if (column != 0) { + //US BUG: + if (column != COLUMN_DESC) { QCheckListItem::paintCell(p, cg, column, width, align); @@ -90,4 +97,12 @@ void ListViewItemPwM::paintCell(QPainter *p, const QColorGroup &cg, p->setViewport(window); +#else + p->eraseRect(0, 0, pixSpace, height()); + // now draw the pixmap + int y = (height() - curPix->height()) / 2; + p->drawPixmap(1, y, *curPix); + p->translate( pixSpace, 0 ); + #endif QListViewItem::paintCell(p, cg, column, width - pixSpace, align); + } |