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 | |||
@@ -149,109 +149,117 @@ enum { | |||
149 | BUTTON_TOOL_FIND, | 149 | BUTTON_TOOL_FIND, |
150 | BUTTON_TOOL_LOCK, | 150 | BUTTON_TOOL_LOCK, |
151 | BUTTON_TOOL_DEEPLOCK, | 151 | BUTTON_TOOL_DEEPLOCK, |
152 | BUTTON_TOOL_UNLOCK | 152 | BUTTON_TOOL_UNLOCK |
153 | }; | 153 | }; |
154 | 154 | ||
155 | 155 | ||
156 | PwM::PwM(PwMInit *_init, PwMDoc *doc, | 156 | PwM::PwM(PwMInit *_init, PwMDoc *doc, |
157 | bool virginity, | 157 | bool virginity, |
158 | QWidget *parent, const char *name) | 158 | QWidget *parent, const char *name) |
159 | : KMainWindow(parent, name) | 159 | : KMainWindow(parent, name) |
160 | , forceQuit (false) | 160 | , forceQuit (false) |
161 | , forceMinimizeToTray (false) | 161 | , forceMinimizeToTray (false) |
162 | { | 162 | { |
163 | init = _init; | 163 | init = _init; |
164 | connect(doc, SIGNAL(docClosed(PwMDoc *)), | 164 | connect(doc, SIGNAL(docClosed(PwMDoc *)), |
165 | this, SLOT(docClosed(PwMDoc *))); | 165 | this, SLOT(docClosed(PwMDoc *))); |
166 | initMenubar(); | 166 | initMenubar(); |
167 | initToolbar(); | 167 | initToolbar(); |
168 | initMetrics(); | 168 | initMetrics(); |
169 | setVirgin(virginity); | 169 | setVirgin(virginity); |
170 | setFocusPolicy(QWidget::WheelFocus); | 170 | setFocusPolicy(QWidget::WheelFocus); |
171 | #ifndef PWM_EMBEDDED | 171 | #ifndef PWM_EMBEDDED |
172 | statusBar()->show(); | 172 | statusBar()->show(); |
173 | #endif | 173 | #endif |
174 | view = makeNewListView(doc); | 174 | view = makeNewListView(doc); |
175 | setCentralWidget(view); | 175 | setCentralWidget(view); |
176 | updateCaption(); | 176 | updateCaption(); |
177 | showStatMsg(i18n("Ready.")); | 177 | showStatMsg(i18n("Ready.")); |
178 | } | 178 | } |
179 | 179 | ||
180 | PwM::~PwM() | 180 | PwM::~PwM() |
181 | { | 181 | { |
182 | disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), | 182 | disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), |
183 | this, SLOT(docClosed(PwMDoc *))); | 183 | this, SLOT(docClosed(PwMDoc *))); |
184 | conf()->confWndMainWndSize(size()); | 184 | conf()->confWndMainWndSize(size()); |
185 | emit closed(this); | 185 | emit closed(this); |
186 | delete view; | 186 | delete view; |
187 | } | 187 | } |
188 | 188 | ||
189 | void PwM::initMenubar() | 189 | void PwM::initMenubar() |
190 | { | 190 | { |
191 | KIconLoader* picons; | 191 | KIconLoader* picons; |
192 | #ifndef PWM_EMBEDDED | 192 | #ifndef PWM_EMBEDDED |
193 | KIconLoader icons; | 193 | KIconLoader icons; |
194 | picons = &icons; | 194 | picons = &icons; |
195 | #else | 195 | #else |
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 |
198 | filePopup = new KPopupMenu(this); | 208 | filePopup = new KPopupMenu(this); |
199 | importPopup = new KPopupMenu(filePopup); | 209 | importPopup = new KPopupMenu(filePopup); |
200 | exportPopup = new KPopupMenu(filePopup); | 210 | exportPopup = new KPopupMenu(filePopup); |
201 | managePopup = new KPopupMenu(this); | 211 | managePopup = new KPopupMenu(this); |
202 | #ifdef CONFIG_KEYCARD | 212 | #ifdef CONFIG_KEYCARD |
203 | chipcardPopup = new KPopupMenu(this); | 213 | chipcardPopup = new KPopupMenu(this); |
204 | #endif // CONFIG_KEYCARD | 214 | #endif // CONFIG_KEYCARD |
205 | viewPopup = new KPopupMenu(this); | 215 | viewPopup = new KPopupMenu(this); |
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 |
211 | filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), | 219 | filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), |
212 | i18n("&New"), this, | 220 | i18n("&New"), this, |
213 | SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); | 221 | SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); |
214 | filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), | 222 | filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), |
215 | i18n("&Open"), this, | 223 | i18n("&Open"), this, |
216 | SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); | 224 | SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); |
217 | filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), | 225 | filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), |
218 | i18n("&Close"), this, | 226 | i18n("&Close"), this, |
219 | SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); | 227 | SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); |
220 | filePopup->insertSeparator(); | 228 | filePopup->insertSeparator(); |
221 | filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), | 229 | filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), |
222 | i18n("&Save"), this, | 230 | i18n("&Save"), this, |
223 | SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); | 231 | SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); |
224 | filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), | 232 | filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), |
225 | i18n("Save &as..."), | 233 | i18n("Save &as..."), |
226 | this, SLOT(saveAs_slot()), 0, | 234 | this, SLOT(saveAs_slot()), 0, |
227 | BUTTON_POPUP_FILE_SAVEAS); | 235 | BUTTON_POPUP_FILE_SAVEAS); |
228 | filePopup->insertSeparator(); | 236 | filePopup->insertSeparator(); |
229 | // "file/export" popup menu | 237 | // "file/export" popup menu |
230 | exportPopup->insertItem(i18n("&Text-file..."), this, | 238 | exportPopup->insertItem(i18n("&Text-file..."), this, |
231 | SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); | 239 | SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); |
232 | exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, | 240 | exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, |
233 | SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); | 241 | SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); |
234 | #ifdef CONFIG_KWALLETIF | 242 | #ifdef CONFIG_KWALLETIF |
235 | exportPopup->insertItem(i18n("&KWallet..."), this, | 243 | exportPopup->insertItem(i18n("&KWallet..."), this, |
236 | SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); | 244 | SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); |
237 | #endif | 245 | #endif |
238 | filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), | 246 | filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), |
239 | i18n("E&xport"), exportPopup, | 247 | i18n("E&xport"), exportPopup, |
240 | BUTTON_POPUP_FILE_EXPORT); | 248 | BUTTON_POPUP_FILE_EXPORT); |
241 | // "file/import" popup menu | 249 | // "file/import" popup menu |
242 | importPopup->insertItem(i18n("&Text-file..."), this, | 250 | importPopup->insertItem(i18n("&Text-file..."), this, |
243 | SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT); | 251 | SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT); |
244 | importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, | 252 | importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, |
245 | SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN); | 253 | SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN); |
246 | #ifdef CONFIG_KWALLETIF | 254 | #ifdef CONFIG_KWALLETIF |
247 | importPopup->insertItem(i18n("&KWallet..."), this, | 255 | importPopup->insertItem(i18n("&KWallet..."), this, |
248 | SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); | 256 | SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); |
249 | #endif | 257 | #endif |
250 | filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), | 258 | filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), |
251 | i18n("I&mport"), importPopup, | 259 | i18n("I&mport"), importPopup, |
252 | BUTTON_POPUP_FILE_IMPORT); | 260 | BUTTON_POPUP_FILE_IMPORT); |
253 | filePopup->insertSeparator(); | 261 | filePopup->insertSeparator(); |
254 | filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), | 262 | filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), |
255 | i18n("&Print..."), this, | 263 | i18n("&Print..."), this, |
256 | SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); | 264 | SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); |
257 | filePopup->insertSeparator(); | 265 | filePopup->insertSeparator(); |
@@ -284,104 +292,97 @@ void PwM::initMenubar() | |||
284 | BUTTON_POPUP_CHIPCARD_GENNEW); | 292 | BUTTON_POPUP_CHIPCARD_GENNEW); |
285 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), | 293 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), |
286 | i18n("&Erase key-card"), this, | 294 | i18n("&Erase key-card"), this, |
287 | SLOT(eraseCard_slot()), 0, | 295 | SLOT(eraseCard_slot()), 0, |
288 | BUTTON_POPUP_CHIPCARD_DEL); | 296 | BUTTON_POPUP_CHIPCARD_DEL); |
289 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)), | 297 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)), |
290 | i18n("Read card-&ID"), this, | 298 | i18n("Read card-&ID"), this, |
291 | SLOT(readCardId_slot()), 0, | 299 | SLOT(readCardId_slot()), 0, |
292 | BUTTON_POPUP_CHIPCARD_READID); | 300 | BUTTON_POPUP_CHIPCARD_READID); |
293 | chipcardPopup->insertSeparator(); | 301 | chipcardPopup->insertSeparator(); |
294 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)), | 302 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)), |
295 | i18n("&Make card backup-image"), this, | 303 | i18n("&Make card backup-image"), this, |
296 | SLOT(makeCardBackup_slot()), 0, | 304 | SLOT(makeCardBackup_slot()), 0, |
297 | BUTTON_POPUP_CHIPCARD_SAVEBACKUP); | 305 | BUTTON_POPUP_CHIPCARD_SAVEBACKUP); |
298 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)), | 306 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)), |
299 | i18n("&Replay card backup-image"), this, | 307 | i18n("&Replay card backup-image"), this, |
300 | SLOT(replayCardBackup_slot()), 0, | 308 | SLOT(replayCardBackup_slot()), 0, |
301 | BUTTON_POPUP_CHIPCARD_REPLAYBACKUP); | 309 | BUTTON_POPUP_CHIPCARD_REPLAYBACKUP); |
302 | menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup); | 310 | menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup); |
303 | #endif // CONFIG_KEYCARD | 311 | #endif // CONFIG_KEYCARD |
304 | // "view" popup menu | 312 | // "view" popup menu |
305 | viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)), | 313 | viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)), |
306 | i18n("&Find"), this, | 314 | i18n("&Find"), this, |
307 | SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND); | 315 | SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND); |
308 | viewPopup->insertSeparator(); | 316 | viewPopup->insertSeparator(); |
309 | viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)), | 317 | viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)), |
310 | i18n("&Lock all entries"), this, | 318 | i18n("&Lock all entries"), this, |
311 | SLOT(lockWnd_slot()), 0, | 319 | SLOT(lockWnd_slot()), 0, |
312 | BUTTON_POPUP_VIEW_LOCK); | 320 | BUTTON_POPUP_VIEW_LOCK); |
313 | viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)), | 321 | viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)), |
314 | i18n("&Deep-lock all entries"), this, | 322 | i18n("&Deep-lock all entries"), this, |
315 | SLOT(deepLockWnd_slot()), 0, | 323 | SLOT(deepLockWnd_slot()), 0, |
316 | BUTTON_POPUP_VIEW_DEEPLOCK); | 324 | BUTTON_POPUP_VIEW_DEEPLOCK); |
317 | viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)), | 325 | viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)), |
318 | i18n("&Unlock all entries"), this, | 326 | i18n("&Unlock all entries"), this, |
319 | SLOT(unlockWnd_slot()), 0, | 327 | SLOT(unlockWnd_slot()), 0, |
320 | BUTTON_POPUP_VIEW_UNLOCK); | 328 | BUTTON_POPUP_VIEW_UNLOCK); |
321 | menuBar()->insertItem(i18n("&View"), viewPopup); | 329 | menuBar()->insertItem(i18n("&View"), viewPopup); |
322 | // "options" popup menu | 330 | // "options" popup menu |
323 | optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), | 331 | optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), |
324 | i18n("&Configure..."), this, | 332 | i18n("&Configure..."), this, |
325 | SLOT(config_slot()), | 333 | SLOT(config_slot()), |
326 | BUTTON_POPUP_OPTIONS_CONFIG); | 334 | BUTTON_POPUP_OPTIONS_CONFIG); |
327 | menuBar()->insertItem(i18n("&Options"), optionsPopup); | 335 | menuBar()->insertItem(i18n("&Options"), optionsPopup); |
328 | // "help" popup menu | 336 | // "help" popup menu |
329 | #ifndef PWM_EMBEDDED | 337 | #ifndef PWM_EMBEDDED |
330 | helpPopup = helpMenu(QString::null, false); | 338 | helpPopup = helpMenu(QString::null, false); |
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 | ||
341 | 342 | ||
342 | 343 | ||
343 | 344 | ||
344 | 345 | ||
345 | helpPopup = new KPopupMenu(this); | 346 | helpPopup = new KPopupMenu(this); |
346 | 347 | ||
347 | 348 | ||
348 | helpPopup->insertItem(i18n("&License"), this, | 349 | helpPopup->insertItem(i18n("&License"), this, |
349 | SLOT(showLicense_slot()), 0, | 350 | SLOT(showLicense_slot()), 0, |
350 | BUTTON_POPUP_HELP_LICENSE); | 351 | BUTTON_POPUP_HELP_LICENSE); |
351 | 352 | ||
352 | helpPopup->insertItem(i18n("&Faq"), this, | 353 | helpPopup->insertItem(i18n("&Faq"), this, |
353 | SLOT(faq_slot()), 0, | 354 | SLOT(faq_slot()), 0, |
354 | BUTTON_POPUP_HELP_FAQ); | 355 | BUTTON_POPUP_HELP_FAQ); |
355 | 356 | ||
356 | helpPopup->insertItem(i18n("&About PwManager"), this, | 357 | helpPopup->insertItem(i18n("&About PwManager"), this, |
357 | SLOT(createAboutData_slot()), 0, | 358 | SLOT(createAboutData_slot()), 0, |
358 | BUTTON_POPUP_HELP_ABOUT); | 359 | BUTTON_POPUP_HELP_ABOUT); |
359 | 360 | ||
360 | #endif | 361 | #endif |
361 | menuBar()->insertItem(i18n("&Help"), helpPopup); | 362 | menuBar()->insertItem(i18n("&Help"), helpPopup); |
362 | 363 | ||
363 | } | 364 | } |
364 | 365 | ||
365 | void PwM::initToolbar() | 366 | void PwM::initToolbar() |
366 | { | 367 | { |
367 | KIconLoader* picons; | 368 | KIconLoader* picons; |
368 | #ifndef PWM_EMBEDDED | 369 | #ifndef PWM_EMBEDDED |
369 | KIconLoader icons; | 370 | KIconLoader icons; |
370 | picons = &icons; | 371 | picons = &icons; |
371 | #else | 372 | #else |
372 | picons = KGlobal::iconLoader(); | 373 | picons = KGlobal::iconLoader(); |
373 | #endif | 374 | #endif |
374 | 375 | ||
375 | #ifdef PWM_EMBEDDED | 376 | #ifdef PWM_EMBEDDED |
376 | if ( QApplication::desktop()->width() > 320 ) | 377 | if ( QApplication::desktop()->width() > 320 ) |
377 | #endif | 378 | #endif |
378 | { | 379 | { |
379 | toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar), | 380 | toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar), |
380 | BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this, | 381 | BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this, |
381 | SLOT(new_slot()), true, i18n("New")); | 382 | SLOT(new_slot()), true, i18n("New")); |
382 | toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar), | 383 | toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar), |
383 | BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this, | 384 | BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this, |
384 | SLOT(open_slot()), true, i18n("Open")); | 385 | SLOT(open_slot()), true, i18n("Open")); |
385 | toolBar()->insertSeparator(); | 386 | toolBar()->insertSeparator(); |
386 | } | 387 | } |
387 | toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar), | 388 | toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar), |
@@ -1272,54 +1273,83 @@ void PwM::focusInEvent(QFocusEvent *e) | |||
1272 | emit lostFocus(this); | 1273 | emit lostFocus(this); |
1273 | } | 1274 | } |
1274 | } | 1275 | } |
1275 | 1276 | ||
1276 | 1277 | ||
1277 | #ifdef PWM_EMBEDDED | 1278 | #ifdef PWM_EMBEDDED |
1278 | 1279 | ||
1279 | void PwM::showLicense_slot() | 1280 | void PwM::showLicense_slot() |
1280 | { | 1281 | { |
1281 | KApplication::showLicence(); | 1282 | KApplication::showLicence(); |
1282 | } | 1283 | } |
1283 | 1284 | ||
1284 | void PwM::faq_slot() | 1285 | void PwM::faq_slot() |
1285 | { | 1286 | { |
1286 | KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" ); | 1287 | KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" ); |
1287 | } | 1288 | } |
1288 | 1289 | ||
1289 | void PwM::createAboutData_slot() | 1290 | void PwM::createAboutData_slot() |
1290 | { | 1291 | { |
1291 | QString version; | 1292 | QString version; |
1292 | #include <../version> | 1293 | #include <../version> |
1293 | QMessageBox::about( this, "About PwManager/Pi", | 1294 | QMessageBox::about( this, "About PwManager/Pi", |
1294 | "PwManager/Platform-independent\n" | 1295 | "PwManager/Platform-independent\n" |
1295 | "(PWM/Pi) " +version + " - " + | 1296 | "(PWM/Pi) " +version + " - " + |
1296 | #ifdef DESKTOP_VERSION | 1297 | #ifdef DESKTOP_VERSION |
1297 | "Desktop Edition\n" | 1298 | "Desktop Edition\n" |
1298 | #else | 1299 | #else |
1299 | "PDA-Edition\n" | 1300 | "PDA-Edition\n" |
1300 | "for: Zaurus 5500 / 7x0 / 8x0\n" | 1301 | "for: Zaurus 5500 / 7x0 / 8x0\n" |
1301 | #endif | 1302 | #endif |
1302 | 1303 | ||
1303 | "(c) 2004 Ulf Schenk\n" | 1304 | "(c) 2004 Ulf Schenk\n" |
1304 | "(c) 2004 Lutz Rogowski\n" | 1305 | "(c) 2004 Lutz Rogowski\n" |
1305 | "(c) 1997-2004, The KDE PIM Team\n" | 1306 | "(c) 1997-2004, The KDE PIM Team\n" |
1306 | 1307 | ||
1307 | "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n" | 1308 | "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n" |
1308 | "Matt Scifo - mscifo@o1.com\n" | 1309 | "Matt Scifo - mscifo@o1.com\n" |
1309 | "Elias Probst - elias.probst@gmx.de\n" | 1310 | "Elias Probst - elias.probst@gmx.de\n" |
1310 | "George Staikos - staikos@kde.org\n" | 1311 | "George Staikos - staikos@kde.org\n" |
1311 | "Matthew Palmer - mjp16@uow.edu.au\n" | 1312 | "Matthew Palmer - mjp16@uow.edu.au\n" |
1312 | "Olivier Sessink - gpasman@nl.linux.org\n" | 1313 | "Olivier Sessink - gpasman@nl.linux.org\n" |
1313 | "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" | 1314 | "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" |
1314 | "Troy Engel - tengel@sonic.net\n" | 1315 | "Troy Engel - tengel@sonic.net\n" |
1315 | "Wickey - wickey@gmx.at\n" | 1316 | "Wickey - wickey@gmx.at\n" |
1316 | "Ian MacGregor - original documentation author.\n" | 1317 | "Ian MacGregor - original documentation author.\n" |
1317 | ); | 1318 | ); |
1318 | } | 1319 | } |
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 |
1321 | 1351 | ||
1322 | 1352 | ||
1323 | #ifndef PWM_EMBEDDED | 1353 | #ifndef PWM_EMBEDDED |
1324 | #include "pwm.moc" | 1354 | #include "pwm.moc" |
1325 | #endif | 1355 | #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 | |||
@@ -1,99 +1,106 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2003, 2004 by Michael Buesch * | 3 | * copyright (C) 2003, 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.0.1 of pwmanager | 14 | * This file is originaly based on version 1.0.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #ifndef __PWM_H | 20 | #ifndef __PWM_H |
21 | #define __PWM_H | 21 | #define __PWM_H |
22 | 22 | ||
23 | 23 | ||
24 | #include <kpopupmenu.h> | 24 | #include <kpopupmenu.h> |
25 | #include <klistview.h> | 25 | #include <klistview.h> |
26 | #include <kmainwindow.h> | 26 | #include <kmainwindow.h> |
27 | 27 | ||
28 | #ifndef PWM_EMBEDDED | 28 | #ifndef PWM_EMBEDDED |
29 | #include <kwin.h> | 29 | #include <kwin.h> |
30 | #include <kapp.h> | 30 | #include <kapp.h> |
31 | #include <kdeversion.h> | 31 | #include <kdeversion.h> |
32 | #else | 32 | #else |
33 | #include <ksyncmanager.h> | ||
33 | #endif | 34 | #endif |
34 | 35 | ||
35 | #include <kaction.h> | 36 | #include <kaction.h> |
36 | 37 | ||
37 | |||
38 | #include <qglobal.h> | 38 | #include <qglobal.h> |
39 | 39 | ||
40 | #include "pwmview.h" | 40 | #include "pwmview.h" |
41 | #include "pwmexception.h" | 41 | #include "pwmexception.h" |
42 | 42 | ||
43 | 43 | ||
44 | /** timeout for displaying a message on the status-bar (in seconds) */ | 44 | /** timeout for displaying a message on the status-bar (in seconds) */ |
45 | #define STATUSBAR_MSG_TIMEOUT5 | 45 | #define STATUSBAR_MSG_TIMEOUT5 |
46 | 46 | ||
47 | 47 | ||
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 | { |
53 | Q_OBJECT | 60 | Q_OBJECT |
54 | public: | 61 | public: |
55 | friend class PwMView; | 62 | friend class PwMView; |
56 | /** construtor */ | 63 | /** construtor */ |
57 | PwM(PwMInit *_init, PwMDoc *doc, | 64 | PwM(PwMInit *_init, PwMDoc *doc, |
58 | bool virginity = true, | 65 | bool virginity = true, |
59 | QWidget* parent = 0, const char *name = 0); | 66 | QWidget* parent = 0, const char *name = 0); |
60 | /** destructor */ | 67 | /** destructor */ |
61 | ~PwM(); | 68 | ~PwM(); |
62 | 69 | ||
63 | /** copy some text to the global clipboard */ | 70 | /** copy some text to the global clipboard */ |
64 | static void copyToClipboard(const QString &s); | 71 | static void copyToClipboard(const QString &s); |
65 | 72 | ||
66 | /** returns pointer to the view */ | 73 | /** returns pointer to the view */ |
67 | PwMView * curView() | 74 | PwMView * curView() |
68 | { return view; } | 75 | { return view; } |
69 | /** returns pointer to the currently using document. */ | 76 | /** returns pointer to the currently using document. */ |
70 | PwMDoc * curDoc() | 77 | PwMDoc * curDoc() |
71 | { return curView()->document(); } | 78 | { return curView()->document(); } |
72 | /** open a new doc with the given filename */ | 79 | /** open a new doc with the given filename */ |
73 | PwMDoc * openDoc(QString filename, bool openDeepLocked = false); | 80 | PwMDoc * openDoc(QString filename, bool openDeepLocked = false); |
74 | /** show a message on the global status bar. | 81 | /** show a message on the global status bar. |
75 | * The message times out after some seconds. | 82 | * The message times out after some seconds. |
76 | */ | 83 | */ |
77 | void showStatMsg(const QString &msg); | 84 | void showStatMsg(const QString &msg); |
78 | /** ask the user where to save the doc (if it has not been saved, yet) | 85 | /** ask the user where to save the doc (if it has not been saved, yet) |
79 | * and write the data to disk. | 86 | * and write the data to disk. |
80 | */ | 87 | */ |
81 | bool save(); | 88 | bool save(); |
82 | /** ask the user where to save the doc | 89 | /** ask the user where to save the doc |
83 | * and write the data to disk. | 90 | * and write the data to disk. |
84 | */ | 91 | */ |
85 | bool saveAs(); | 92 | bool saveAs(); |
86 | /** force quit. Quit this window, always! Don't minimize it */ | 93 | /** force quit. Quit this window, always! Don't minimize it */ |
87 | bool isForceQuit() | 94 | bool isForceQuit() |
88 | { return forceQuit; } | 95 | { return forceQuit; } |
89 | /** set forceQuit */ | 96 | /** set forceQuit */ |
90 | void setForceQuit(bool force) | 97 | void setForceQuit(bool force) |
91 | { forceQuit = force; } | 98 | { forceQuit = force; } |
92 | /** force minimize this window */ | 99 | /** force minimize this window */ |
93 | bool isForceMinimizeToTray() | 100 | bool isForceMinimizeToTray() |
94 | { return forceMinimizeToTray; } | 101 | { return forceMinimizeToTray; } |
95 | /** set forceMinimizeToTray */ | 102 | /** set forceMinimizeToTray */ |
96 | void setForceMinimizeToTray(bool force) | 103 | void setForceMinimizeToTray(bool force) |
97 | { forceMinimizeToTray = force; } | 104 | { forceMinimizeToTray = force; } |
98 | 105 | ||
99 | public slots: | 106 | public slots: |
@@ -211,51 +218,81 @@ protected: | |||
211 | /** check if kwalletemu is enabled and ask the user what to do */ | 218 | /** check if kwalletemu is enabled and ask the user what to do */ |
212 | bool checkAndAskForKWalletEmu(); | 219 | bool checkAndAskForKWalletEmu(); |
213 | #endif // CONFIG_KWALLETIF | 220 | #endif // CONFIG_KWALLETIF |
214 | 221 | ||
215 | protected slots: | 222 | protected slots: |
216 | /** doc got closed */ | 223 | /** doc got closed */ |
217 | void docClosed(PwMDoc *doc); | 224 | void docClosed(PwMDoc *doc); |
218 | 225 | ||
219 | signals: | 226 | signals: |
220 | /** window got closed (by user or someone else) */ | 227 | /** window got closed (by user or someone else) */ |
221 | void closed(PwM *wnd); | 228 | void closed(PwM *wnd); |
222 | /** window got the focus (was brought to foreground) */ | 229 | /** window got the focus (was brought to foreground) */ |
223 | void gotFocus(PwM *wnd); | 230 | void gotFocus(PwM *wnd); |
224 | /** window lost the focus */ | 231 | /** window lost the focus */ |
225 | void lostFocus(PwM *wnd); | 232 | void lostFocus(PwM *wnd); |
226 | 233 | ||
227 | protected: | 234 | protected: |
228 | /** pointer to the view active in this KMainWindow */ | 235 | /** pointer to the view active in this KMainWindow */ |
229 | PwMView *view; | 236 | PwMView *view; |
230 | /** pointer to the init class */ | 237 | /** pointer to the init class */ |
231 | PwMInit *init; | 238 | PwMInit *init; |
232 | /** has this window already lost its virginity? | 239 | /** has this window already lost its virginity? |
233 | * Means is there an open working document | 240 | * Means is there an open working document |
234 | */ | 241 | */ |
235 | bool virgin; | 242 | bool virgin; |
236 | /** "file" popup-menu */ | 243 | /** "file" popup-menu */ |
237 | KPopupMenu *filePopup; | 244 | KPopupMenu *filePopup; |
238 | 245 | ||
239 | /** "manage" popup-menu */ | 246 | /** "manage" popup-menu */ |
240 | KPopupMenu *managePopup; | 247 | KPopupMenu *managePopup; |
241 | #ifdef CONFIG_KEYCARD | 248 | #ifdef CONFIG_KEYCARD |
242 | /** "chipcard" popup-menu */ | 249 | /** "chipcard" popup-menu */ |
243 | KPopupMenu *chipcardPopup; | 250 | KPopupMenu *chipcardPopup; |
244 | #endif // CONFIG_KEYCARD | 251 | #endif // CONFIG_KEYCARD |
245 | /** "view" popup-menu */ | 252 | /** "view" popup-menu */ |
246 | KPopupMenu *viewPopup; | 253 | KPopupMenu *viewPopup; |
247 | /** "options" popup-menu */ | 254 | /** "options" popup-menu */ |
248 | KPopupMenu *optionsPopup; | 255 | KPopupMenu *optionsPopup; |
249 | /** "help" popup-menu */ | 256 | /** "help" popup-menu */ |
250 | KPopupMenu *helpPopup; | 257 | KPopupMenu *helpPopup; |
251 | /** "export" popup-menu */ | 258 | /** "export" popup-menu */ |
252 | KPopupMenu *exportPopup; | 259 | KPopupMenu *exportPopup; |
253 | /** "import" popup-menu */ | 260 | /** "import" popup-menu */ |
254 | KPopupMenu *importPopup; | 261 | KPopupMenu *importPopup; |
255 | /** force quit this window? */ | 262 | /** force quit this window? */ |
256 | bool forceQuit; | 263 | bool forceQuit; |
257 | /** force minimize this window to the tray */ | 264 | /** force minimize this window to the tray */ |
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 | }; |
260 | 297 | ||
261 | #endif | 298 | #endif |