summaryrefslogtreecommitdiffabout
path: root/pwmanager
authorulf69 <ulf69>2004-10-19 01:12:41 (UTC)
committer ulf69 <ulf69>2004-10-19 01:12:41 (UTC)
commit6fdb13cb4142ecde29fd537ff32a3e8e6cc30b26 (patch) (unidiff)
tree760ad21fcdc4e2d885c5d875d91629a70ce89843 /pwmanager
parentda724334d46c01ee9d4f04101dab5d048c35c833 (diff)
downloadkdepimpi-6fdb13cb4142ecde29fd537ff32a3e8e6cc30b26.zip
kdepimpi-6fdb13cb4142ecde29fd537ff32a3e8e6cc30b26.tar.gz
kdepimpi-6fdb13cb4142ecde29fd537ff32a3e8e6cc30b26.tar.bz2
added whats new page
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwm.cpp13
-rw-r--r--pwmanager/pwmanager/pwm.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 57b4432..26a44b1 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -72,129 +72,130 @@
72enum { 72enum {
73 BUTTON_POPUP_FILE_NEW = 0, 73 BUTTON_POPUP_FILE_NEW = 0,
74 BUTTON_POPUP_FILE_OPEN, 74 BUTTON_POPUP_FILE_OPEN,
75 BUTTON_POPUP_FILE_CLOSE, 75 BUTTON_POPUP_FILE_CLOSE,
76 BUTTON_POPUP_FILE_SAVE, 76 BUTTON_POPUP_FILE_SAVE,
77 BUTTON_POPUP_FILE_SAVEAS, 77 BUTTON_POPUP_FILE_SAVEAS,
78 BUTTON_POPUP_FILE_EXPORT, 78 BUTTON_POPUP_FILE_EXPORT,
79 BUTTON_POPUP_FILE_IMPORT, 79 BUTTON_POPUP_FILE_IMPORT,
80 BUTTON_POPUP_FILE_PRINT, 80 BUTTON_POPUP_FILE_PRINT,
81 BUTTON_POPUP_FILE_QUIT 81 BUTTON_POPUP_FILE_QUIT
82}; 82};
83// Button IDs for "manage" popup menu 83// Button IDs for "manage" popup menu
84enum { 84enum {
85 BUTTON_POPUP_MANAGE_ADD = 0, 85 BUTTON_POPUP_MANAGE_ADD = 0,
86 BUTTON_POPUP_MANAGE_EDIT, 86 BUTTON_POPUP_MANAGE_EDIT,
87 BUTTON_POPUP_MANAGE_DEL, 87 BUTTON_POPUP_MANAGE_DEL,
88 BUTTON_POPUP_MANAGE_CHANGEMP 88 BUTTON_POPUP_MANAGE_CHANGEMP
89}; 89};
90// Button IDs for chipcard popup menu 90// Button IDs for chipcard popup menu
91enum { 91enum {
92#ifdef CONFIG_KEYCARD 92#ifdef CONFIG_KEYCARD
93 BUTTON_POPUP_CHIPCARD_GENNEW = 0, 93 BUTTON_POPUP_CHIPCARD_GENNEW = 0,
94 BUTTON_POPUP_CHIPCARD_DEL, 94 BUTTON_POPUP_CHIPCARD_DEL,
95 BUTTON_POPUP_CHIPCARD_READID, 95 BUTTON_POPUP_CHIPCARD_READID,
96 BUTTON_POPUP_CHIPCARD_SAVEBACKUP, 96 BUTTON_POPUP_CHIPCARD_SAVEBACKUP,
97 BUTTON_POPUP_CHIPCARD_REPLAYBACKUP 97 BUTTON_POPUP_CHIPCARD_REPLAYBACKUP
98#else // CONFIG_KEYCARD 98#else // CONFIG_KEYCARD
99 BUTTON_POPUP_CHIPCARD_NO = 0 99 BUTTON_POPUP_CHIPCARD_NO = 0
100#endif // CONFIG_KEYCARD 100#endif // CONFIG_KEYCARD
101}; 101};
102// Button IDs for "view" popup menu 102// Button IDs for "view" popup menu
103enum { 103enum {
104 BUTTON_POPUP_VIEW_FIND = 0, 104 BUTTON_POPUP_VIEW_FIND = 0,
105 BUTTON_POPUP_VIEW_LOCK, 105 BUTTON_POPUP_VIEW_LOCK,
106 BUTTON_POPUP_VIEW_DEEPLOCK, 106 BUTTON_POPUP_VIEW_DEEPLOCK,
107 BUTTON_POPUP_VIEW_UNLOCK 107 BUTTON_POPUP_VIEW_UNLOCK
108}; 108};
109// Button IDs for "options" popup menu 109// Button IDs for "options" popup menu
110enum { 110enum {
111 BUTTON_POPUP_OPTIONS_CONFIG = 0 111 BUTTON_POPUP_OPTIONS_CONFIG = 0
112}; 112};
113// Button IDs for "export" popup menu (in "file" popup menu) 113// Button IDs for "export" popup menu (in "file" popup menu)
114enum { 114enum {
115 BUTTON_POPUP_EXPORT_TEXT = 0, 115 BUTTON_POPUP_EXPORT_TEXT = 0,
116 BUTTON_POPUP_EXPORT_GPASMAN 116 BUTTON_POPUP_EXPORT_GPASMAN
117#ifdef CONFIG_KWALLETIF 117#ifdef CONFIG_KWALLETIF
118 ,BUTTON_POPUP_EXPORT_KWALLET 118 ,BUTTON_POPUP_EXPORT_KWALLET
119#endif 119#endif
120}; 120};
121// Button IDs for "import" popup menu (in "file" popup menu) 121// Button IDs for "import" popup menu (in "file" popup menu)
122enum { 122enum {
123 BUTTON_POPUP_IMPORT_TEXT = 0, 123 BUTTON_POPUP_IMPORT_TEXT = 0,
124 BUTTON_POPUP_IMPORT_GPASMAN 124 BUTTON_POPUP_IMPORT_GPASMAN
125#ifdef CONFIG_KWALLETIF 125#ifdef CONFIG_KWALLETIF
126 ,BUTTON_POPUP_IMPORT_KWALLET 126 ,BUTTON_POPUP_IMPORT_KWALLET
127#endif 127#endif
128}; 128};
129 129
130#ifdef PWM_EMBEDDED 130#ifdef PWM_EMBEDDED
131// Button IDs for "help" popup menu 131// Button IDs for "help" popup menu
132enum { 132enum {
133 BUTTON_POPUP_HELP_LICENSE = 0, 133 BUTTON_POPUP_HELP_LICENSE = 0,
134 BUTTON_POPUP_HELP_FAQ, 134 BUTTON_POPUP_HELP_FAQ,
135 BUTTON_POPUP_HELP_ABOUT, 135 BUTTON_POPUP_HELP_ABOUT,
136 BUTTON_POPUP_HELP_SYNC 136 BUTTON_POPUP_HELP_SYNC,
137 BUTTON_POPUP_HELP_WHATSNEW
137}; 138};
138#endif 139#endif
139 140
140// Button IDs for toolbar 141// Button IDs for toolbar
141enum { 142enum {
142 BUTTON_TOOL_NEW = 0, 143 BUTTON_TOOL_NEW = 0,
143 BUTTON_TOOL_OPEN, 144 BUTTON_TOOL_OPEN,
144 BUTTON_TOOL_SAVE, 145 BUTTON_TOOL_SAVE,
145 BUTTON_TOOL_SAVEAS, 146 BUTTON_TOOL_SAVEAS,
146 BUTTON_TOOL_PRINT, 147 BUTTON_TOOL_PRINT,
147 BUTTON_TOOL_ADD, 148 BUTTON_TOOL_ADD,
148 BUTTON_TOOL_EDIT, 149 BUTTON_TOOL_EDIT,
149 BUTTON_TOOL_DEL, 150 BUTTON_TOOL_DEL,
150 BUTTON_TOOL_FIND, 151 BUTTON_TOOL_FIND,
151 BUTTON_TOOL_LOCK, 152 BUTTON_TOOL_LOCK,
152 BUTTON_TOOL_DEEPLOCK, 153 BUTTON_TOOL_DEEPLOCK,
153 BUTTON_TOOL_UNLOCK 154 BUTTON_TOOL_UNLOCK
154}; 155};
155 156
156 157
157PwM::PwM(PwMInit *_init, PwMDoc *doc, 158PwM::PwM(PwMInit *_init, PwMDoc *doc,
158 bool virginity, 159 bool virginity,
159 QWidget *parent, const char *name) 160 QWidget *parent, const char *name)
160 : KMainWindow(parent, "HALLO") 161 : KMainWindow(parent, "HALLO")
161 , forceQuit (false) 162 , forceQuit (false)
162 , forceMinimizeToTray (false) 163 , forceMinimizeToTray (false)
163{ 164{
164 init = _init; 165 init = _init;
165 connect(doc, SIGNAL(docClosed(PwMDoc *)), 166 connect(doc, SIGNAL(docClosed(PwMDoc *)),
166 this, SLOT(docClosed(PwMDoc *))); 167 this, SLOT(docClosed(PwMDoc *)));
167 initMenubar(); 168 initMenubar();
168 initToolbar(); 169 initToolbar();
169 initMetrics(); 170 initMetrics();
170 setVirgin(virginity); 171 setVirgin(virginity);
171 setFocusPolicy(QWidget::WheelFocus); 172 setFocusPolicy(QWidget::WheelFocus);
172#ifndef PWM_EMBEDDED 173#ifndef PWM_EMBEDDED
173 statusBar()->show(); 174 statusBar()->show();
174#endif 175#endif
175 view = makeNewListView(doc); 176 view = makeNewListView(doc);
176 setCentralWidget(view); 177 setCentralWidget(view);
177 updateCaption(); 178 updateCaption();
178 showStatMsg(i18n("Ready.")); 179 showStatMsg(i18n("Ready."));
179} 180}
180 181
181PwM::~PwM() 182PwM::~PwM()
182{ 183{
183 disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), 184 disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)),
184 this, SLOT(docClosed(PwMDoc *))); 185 this, SLOT(docClosed(PwMDoc *)));
185 conf()->confWndMainWndSize(size()); 186 conf()->confWndMainWndSize(size());
186 emit closed(this); 187 emit closed(this);
187 delete view; 188 delete view;
188} 189}
189 190
190void PwM::initMenubar() 191void PwM::initMenubar()
191{ 192{
192 KIconLoader* picons; 193 KIconLoader* picons;
193#ifndef PWM_EMBEDDED 194#ifndef PWM_EMBEDDED
194 KIconLoader icons; 195 KIconLoader icons;
195 picons = &icons; 196 picons = &icons;
196#else 197#else
197 picons = KGlobal::iconLoader(); 198 picons = KGlobal::iconLoader();
198 199
199 200
200 syncPopup = new KPopupMenu(this); 201 syncPopup = new KPopupMenu(this);
@@ -302,128 +303,132 @@ void PwM::initMenubar()
302 chipcardPopup->insertSeparator(); 303 chipcardPopup->insertSeparator();
303 chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)), 304 chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)),
304 i18n("&Make card backup-image"), this, 305 i18n("&Make card backup-image"), this,
305 SLOT(makeCardBackup_slot()), 0, 306 SLOT(makeCardBackup_slot()), 0,
306 BUTTON_POPUP_CHIPCARD_SAVEBACKUP); 307 BUTTON_POPUP_CHIPCARD_SAVEBACKUP);
307 chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)), 308 chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)),
308 i18n("&Replay card backup-image"), this, 309 i18n("&Replay card backup-image"), this,
309 SLOT(replayCardBackup_slot()), 0, 310 SLOT(replayCardBackup_slot()), 0,
310 BUTTON_POPUP_CHIPCARD_REPLAYBACKUP); 311 BUTTON_POPUP_CHIPCARD_REPLAYBACKUP);
311 menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup); 312 menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup);
312#endif // CONFIG_KEYCARD 313#endif // CONFIG_KEYCARD
313// "view" popup menu 314// "view" popup menu
314 viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)), 315 viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)),
315 i18n("&Find"), this, 316 i18n("&Find"), this,
316 SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND); 317 SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND);
317 viewPopup->insertSeparator(); 318 viewPopup->insertSeparator();
318 viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)), 319 viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)),
319 i18n("&Lock all entries"), this, 320 i18n("&Lock all entries"), this,
320 SLOT(lockWnd_slot()), 0, 321 SLOT(lockWnd_slot()), 0,
321 BUTTON_POPUP_VIEW_LOCK); 322 BUTTON_POPUP_VIEW_LOCK);
322 viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)), 323 viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)),
323 i18n("&Deep-lock all entries"), this, 324 i18n("&Deep-lock all entries"), this,
324 SLOT(deepLockWnd_slot()), 0, 325 SLOT(deepLockWnd_slot()), 0,
325 BUTTON_POPUP_VIEW_DEEPLOCK); 326 BUTTON_POPUP_VIEW_DEEPLOCK);
326 viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)), 327 viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)),
327 i18n("&Unlock all entries"), this, 328 i18n("&Unlock all entries"), this,
328 SLOT(unlockWnd_slot()), 0, 329 SLOT(unlockWnd_slot()), 0,
329 BUTTON_POPUP_VIEW_UNLOCK); 330 BUTTON_POPUP_VIEW_UNLOCK);
330 menuBar()->insertItem(i18n("&View"), viewPopup); 331 menuBar()->insertItem(i18n("&View"), viewPopup);
331// "options" popup menu 332// "options" popup menu
332 optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), 333 optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)),
333 i18n("&Configure..."), this, 334 i18n("&Configure..."), this,
334 SLOT(config_slot()), 335 SLOT(config_slot()),
335 BUTTON_POPUP_OPTIONS_CONFIG); 336 BUTTON_POPUP_OPTIONS_CONFIG);
336 menuBar()->insertItem(i18n("&Options"), optionsPopup); 337 menuBar()->insertItem(i18n("&Options"), optionsPopup);
337// "help" popup menu 338// "help" popup menu
338#ifndef PWM_EMBEDDED 339#ifndef PWM_EMBEDDED
339 helpPopup = helpMenu(QString::null, false); 340 helpPopup = helpMenu(QString::null, false);
340#else 341#else
341 menuBar()->insertItem(i18n("&Sync"), syncPopup); 342 menuBar()->insertItem(i18n("&Sync"), syncPopup);
342 343
343 344
344 345
345 346
346 347
347 helpPopup = new KPopupMenu(this); 348 helpPopup = new KPopupMenu(this);
348 349
349 350
350 helpPopup->insertItem(i18n("&License"), this, 351 helpPopup->insertItem(i18n("&License"), this,
351 SLOT(showLicense_slot()), 0, 352 SLOT(showLicense_slot()), 0,
352 BUTTON_POPUP_HELP_LICENSE); 353 BUTTON_POPUP_HELP_LICENSE);
353 354
354 helpPopup->insertItem(i18n("&Faq"), this, 355 helpPopup->insertItem(i18n("&Faq"), this,
355 SLOT(faq_slot()), 0, 356 SLOT(faq_slot()), 0,
356 BUTTON_POPUP_HELP_FAQ); 357 BUTTON_POPUP_HELP_FAQ);
357 358
358 helpPopup->insertItem(i18n("&About PwManager"), this, 359 helpPopup->insertItem(i18n("&About PwManager"), this,
359 SLOT(createAboutData_slot()), 0, 360 SLOT(createAboutData_slot()), 0,
360 BUTTON_POPUP_HELP_ABOUT); 361 BUTTON_POPUP_HELP_ABOUT);
361 362
362 helpPopup->insertItem(i18n("&Sync HowTo"), this, 363 helpPopup->insertItem(i18n("&Sync HowTo"), this,
363 SLOT(syncHowTo_slot()), 0, 364 SLOT(syncHowTo_slot()), 0,
364 BUTTON_POPUP_HELP_SYNC); 365 BUTTON_POPUP_HELP_SYNC);
365 366
367 helpPopup->insertItem(i18n("&What's New"), this,
368 SLOT(whatsnew_slot()), 0,
369 BUTTON_POPUP_HELP_WHATSNEW);
370
366#endif 371#endif
367 menuBar()->insertItem(i18n("&Help"), helpPopup); 372 menuBar()->insertItem(i18n("&Help"), helpPopup);
368 373
369} 374}
370 375
371void PwM::initToolbar() 376void PwM::initToolbar()
372{ 377{
373 KIconLoader* picons; 378 KIconLoader* picons;
374#ifndef PWM_EMBEDDED 379#ifndef PWM_EMBEDDED
375 KIconLoader icons; 380 KIconLoader icons;
376 picons = &icons; 381 picons = &icons;
377#else 382#else
378 picons = KGlobal::iconLoader(); 383 picons = KGlobal::iconLoader();
379#endif 384#endif
380 385
381#ifdef PWM_EMBEDDED 386#ifdef PWM_EMBEDDED
382 if ( QApplication::desktop()->width() > 320 ) 387 if ( QApplication::desktop()->width() > 320 )
383#endif 388#endif
384 { 389 {
385 toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar), 390 toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar),
386 BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this, 391 BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this,
387 SLOT(new_slot()), true, i18n("New")); 392 SLOT(new_slot()), true, i18n("New"));
388 toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar), 393 toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar),
389 BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this, 394 BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this,
390 SLOT(open_slot()), true, i18n("Open")); 395 SLOT(open_slot()), true, i18n("Open"));
391 toolBar()->insertSeparator(); 396 toolBar()->insertSeparator();
392 } 397 }
393 toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar), 398 toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar),
394 BUTTON_TOOL_SAVE, SIGNAL(clicked(int)), this, 399 BUTTON_TOOL_SAVE, SIGNAL(clicked(int)), this,
395 SLOT(save_slot()), true, i18n("Save")); 400 SLOT(save_slot()), true, i18n("Save"));
396 toolBar()->insertButton(picons->loadIcon("filesaveas", KIcon::Toolbar), 401 toolBar()->insertButton(picons->loadIcon("filesaveas", KIcon::Toolbar),
397 BUTTON_TOOL_SAVEAS, SIGNAL(clicked(int)), this, 402 BUTTON_TOOL_SAVEAS, SIGNAL(clicked(int)), this,
398 SLOT(saveAs_slot()), true, i18n("Save as")); 403 SLOT(saveAs_slot()), true, i18n("Save as"));
399 toolBar()->insertButton(picons->loadIcon("fileprint", KIcon::Toolbar), 404 toolBar()->insertButton(picons->loadIcon("fileprint", KIcon::Toolbar),
400 BUTTON_TOOL_PRINT, SIGNAL(clicked(int)), this, 405 BUTTON_TOOL_PRINT, SIGNAL(clicked(int)), this,
401 SLOT(print_slot()), true, i18n("Print...")); 406 SLOT(print_slot()), true, i18n("Print..."));
402 toolBar()->insertSeparator(); 407 toolBar()->insertSeparator();
403 toolBar()->insertButton(picons->loadIcon("pencil", KIcon::Toolbar), 408 toolBar()->insertButton(picons->loadIcon("pencil", KIcon::Toolbar),
404 BUTTON_TOOL_ADD, SIGNAL(clicked(int)), this, 409 BUTTON_TOOL_ADD, SIGNAL(clicked(int)), this,
405 SLOT(addPwd_slot()), true, 410 SLOT(addPwd_slot()), true,
406 i18n("Add password")); 411 i18n("Add password"));
407 toolBar()->insertButton(picons->loadIcon("edit", KIcon::Toolbar), 412 toolBar()->insertButton(picons->loadIcon("edit", KIcon::Toolbar),
408 BUTTON_TOOL_EDIT, SIGNAL(clicked(int)), this, 413 BUTTON_TOOL_EDIT, SIGNAL(clicked(int)), this,
409 SLOT(editPwd_slot()), true, 414 SLOT(editPwd_slot()), true,
410 i18n("Edit password")); 415 i18n("Edit password"));
411 toolBar()->insertButton(picons->loadIcon("editdelete", KIcon::Toolbar), 416 toolBar()->insertButton(picons->loadIcon("editdelete", KIcon::Toolbar),
412 BUTTON_TOOL_DEL, SIGNAL(clicked(int)), this, 417 BUTTON_TOOL_DEL, SIGNAL(clicked(int)), this,
413 SLOT(deletePwd_slot()), true, 418 SLOT(deletePwd_slot()), true,
414 i18n("Delete password")); 419 i18n("Delete password"));
415 toolBar()->insertSeparator(); 420 toolBar()->insertSeparator();
416 toolBar()->insertButton(picons->loadIcon("find", KIcon::Toolbar), 421 toolBar()->insertButton(picons->loadIcon("find", KIcon::Toolbar),
417 BUTTON_TOOL_FIND, SIGNAL(clicked(int)), this, 422 BUTTON_TOOL_FIND, SIGNAL(clicked(int)), this,
418 SLOT(find_slot()), true, i18n("Find entry")); 423 SLOT(find_slot()), true, i18n("Find entry"));
419 toolBar()->insertSeparator(); 424 toolBar()->insertSeparator();
420 toolBar()->insertButton(picons->loadIcon("halfencrypted", KIcon::Toolbar), 425 toolBar()->insertButton(picons->loadIcon("halfencrypted", KIcon::Toolbar),
421 BUTTON_TOOL_LOCK, SIGNAL(clicked(int)), this, 426 BUTTON_TOOL_LOCK, SIGNAL(clicked(int)), this,
422 SLOT(lockWnd_slot()), true, 427 SLOT(lockWnd_slot()), true,
423 i18n("Lock all entries")); 428 i18n("Lock all entries"));
424 toolBar()->insertButton(picons->loadIcon("encrypted", KIcon::Toolbar), 429 toolBar()->insertButton(picons->loadIcon("encrypted", KIcon::Toolbar),
425 BUTTON_TOOL_DEEPLOCK, SIGNAL(clicked(int)), this, 430 BUTTON_TOOL_DEEPLOCK, SIGNAL(clicked(int)), this,
426 SLOT(deepLockWnd_slot()), true, 431 SLOT(deepLockWnd_slot()), true,
427 i18n("Deep-Lock all entries")); 432 i18n("Deep-Lock all entries"));
428 toolBar()->insertButton(picons->loadIcon("decrypted", KIcon::Toolbar), 433 toolBar()->insertButton(picons->loadIcon("decrypted", KIcon::Toolbar),
429 BUTTON_TOOL_UNLOCK, SIGNAL(clicked(int)), this, 434 BUTTON_TOOL_UNLOCK, SIGNAL(clicked(int)), this,
@@ -1227,138 +1232,142 @@ void PwM::execLauncher_slot()
1227 return; 1232 return;
1228 unsigned int curEntryIndex; 1233 unsigned int curEntryIndex;
1229 if (!view->getCurEntryIndex(&curEntryIndex)) 1234 if (!view->getCurEntryIndex(&curEntryIndex))
1230 return; 1235 return;
1231 bool ret = curDoc()->execLauncher(view->getCurrentCategory(), 1236 bool ret = curDoc()->execLauncher(view->getCurrentCategory(),
1232 curEntryIndex); 1237 curEntryIndex);
1233 if (ret) 1238 if (ret)
1234 showStatMsg(i18n("Executed the \"Launcher\".")); 1239 showStatMsg(i18n("Executed the \"Launcher\"."));
1235 else 1240 else
1236 showStatMsg(i18n("ERROR: Couldn't execute the \"Launcher\"!")); 1241 showStatMsg(i18n("ERROR: Couldn't execute the \"Launcher\"!"));
1237} 1242}
1238 1243
1239void PwM::goToURL_slot() 1244void PwM::goToURL_slot()
1240{ 1245{
1241 PWM_ASSERT(curDoc()); 1246 PWM_ASSERT(curDoc());
1242 if (curDoc()->isDeepLocked()) 1247 if (curDoc()->isDeepLocked())
1243 return; 1248 return;
1244 unsigned int curEntryIndex; 1249 unsigned int curEntryIndex;
1245 if (!view->getCurEntryIndex(&curEntryIndex)) 1250 if (!view->getCurEntryIndex(&curEntryIndex))
1246 return; 1251 return;
1247 bool ret = curDoc()->goToURL(view->getCurrentCategory(), 1252 bool ret = curDoc()->goToURL(view->getCurrentCategory(),
1248 curEntryIndex); 1253 curEntryIndex);
1249 if (ret) 1254 if (ret)
1250 showStatMsg(i18n("started browser with current URL.")); 1255 showStatMsg(i18n("started browser with current URL."));
1251 else 1256 else
1252 showStatMsg(i18n("ERROR: Couldn't start browser! Maybe invalid URL?")); 1257 showStatMsg(i18n("ERROR: Couldn't start browser! Maybe invalid URL?"));
1253} 1258}
1254 1259
1255void PwM::copyToClipboard(const QString &s) 1260void PwM::copyToClipboard(const QString &s)
1256{ 1261{
1257 QClipboard *cb = QApplication::clipboard(); 1262 QClipboard *cb = QApplication::clipboard();
1258#ifndef PWM_EMBEDDED 1263#ifndef PWM_EMBEDDED
1259 if (cb->supportsSelection()) 1264 if (cb->supportsSelection())
1260 cb->setText(s, QClipboard::Selection); 1265 cb->setText(s, QClipboard::Selection);
1261 cb->setText(s, QClipboard::Clipboard); 1266 cb->setText(s, QClipboard::Clipboard);
1262#else 1267#else
1263 cb->setText(s); 1268 cb->setText(s);
1264 1269
1265#endif 1270#endif
1266 1271
1267} 1272}
1268 1273
1269void PwM::showStatMsg(const QString &msg) 1274void PwM::showStatMsg(const QString &msg)
1270{ 1275{
1271#ifndef PWM_EMBEDDED 1276#ifndef PWM_EMBEDDED
1272 KStatusBar *statBar = statusBar(); 1277 KStatusBar *statBar = statusBar();
1273 statBar->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); 1278 statBar->message(msg, STATUSBAR_MSG_TIMEOUT * 1000);
1274#else 1279#else
1275 qDebug("Statusbar : %s",msg.latin1()); 1280 qDebug("Statusbar : %s",msg.latin1());
1276#endif 1281#endif
1277} 1282}
1278 1283
1279void PwM::focusInEvent(QFocusEvent *e) 1284void PwM::focusInEvent(QFocusEvent *e)
1280{ 1285{
1281 if (e->gotFocus()) { 1286 if (e->gotFocus()) {
1282 emit gotFocus(this); 1287 emit gotFocus(this);
1283 } else if (e->lostFocus()) { 1288 } else if (e->lostFocus()) {
1284 emit lostFocus(this); 1289 emit lostFocus(this);
1285 } 1290 }
1286} 1291}
1287 1292
1288 1293
1289#ifdef PWM_EMBEDDED 1294#ifdef PWM_EMBEDDED
1290 1295
1296void PwM::whatsnew_slot()
1297{
1298 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1299}
1300
1291void PwM::showLicense_slot() 1301void PwM::showLicense_slot()
1292{ 1302{
1293 KApplication::showLicence(); 1303 KApplication::showLicence();
1294} 1304}
1295 1305
1296void PwM::faq_slot() 1306void PwM::faq_slot()
1297{ 1307{
1298 KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" ); 1308 KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" );
1299} 1309}
1300 1310
1301void PwM::syncHowTo_slot() 1311void PwM::syncHowTo_slot()
1302{ 1312{
1303 qDebug("PwM::syncHowTo_slot");
1304 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1313 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1305} 1314}
1306 1315
1307 1316
1308void PwM::createAboutData_slot() 1317void PwM::createAboutData_slot()
1309{ 1318{
1310 QString version; 1319 QString version;
1311#include <../version> 1320#include <../version>
1312 QMessageBox::about( this, "About PwManager/Pi", 1321 QMessageBox::about( this, "About PwManager/Pi",
1313 "PwManager/Platform-independent\n" 1322 "PwManager/Platform-independent\n"
1314 "(PWM/Pi) " +version + " - " + 1323 "(PWM/Pi) " +version + " - " +
1315#ifdef DESKTOP_VERSION 1324#ifdef DESKTOP_VERSION
1316 "Desktop Edition\n" 1325 "Desktop Edition\n"
1317#else 1326#else
1318 "PDA-Edition\n" 1327 "PDA-Edition\n"
1319 "for: Zaurus 5500 / 7x0 / 8x0\n" 1328 "for: Zaurus 5500 / 7x0 / 8x0\n"
1320#endif 1329#endif
1321 1330
1322 "(c) 2004 Ulf Schenk\n" 1331 "(c) 2004 Ulf Schenk\n"
1323 "(c) 2004 Lutz Rogowski\n" 1332 "(c) 2004 Lutz Rogowski\n"
1324 "(c) 1997-2004, The KDE PIM Team\n" 1333 "(c) 1997-2004, The KDE PIM Team\n"
1325 1334
1326 "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n" 1335 "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n"
1327 "Matt Scifo - mscifo@o1.com\n" 1336 "Matt Scifo - mscifo@o1.com\n"
1328 "Elias Probst - elias.probst@gmx.de\n" 1337 "Elias Probst - elias.probst@gmx.de\n"
1329 "George Staikos - staikos@kde.org\n" 1338 "George Staikos - staikos@kde.org\n"
1330 "Matthew Palmer - mjp16@uow.edu.au\n" 1339 "Matthew Palmer - mjp16@uow.edu.au\n"
1331 "Olivier Sessink - gpasman@nl.linux.org\n" 1340 "Olivier Sessink - gpasman@nl.linux.org\n"
1332 "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" 1341 "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n"
1333 "Troy Engel - tengel@sonic.net\n" 1342 "Troy Engel - tengel@sonic.net\n"
1334 "Wickey - wickey@gmx.at\n" 1343 "Wickey - wickey@gmx.at\n"
1335 "Ian MacGregor - original documentation author.\n" 1344 "Ian MacGregor - original documentation author.\n"
1336 ); 1345 );
1337} 1346}
1338 1347
1339 1348
1340//this are the overwritten callbackmethods from the syncinterface 1349//this are the overwritten callbackmethods from the syncinterface
1341bool PwM::sync(KSyncManager* manager, QString filename, int mode) 1350bool PwM::sync(KSyncManager* manager, QString filename, int mode)
1342{ 1351{
1343 PWM_ASSERT(curDoc()); 1352 PWM_ASSERT(curDoc());
1344 1353
1345 bool ret = curDoc()->sync(manager, filename, mode); 1354 bool ret = curDoc()->sync(manager, filename, mode);
1346 1355
1347 qDebug("PwM::sync save now: ret=%i", ret); 1356 qDebug("PwM::sync save now: ret=%i", ret);
1348 1357
1349 if (ret == true) { 1358 if (ret == true) {
1350 //US BUG: what can we call here to update the view of the current doc? 1359 //US BUG: what can we call here to update the view of the current doc?
1351 //mViewManager->refreshView(); 1360 //mViewManager->refreshView();
1352 1361
1353 //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. 1362 //US curDoc()->sync sets the dirtyFlag in case the sync was successfull.
1354 save(); 1363 save();
1355 } 1364 }
1356 1365
1357 return ret; 1366 return ret;
1358} 1367}
1359#endif 1368#endif
1360 1369
1361 1370
1362#ifndef PWM_EMBEDDED 1371#ifndef PWM_EMBEDDED
1363#include "pwm.moc" 1372#include "pwm.moc"
1364#endif 1373#endif
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h
index 6ed9d34..fe1f7a1 100644
--- a/pwmanager/pwmanager/pwm.h
+++ b/pwmanager/pwmanager/pwm.h
@@ -113,128 +113,129 @@ public slots:
113 /** file/close triggered */ 113 /** file/close triggered */
114 void close_slot(); 114 void close_slot();
115 /** file/quit triggered */ 115 /** file/quit triggered */
116 void quitButton_slot(); 116 void quitButton_slot();
117 /** file/save triggered */ 117 /** file/save triggered */
118 void save_slot(); 118 void save_slot();
119 /** file/saveAs triggered */ 119 /** file/saveAs triggered */
120 void saveAs_slot(); 120 void saveAs_slot();
121 /** file/export/text triggered */ 121 /** file/export/text triggered */
122 void exportToText(); 122 void exportToText();
123 /** file/export/gpasman triggered */ 123 /** file/export/gpasman triggered */
124 void exportToGpasman(); 124 void exportToGpasman();
125 /** file/export/kwallet triggered */ 125 /** file/export/kwallet triggered */
126 void exportToKWallet(); 126 void exportToKWallet();
127 /** file/import/text triggered */ 127 /** file/import/text triggered */
128 bool importFromText(); 128 bool importFromText();
129 /** file/import/gpasman triggered */ 129 /** file/import/gpasman triggered */
130 bool importFromGpasman(); 130 bool importFromGpasman();
131 /** file/import/kwallet triggered */ 131 /** file/import/kwallet triggered */
132 bool importKWallet(); 132 bool importKWallet();
133 /** file/print triggered */ 133 /** file/print triggered */
134 void print_slot(); 134 void print_slot();
135 /** manage/add triggered */ 135 /** manage/add triggered */
136 //US ENH : changed code to run with older MOC 136 //US ENH : changed code to run with older MOC
137 void addPwd_slot(); 137 void addPwd_slot();
138 void addPwd_slot(QString *pw, PwMDoc *_doc); 138 void addPwd_slot(QString *pw, PwMDoc *_doc);
139 /** manage/edit triggered */ 139 /** manage/edit triggered */
140 //US ENH : changed code to run with older MOC 140 //US ENH : changed code to run with older MOC
141 void editPwd_slot(); 141 void editPwd_slot();
142 void editPwd_slot(const QString *category); 142 void editPwd_slot(const QString *category);
143 void editPwd_slot(const QString *category = 0, const int *index = 0, 143 void editPwd_slot(const QString *category = 0, const int *index = 0,
144 PwMDoc *_doc = 0); 144 PwMDoc *_doc = 0);
145 /** manage/delete triggered */ 145 /** manage/delete triggered */
146 void deletePwd_slot(); 146 void deletePwd_slot();
147 /** execute the "Launcher" entry */ 147 /** execute the "Launcher" entry */
148 void execLauncher_slot(); 148 void execLauncher_slot();
149 /** open browser with URL entry */ 149 /** open browser with URL entry */
150 void goToURL_slot(); 150 void goToURL_slot();
151 /** manage/changeMasterPwd triggered */ 151 /** manage/changeMasterPwd triggered */
152 void changeMasterPwd_slot(); 152 void changeMasterPwd_slot();
153 /** lock current document */ 153 /** lock current document */
154 void lockWnd_slot(); 154 void lockWnd_slot();
155 /** deeplock current document */ 155 /** deeplock current document */
156 void deepLockWnd_slot(); 156 void deepLockWnd_slot();
157 /** window/unlock triggered */ 157 /** window/unlock triggered */
158 void unlockWnd_slot(); 158 void unlockWnd_slot();
159 /** find item */ 159 /** find item */
160 void find_slot(); 160 void find_slot();
161 /** configure clicked */ 161 /** configure clicked */
162 void config_slot(); 162 void config_slot();
163 /** (de)activate the "change master pw" button in the menu-bar */ 163 /** (de)activate the "change master pw" button in the menu-bar */
164 void activateMpButton(bool activate = true); 164 void activateMpButton(bool activate = true);
165 /** generate a new chipcard */ 165 /** generate a new chipcard */
166 void genNewCard_slot(); 166 void genNewCard_slot();
167 /** completely erase the current card */ 167 /** completely erase the current card */
168 void eraseCard_slot(); 168 void eraseCard_slot();
169 /** returns the ID number of the current card */ 169 /** returns the ID number of the current card */
170 void readCardId_slot(); 170 void readCardId_slot();
171 /** make backup image of the current card */ 171 /** make backup image of the current card */
172 void makeCardBackup_slot(); 172 void makeCardBackup_slot();
173 /** write backup image to current card */ 173 /** write backup image to current card */
174 void replayCardBackup_slot(); 174 void replayCardBackup_slot();
175 175
176#ifdef PWM_EMBEDDED 176#ifdef PWM_EMBEDDED
177 void whatsnew_slot();
177 void showLicense_slot(); 178 void showLicense_slot();
178 void faq_slot(); 179 void faq_slot();
179 void createAboutData_slot(); 180 void createAboutData_slot();
180 void syncHowTo_slot(); 181 void syncHowTo_slot();
181#endif 182#endif
182 183
183protected: 184protected:
184 /** is this window virgin? */ 185 /** is this window virgin? */
185 bool isVirgin() 186 bool isVirgin()
186 { return virgin; } 187 { return virgin; }
187 /** add/remove virginity */ 188 /** add/remove virginity */
188 void setVirgin(bool v); 189 void setVirgin(bool v);
189 /** initialize the menubar */ 190 /** initialize the menubar */
190 void initMenubar(); 191 void initMenubar();
191 /** initialize the toolbar */ 192 /** initialize the toolbar */
192 void initToolbar(); 193 void initToolbar();
193 /** initialize the window-metrics */ 194 /** initialize the window-metrics */
194 void initMetrics(); 195 void initMetrics();
195 /** close-event */ 196 /** close-event */
196 void closeEvent(QCloseEvent *e); 197 void closeEvent(QCloseEvent *e);
197 /** creates a new PwM-ListView and returns it */ 198 /** creates a new PwM-ListView and returns it */
198 PwMView * makeNewListView(PwMDoc *doc); 199 PwMView * makeNewListView(PwMDoc *doc);
199 /** Window hide-event */ 200 /** Window hide-event */
200 void hideEvent(QHideEvent *); 201 void hideEvent(QHideEvent *);
201 /** is this window minimized? */ 202 /** is this window minimized? */
202 bool isMinimized() 203 bool isMinimized()
203 { 204 {
204#ifndef PWM_EMBEDDED 205#ifndef PWM_EMBEDDED
205 #if KDE_VERSION >= KDE_MAKE_VERSION(3, 2, 0) 206 #if KDE_VERSION >= KDE_MAKE_VERSION(3, 2, 0)
206 return KWin::windowInfo(winId()).isMinimized(); 207 return KWin::windowInfo(winId()).isMinimized();
207 #else // KDE_VERSION 208 #else // KDE_VERSION
208 return KWin::info(winId()).isIconified(); 209 return KWin::info(winId()).isIconified();
209 #endif // KDE_VERSION 210 #endif // KDE_VERSION
210#else 211#else
211 return false; 212 return false;
212#endif 213#endif
213 } 214 }
214 /** window got the focus */ 215 /** window got the focus */
215 void focusInEvent(QFocusEvent *e); 216 void focusInEvent(QFocusEvent *e);
216 /** update the caption string */ 217 /** update the caption string */
217 void updateCaption(); 218 void updateCaption();
218#ifdef CONFIG_KWALLETIF 219#ifdef CONFIG_KWALLETIF
219 /** check if kwalletemu is enabled and ask the user what to do */ 220 /** check if kwalletemu is enabled and ask the user what to do */
220 bool checkAndAskForKWalletEmu(); 221 bool checkAndAskForKWalletEmu();
221#endif // CONFIG_KWALLETIF 222#endif // CONFIG_KWALLETIF
222 223
223protected slots: 224protected slots:
224 /** doc got closed */ 225 /** doc got closed */
225 void docClosed(PwMDoc *doc); 226 void docClosed(PwMDoc *doc);
226 227
227signals: 228signals:
228 /** window got closed (by user or someone else) */ 229 /** window got closed (by user or someone else) */
229 void closed(PwM *wnd); 230 void closed(PwM *wnd);
230 /** window got the focus (was brought to foreground) */ 231 /** window got the focus (was brought to foreground) */
231 void gotFocus(PwM *wnd); 232 void gotFocus(PwM *wnd);
232 /** window lost the focus */ 233 /** window lost the focus */
233 void lostFocus(PwM *wnd); 234 void lostFocus(PwM *wnd);
234 235
235protected: 236protected:
236 /** pointer to the view active in this KMainWindow */ 237 /** pointer to the view active in this KMainWindow */
237 PwMView *view; 238 PwMView *view;
238 /** pointer to the init class */ 239 /** pointer to the init class */
239 PwMInit *init; 240 PwMInit *init;
240 /** has this window already lost its virginity? 241 /** has this window already lost its virginity?