Diffstat (limited to 'pwmanager/pwmanager/pwmview.cpp') (more/less context) (ignore 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 @@ | |||
35 | #include <qlineedit.h> | 35 | #include <qlineedit.h> |
36 | #include <qpoint.h> | 36 | #include <qpoint.h> |
37 | #include <qapplication.h> | 37 | #include <qapplication.h> |
38 | #include <qlayout.h> | ||
38 | 39 | ||
39 | //US ENH: wouldn't it be a good idea if we could use this consts everywhere else. | 40 | //US ENH: wouldn't it be a good idea if we could use this consts everywhere else. |
40 | //US ENH: for examle in listviewpwm.cpp | 41 | //US ENH: for examle in listviewpwm.cpp |
@@ -455,6 +456,69 @@ void PwMView::copyCommentToClip() | |||
455 | PwM::copyToClipboard(d.comment.c_str()); | 456 | PwM::copyToClipboard(d.comment.c_str()); |
456 | } | 457 | } |
457 | 458 | ||
459 | |||
460 | |||
461 | |||
462 | PwMDataItemChooser::PwMDataItemChooser( PwMDataItem loc, PwMDataItem rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name, | ||
463 | true ,i18n("Conflict! Please choose Entry!"),Ok|User1|Close,Close, false) | ||
464 | { | ||
465 | findButton( Close )->setText( i18n("Cancel Sync")); | ||
466 | findButton( Ok )->setText( i18n("Remote")); | ||
467 | findButton( User1 )->setText( i18n("Local")); | ||
468 | QWidget* topframe = new QWidget( this ); | ||
469 | setMainWidget( topframe ); | ||
470 | QBoxLayout* bl; | ||
471 | if ( QApplication::desktop()->width() < 640 ) { | ||
472 | bl = new QVBoxLayout( topframe ); | ||
473 | } else { | ||
474 | bl = new QHBoxLayout( topframe ); | ||
475 | } | ||
476 | QVBox* subframe = new QVBox( topframe ); | ||
477 | bl->addWidget(subframe ); | ||
478 | QLabel* lab = new QLabel( i18n("Local Entry"), subframe ); | ||
479 | if ( takeloc ) | ||
480 | lab->setBackgroundColor(Qt::green.light() ); | ||
481 | // AddresseeView * av = new AddresseeView( subframe ); | ||
482 | // av->setAddressee( loc ); | ||
483 | subframe = new QVBox( topframe ); | ||
484 | bl->addWidget(subframe ); | ||
485 | lab = new QLabel( i18n("Remote Entry"), subframe ); | ||
486 | if ( !takeloc ) | ||
487 | lab->setBackgroundColor(Qt::green.light() ); | ||
488 | // av = new AddresseeView( subframe ); | ||
489 | // av->setAddressee( rem ); | ||
490 | QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); | ||
491 | QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); | ||
492 | #ifndef DESKTOP_VERSION | ||
493 | showMaximized(); | ||
494 | #else | ||
495 | resize ( 640, 400 ); | ||
496 | #endif | ||
497 | } | ||
498 | |||
499 | int PwMDataItemChooser::executeD( bool local ) | ||
500 | { | ||
501 | mSyncResult = 3; | ||
502 | if ( local ) | ||
503 | findButton( User1 )->setFocus(); | ||
504 | else | ||
505 | findButton( Ok )->setFocus(); | ||
506 | exec(); | ||
507 | return mSyncResult; | ||
508 | } | ||
509 | void PwMDataItemChooser::slot_remote() | ||
510 | { | ||
511 | mSyncResult = 2; | ||
512 | accept(); | ||
513 | } | ||
514 | void PwMDataItemChooser::slot_local() | ||
515 | { | ||
516 | mSyncResult = 1; | ||
517 | accept(); | ||
518 | } | ||
519 | |||
520 | |||
521 | |||
458 | #ifndef PWM_EMBEDDED | 522 | #ifndef PWM_EMBEDDED |
459 | #include "pwmview.moc" | 523 | #include "pwmview.moc" |
460 | #endif | 524 | #endif |