-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 @@ -134,3 +134,4 @@ enum { BUTTON_POPUP_HELP_FAQ, - BUTTON_POPUP_HELP_ABOUT + BUTTON_POPUP_HELP_ABOUT, + BUTTON_POPUP_HELP_SYNC }; @@ -158,3 +159,3 @@ PwM::PwM(PwMInit *_init, PwMDoc *doc, QWidget *parent, const char *name) - : KMainWindow(parent, name) + : KMainWindow(parent, "HALLO") , forceQuit (false) @@ -360,2 +361,6 @@ void PwM::initMenubar() + helpPopup->insertItem(i18n("&Sync HowTo"), this, + SLOT(syncHowTo_slot()), 0, + BUTTON_POPUP_HELP_SYNC); + #endif @@ -611,2 +616,8 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) 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(); @@ -621,3 +632,3 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) i18n - ("An entry with this \"Description\", " + ("An entry with this \"Description\",\n" "does already exist.\n" @@ -627,4 +638,4 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) } 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")); @@ -1289,2 +1300,9 @@ void PwM::faq_slot() +void PwM::syncHowTo_slot() +{ + qDebug("PwM::syncHowTo_slot"); + KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); +} + + void PwM::createAboutData_slot() @@ -1328,2 +1346,4 @@ bool PwM::sync(KSyncManager* manager, QString filename, int mode) + qDebug("PwM::sync save now: ret=%i", ret); + if (ret == true) { @@ -1331,2 +1351,5 @@ bool PwM::sync(KSyncManager* manager, QString filename, int mode) //mViewManager->refreshView(); + + //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. + save(); } @@ -1335,26 +1358,2 @@ bool PwM::sync(KSyncManager* manager, QString filename, int mode) } - -//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 |