summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwm.cpp52
-rw-r--r--pwmanager/pwmanager/pwm.h39
2 files changed, 79 insertions, 12 deletions
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index cd56399..ac2e66e 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -196,2 +196,12 @@ void PwM::initMenubar()
picons = KGlobal::iconLoader();
+
+
+ syncPopup = new KPopupMenu(this);
+
+ syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup);
+ syncManager->setBlockSave(false);
+
+ connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
+ syncManager->fillSyncMenu();
+
#endif
@@ -206,5 +216,3 @@ void PwM::initMenubar()
optionsPopup = new KPopupMenu(this);
-#ifdef PWM_EMBEDDED
- syncPopup = new KPopupMenu(this);
-#endif
+
// "file" popup menu
@@ -331,10 +339,3 @@ void PwM::initMenubar()
#else
- Popup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)),
- i18n("&Configure..."), this,
- SLOT(config_slot()),
- BUTTON_POPUP_OPTIONS_CONFIG);
- connect ( syncMenu, SIGNAL( activated ( int ) ), this, SLOT (slotSyncMenu( int ) ) );
- fillSyncMenu();
-
- menuBar()->insertItem(i18n("&Syncronize"), syncPopup);
+ menuBar()->insertItem(i18n("&Sync"), syncPopup);
@@ -1319,2 +1320,31 @@ void PwM::createAboutData_slot()
+
+//this are the overwritten callbackmethods from the syncinterface
+bool PwM::sync(KSyncManager* manager, QString filename, int mode)
+{
+ return true;
+}
+
+bool PwM::syncExternal(KSyncManager* manager, QString resource)
+{
+ return true;
+}
+
+//called by the syncmanager to indicate that the work has to marked as dirty.
+void PwM::sync_setModified()
+{
+}
+
+//called by the syncmanager to ask if the dirty flag is set.
+bool PwM::sync_isModified()
+{
+}
+
+//called by the syncmanager to indicate that the work has to be saved.
+void PwM::sync_save()
+{
+}
+
+
+
#endif
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h
index 36a8b5b..2fe7352 100644
--- a/pwmanager/pwmanager/pwm.h
+++ b/pwmanager/pwmanager/pwm.h
@@ -32,2 +32,3 @@
#else
+#include <ksyncmanager.h>
#endif
@@ -36,3 +37,2 @@
-
#include <qglobal.h>
@@ -48,5 +48,12 @@
class PwMInit;
+class KSyncManager;
/** PwM is the base class of the project */
+#ifndef PWM_EMBEDDED
+//MOC_SKIP_BEGIN
class PwM : public KMainWindow
+//MOC_SKIP_END
+#else
+class PwM : public KMainWindow, public KSyncInterface
+#endif
{
@@ -258,2 +265,32 @@ protected:
bool forceMinimizeToTray;
+
+
+
+
+ private:
+#ifdef PWM_EMBEDDED
+ //this are the overwritten callbackmethods from the syncinterface
+ virtual bool sync(KSyncManager* manager, QString filename, int mode);
+ virtual bool syncExternal(KSyncManager* manager, QString resource);
+
+ //called by the syncmanager to indicate that the work has to marked as dirty.
+ virtual void sync_setModified();
+ //called by the syncmanager to ask if the dirty flag is set.
+ virtual bool sync_isModified();
+ //called by the syncmanager to indicate that the work has to be saved.
+ virtual void sync_save();
+
+ // LR *******************************
+ // sync stuff!
+ QPopupMenu *syncPopup;
+ KSyncManager* syncManager;
+#endif
+
+
+
+
+
+
+
+
};