Diffstat (limited to 'pwmanager/pwmanager/pwmview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/pwmview.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/pwmview.cpp b/pwmanager/pwmanager/pwmview.cpp index d192119..e23ce25 100644 --- a/pwmanager/pwmanager/pwmview.cpp +++ b/pwmanager/pwmanager/pwmview.cpp @@ -35,6 +35,7 @@ #include <qlineedit.h> #include <qpoint.h> #include <qapplication.h> +#include <qlayout.h> //US ENH: wouldn't it be a good idea if we could use this consts everywhere else. //US ENH: for examle in listviewpwm.cpp @@ -455,6 +456,69 @@ void PwMView::copyCommentToClip() PwM::copyToClipboard(d.comment.c_str()); } + + + +PwMDataItemChooser::PwMDataItemChooser( PwMDataItem loc, PwMDataItem rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name, + true ,i18n("Conflict! Please choose Entry!"),Ok|User1|Close,Close, false) +{ + findButton( Close )->setText( i18n("Cancel Sync")); + findButton( Ok )->setText( i18n("Remote")); + findButton( User1 )->setText( i18n("Local")); + QWidget* topframe = new QWidget( this ); + setMainWidget( topframe ); + QBoxLayout* bl; + if ( QApplication::desktop()->width() < 640 ) { + bl = new QVBoxLayout( topframe ); + } else { + bl = new QHBoxLayout( topframe ); + } + QVBox* subframe = new QVBox( topframe ); + bl->addWidget(subframe ); + QLabel* lab = new QLabel( i18n("Local Entry"), subframe ); + if ( takeloc ) + lab->setBackgroundColor(Qt::green.light() ); + // AddresseeView * av = new AddresseeView( subframe ); + // av->setAddressee( loc ); + subframe = new QVBox( topframe ); + bl->addWidget(subframe ); + lab = new QLabel( i18n("Remote Entry"), subframe ); + if ( !takeloc ) + lab->setBackgroundColor(Qt::green.light() ); + // av = new AddresseeView( subframe ); + // av->setAddressee( rem ); + QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); + QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); +#ifndef DESKTOP_VERSION + showMaximized(); +#else + resize ( 640, 400 ); +#endif +} + +int PwMDataItemChooser::executeD( bool local ) +{ + mSyncResult = 3; + if ( local ) + findButton( User1 )->setFocus(); + else + findButton( Ok )->setFocus(); + exec(); + return mSyncResult; +} +void PwMDataItemChooser::slot_remote() +{ + mSyncResult = 2; + accept(); +} +void PwMDataItemChooser::slot_local() +{ + mSyncResult = 1; + accept(); +} + + + #ifndef PWM_EMBEDDED #include "pwmview.moc" #endif |