author | ulf69 <ulf69> | 2004-10-02 01:07:49 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-02 01:07:49 (UTC) |
commit | a5abf6c989a29e7f3a348786c7b0890740835497 (patch) (unidiff) | |
tree | b3bcff83db4a35dc089abcdc28d839cdbd746ab3 | |
parent | ba1176743a536e19bb8b9d68b1c0c0023a0f3101 (diff) | |
download | kdepimpi-a5abf6c989a29e7f3a348786c7b0890740835497.zip kdepimpi-a5abf6c989a29e7f3a348786c7b0890740835497.tar.gz kdepimpi-a5abf6c989a29e7f3a348786c7b0890740835497.tar.bz2 |
checked in ksyncmanager handling (not complete yet)
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 52 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.h | 39 |
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() | |||
196 | picons = KGlobal::iconLoader(); | 196 | picons = KGlobal::iconLoader(); |
197 | |||
198 | |||
199 | syncPopup = new KPopupMenu(this); | ||
200 | |||
201 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup); | ||
202 | syncManager->setBlockSave(false); | ||
203 | |||
204 | connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); | ||
205 | syncManager->fillSyncMenu(); | ||
206 | |||
197 | #endif | 207 | #endif |
@@ -206,5 +216,3 @@ void PwM::initMenubar() | |||
206 | optionsPopup = new KPopupMenu(this); | 216 | optionsPopup = new KPopupMenu(this); |
207 | #ifdef PWM_EMBEDDED | 217 | |
208 | syncPopup = new KPopupMenu(this); | ||
209 | #endif | ||
210 | // "file" popup menu | 218 | // "file" popup menu |
@@ -331,10 +339,3 @@ void PwM::initMenubar() | |||
331 | #else | 339 | #else |
332 | Popup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), | 340 | menuBar()->insertItem(i18n("&Sync"), syncPopup); |
333 | i18n("&Configure..."), this, | ||
334 | SLOT(config_slot()), | ||
335 | BUTTON_POPUP_OPTIONS_CONFIG); | ||
336 | connect ( syncMenu, SIGNAL( activated ( int ) ), this, SLOT (slotSyncMenu( int ) ) ); | ||
337 | fillSyncMenu(); | ||
338 | |||
339 | menuBar()->insertItem(i18n("&Syncronize"), syncPopup); | ||
340 | 341 | ||
@@ -1319,2 +1320,31 @@ void PwM::createAboutData_slot() | |||
1319 | 1320 | ||
1321 | |||
1322 | //this are the overwritten callbackmethods from the syncinterface | ||
1323 | bool PwM::sync(KSyncManager* manager, QString filename, int mode) | ||
1324 | { | ||
1325 | return true; | ||
1326 | } | ||
1327 | |||
1328 | bool PwM::syncExternal(KSyncManager* manager, QString resource) | ||
1329 | { | ||
1330 | return true; | ||
1331 | } | ||
1332 | |||
1333 | //called by the syncmanager to indicate that the work has to marked as dirty. | ||
1334 | void PwM::sync_setModified() | ||
1335 | { | ||
1336 | } | ||
1337 | |||
1338 | //called by the syncmanager to ask if the dirty flag is set. | ||
1339 | bool PwM::sync_isModified() | ||
1340 | { | ||
1341 | } | ||
1342 | |||
1343 | //called by the syncmanager to indicate that the work has to be saved. | ||
1344 | void PwM::sync_save() | ||
1345 | { | ||
1346 | } | ||
1347 | |||
1348 | |||
1349 | |||
1320 | #endif | 1350 | #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 @@ | |||
32 | #else | 32 | #else |
33 | #include <ksyncmanager.h> | ||
33 | #endif | 34 | #endif |
@@ -36,3 +37,2 @@ | |||
36 | 37 | ||
37 | |||
38 | #include <qglobal.h> | 38 | #include <qglobal.h> |
@@ -48,5 +48,12 @@ | |||
48 | class PwMInit; | 48 | class PwMInit; |
49 | class KSyncManager; | ||
49 | 50 | ||
50 | /** PwM is the base class of the project */ | 51 | /** PwM is the base class of the project */ |
52 | #ifndef PWM_EMBEDDED | ||
53 | //MOC_SKIP_BEGIN | ||
51 | class PwM : public KMainWindow | 54 | class PwM : public KMainWindow |
55 | //MOC_SKIP_END | ||
56 | #else | ||
57 | class PwM : public KMainWindow, public KSyncInterface | ||
58 | #endif | ||
52 | { | 59 | { |
@@ -258,2 +265,32 @@ protected: | |||
258 | bool forceMinimizeToTray; | 265 | bool forceMinimizeToTray; |
266 | |||
267 | |||
268 | |||
269 | |||
270 | private: | ||
271 | #ifdef PWM_EMBEDDED | ||
272 | //this are the overwritten callbackmethods from the syncinterface | ||
273 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | ||
274 | virtual bool syncExternal(KSyncManager* manager, QString resource); | ||
275 | |||
276 | //called by the syncmanager to indicate that the work has to marked as dirty. | ||
277 | virtual void sync_setModified(); | ||
278 | //called by the syncmanager to ask if the dirty flag is set. | ||
279 | virtual bool sync_isModified(); | ||
280 | //called by the syncmanager to indicate that the work has to be saved. | ||
281 | virtual void sync_save(); | ||
282 | |||
283 | // LR ******************************* | ||
284 | // sync stuff! | ||
285 | QPopupMenu *syncPopup; | ||
286 | KSyncManager* syncManager; | ||
287 | #endif | ||
288 | |||
289 | |||
290 | |||
291 | |||
292 | |||
293 | |||
294 | |||
295 | |||
259 | }; | 296 | }; |