summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show 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,50 +1,50 @@
{ " Local Time","Ortszeit" },
-{ "Default","Voreinstellungen" },
+{ "Default","Default" },
{ "Configure...","Konfigurieren..." },
{ "Remove sync info","Entferne Sync Info" },
{ "For all profiles","Für alle Profile" },
{ "Enable Pi-Sync","Aktiviere Pi-Sync" },
{ "Multiple sync","Multi Sync" },
{ "&Save","&Speichern" },
{ "&Print...","Drucken..." },
{ "&File","Datei" },
{ "&Edit","Bearbeite" },
{ "&View","Ansicht" },
{ "&Help","Hilfe" },
{ "Description","Beschreibungen" },
{ "URL","URL" },
{ "Name:","Name:" },
{ "Documents","Dokumente" },
{ "Files","Dateien" },
{ "All Files","Alle Dateien" },
{ "Name","Name" },
{ "Size","Größe" },
{ "Date","Datum" },
{ "Mime Type","Mime Typ" },
{ "Ok","Ok" },
{ "Cancel","Abbrechen" },
{ "1","1" },
{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile" },
{ "Local device name:","Name dieses Gerätes:" },
{ "New profile","Neues Profil" },
{ "Clone profile","Klone Profil" },
{ "Delete profile","Lösche Profil" },
{ "Profile:","Profil:" },
{ "Multiple Sync options","Multi Sync Optionen" },
{ "Include in multiple ","Beziehe in mehrfach " },
{ "calendar ","Kalender " },
{ "addressbook ","Adressbuch " },
{ "pwmanager","PWmanager" },
{ " sync"," Sync ein" },
{ "Sync algo options","Sync Ablauf Optionen" },
{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" },
{ "Sync preferences","Synchronisations Einstellungen" },
{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" },
{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" },
{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" },
{ "Ask for every entry on conflict","Frage bei Konflikten nach" },
{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" },
{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" },
{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" },
{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
@@ -263,91 +263,92 @@
{ "Font:","Schriftart:" },
{ "Compression:","Kompression:" },
{ "gzip","gzip" },
{ "Encryption:","Verschlüsselung:" },
{ "Blowfish (128 bit)","Blowfish (128 bit)" },
{ "AES-128, Rijndael (128 bit)","AES-128, Rijndael (128 bit)" },
{ "AES-192, Rijndael (192 bit)","AES-192, Rijndael (192 bit)" },
{ "AES-256, Rijndael (256 bit)","AES-256, Rijndael (256 bit)" },
{ "Triple-DES (168 bit)","Triple-DES (168 bit)" },
{ "Twofish (256 bit)","Twofish (256 bit)" },
{ "Twofish-128 (128 bit)","Twofish-128 (128 bit)" },
{ "Hashing:","Hashing:" },
{ "SHA-160, SHA1 (160 bit)","SHA-160, SHA1 (160 bit)" },
{ "SHA-256 (256 bit)","SHA-256 (256 bit)" },
{ "SHA-384 (384 bit)","SHA-384 (384 bit)" },
{ "SHA-512 (512 bit)","SHA-512 (512 bit)" },
{ "MD5 (128 bit)","MD5 (128 bit)" },
{ "RIPE-MD-160 (160 bit)","RIPE-MD-160 (160 bit)" },
{ "Tiger (192 bit)","Tiger (192 bit)" },
{ "Permissions:","Zugriffsrechte:" },
{ "Make backup before saving","Mache Backup vor dem Speichern" },
{ "Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:","Passwort Timeout\n(Timeout um das Passwort\nim Speicher zu halten,\nso dass es nicht noch mal\neingegeben werden muß.)\n[Setze auf 0 zum deaktivieren]:" },
{ "Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:","(Total-)Sperr-Timeout\n(Sperre Dokument total nach\ndieser Anzahl Sekunden)\n[Setze auf 0 zum deaktivieren]:" },
{ "deep-lock on autolock","Sperre total beim Sperr-Timeout" },
{ "open deeplocked","Öffne total gesperrt" },
{ "Favourite browser:","Bevorzugter Browser:" },
{ "Favourite x-terminal:","Bevorzugtes x-terminal:" },
{ "Open document with passwords unlocked","Öffne Dokument mit Passwort ungesperrt" },
{ "Look && feel","Aussehen" },
{ "File","Datei" },
{ "Timeout","Timeout" },
{ "Autostart","Autostart" },
{ "External apps","Externe Applik." },
{ "Miscellaneous","Verschiedenes" },
{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" },
{ "edit category descriptions","Ändere Label für Kategorie" },
{ "Close","Schließen" },
{ "Category:","Category:" },
{ "Text1 (Description):","Text1 (Beschreibung):" },
{ "Text2 (Username):","Text2 (Benutzername):" },
{ "Text3 (Password):","Text3 (Passwort):" },
{ "edit/add a password entry","Ändere/hinzufüge Passwort Eintrag" },
{ "Description:","Beschreibung:" },
{ "Username:","Benutzername:" },
{ "Password:","Passwort:" },
{ "&Reveal","&Offen zeigen" },
{ "&Generate","&Generiere" },
{ "&Password","&Passwort" },
-{ "&Comments","Kommentare" },
+{ "&Comments","Kommentar" },
{ "Launcher:","Launcher:" },
{ "$d = Description","$d = Beschreibung" },
{ "$n = Username","$n = Benutzername" },
{ "$c = Comment","$c = Kommentar" },
{ "$u = URL","$u = URL" },
{ "$p = Password","$p = Passwort" },
{ "&Launcher","&Launcher" },
{ "Password generator","Passwort Generator" },
{ "Character set:","Buchstaben Set:" },
{ "Lowercase (abc)","Klein (abc)" },
{ "Uppercase (ABC)","Groß (ABC)" },
{ "Numbers (123)","Nummmern (123)" },
{ "Special characters:","Spezielle Buchstaben:" },
{ "Spaces (blank characters)","Leerzeichen" },
{ "User defined:","Benutzer definiert:" },
{ "Password Length:","Passwort Länge:" },
{ "Enable Filtering to get better passwords","Enable Filtering to get better passwords" },
{ "no password","Kein Passwort" },
{ "Sorry, you haven't set a password.","Sorry, Sie haben kein Passwort angegeben." },
{ "not saved, yet","not saved, yet" },
{ "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." },
{ "Find","Finde" },
{ "&Exact match","Genaue Übereinstimmung" },
{ "&Case sensitive","Großschrift abhängig" },
{ "Search in Column","Suche in Spalten" },
{ "&Description","Beschreibung" },
{ "C&omment","Kommentar" },
{ "&Username","Benutzername" },
{ "U&RL","URL" },
{ "delete?","Löschen?" },
{ "Do you really want to delete\nthe selected entry","Wollen Sie wirklich\nden Eintrag löschen:" },
{ "Save?","Speichern?" },
{ ""\nhas been modified.\nDo you want to save it?",""\nwurde geändert.\nMöchten Sie speichern?" },
{ "The list\n "","Die Liste\n "" },
{ "nothing to do","Nichts zu tun" },
{ "Sorry, there's nothing to save.\nPlease first add some passwords.","Sorry, es gibt nichts zu speichern.\nBitte erst Passwörter hinzufügen." },
-{ "","" },
+{ "Add new password","Passwort hinzufügen" },
+{ "Successfully saved data.","Datei gespeichert." },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
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
@@ -26,97 +26,97 @@
#ifndef PWM_EMBEDDED
#include <khtml_part.h>
#include <khtmlview.h>
#include <qtextedit.h>
#else
#include <qmultilineedit.h>
#endif
#ifndef PWM_EMBEDDED
CommentBox::CommentBox(QWidget *_parentWidget)
{
PWM_ASSERT(_parentWidget);
parentWidget = _parentWidget;
textDta = 0;
htmlDta = 0;
mode = mode_notSet;
}
CommentBox::~CommentBox()
{
clearText();
clearHtml();
}
void CommentBox::clear()
{
clearText();
clearHtml();
mode = mode_notSet;
this->hide();
}
void CommentBox::clearText()
{
delete_ifnot_null(textDta);
}
void CommentBox::clearHtml()
{
delete_ifnot_null(htmlDta);
}
void CommentBox::setText(const QString &text)
{
switchTo(mode_text);
PWM_ASSERT(textDta);
- textDta->setText(i18n("Comment") + ": " + text);
+ textDta->setText( text);
if (!textDta->isVisible())
textDta->show();
}
bool CommentBox::getText(QString *text)
{
if (mode != mode_text)
return false;
PWM_ASSERT(text);
if (!textDta) {
*text = "";
return true;
}
*text = textDta->text();
return true;
}
void CommentBox::setHtml(QString code)
{
switchTo(mode_html);
PWM_ASSERT(htmlDta);
if (!HtmlGen::replaceSSDummy(&code))
printWarn("CommentBox::setHtml(): replaceSSDummy() failed!");
htmlDta->begin();
htmlDta->write(code);
htmlDta->end();
htmlDta->show();
}
void CommentBox::setContent(const QString &dta)
{
// if there's no data, hide the comment-box
if (dta.isEmpty()) {
clear();
return;
}
if (HtmlGen::isHtml(dta)) {
setHtml(dta);
return;
}
// we assume it's plain text
setText(dta);
}
void CommentBox::switchTo(commentBoxMode newMode)
{
if (newMode == mode)
return;
@@ -201,81 +201,81 @@ void CommentBox::resize(const QSize &size)
default:
break;
}
}
QSize CommentBox::size()
{
switch (mode) {
case mode_text:
PWM_ASSERT(textDta);
return textDta->size();
break;
case mode_html:
PWM_ASSERT(htmlDta);
return htmlDta->view()->size();
break;
default:
break;
}
return QSize();
}
////////////////////////////////////////////////////////////////////////
#else
CommentBox::CommentBox(QWidget *_parentWidget)
: QMultiLineEdit(_parentWidget)
{
this->setReadOnly(true);
}
CommentBox::~CommentBox()
{
}
void CommentBox::clear()
{
this->hide();
}
void CommentBox::setText(const QString &text)
{
- QMultiLineEdit::setText(i18n("Comment") + ": " + text);
+ QMultiLineEdit::setText( text);
if (!this->isVisible())
this->show();
}
bool CommentBox::getText(QString *text)
{
*text = this->text();
return true;
}
void CommentBox::setContent(const QString &dta)
{
// if there's no data, hide the comment-box
if (dta.isEmpty()) {
clear();
return;
}
// we assume it's plain text
setText(dta);
}
#endif
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
@@ -204,146 +204,154 @@ PwM::~PwM()
//LR closing of windows changed
//needed for fastload option on PDA
//emit closed(this);
//qDebug("PwM::~PwM() emited closed(this)");
delete view;
delete syncManager;
}
void PwM::initMenubar()
{
KIconLoader* picons;
#ifndef PWM_EMBEDDED
KIconLoader icons;
picons = &icons;
#else
picons = KGlobal::iconLoader();
syncPopup = new KPopupMenu(this);
syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup);
syncManager->setBlockSave(false);
connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
syncManager->fillSyncMenu();
#endif
filePopup = new KPopupMenu(this);
importPopup = new KPopupMenu(filePopup);
exportPopup = new KPopupMenu(filePopup);
managePopup = new KPopupMenu(this);
#ifdef CONFIG_KEYCARD
chipcardPopup = new KPopupMenu(this);
#endif // CONFIG_KEYCARD
viewPopup = new KPopupMenu(this);
optionsPopup = new KPopupMenu(this);
// "file" popup menu
filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)),
i18n("&New"), this,
SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW);
filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)),
i18n("&Open"), this,
SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN);
filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)),
i18n("&Close"), this,
SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE);
filePopup->insertSeparator();
+ filePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)),
+ i18n("&Add password"), this,
+ SLOT(addPwd_slot()), 0,
+ BUTTON_POPUP_MANAGE_ADD);
+ filePopup->insertSeparator();
filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)),
i18n("&Save"), this,
SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE);
filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)),
i18n("Save &as..."),
this, SLOT(saveAs_slot()), 0,
BUTTON_POPUP_FILE_SAVEAS);
filePopup->insertSeparator();
// "file/export" popup menu
exportPopup->insertItem(i18n("&Text-file..."), this,
SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT);
exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN);
exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV);
#ifdef CONFIG_KWALLETIF
exportPopup->insertItem(i18n("&KWallet..."), this,
SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET);
#endif
filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)),
i18n("E&xport"), exportPopup,
BUTTON_POPUP_FILE_EXPORT);
// "file/import" popup menu
importPopup->insertItem(i18n("&Text-file..."), this,
SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT);
importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN);
importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV);
#ifdef CONFIG_KWALLETIF
importPopup->insertItem(i18n("&KWallet..."), this,
SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET);
#endif
filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)),
i18n("I&mport"), importPopup,
BUTTON_POPUP_FILE_IMPORT);
filePopup->insertSeparator();
+#if 0
filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)),
i18n("&Print..."), this,
SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT);
filePopup->insertSeparator();
+#endif
filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)),
i18n("&Quit"), this,
SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT);
menuBar()->insertItem(i18n("&File"), filePopup);
// "manage" popup menu
managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)),
i18n("&Add password"), this,
SLOT(addPwd_slot()), 0,
BUTTON_POPUP_MANAGE_ADD);
+ managePopup->insertSeparator();
managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)),
i18n("&Edit"), this, SLOT(editPwd_slot()), 0,
BUTTON_POPUP_MANAGE_EDIT);
managePopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)),
i18n("&Delete"), this, SLOT(deletePwd_slot()),
0, BUTTON_POPUP_MANAGE_DEL);
managePopup->insertSeparator();
managePopup->insertItem(QIconSet(picons->loadIcon("rotate", KIcon::Small)),
i18n("Change &Master Password"), this,
SLOT(changeMasterPwd_slot()), 0,
BUTTON_POPUP_MANAGE_CHANGEMP);
menuBar()->insertItem(i18n("&Manage"), managePopup);
// "chipcard" popup menu
#ifdef CONFIG_KEYCARD
chipcardPopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)),
i18n("&Generate new key-card"), this,
SLOT(genNewCard_slot()), 0,
BUTTON_POPUP_CHIPCARD_GENNEW);
chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)),
i18n("&Erase key-card"), this,
SLOT(eraseCard_slot()), 0,
BUTTON_POPUP_CHIPCARD_DEL);
chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)),
i18n("Read card-&ID"), this,
SLOT(readCardId_slot()), 0,
BUTTON_POPUP_CHIPCARD_READID);
chipcardPopup->insertSeparator();
chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)),
i18n("&Make card backup-image"), this,
SLOT(makeCardBackup_slot()), 0,
BUTTON_POPUP_CHIPCARD_SAVEBACKUP);
chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)),
i18n("&Replay card backup-image"), this,
SLOT(replayCardBackup_slot()), 0,
BUTTON_POPUP_CHIPCARD_REPLAYBACKUP);
menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup);
#endif // CONFIG_KEYCARD
// "view" popup menu
viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)),
i18n("&Find"), this,
SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND);
viewPopup->insertSeparator();
viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)),
i18n("&Lock all entries"), this,
SLOT(lockWnd_slot()), 0,
BUTTON_POPUP_VIEW_LOCK);
viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)),
i18n("&Deep-lock all entries"), this,
@@ -369,135 +377,139 @@ void PwM::initMenubar()
SLOT(category_slot()),0,
BUTTON_POPUP_OPTIONS_CATEGORY);
menuBar()->insertItem(i18n("&Sync"), syncPopup);
helpPopup = new KPopupMenu(this);
helpPopup->insertItem(i18n("&License"), this,
SLOT(showLicense_slot()), 0,
BUTTON_POPUP_HELP_LICENSE);
helpPopup->insertItem(i18n("&Faq"), this,
SLOT(faq_slot()), 0,
BUTTON_POPUP_HELP_FAQ);
helpPopup->insertItem(i18n("&About PwManager"), this,
SLOT(createAboutData_slot()), 0,
BUTTON_POPUP_HELP_ABOUT);
helpPopup->insertItem(i18n("&Sync HowTo"), this,
SLOT(syncHowTo_slot()), 0,
BUTTON_POPUP_HELP_SYNC);
helpPopup->insertItem(i18n("&What's New"), this,
SLOT(whatsnew_slot()), 0,
BUTTON_POPUP_HELP_WHATSNEW);
#endif
menuBar()->insertItem(i18n("&Help"), helpPopup);
}
void PwM::initToolbar()
{
KIconLoader* picons;
#ifndef PWM_EMBEDDED
KIconLoader icons;
picons = &icons;
#else
picons = KGlobal::iconLoader();
#endif
-#ifdef PWM_EMBEDDED
- if ( QApplication::desktop()->width() > 320 )
-#endif
- {
+#if 0
toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar),
BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this,
SLOT(new_slot()), true, i18n("New"));
+#endif
toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar),
BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this,
SLOT(open_slot()), true, i18n("Open"));
+ toolBar()->insertButton(picons->loadIcon("pencil", KIcon::Toolbar),
+ BUTTON_TOOL_ADD, SIGNAL(clicked(int)), this,
+ SLOT(addPwd_slot()), true,
+ i18n("Add password"));
+ toolBar()->insertSeparator();
+
+ toolBar()->insertButton(picons->loadIcon("find", KIcon::Toolbar),
+ BUTTON_TOOL_FIND, SIGNAL(clicked(int)), this,
+ SLOT(find_slot()), true, i18n("Find entry"));
toolBar()->insertSeparator();
- }
toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar),
BUTTON_TOOL_SAVE, SIGNAL(clicked(int)), this,
SLOT(save_slot()), true, i18n("Save"));
+#if 0
toolBar()->insertButton(picons->loadIcon("filesaveas", KIcon::Toolbar),
BUTTON_TOOL_SAVEAS, SIGNAL(clicked(int)), this,
SLOT(saveAs_slot()), true, i18n("Save as"));
+#endif
+
+
+#if 0
toolBar()->insertButton(picons->loadIcon("fileprint", KIcon::Toolbar),
BUTTON_TOOL_PRINT, SIGNAL(clicked(int)), this,
SLOT(print_slot()), true, i18n("Print..."));
+#endif
toolBar()->insertSeparator();
- toolBar()->insertButton(picons->loadIcon("pencil", KIcon::Toolbar),
- BUTTON_TOOL_ADD, SIGNAL(clicked(int)), this,
- SLOT(addPwd_slot()), true,
- i18n("Add password"));
toolBar()->insertButton(picons->loadIcon("edit", KIcon::Toolbar),
BUTTON_TOOL_EDIT, SIGNAL(clicked(int)), this,
SLOT(editPwd_slot()), true,
i18n("Edit password"));
toolBar()->insertButton(picons->loadIcon("editdelete", KIcon::Toolbar),
BUTTON_TOOL_DEL, SIGNAL(clicked(int)), this,
SLOT(deletePwd_slot()), true,
i18n("Delete password"));
toolBar()->insertSeparator();
- toolBar()->insertButton(picons->loadIcon("find", KIcon::Toolbar),
- BUTTON_TOOL_FIND, SIGNAL(clicked(int)), this,
- SLOT(find_slot()), true, i18n("Find entry"));
- toolBar()->insertSeparator();
toolBar()->insertButton(picons->loadIcon("halfencrypted", KIcon::Toolbar),
BUTTON_TOOL_LOCK, SIGNAL(clicked(int)), this,
SLOT(lockWnd_slot()), true,
i18n("Lock all entries"));
toolBar()->insertButton(picons->loadIcon("encrypted", KIcon::Toolbar),
BUTTON_TOOL_DEEPLOCK, SIGNAL(clicked(int)), this,
SLOT(deepLockWnd_slot()), true,
i18n("Deep-Lock all entries"));
toolBar()->insertButton(picons->loadIcon("decrypted", KIcon::Toolbar),
BUTTON_TOOL_UNLOCK, SIGNAL(clicked(int)), this,
SLOT(unlockWnd_slot()), true,
i18n("Unlock all entries"));
}
void PwM::initMetrics()
{
QSize s = conf()->confWndMainWndSize();
if (s.isValid())
resize(s);
else
resize(DEFAULT_SIZE);
}
void PwM::updateCaption()
{
setPlainCaption(curDoc()->getTitle() + " - " PROG_NAME " " PACKAGE_VER);
}
void PwM::hideEvent(QHideEvent *)
{
if (isMinimized()) {
if (init->tray()) {
forceMinimizeToTray = true;
close();
}
int mmlock = conf()->confGlobMinimizeLock();
switch (mmlock) {
case 0: // don't lock anything
break;
case 1: { // normal lock
curDoc()->lockAll(true);
break;
} case 2: { // deep-lock
curDoc()->deepLock();
break;
} default:
WARN();
}
@@ -590,97 +602,97 @@ void PwM::save_slot()
{
save();
}
bool PwM::save()
{
if (!curDoc()->saveDocUi(curDoc()))
return false;
showStatMsg(i18n("Successfully saved data."));
updateCaption();
return true;
}
void PwM::saveAs_slot()
{
saveAs();
}
bool PwM::saveAs()
{
if (!curDoc()->saveAsDocUi(curDoc()))
return false;
showStatMsg(i18n("Successfully saved data."));
updateCaption();
return true;
}
//US ENH : changed code to run with older MOC
void PwM::addPwd_slot()
{
addPwd_slot1(0, 0);
}
void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc)
{
PwMDoc *doc;
if (_doc) {
doc = _doc;
} else {
doc = curDoc();
}
PWM_ASSERT(doc);
doc->timer()->getLock(DocTimer::id_autoLockTimer);
#ifndef PWM_EMBEDDED
AddEntryWndImpl w;
#else
AddEntryWndImpl w(doc, this, "addentrywndimpl");
#endif
-
+ w.setCaption( i18n ("Add new password") );
vector<string> catList;
doc->getCategoryList(&catList);
unsigned i, size = catList.size();
for (i = 0; i < size; ++i) {
w.addCategory(catList[i].c_str());
}
w.setCurrCategory(view->getCurrentCategory());
if (pw)
w.pwLineEdit->setText(*pw);
tryAgain:
if (w.exec() == 1)
{
PwMDataItem d;
//US BUG: to initialize all values of curEntr with meaningfulldata,
// we call clear on it. Reason: Metadata will be uninitialized otherwise.
// another option would be to create a constructor for PwMDataItem
d.clear(true);
d.desc = w.getDescription().latin1();
d.name = w.getUsername().latin1();
d.pw = w.getPassword().latin1();
d.comment = w.getComment().latin1();
d.url = w.getUrl().latin1();
d.launcher = w.getLauncher().latin1();
PwMerror ret = doc->addEntry(w.getCategory(), &d);
if (ret == e_entryExists) {
KMessageBox::error(this,
i18n
("An entry with this \"Description\",\n"
"does already exist.\n"
"Please select another description."),
i18n("entry already exists."));
goto tryAgain;
} else if (ret == e_maxAllowedEntr) {
KMessageBox::error(this, i18n("The maximum possible number of\nentries"
"has been reached.\nYou can't add more entries."),
i18n("maximum number of entries"));
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return;
}
}
setVirgin(false);
doc->timer()->putLock(DocTimer::id_autoLockTimer);
}
//US ENH : changed code to run with older MOC
@@ -688,96 +700,97 @@ void PwM::editPwd_slot()
{
editPwd_slot3(0,0,0);
}
void PwM::editPwd_slot1(const QString *category)
{
editPwd_slot3(category, 0, 0);
}
void PwM::editPwd_slot3(const QString *category, const int *index,
PwMDoc *_doc)
{
PwMDoc *doc;
if (_doc) {
doc = _doc;
} else {
doc = curDoc();
}
PWM_ASSERT(doc);
if (doc->isDocEmpty())
return;
if (doc->isDeepLocked())
return;
doc->timer()->getLock(DocTimer::id_autoLockTimer);
unsigned int curEntryIndex;
if (index) {
curEntryIndex = *index;
} else {
if (!(view->getCurEntryIndex(&curEntryIndex))) {
printDebug("couldn't get index. Maybe we have a binary entry here.");
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return;
}
}
QString curCategory;
if (category) {
curCategory = *category;
} else {
curCategory = view->getCurrentCategory();
}
PwMDataItem currItem;
if (!doc->getEntry(curCategory, curEntryIndex, &currItem, true)) {
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return;
}
BUG_ON(currItem.binary);
AddEntryWndImpl w(doc);
+ w.setCaption( i18n ("Edit password") );
vector<string> catList;
doc->getCategoryList(&catList);
unsigned i, size = catList.size();
for (i = 0; i < size; ++i) {
w.addCategory(catList[i].c_str());
}
w.setCurrCategory(curCategory);
w.setDescription(currItem.desc.c_str());
w.setUsername(currItem.name.c_str());
w.setPassword(currItem.pw.c_str());
w.setUrl(currItem.url.c_str());
w.setLauncher(currItem.launcher.c_str());
w.setComment(currItem.comment.c_str());
if (w.exec() == 1) {
currItem.desc = w.getDescription().latin1();
currItem.name = w.getUsername().latin1();
currItem.pw = w.getPassword().latin1();
currItem.comment = w.getComment().latin1();
currItem.url = w.getUrl().latin1();
currItem.launcher = w.getLauncher().latin1();
if (!doc->editEntry(curCategory, w.getCategory(),
curEntryIndex, &currItem)) {
KMessageBox::error(this,
i18n("Couldn't edit the entry.\n"
"Maybe you changed the category and\n"
"this entry is already present\nin the new "
"category?"),
i18n("couldn't edit entry."));
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return;
}
}
doc->timer()->putLock(DocTimer::id_autoLockTimer);
}
void PwM::deletePwd_slot()
{
PWM_ASSERT(curDoc());
if (curDoc()->isDocEmpty())
return;
if (curDoc()->isDeepLocked())
return;
curDoc()->timer()->getLock(DocTimer::id_autoLockTimer);
unsigned int curEntryIndex = 0;
if (!(view->getCurEntryIndex(&curEntryIndex))) {
printDebug("couldn't get index");
curDoc()->timer()->putLock(DocTimer::id_autoLockTimer);
return;