author | ulf69 <ulf69> | 2004-10-18 02:55:13 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-18 02:55:13 (UTC) |
commit | 2fd3f09238a624b1a91793d43b5f3653e2b34763 (patch) (side-by-side diff) | |
tree | 07cff893e261ad594ff44d7ab2e8e457a88d6390 /pwmanager/pwmanager/pwm.cpp | |
parent | 4e7fac5fdb4c0dace10cada64f036c56bb29fe58 (diff) | |
download | kdepimpi-2fd3f09238a624b1a91793d43b5f3653e2b34763.zip kdepimpi-2fd3f09238a624b1a91793d43b5f3653e2b34763.tar.gz kdepimpi-2fd3f09238a624b1a91793d43b5f3653e2b34763.tar.bz2 |
*** empty log message ***
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index 014e809..57b4432 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp @@ -132,7 +132,8 @@ enum { enum { BUTTON_POPUP_HELP_LICENSE = 0, BUTTON_POPUP_HELP_FAQ, - BUTTON_POPUP_HELP_ABOUT + BUTTON_POPUP_HELP_ABOUT, + BUTTON_POPUP_HELP_SYNC }; #endif @@ -156,7 +157,7 @@ enum { PwM::PwM(PwMInit *_init, PwMDoc *doc, bool virginity, QWidget *parent, const char *name) - : KMainWindow(parent, name) + : KMainWindow(parent, "HALLO") , forceQuit (false) , forceMinimizeToTray (false) { @@ -358,6 +359,10 @@ void PwM::initMenubar() SLOT(createAboutData_slot()), 0, BUTTON_POPUP_HELP_ABOUT); + helpPopup->insertItem(i18n("&Sync HowTo"), this, + SLOT(syncHowTo_slot()), 0, + BUTTON_POPUP_HELP_SYNC); + #endif menuBar()->insertItem(i18n("&Help"), helpPopup); @@ -609,6 +614,12 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) if (w.exec() == 1) { PwMDataItem d; + + //US BUG: to initialize all values of curEntr with meaningfulldata, + // we call clear on it. Reason: Metadata will be uninitialized otherwise. + // another option would be to create a constructor for PwMDataItem + d.clear(true); + d.desc = w.getDescription().latin1(); d.name = w.getUsername().latin1(); d.pw = w.getPassword().latin1(); @@ -619,14 +630,14 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) if (ret == e_entryExists) { KMessageBox::error(this, i18n - ("An entry with this \"Description\", " + ("An entry with this \"Description\",\n" "does already exist.\n" "Please select another description."), i18n("entry already exists.")); goto tryAgain; } else if (ret == e_maxAllowedEntr) { - KMessageBox::error(this, i18n("The maximum possible number of entries " - "has been reached. You can't add more entries."), + KMessageBox::error(this, i18n("The maximum possible number of\nentries" + "has been reached.\nYou can't add more entries."), i18n("maximum number of entries")); doc->timer()->putLock(DocTimer::id_autoLockTimer); return; @@ -1287,6 +1298,13 @@ void PwM::faq_slot() KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" ); } +void PwM::syncHowTo_slot() +{ + qDebug("PwM::syncHowTo_slot"); + KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); +} + + void PwM::createAboutData_slot() { QString version; @@ -1326,37 +1344,18 @@ bool PwM::sync(KSyncManager* manager, QString filename, int mode) bool ret = curDoc()->sync(manager, filename, mode); + qDebug("PwM::sync save now: ret=%i", ret); + if (ret == true) { //US BUG: what can we call here to update the view of the current doc? //mViewManager->refreshView(); + + //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. + save(); } return ret; } - -//called by the syncmanager to indicate that the work has to be marked as dirty. -void PwM::sync_setModified() -{ - PWM_ASSERT(curDoc()); - curDoc()->sync_setModified(); -} - -//called by the syncmanager to ask if the dirty flag is set. -bool PwM::sync_isModified() -{ - PWM_ASSERT(curDoc()); - return curDoc()->sync_isModified(); -} - -//called by the syncmanager to indicate that the work has to be saved. -void PwM::sync_save() -{ - PWM_ASSERT(curDoc()); - return curDoc()->sync_save(); -} - - - #endif |