summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/pwmanager/germantranslation.txt7
-rw-r--r--pwmanager/pwmanager/commentbox.cpp4
-rw-r--r--pwmanager/pwmanager/pwm.cpp41
3 files changed, 33 insertions, 19 deletions
diff --git a/bin/kdepim/pwmanager/germantranslation.txt b/bin/kdepim/pwmanager/germantranslation.txt
index 0ebc644..d481c42 100644
--- a/bin/kdepim/pwmanager/germantranslation.txt
+++ b/bin/kdepim/pwmanager/germantranslation.txt
@@ -1,26 +1,26 @@
1{ " Local Time","Ortszeit" }, 1{ " Local Time","Ortszeit" },
2{ "Default","Voreinstellungen" }, 2{ "Default","Default" },
3{ "Configure...","Konfigurieren..." }, 3{ "Configure...","Konfigurieren..." },
4{ "Remove sync info","Entferne Sync Info" }, 4{ "Remove sync info","Entferne Sync Info" },
5{ "For all profiles","Für alle Profile" }, 5{ "For all profiles","Für alle Profile" },
6{ "Enable Pi-Sync","Aktiviere Pi-Sync" }, 6{ "Enable Pi-Sync","Aktiviere Pi-Sync" },
7{ "Multiple sync","Multi Sync" }, 7{ "Multiple sync","Multi Sync" },
8{ "&Save","&Speichern" }, 8{ "&Save","&Speichern" },
9{ "&Print...","Drucken..." }, 9{ "&Print...","Drucken..." },
10{ "&File","Datei" }, 10{ "&File","Datei" },
11{ "&Edit","Bearbeite" }, 11{ "&Edit","Bearbeite" },
12{ "&View","Ansicht" }, 12{ "&View","Ansicht" },
13{ "&Help","Hilfe" }, 13{ "&Help","Hilfe" },
14{ "Description","Beschreibungen" }, 14{ "Description","Beschreibungen" },
15{ "URL","URL" }, 15{ "URL","URL" },
16{ "Name:","Name:" }, 16{ "Name:","Name:" },
17{ "Documents","Dokumente" }, 17{ "Documents","Dokumente" },
18{ "Files","Dateien" }, 18{ "Files","Dateien" },
19{ "All Files","Alle Dateien" }, 19{ "All Files","Alle Dateien" },
20{ "Name","Name" }, 20{ "Name","Name" },
21{ "Size","Größe" }, 21{ "Size","Größe" },
22{ "Date","Datum" }, 22{ "Date","Datum" },
23{ "Mime Type","Mime Typ" }, 23{ "Mime Type","Mime Typ" },
24{ "Ok","Ok" }, 24{ "Ok","Ok" },
25{ "Cancel","Abbrechen" }, 25{ "Cancel","Abbrechen" },
26{ "1","1" }, 26{ "1","1" },
@@ -287,67 +287,68 @@
287{ "open deeplocked","Öffne total gesperrt" }, 287{ "open deeplocked","Öffne total gesperrt" },
288{ "Favourite browser:","Bevorzugter Browser:" }, 288{ "Favourite browser:","Bevorzugter Browser:" },
289{ "Favourite x-terminal:","Bevorzugtes x-terminal:" }, 289{ "Favourite x-terminal:","Bevorzugtes x-terminal:" },
290{ "Open document with passwords unlocked","Öffne Dokument mit Passwort ungesperrt" }, 290{ "Open document with passwords unlocked","Öffne Dokument mit Passwort ungesperrt" },
291{ "Look && feel","Aussehen" }, 291{ "Look && feel","Aussehen" },
292{ "File","Datei" }, 292{ "File","Datei" },
293{ "Timeout","Timeout" }, 293{ "Timeout","Timeout" },
294{ "Autostart","Autostart" }, 294{ "Autostart","Autostart" },
295{ "External apps","Externe Applik." }, 295{ "External apps","Externe Applik." },
296{ "Miscellaneous","Verschiedenes" }, 296{ "Miscellaneous","Verschiedenes" },
297{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, 297{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" },
298{ "edit category descriptions","Ändere Label für Kategorie" }, 298{ "edit category descriptions","Ändere Label für Kategorie" },
299{ "Close","Schließen" }, 299{ "Close","Schließen" },
300{ "Category:","Category:" }, 300{ "Category:","Category:" },
301{ "Text1 (Description):","Text1 (Beschreibung):" }, 301{ "Text1 (Description):","Text1 (Beschreibung):" },
302{ "Text2 (Username):","Text2 (Benutzername):" }, 302{ "Text2 (Username):","Text2 (Benutzername):" },
303{ "Text3 (Password):","Text3 (Passwort):" }, 303{ "Text3 (Password):","Text3 (Passwort):" },
304{ "edit/add a password entry","Ändere/hinzufüge Passwort Eintrag" }, 304{ "edit/add a password entry","Ändere/hinzufüge Passwort Eintrag" },
305{ "Description:","Beschreibung:" }, 305{ "Description:","Beschreibung:" },
306{ "Username:","Benutzername:" }, 306{ "Username:","Benutzername:" },
307{ "Password:","Passwort:" }, 307{ "Password:","Passwort:" },
308{ "&Reveal","&Offen zeigen" }, 308{ "&Reveal","&Offen zeigen" },
309{ "&Generate","&Generiere" }, 309{ "&Generate","&Generiere" },
310{ "&Password","&Passwort" }, 310{ "&Password","&Passwort" },
311{ "&Comments","Kommentare" }, 311{ "&Comments","Kommentar" },
312{ "Launcher:","Launcher:" }, 312{ "Launcher:","Launcher:" },
313{ "$d = Description","$d = Beschreibung" }, 313{ "$d = Description","$d = Beschreibung" },
314{ "$n = Username","$n = Benutzername" }, 314{ "$n = Username","$n = Benutzername" },
315{ "$c = Comment","$c = Kommentar" }, 315{ "$c = Comment","$c = Kommentar" },
316{ "$u = URL","$u = URL" }, 316{ "$u = URL","$u = URL" },
317{ "$p = Password","$p = Passwort" }, 317{ "$p = Password","$p = Passwort" },
318{ "&Launcher","&Launcher" }, 318{ "&Launcher","&Launcher" },
319{ "Password generator","Passwort Generator" }, 319{ "Password generator","Passwort Generator" },
320{ "Character set:","Buchstaben Set:" }, 320{ "Character set:","Buchstaben Set:" },
321{ "Lowercase (abc)","Klein (abc)" }, 321{ "Lowercase (abc)","Klein (abc)" },
322{ "Uppercase (ABC)","Groß (ABC)" }, 322{ "Uppercase (ABC)","Groß (ABC)" },
323{ "Numbers (123)","Nummmern (123)" }, 323{ "Numbers (123)","Nummmern (123)" },
324{ "Special characters:","Spezielle Buchstaben:" }, 324{ "Special characters:","Spezielle Buchstaben:" },
325{ "Spaces (blank characters)","Leerzeichen" }, 325{ "Spaces (blank characters)","Leerzeichen" },
326{ "User defined:","Benutzer definiert:" }, 326{ "User defined:","Benutzer definiert:" },
327{ "Password Length:","Passwort Länge:" }, 327{ "Password Length:","Passwort Länge:" },
328{ "Enable Filtering to get better passwords","Enable Filtering to get better passwords" }, 328{ "Enable Filtering to get better passwords","Enable Filtering to get better passwords" },
329{ "no password","Kein Passwort" }, 329{ "no password","Kein Passwort" },
330{ "Sorry, you haven't set a password.","Sorry, Sie haben kein Passwort angegeben." }, 330{ "Sorry, you haven't set a password.","Sorry, Sie haben kein Passwort angegeben." },
331{ "not saved, yet","not saved, yet" }, 331{ "not saved, yet","not saved, yet" },
332{ "Can't deep-lock, because the document\nhasn't been saved, yet. Please save\nto a file and try again.","Kann nicht tiefsperren, weil das\nDokument noch nicht gespeichert wurde.\nBitte speichern und noch einmal versuchen." }, 332{ "Can't deep-lock, because the document\nhasn't been saved, yet. Please save\nto a file and try again.","Kann nicht tiefsperren, weil das\nDokument noch nicht gespeichert wurde.\nBitte speichern und noch einmal versuchen." },
333{ "Find","Finde" }, 333{ "Find","Finde" },
334{ "&Exact match","Genaue Übereinstimmung" }, 334{ "&Exact match","Genaue Übereinstimmung" },
335{ "&Case sensitive","Großschrift abhängig" }, 335{ "&Case sensitive","Großschrift abhängig" },
336{ "Search in Column","Suche in Spalten" }, 336{ "Search in Column","Suche in Spalten" },
337{ "&Description","Beschreibung" }, 337{ "&Description","Beschreibung" },
338{ "C&omment","Kommentar" }, 338{ "C&omment","Kommentar" },
339{ "&Username","Benutzername" }, 339{ "&Username","Benutzername" },
340{ "U&RL","URL" }, 340{ "U&RL","URL" },
341{ "delete?","Löschen?" }, 341{ "delete?","Löschen?" },
342{ "Do you really want to delete\nthe selected entry","Wollen Sie wirklich\nden Eintrag löschen:" }, 342{ "Do you really want to delete\nthe selected entry","Wollen Sie wirklich\nden Eintrag löschen:" },
343{ "Save?","Speichern?" }, 343{ "Save?","Speichern?" },
344{ ""\nhas been modified.\nDo you want to save it?",""\nwurde geändert.\nMöchten Sie speichern?" }, 344{ ""\nhas been modified.\nDo you want to save it?",""\nwurde geändert.\nMöchten Sie speichern?" },
345{ "The list\n "","Die Liste\n "" }, 345{ "The list\n "","Die Liste\n "" },
346{ "nothing to do","Nichts zu tun" }, 346{ "nothing to do","Nichts zu tun" },
347{ "Sorry, there's nothing to save.\nPlease first add some passwords.","Sorry, es gibt nichts zu speichern.\nBitte erst Passwörter hinzufügen." }, 347{ "Sorry, there's nothing to save.\nPlease first add some passwords.","Sorry, es gibt nichts zu speichern.\nBitte erst Passwörter hinzufügen." },
348{ "","" }, 348{ "Add new password","Passwort hinzufügen" },
349{ "Successfully saved data.","Datei gespeichert." },
349{ "","" }, 350{ "","" },
350{ "","" }, 351{ "","" },
351{ "","" }, 352{ "","" },
352{ "","" }, 353{ "","" },
353 354
diff --git a/pwmanager/pwmanager/commentbox.cpp b/pwmanager/pwmanager/commentbox.cpp
index 4a76f36..e2d2d2b 100644
--- a/pwmanager/pwmanager/commentbox.cpp
+++ b/pwmanager/pwmanager/commentbox.cpp
@@ -50,49 +50,49 @@ CommentBox::~CommentBox()
50} 50}
51 51
52void CommentBox::clear() 52void CommentBox::clear()
53{ 53{
54 clearText(); 54 clearText();
55 clearHtml(); 55 clearHtml();
56 mode = mode_notSet; 56 mode = mode_notSet;
57 this->hide(); 57 this->hide();
58} 58}
59 59
60void CommentBox::clearText() 60void CommentBox::clearText()
61{ 61{
62 delete_ifnot_null(textDta); 62 delete_ifnot_null(textDta);
63} 63}
64 64
65void CommentBox::clearHtml() 65void CommentBox::clearHtml()
66{ 66{
67 delete_ifnot_null(htmlDta); 67 delete_ifnot_null(htmlDta);
68} 68}
69 69
70void CommentBox::setText(const QString &text) 70void CommentBox::setText(const QString &text)
71{ 71{
72 switchTo(mode_text); 72 switchTo(mode_text);
73 PWM_ASSERT(textDta); 73 PWM_ASSERT(textDta);
74 textDta->setText(i18n("Comment") + ": " + text); 74 textDta->setText( text);
75 if (!textDta->isVisible()) 75 if (!textDta->isVisible())
76 textDta->show(); 76 textDta->show();
77} 77}
78 78
79bool CommentBox::getText(QString *text) 79bool CommentBox::getText(QString *text)
80{ 80{
81 if (mode != mode_text) 81 if (mode != mode_text)
82 return false; 82 return false;
83 PWM_ASSERT(text); 83 PWM_ASSERT(text);
84 if (!textDta) { 84 if (!textDta) {
85 *text = ""; 85 *text = "";
86 return true; 86 return true;
87 } 87 }
88 *text = textDta->text(); 88 *text = textDta->text();
89 return true; 89 return true;
90} 90}
91 91
92void CommentBox::setHtml(QString code) 92void CommentBox::setHtml(QString code)
93{ 93{
94 switchTo(mode_html); 94 switchTo(mode_html);
95 PWM_ASSERT(htmlDta); 95 PWM_ASSERT(htmlDta);
96 if (!HtmlGen::replaceSSDummy(&code)) 96 if (!HtmlGen::replaceSSDummy(&code))
97 printWarn("CommentBox::setHtml(): replaceSSDummy() failed!"); 97 printWarn("CommentBox::setHtml(): replaceSSDummy() failed!");
98 htmlDta->begin(); 98 htmlDta->begin();
@@ -225,49 +225,49 @@ QSize CommentBox::size()
225 225
226//////////////////////////////////////////////////////////////////////// 226////////////////////////////////////////////////////////////////////////
227 227
228#else 228#else
229 229
230CommentBox::CommentBox(QWidget *_parentWidget) 230CommentBox::CommentBox(QWidget *_parentWidget)
231 : QMultiLineEdit(_parentWidget) 231 : QMultiLineEdit(_parentWidget)
232 232
233{ 233{
234 this->setReadOnly(true); 234 this->setReadOnly(true);
235} 235}
236 236
237CommentBox::~CommentBox() 237CommentBox::~CommentBox()
238{ 238{
239} 239}
240 240
241void CommentBox::clear() 241void CommentBox::clear()
242{ 242{
243 this->hide(); 243 this->hide();
244} 244}
245 245
246 246
247void CommentBox::setText(const QString &text) 247void CommentBox::setText(const QString &text)
248{ 248{
249 QMultiLineEdit::setText(i18n("Comment") + ": " + text); 249 QMultiLineEdit::setText( text);
250 if (!this->isVisible()) 250 if (!this->isVisible())
251 this->show(); 251 this->show();
252} 252}
253 253
254bool CommentBox::getText(QString *text) 254bool CommentBox::getText(QString *text)
255{ 255{
256 *text = this->text(); 256 *text = this->text();
257 return true; 257 return true;
258} 258}
259 259
260void CommentBox::setContent(const QString &dta) 260void CommentBox::setContent(const QString &dta)
261{ 261{
262 // if there's no data, hide the comment-box 262 // if there's no data, hide the comment-box
263 if (dta.isEmpty()) { 263 if (dta.isEmpty()) {
264 clear(); 264 clear();
265 return; 265 return;
266 } 266 }
267 267
268 // we assume it's plain text 268 // we assume it's plain text
269 setText(dta); 269 setText(dta);
270} 270}
271 271
272#endif 272#endif
273 273
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 48257ef..fc6837f 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -228,98 +228,106 @@ void PwM::initMenubar()
228 syncManager->fillSyncMenu(); 228 syncManager->fillSyncMenu();
229 229
230#endif 230#endif
231 filePopup = new KPopupMenu(this); 231 filePopup = new KPopupMenu(this);
232 importPopup = new KPopupMenu(filePopup); 232 importPopup = new KPopupMenu(filePopup);
233 exportPopup = new KPopupMenu(filePopup); 233 exportPopup = new KPopupMenu(filePopup);
234 managePopup = new KPopupMenu(this); 234 managePopup = new KPopupMenu(this);
235#ifdef CONFIG_KEYCARD 235#ifdef CONFIG_KEYCARD
236 chipcardPopup = new KPopupMenu(this); 236 chipcardPopup = new KPopupMenu(this);
237#endif // CONFIG_KEYCARD 237#endif // CONFIG_KEYCARD
238 viewPopup = new KPopupMenu(this); 238 viewPopup = new KPopupMenu(this);
239 optionsPopup = new KPopupMenu(this); 239 optionsPopup = new KPopupMenu(this);
240 240
241// "file" popup menu 241// "file" popup menu
242 filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), 242 filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)),
243 i18n("&New"), this, 243 i18n("&New"), this,
244 SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); 244 SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW);
245 filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), 245 filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)),
246 i18n("&Open"), this, 246 i18n("&Open"), this,
247 SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); 247 SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN);
248 filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), 248 filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)),
249 i18n("&Close"), this, 249 i18n("&Close"), this,
250 SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); 250 SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE);
251 filePopup->insertSeparator(); 251 filePopup->insertSeparator();
252 filePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)),
253 i18n("&Add password"), this,
254 SLOT(addPwd_slot()), 0,
255 BUTTON_POPUP_MANAGE_ADD);
256 filePopup->insertSeparator();
252 filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), 257 filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)),
253 i18n("&Save"), this, 258 i18n("&Save"), this,
254 SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); 259 SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE);
255 filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), 260 filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)),
256 i18n("Save &as..."), 261 i18n("Save &as..."),
257 this, SLOT(saveAs_slot()), 0, 262 this, SLOT(saveAs_slot()), 0,
258 BUTTON_POPUP_FILE_SAVEAS); 263 BUTTON_POPUP_FILE_SAVEAS);
259 filePopup->insertSeparator(); 264 filePopup->insertSeparator();
260 // "file/export" popup menu 265 // "file/export" popup menu
261 exportPopup->insertItem(i18n("&Text-file..."), this, 266 exportPopup->insertItem(i18n("&Text-file..."), this,
262 SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); 267 SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT);
263 exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, 268 exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
264 SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); 269 SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN);
265 exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, 270 exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
266 SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV); 271 SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV);
267#ifdef CONFIG_KWALLETIF 272#ifdef CONFIG_KWALLETIF
268 exportPopup->insertItem(i18n("&KWallet..."), this, 273 exportPopup->insertItem(i18n("&KWallet..."), this,
269 SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); 274 SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET);
270#endif 275#endif
271 filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), 276 filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)),
272 i18n("E&xport"), exportPopup, 277 i18n("E&xport"), exportPopup,
273 BUTTON_POPUP_FILE_EXPORT); 278 BUTTON_POPUP_FILE_EXPORT);
274 // "file/import" popup menu 279 // "file/import" popup menu
275 importPopup->insertItem(i18n("&Text-file..."), this, 280 importPopup->insertItem(i18n("&Text-file..."), this,
276 SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT); 281 SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT);
277 importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, 282 importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
278 SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN); 283 SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN);
279 importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, 284 importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
280 SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV); 285 SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV);
281#ifdef CONFIG_KWALLETIF 286#ifdef CONFIG_KWALLETIF
282 importPopup->insertItem(i18n("&KWallet..."), this, 287 importPopup->insertItem(i18n("&KWallet..."), this,
283 SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); 288 SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET);
284#endif 289#endif
285 filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), 290 filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)),
286 i18n("I&mport"), importPopup, 291 i18n("I&mport"), importPopup,
287 BUTTON_POPUP_FILE_IMPORT); 292 BUTTON_POPUP_FILE_IMPORT);
288 filePopup->insertSeparator(); 293 filePopup->insertSeparator();
294#if 0
289 filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), 295 filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)),
290 i18n("&Print..."), this, 296 i18n("&Print..."), this,
291 SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); 297 SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT);
292 filePopup->insertSeparator(); 298 filePopup->insertSeparator();
299#endif
293 filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)), 300 filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)),
294 i18n("&Quit"), this, 301 i18n("&Quit"), this,
295 SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT); 302 SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT);
296 menuBar()->insertItem(i18n("&File"), filePopup); 303 menuBar()->insertItem(i18n("&File"), filePopup);
297// "manage" popup menu 304// "manage" popup menu
298 managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)), 305 managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)),
299 i18n("&Add password"), this, 306 i18n("&Add password"), this,
300 SLOT(addPwd_slot()), 0, 307 SLOT(addPwd_slot()), 0,
301 BUTTON_POPUP_MANAGE_ADD); 308 BUTTON_POPUP_MANAGE_ADD);
309 managePopup->insertSeparator();
302 managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)), 310 managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)),
303 i18n("&Edit"), this, SLOT(editPwd_slot()), 0, 311 i18n("&Edit"), this, SLOT(editPwd_slot()), 0,
304 BUTTON_POPUP_MANAGE_EDIT); 312 BUTTON_POPUP_MANAGE_EDIT);
305 managePopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), 313 managePopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)),
306 i18n("&Delete"), this, SLOT(deletePwd_slot()), 314 i18n("&Delete"), this, SLOT(deletePwd_slot()),
307 0, BUTTON_POPUP_MANAGE_DEL); 315 0, BUTTON_POPUP_MANAGE_DEL);
308 managePopup->insertSeparator(); 316 managePopup->insertSeparator();
309 managePopup->insertItem(QIconSet(picons->loadIcon("rotate", KIcon::Small)), 317 managePopup->insertItem(QIconSet(picons->loadIcon("rotate", KIcon::Small)),
310 i18n("Change &Master Password"), this, 318 i18n("Change &Master Password"), this,
311 SLOT(changeMasterPwd_slot()), 0, 319 SLOT(changeMasterPwd_slot()), 0,
312 BUTTON_POPUP_MANAGE_CHANGEMP); 320 BUTTON_POPUP_MANAGE_CHANGEMP);
313 menuBar()->insertItem(i18n("&Manage"), managePopup); 321 menuBar()->insertItem(i18n("&Manage"), managePopup);
314// "chipcard" popup menu 322// "chipcard" popup menu
315#ifdef CONFIG_KEYCARD 323#ifdef CONFIG_KEYCARD
316 chipcardPopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), 324 chipcardPopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)),
317 i18n("&Generate new key-card"), this, 325 i18n("&Generate new key-card"), this,
318 SLOT(genNewCard_slot()), 0, 326 SLOT(genNewCard_slot()), 0,
319 BUTTON_POPUP_CHIPCARD_GENNEW); 327 BUTTON_POPUP_CHIPCARD_GENNEW);
320 chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), 328 chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)),
321 i18n("&Erase key-card"), this, 329 i18n("&Erase key-card"), this,
322 SLOT(eraseCard_slot()), 0, 330 SLOT(eraseCard_slot()), 0,
323 BUTTON_POPUP_CHIPCARD_DEL); 331 BUTTON_POPUP_CHIPCARD_DEL);
324 chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)), 332 chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)),
325 i18n("Read card-&ID"), this, 333 i18n("Read card-&ID"), this,
@@ -393,87 +401,91 @@ void PwM::initMenubar()
393 401
394 helpPopup->insertItem(i18n("&Sync HowTo"), this, 402 helpPopup->insertItem(i18n("&Sync HowTo"), this,
395 SLOT(syncHowTo_slot()), 0, 403 SLOT(syncHowTo_slot()), 0,
396 BUTTON_POPUP_HELP_SYNC); 404 BUTTON_POPUP_HELP_SYNC);
397 405
398 helpPopup->insertItem(i18n("&What's New"), this, 406 helpPopup->insertItem(i18n("&What's New"), this,
399 SLOT(whatsnew_slot()), 0, 407 SLOT(whatsnew_slot()), 0,
400 BUTTON_POPUP_HELP_WHATSNEW); 408 BUTTON_POPUP_HELP_WHATSNEW);
401 409
402#endif 410#endif
403 menuBar()->insertItem(i18n("&Help"), helpPopup); 411 menuBar()->insertItem(i18n("&Help"), helpPopup);
404 412
405} 413}
406 414
407void PwM::initToolbar() 415void PwM::initToolbar()
408{ 416{
409 KIconLoader* picons; 417 KIconLoader* picons;
410#ifndef PWM_EMBEDDED 418#ifndef PWM_EMBEDDED
411 KIconLoader icons; 419 KIconLoader icons;
412 picons = &icons; 420 picons = &icons;
413#else 421#else
414 picons = KGlobal::iconLoader(); 422 picons = KGlobal::iconLoader();
415#endif 423#endif
416 424
417#ifdef PWM_EMBEDDED 425#if 0
418 if ( QApplication::desktop()->width() > 320 )
419#endif
420 {
421 toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar), 426 toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar),
422 BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this, 427 BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this,
423 SLOT(new_slot()), true, i18n("New")); 428 SLOT(new_slot()), true, i18n("New"));
429#endif
424 toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar), 430 toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar),
425 BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this, 431 BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this,
426 SLOT(open_slot()), true, i18n("Open")); 432 SLOT(open_slot()), true, i18n("Open"));
433 toolBar()->insertButton(picons->loadIcon("pencil", KIcon::Toolbar),
434 BUTTON_TOOL_ADD, SIGNAL(clicked(int)), this,
435 SLOT(addPwd_slot()), true,
436 i18n("Add password"));
437 toolBar()->insertSeparator();
438
439 toolBar()->insertButton(picons->loadIcon("find", KIcon::Toolbar),
440 BUTTON_TOOL_FIND, SIGNAL(clicked(int)), this,
441 SLOT(find_slot()), true, i18n("Find entry"));
427 toolBar()->insertSeparator(); 442 toolBar()->insertSeparator();
428 }
429 toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar), 443 toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar),
430 BUTTON_TOOL_SAVE, SIGNAL(clicked(int)), this, 444 BUTTON_TOOL_SAVE, SIGNAL(clicked(int)), this,
431 SLOT(save_slot()), true, i18n("Save")); 445 SLOT(save_slot()), true, i18n("Save"));
446#if 0
432 toolBar()->insertButton(picons->loadIcon("filesaveas", KIcon::Toolbar), 447 toolBar()->insertButton(picons->loadIcon("filesaveas", KIcon::Toolbar),
433 BUTTON_TOOL_SAVEAS, SIGNAL(clicked(int)), this, 448 BUTTON_TOOL_SAVEAS, SIGNAL(clicked(int)), this,
434 SLOT(saveAs_slot()), true, i18n("Save as")); 449 SLOT(saveAs_slot()), true, i18n("Save as"));
450#endif
451
452
453#if 0
435 toolBar()->insertButton(picons->loadIcon("fileprint", KIcon::Toolbar), 454 toolBar()->insertButton(picons->loadIcon("fileprint", KIcon::Toolbar),
436 BUTTON_TOOL_PRINT, SIGNAL(clicked(int)), this, 455 BUTTON_TOOL_PRINT, SIGNAL(clicked(int)), this,
437 SLOT(print_slot()), true, i18n("Print...")); 456 SLOT(print_slot()), true, i18n("Print..."));
457#endif
438 toolBar()->insertSeparator(); 458 toolBar()->insertSeparator();
439 toolBar()->insertButton(picons->loadIcon("pencil", KIcon::Toolbar),
440 BUTTON_TOOL_ADD, SIGNAL(clicked(int)), this,
441 SLOT(addPwd_slot()), true,
442 i18n("Add password"));
443 toolBar()->insertButton(picons->loadIcon("edit", KIcon::Toolbar), 459 toolBar()->insertButton(picons->loadIcon("edit", KIcon::Toolbar),
444 BUTTON_TOOL_EDIT, SIGNAL(clicked(int)), this, 460 BUTTON_TOOL_EDIT, SIGNAL(clicked(int)), this,
445 SLOT(editPwd_slot()), true, 461 SLOT(editPwd_slot()), true,
446 i18n("Edit password")); 462 i18n("Edit password"));
447 toolBar()->insertButton(picons->loadIcon("editdelete", KIcon::Toolbar), 463 toolBar()->insertButton(picons->loadIcon("editdelete", KIcon::Toolbar),
448 BUTTON_TOOL_DEL, SIGNAL(clicked(int)), this, 464 BUTTON_TOOL_DEL, SIGNAL(clicked(int)), this,
449 SLOT(deletePwd_slot()), true, 465 SLOT(deletePwd_slot()), true,
450 i18n("Delete password")); 466 i18n("Delete password"));
451 toolBar()->insertSeparator(); 467 toolBar()->insertSeparator();
452 toolBar()->insertButton(picons->loadIcon("find", KIcon::Toolbar),
453 BUTTON_TOOL_FIND, SIGNAL(clicked(int)), this,
454 SLOT(find_slot()), true, i18n("Find entry"));
455 toolBar()->insertSeparator();
456 toolBar()->insertButton(picons->loadIcon("halfencrypted", KIcon::Toolbar), 468 toolBar()->insertButton(picons->loadIcon("halfencrypted", KIcon::Toolbar),
457 BUTTON_TOOL_LOCK, SIGNAL(clicked(int)), this, 469 BUTTON_TOOL_LOCK, SIGNAL(clicked(int)), this,
458 SLOT(lockWnd_slot()), true, 470 SLOT(lockWnd_slot()), true,
459 i18n("Lock all entries")); 471 i18n("Lock all entries"));
460 toolBar()->insertButton(picons->loadIcon("encrypted", KIcon::Toolbar), 472 toolBar()->insertButton(picons->loadIcon("encrypted", KIcon::Toolbar),
461 BUTTON_TOOL_DEEPLOCK, SIGNAL(clicked(int)), this, 473 BUTTON_TOOL_DEEPLOCK, SIGNAL(clicked(int)), this,
462 SLOT(deepLockWnd_slot()), true, 474 SLOT(deepLockWnd_slot()), true,
463 i18n("Deep-Lock all entries")); 475 i18n("Deep-Lock all entries"));
464 toolBar()->insertButton(picons->loadIcon("decrypted", KIcon::Toolbar), 476 toolBar()->insertButton(picons->loadIcon("decrypted", KIcon::Toolbar),
465 BUTTON_TOOL_UNLOCK, SIGNAL(clicked(int)), this, 477 BUTTON_TOOL_UNLOCK, SIGNAL(clicked(int)), this,
466 SLOT(unlockWnd_slot()), true, 478 SLOT(unlockWnd_slot()), true,
467 i18n("Unlock all entries")); 479 i18n("Unlock all entries"));
468} 480}
469 481
470void PwM::initMetrics() 482void PwM::initMetrics()
471{ 483{
472 QSize s = conf()->confWndMainWndSize(); 484 QSize s = conf()->confWndMainWndSize();
473 if (s.isValid()) 485 if (s.isValid())
474 resize(s); 486 resize(s);
475 else 487 else
476 resize(DEFAULT_SIZE); 488 resize(DEFAULT_SIZE);
477} 489}
478 490
479void PwM::updateCaption() 491void PwM::updateCaption()
@@ -614,49 +626,49 @@ bool PwM::saveAs()
614 return true; 626 return true;
615} 627}
616 628
617//US ENH : changed code to run with older MOC 629//US ENH : changed code to run with older MOC
618void PwM::addPwd_slot() 630void PwM::addPwd_slot()
619{ 631{
620 addPwd_slot1(0, 0); 632 addPwd_slot1(0, 0);
621} 633}
622 634
623void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc) 635void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc)
624{ 636{
625 PwMDoc *doc; 637 PwMDoc *doc;
626 if (_doc) { 638 if (_doc) {
627 doc = _doc; 639 doc = _doc;
628 } else { 640 } else {
629 doc = curDoc(); 641 doc = curDoc();
630 } 642 }
631 PWM_ASSERT(doc); 643 PWM_ASSERT(doc);
632 doc->timer()->getLock(DocTimer::id_autoLockTimer); 644 doc->timer()->getLock(DocTimer::id_autoLockTimer);
633#ifndef PWM_EMBEDDED 645#ifndef PWM_EMBEDDED
634 AddEntryWndImpl w; 646 AddEntryWndImpl w;
635#else 647#else
636 AddEntryWndImpl w(doc, this, "addentrywndimpl"); 648 AddEntryWndImpl w(doc, this, "addentrywndimpl");
637#endif 649#endif
638 650 w.setCaption( i18n ("Add new password") );
639 vector<string> catList; 651 vector<string> catList;
640 doc->getCategoryList(&catList); 652 doc->getCategoryList(&catList);
641 unsigned i, size = catList.size(); 653 unsigned i, size = catList.size();
642 for (i = 0; i < size; ++i) { 654 for (i = 0; i < size; ++i) {
643 w.addCategory(catList[i].c_str()); 655 w.addCategory(catList[i].c_str());
644 } 656 }
645 w.setCurrCategory(view->getCurrentCategory()); 657 w.setCurrCategory(view->getCurrentCategory());
646 if (pw) 658 if (pw)
647 w.pwLineEdit->setText(*pw); 659 w.pwLineEdit->setText(*pw);
648 660
649 tryAgain: 661 tryAgain:
650 if (w.exec() == 1) 662 if (w.exec() == 1)
651 { 663 {
652 PwMDataItem d; 664 PwMDataItem d;
653 665
654 //US BUG: to initialize all values of curEntr with meaningfulldata, 666 //US BUG: to initialize all values of curEntr with meaningfulldata,
655 // we call clear on it. Reason: Metadata will be uninitialized otherwise. 667 // we call clear on it. Reason: Metadata will be uninitialized otherwise.
656 // another option would be to create a constructor for PwMDataItem 668 // another option would be to create a constructor for PwMDataItem
657 d.clear(true); 669 d.clear(true);
658 670
659 d.desc = w.getDescription().latin1(); 671 d.desc = w.getDescription().latin1();
660 d.name = w.getUsername().latin1(); 672 d.name = w.getUsername().latin1();
661 d.pw = w.getPassword().latin1(); 673 d.pw = w.getPassword().latin1();
662 d.comment = w.getComment().latin1(); 674 d.comment = w.getComment().latin1();
@@ -712,48 +724,49 @@ void PwM::editPwd_slot3(const QString *category, const int *index,
712 unsigned int curEntryIndex; 724 unsigned int curEntryIndex;
713 if (index) { 725 if (index) {
714 curEntryIndex = *index; 726 curEntryIndex = *index;
715 } else { 727 } else {
716 if (!(view->getCurEntryIndex(&curEntryIndex))) { 728 if (!(view->getCurEntryIndex(&curEntryIndex))) {
717 printDebug("couldn't get index. Maybe we have a binary entry here."); 729 printDebug("couldn't get index. Maybe we have a binary entry here.");
718 doc->timer()->putLock(DocTimer::id_autoLockTimer); 730 doc->timer()->putLock(DocTimer::id_autoLockTimer);
719 return; 731 return;
720 } 732 }
721 } 733 }
722 QString curCategory; 734 QString curCategory;
723 if (category) { 735 if (category) {
724 curCategory = *category; 736 curCategory = *category;
725 } else { 737 } else {
726 curCategory = view->getCurrentCategory(); 738 curCategory = view->getCurrentCategory();
727 } 739 }
728 PwMDataItem currItem; 740 PwMDataItem currItem;
729 if (!doc->getEntry(curCategory, curEntryIndex, &currItem, true)) { 741 if (!doc->getEntry(curCategory, curEntryIndex, &currItem, true)) {
730 doc->timer()->putLock(DocTimer::id_autoLockTimer); 742 doc->timer()->putLock(DocTimer::id_autoLockTimer);
731 return; 743 return;
732 } 744 }
733 BUG_ON(currItem.binary); 745 BUG_ON(currItem.binary);
734 746
735 AddEntryWndImpl w(doc); 747 AddEntryWndImpl w(doc);
748 w.setCaption( i18n ("Edit password") );
736 vector<string> catList; 749 vector<string> catList;
737 doc->getCategoryList(&catList); 750 doc->getCategoryList(&catList);
738 unsigned i, size = catList.size(); 751 unsigned i, size = catList.size();
739 for (i = 0; i < size; ++i) { 752 for (i = 0; i < size; ++i) {
740 w.addCategory(catList[i].c_str()); 753 w.addCategory(catList[i].c_str());
741 } 754 }
742 w.setCurrCategory(curCategory); 755 w.setCurrCategory(curCategory);
743 w.setDescription(currItem.desc.c_str()); 756 w.setDescription(currItem.desc.c_str());
744 w.setUsername(currItem.name.c_str()); 757 w.setUsername(currItem.name.c_str());
745 w.setPassword(currItem.pw.c_str()); 758 w.setPassword(currItem.pw.c_str());
746 w.setUrl(currItem.url.c_str()); 759 w.setUrl(currItem.url.c_str());
747 w.setLauncher(currItem.launcher.c_str()); 760 w.setLauncher(currItem.launcher.c_str());
748 w.setComment(currItem.comment.c_str()); 761 w.setComment(currItem.comment.c_str());
749 if (w.exec() == 1) { 762 if (w.exec() == 1) {
750 currItem.desc = w.getDescription().latin1(); 763 currItem.desc = w.getDescription().latin1();
751 currItem.name = w.getUsername().latin1(); 764 currItem.name = w.getUsername().latin1();
752 currItem.pw = w.getPassword().latin1(); 765 currItem.pw = w.getPassword().latin1();
753 currItem.comment = w.getComment().latin1(); 766 currItem.comment = w.getComment().latin1();
754 currItem.url = w.getUrl().latin1(); 767 currItem.url = w.getUrl().latin1();
755 currItem.launcher = w.getLauncher().latin1(); 768 currItem.launcher = w.getLauncher().latin1();
756 if (!doc->editEntry(curCategory, w.getCategory(), 769 if (!doc->editEntry(curCategory, w.getCategory(),
757 curEntryIndex, &currItem)) { 770 curEntryIndex, &currItem)) {
758 KMessageBox::error(this, 771 KMessageBox::error(this,
759 i18n("Couldn't edit the entry.\n" 772 i18n("Couldn't edit the entry.\n"