summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-03 14:48:33 (UTC)
committer zautrix <zautrix>2005-03-03 14:48:33 (UTC)
commita4ea625087ea7213419828e8decdff48ae231968 (patch) (side-by-side diff)
treee29565039694702cdc471e76891b2d6c3ac89294
parent91feaad38e5f81063fa496a4e2988aa791267fd1 (diff)
downloadkdepimpi-a4ea625087ea7213419828e8decdff48ae231968.zip
kdepimpi-a4ea625087ea7213419828e8decdff48ae231968.tar.gz
kdepimpi-a4ea625087ea7213419828e8decdff48ae231968.tar.bz2
VINklumpen
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--bin/kdepim/pwmanager/germantranslation.txt2
-rw-r--r--bin/kdepim/pwmanager/icons16/decrypted.pngbin1009 -> 855 bytes
-rw-r--r--bin/kdepim/pwmanager/icons22/decrypted.pngbin939 -> 1117 bytes
-rw-r--r--pwmanager/pwmanager/addentrywndimpl.cpp1
-rw-r--r--pwmanager/pwmanager/pwm.cpp11
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_0.cpp22
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_1.cpp4
8 files changed, 29 insertions, 15 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 11c50f8..657d1de 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,198 +1,200 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.0.14 ************
Made Passwordmanager PwM/Pi more userfriendly:
-Rearranged some toolbar icons and optimized setting of focus.
+Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
+Fixed bug in KO/Pi todo printing.
+Made Qtopia calendar import possible on desktop .
********** VERSION 2.0.13 ************
Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter.
In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down".
OM/Pi:
Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails.
Added missing German translation.
Added warning if path is specified in local folder settings of account config.
********** VERSION 2.0.12 ************
KO/Pi:
Fixed a bug in todo start/due date handling for non recurring todos with a start and due date.
Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes.
Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer.
Fixed problem in pi-sync mode when wrong password was sent.
OM/Pi:
Fixed a crash when displaying mails with "Show mail as html" was checked in the config.
Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled.
********** VERSION 2.0.11 ************
Fixed some problems in pi-sync mode
(e.g. details of events were not synced properly)
********** VERSION 2.0.10 ************
KO/Pi:
In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view.
This is fixed.
Changed the search dialog a bit to make it more user friendly.
(E.g.: Removed message box about "no items found" and set key focus to search line edit after search).
Added config option to hide the week number in KO/Pi toolbar.
********** VERSION 2.0.9 ************
Made month view icons for multiday events a bit nicer.
Some minor fixes in KO/Pi
(e.g. go to today did not work for new week view properly).
********** VERSION 2.0.8 ************
Fixed a problem in dependency info in the ipk files for the Zaurus.
Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar.
Added a "go today" button to the datepicker.
Added "created" and "last modified" to event/todo viewer (and What'sThis viewer)
and made it configureable to show these values.
Fixed a problem for events (from external iCal files) that do have a duration but no end date.
********** VERSION 2.0.7 ************
Added global application font settings
(for all KDE-Pim/Pi apps) to the general settings.
Fixed a problem in OM/Pi when trying to login to some IMAP servers
(like the IMAP server of Apple: mail.mac.com )
Added recurring todos to KO/Pi.
********** VERSION 2.0.6 ************
Some bugfixes in the pi-sync mode.
Added German translation for pi-sync mode.
KO/Pi:
Made the todolist using alternate background.
Other minor fixes in KO/Pi.
********** VERSION 2.0.5 ************
Bugfixes in KO/Pi.
********** VERSION 2.0.4 ************
KO/Pi:
Fixed problem loading translations for summary/location edit boxes in event/todo editor.
Added a general "select week number" to the toolbar.
Fixed some small problem of the new features introduced in version 2.0.3.
Made it possible to specify one specific category as category color,
if more than one categories are selected.
Fixed a bug in saving colors for categories with non-ascii characters.
(Like, e.g. German Umlauts).
Propably you have to set your colors again for those categories.
********** VERSION 2.0.3 ************
KO/Pi:
Added feature for changing alarm settings for many items at once:
Open list view (or search dialog), select the desired items and choose in
the popup menu: Set alarm for selected...
Added to the event/todo viewer the option to send an email to
all attendees or all selected (with RSVP) attendees.
Made the week-month mode changing in month view faster.
Made month view better useable with keyboard.
Now TAB key jumps to next cell with an event/todo.
Scroll in cell with coursor keys, scroll in time (next week) with
Shift/Control + coursorkeys.
Fixed bug that the todo view flat mode was reset after first view update.
If a todo is displayed closed in the todo view,
it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties.
Added info about the numbers of years to the caption (title) information about a birthday event.
Made completion date in todo editor editable.
Added possibility to save/load templates for journals.
(Which is just a simple "save text to file" or "insert text from file".
********** VERSION 2.0.2 ************
KO/Pi:
Fixed the layout problem of the day label buttons
of the agenda view introduced in version 2.0.1.
Added WhatsThis support for the todo view and the list view.
Added a quite useful feature to the montview.
Just click on the week numbers on the left.
And in the top right corner of month view/agenda view
there is now a "week number quick selector".
(Click on the black triangle).
Made the quite difficult timezone change in KO/Pi easy.
OM/Pi:
Fixed too small icons on desktop.
Fixed non visible icons in mainwindow on Z with fastload enabled.
Added signature file setting to smtp account config.
And the signature can be edited and saved in the edit mail dialog.
That does mean:
Simply edit the signature for the selected smtp account in the
edit new mail dialog and press the "save signature" button there.
Then the signature is saved to the file specified in the smtp account settings.
If there is no file specified, it is saved automatically to the file
kdepim/apps/kopiemail/<accountname>.sig.
********** VERSION 2.0.1 ************
Oooops ... I forgot to test on the Zaurus 5500 ...
Fixed many problems of new (english) strings (and german translations)
introduced in the latest versions, where the text was not fitting on the
240x320 display of the Zaurus 5500.
KO/Pi:
Added a popup menu ( press pen and hold to get popup ) to the agenda view
with many useful items (add event/todo, show next week, two weeks, month, journal).
Added items to the todolist popup menu for:
Display all opened, all closed or all todos flat.
The "flat" view makes is possible to sort all todos after ,e.g., prio or date.
Made the reparenting of todos on the desktop possible via Drag&Drop.
Fixed several bugs in setting the completed datetime for todos.
Added info about completed datetime of todos to the todo viewer.
Now displaying a completed todo (with completed datetime set) in the agenda view
at the time of the completion. Such that now it is possible to see in the agenda view
when what todo was completed.
Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos.
Now the behaviour is:
Setting a parent to complete sets all (sub)childs to complete.
Setting a parent to uncomplete does not change the childs.
Setting a child to uncomplete sets all parent to uncomplete.
Setting a child to complete does not change the parents.
Smart updating and double buffering of the daymatrix.
diff --git a/bin/kdepim/pwmanager/germantranslation.txt b/bin/kdepim/pwmanager/germantranslation.txt
index a63be31..ccc9d83 100644
--- a/bin/kdepim/pwmanager/germantranslation.txt
+++ b/bin/kdepim/pwmanager/germantranslation.txt
@@ -160,197 +160,197 @@
{ "Tuesday","Dienstag" },
{ "Wednesday","Mittwoch" },
{ "Thursday","Donnerstag" },
{ "Friday","Freitag" },
{ "Saturday","Samstag" },
{ "Sunday","Sonntag" },
{ "Daylight end:","Sommerzeit Ende:" },
{ "Time Zone","Zeit Zone" },
{ "Used Mail Client","Benutzter Mail Client" },
{ "Channel:","Channel:" },
{ "Message:","Message:" },
{ "Parameters:","Parameter:" },
{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" },
{ "extra Message:","extra Message:" },
{ "extra Parameters:","extra Parameter:" },
{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" },
{ "External Apps.","Externe Appl." },
{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" },
{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
{ "Save settings","Speichere Einstellungen" },
{ "Save standard","Speichere Standard" },
{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
{ "Data storage path","Daten Speicherpfad" },
{ "Used %1 Client","Benutzer %1 Client" },
{ "No email client installed","Keine Email Client installiert" },
{ "Userdefined email client","Benutzerdef. Email Client" },
{ "OM/Pi email client","OM/Pi Email Client" },
{ "URL:","URL:" },
{ "No","Nein" },
{ "Yes","Ja" },
{ "Untitled","Unbenannt" },
{ "&New","&Neu" },
{ "&Open","&Öffne" },
{ "&Close","Schließen" },
{ "Save &as...","Speichere &als..." },
{ "&Text-file...","&Text-Datei..." },
{ "&Gpasman / Kpasman ...","&Gpasman / Kpasman ..." },
{ "&CSV (Comma Separated Value) ...","&CSV (Komma getrennte Werte) ..." },
{ "E&xport","E&xport" },
{ "I&mport","I&mport" },
{ "&Quit","Beenden" },
{ "&Add password","&Passwort hinzufügen" },
{ "&Delete","Lösche" },
{ "Change &Master Password","Ändere &Master Passwort" },
{ "&Manage","Verwalte" },
{ "&Find","&Finde" },
{ "&Lock all entries","Sperre alle Einträge" },
{ "&Deep-lock all entries","Sperre total alle Einträge" },
{ "&Unlock all entries","Entsperre alle Einträge" },
{ "&Configure...","Konfiguriere..." },
{ "&Options","Konfig" },
{ "C&ategories...","K&ategorien..." },
{ "&Sync","&Sync" },
{ "&License","&Lizenz" },
{ "&Faq","&Faq" },
{ "&About PwManager","Über PwManager" },
{ "&Sync HowTo","&Sync HowTo" },
{ "&What's New","Was ist neu?" },
{ "New","Neu" },
{ "Open","Öffnen" },
{ "Save","Speichern" },
{ "Save as","Speichern als" },
{ "Print...","Drucke..." },
{ "Add password","Passwort hinzufügen" },
{ "Edit password","Passwort ändern" },
{ "Delete password","Passwort löschen" },
{ "Find entry","Finde Eintrag" },
{ "Lock all entries","Sperre alle Einträge" },
{ "Deep-Lock all entries","Sperre total alle Einträge" },
{ "Unlock all entries","Entsperre alle Einträge" },
{ "Categories:","Kategorien:" },
{ "&Rename","&Umbenennen" },
{ "Username","Benutzername" },
{ "Password","Passwort" },
{ "Launcher","Launcher" },
{ "copy password to clipboard","Kopiere Passwort ins Clipboard" },
{ "copy username to clipboard","Kopiere Benutzername ins Clipboard" },
{ "copy description to clipboard","Kopiere Beschreibung ins Clipboard" },
{ "copy url to clipboard","Kopiere URL ins Clipboard" },
{ "copy launcher to clipboard","Kopiere Launcher ins Clipboard" },
{ "copy comment to clipboard","Kopiere Kommentare ins Clipboard" },
{ "Execute "Launcher"",""Launcher" ausführen" },
{ "Go to "URL"","Gehe zu "URL"" },
{ "Ready.","Fertig." },
{ "password filename(*.pwm)","passwort dateiname(*.pwm)" },
{ "File error","Datei Fehler" },
{ "Could not read file!","Kann Datei nicht lesen!" },
{ "Master-password","Master-Passwort" },
{ "Please enter the master-password:","Bitter Master-Passwort eingeben:" },
{ "Wrong master-password!\nPlease try again.","Falsches Master-Passwort!\nBitte erneut versuchen." },
{ "password error","Passwort Fehler" },
{ "Successfully opened file.","Datei erfolgreich geöffnet." },
{ "DEEP-LOCKED","TOTAL-GESPERRT" },
{ "This file is DEEP-LOCKED!\nThat means all data has been encrypted\nand written out to the file. If you want\nto see the entries, please UNLOCK the file.\nWhile unlocking, you will be prompted for the\nmaster-password or the key-card.","Diese Datei ist TOTAL-GESPERRT!\nDas bedeutet, dass alle Daten verschlüsselt\nsind und in die Datei geschrieben wurden.\nWenn Sie die Einträge sehen möchten\nENTSPERREN Sie bitte die Datei.\nZum Entsperren werden Sie nach\ndem Master-Passwort gefragt." },
{ "<LOCKED>","<GESPERRT>" },
{ "To unlock click the icon on the left.","Zum Entsperren auf linkes Icon klicken." },
{ "PwManager","PwManager" },
{ "Window-style:","Window-Stil:" },
{ "Category on top","Kategorien oben" },
{ "Category-list left/top","Kategorien links oben" },
{ "Font for Password entries:","Schrift für Passwort Einträge:" },
{ "Font for Password summary:","Schrift für Passwort Übersicht:" },
{ "Font:","Schriftart:" },
{ "Summary","Übersicht" },
{ "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","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." },
-{ "","" },
+{ "Category:","Kategorie:" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/bin/kdepim/pwmanager/icons16/decrypted.png b/bin/kdepim/pwmanager/icons16/decrypted.png
index a52d790..3777a12 100644
--- a/bin/kdepim/pwmanager/icons16/decrypted.png
+++ b/bin/kdepim/pwmanager/icons16/decrypted.png
Binary files differ
diff --git a/bin/kdepim/pwmanager/icons22/decrypted.png b/bin/kdepim/pwmanager/icons22/decrypted.png
index 2228639..ea770ea 100644
--- a/bin/kdepim/pwmanager/icons22/decrypted.png
+++ b/bin/kdepim/pwmanager/icons22/decrypted.png
Binary files differ
diff --git a/pwmanager/pwmanager/addentrywndimpl.cpp b/pwmanager/pwmanager/addentrywndimpl.cpp
index fa6b6c0..09efd1c 100644
--- a/pwmanager/pwmanager/addentrywndimpl.cpp
+++ b/pwmanager/pwmanager/addentrywndimpl.cpp
@@ -1,220 +1,221 @@
/***************************************************************************
* *
* copyright (C) 2003, 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* Many very good improvements and the original implementations of *
* them came from Matt Scifo <mscifo@o1.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include "addentrywndimpl.h"
#include "pwmexception.h"
#include "pwgenwndimpl.h"
#ifndef PWM_EMBEDDED
#include "advcommeditimpl.h"
#endif
#include "htmlgen.h"
#include <kmessagebox.h>
#include <klocale.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qlayout.h>
#ifndef PWM_EMBEDDED
AddEntryWndImpl::AddEntryWndImpl()
: addEntryWnd( 0, "AddEntryWndImpl", TRUE)
#else
AddEntryWndImpl::AddEntryWndImpl( PwMDoc* doc, QWidget* parent, const char* name)
: addEntryWnd( doc, parent, name)
#endif
{
+ categoryComboBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred ));
#ifndef PWM_EMBEDDED
editAdvCommentButton = 0;
commentTextEdit = 0;
#endif
switchComment(false);
pwGen = new PwGenWndImpl(this);
}
AddEntryWndImpl::~AddEntryWndImpl()
{
#ifndef PWM_EMBEDDED
delete_ifnot_null(editAdvCommentButton);
delete_ifnot_null(commentTextEdit);
#endif
delete pwGen;
}
#ifdef PWM_EMBEDDED
void AddEntryWndImpl::slotOk()
{
slotApply();
if (pwLineEdit->text().isEmpty()) {
KMessageBox::error(this,
i18n("Sorry, you haven't set a password."),
i18n("no password"));
return;
}
if (descLineEdit->text().isEmpty()) {
KMessageBox::error(this,
i18n("You haven't set a \"Description\"."),
i18n("Description not set"));
return;
}
KDialogBase::slotOk();
}
#else
void AddEntryWndImpl::okButton_slot()
{
if (pwLineEdit->text().isEmpty()) {
KMessageBox::error(this,
i18n("Sorry, you haven't set a password."),
i18n("no password"));
return;
}
if (descLineEdit->text().isEmpty()) {
KMessageBox::error(this,
i18n
("You haven't set a \"Description\"."),
i18n("Description not set"));
return;
}
done(1);
}
void AddEntryWndImpl::cancelButton_slot()
{
done(2);
}
#endif
void AddEntryWndImpl::setCurrCategory(const QString &cat)
{
int i, count = categoryComboBox->count();
for (i = 0; i < count; ++i) {
if (categoryComboBox->text(i) == cat) {
categoryComboBox->setCurrentItem(i);
#ifdef PWM_EMBEDDED
categorySelected(cat);
#endif
return;
}
}
BUG();
}
void AddEntryWndImpl::revealButton_slot()
{
if (revealButton->isOn()) {
pwLineEdit->setEchoMode(QLineEdit::Normal);
} else {
pwLineEdit->setEchoMode(QLineEdit::Password);
}
}
void AddEntryWndImpl::generateButton_slot()
{
if (!pwGen->exec())
return;
setPassword(pwGen->getPassword());
}
QString AddEntryWndImpl::getComment()
{
#ifndef PWM_EMBEDDED
if (isAdvancedComment()) {
return advCommentDta;
}
#endif
return commentTextEdit->text();
}
void AddEntryWndImpl::setComment(const QString &comm)
{
#ifndef PWM_EMBEDDED
if (HtmlGen::isHtml(comm)) {
advancedCommentButton->setOn(true);
advCommentDta = comm;
} else {
advancedCommentButton->setOn(false);
commentTextEdit->setText(comm);
}
#else
commentTextEdit->setText(comm);
#endif
}
void AddEntryWndImpl::advancedCommentButton_slot(bool on)
{
#ifndef PWM_EMBEDDED
switchComment(on);
#endif
}
void AddEntryWndImpl::switchComment(bool toAdvanced)
{
#ifndef PWM_EMBEDDED
useAdvComment = toAdvanced;
if (toAdvanced) {
if (commentTextEdit) {
savedCommentText = commentTextEdit->text();
delete_and_null(commentTextEdit);
}
if (editAdvCommentButton)
return;
editAdvCommentButton = new QPushButton(i18n("Edit advanced comment..."),
commentDummy);
editAdvCommentButton->resize(commentDummy->size().width(), 50);
connect(editAdvCommentButton, SIGNAL(clicked()),
this, SLOT(editAdvCommentButton_slot()));
editAdvCommentButton->show();
} else {
delete_ifnot_null(editAdvCommentButton);
if (commentTextEdit)
return;
commentTextEdit = new QTextEdit(commentDummy);
commentTextEdit->setTextFormat(Qt::PlainText);
commentTextEdit->resize(commentDummy->size());
commentTextEdit->setText(savedCommentText);
commentTextEdit->show();
}
#endif
}
void AddEntryWndImpl::editAdvCommentButton_slot()
{
#ifndef PWM_EMBEDDED
AdvCommEditImpl editor(this);
editor.setHtmlDta(advCommentDta);
if (editor.exec())
return;
advCommentDta = editor.getHtmlDta();
#endif
}
#ifndef PWM_EMBEDDED
#include "addentrywndimpl.moc"
#endif
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 9187380..a751fce 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -60,503 +60,502 @@
#include "pwm.h"
#include "pwminit.h"
#include "pwmprint.h"
#include "addentrywndimpl.h"
#include "globalstuff.h"
#include "findwndimpl.h"
#include "csv.h"
#ifdef CONFIG_KWALLETIF
# include "kwalletif.h"
# include "kwalletemu.h"
#endif
#ifdef CONFIG_KEYCARD
# include "pwmkeycard.h"
#endif
#define DEFAULT_SIZE (QSize(700, 400))
// Button IDs for "file" popup menu
enum {
BUTTON_POPUP_FILE_NEW = 0,
BUTTON_POPUP_FILE_OPEN,
BUTTON_POPUP_FILE_CLOSE,
BUTTON_POPUP_FILE_SAVE,
BUTTON_POPUP_FILE_SAVEAS,
BUTTON_POPUP_FILE_EXPORT,
BUTTON_POPUP_FILE_IMPORT,
BUTTON_POPUP_FILE_PRINT,
BUTTON_POPUP_FILE_QUIT
};
// Button IDs for "manage" popup menu
enum {
BUTTON_POPUP_MANAGE_ADD = 0,
BUTTON_POPUP_MANAGE_EDIT,
BUTTON_POPUP_MANAGE_DEL,
BUTTON_POPUP_MANAGE_CHANGEMP
};
// Button IDs for chipcard popup menu
enum {
#ifdef CONFIG_KEYCARD
BUTTON_POPUP_CHIPCARD_GENNEW = 0,
BUTTON_POPUP_CHIPCARD_DEL,
BUTTON_POPUP_CHIPCARD_READID,
BUTTON_POPUP_CHIPCARD_SAVEBACKUP,
BUTTON_POPUP_CHIPCARD_REPLAYBACKUP
#else // CONFIG_KEYCARD
BUTTON_POPUP_CHIPCARD_NO = 0
#endif // CONFIG_KEYCARD
};
// Button IDs for "view" popup menu
enum {
BUTTON_POPUP_VIEW_FIND = 0,
BUTTON_POPUP_VIEW_LOCK,
BUTTON_POPUP_VIEW_DEEPLOCK,
BUTTON_POPUP_VIEW_UNLOCK
};
// Button IDs for "options" popup menu
enum {
BUTTON_POPUP_OPTIONS_CONFIG = 0
#ifdef PWM_EMBEDDED
,BUTTON_POPUP_OPTIONS_CATEGORY
#endif
};
// Button IDs for "export" popup menu (in "file" popup menu)
enum {
BUTTON_POPUP_EXPORT_TEXT = 0,
BUTTON_POPUP_EXPORT_GPASMAN,
BUTTON_POPUP_EXPORT_CSV
#ifdef CONFIG_KWALLETIF
,BUTTON_POPUP_EXPORT_KWALLET
#endif
};
// Button IDs for "import" popup menu (in "file" popup menu)
enum {
BUTTON_POPUP_IMPORT_TEXT = 0,
BUTTON_POPUP_IMPORT_GPASMAN,
BUTTON_POPUP_IMPORT_CSV
#ifdef CONFIG_KWALLETIF
,BUTTON_POPUP_IMPORT_KWALLET
#endif
};
#ifdef PWM_EMBEDDED
// Button IDs for "help" popup menu
enum {
BUTTON_POPUP_HELP_LICENSE = 0,
BUTTON_POPUP_HELP_FAQ,
BUTTON_POPUP_HELP_ABOUT,
BUTTON_POPUP_HELP_SYNC,
BUTTON_POPUP_HELP_WHATSNEW
};
#endif
// Button IDs for toolbar
enum {
BUTTON_TOOL_NEW = 0,
BUTTON_TOOL_OPEN,
BUTTON_TOOL_SAVE,
BUTTON_TOOL_SAVEAS,
BUTTON_TOOL_PRINT,
BUTTON_TOOL_ADD,
BUTTON_TOOL_EDIT,
BUTTON_TOOL_DEL,
BUTTON_TOOL_FIND,
BUTTON_TOOL_LOCK,
BUTTON_TOOL_DEEPLOCK,
BUTTON_TOOL_UNLOCK
};
PwM::PwM(PwMInit *_init, PwMDoc *doc,
bool virginity,
QWidget *parent, const char *name)
: KMainWindow(parent, "HALLO")
, forceQuit (false)
, forceMinimizeToTray (false)
{
syncManager = 0;
virgin = !virginity;
init = _init;
connect(doc, SIGNAL(docClosed(PwMDoc *)),
this, SLOT(docClosed(PwMDoc *)));
initMenubar();
initToolbar();
initMetrics();
setVirgin(virginity);
setFocusPolicy(QWidget::WheelFocus);
#ifndef PWM_EMBEDDED
statusBar()->show();
#endif
view = makeNewListView(doc);
setCentralWidget(view);
updateCaption();
showStatMsg(i18n("Ready."));
}
PwM::~PwM()
{
//qDebug("PwM::~PwM() %x", this);
disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)),
this, SLOT(docClosed(PwMDoc *)));
conf()->confWndMainWndSize(size());
//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,
SLOT(deepLockWnd_slot()), 0,
BUTTON_POPUP_VIEW_DEEPLOCK);
viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)),
i18n("&Unlock all entries"), this,
SLOT(unlockWnd_slot()), 0,
BUTTON_POPUP_VIEW_UNLOCK);
menuBar()->insertItem(i18n("&View"), viewPopup);
// "options" popup menu
optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)),
i18n("&Configure..."), this,
SLOT(config_slot()),0,
BUTTON_POPUP_OPTIONS_CONFIG);
- menuBar()->insertItem(i18n("&Options"), optionsPopup);
+ if ( QApplication::desktop()->width() <= 240 ) {
+ managePopup->insertSeparator();
+ managePopup->insertItem(i18n("&Options"), optionsPopup);
+ } else
+ menuBar()->insertItem(i18n("&Options"), optionsPopup);
// "help" popup menu
#ifndef PWM_EMBEDDED
helpPopup = helpMenu(QString::null, false);
#else
optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)),
i18n("C&ategories..."), this,
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
#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("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("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();
}
}
}
void PwM::setVirgin(bool v)
{
if (virgin == v)
return;
virgin = v;
filePopup->setItemEnabled(BUTTON_POPUP_FILE_SAVE, !v);
filePopup->setItemEnabled(BUTTON_POPUP_FILE_SAVEAS, !v);
filePopup->setItemEnabled(BUTTON_POPUP_FILE_EXPORT, !v);
filePopup->setItemEnabled(BUTTON_POPUP_FILE_PRINT, !v);
managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_EDIT, !v);
managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_DEL, !v);
managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, !v);
viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_LOCK, !v);
viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_DEEPLOCK, !v);
viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_UNLOCK, !v);
viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_FIND, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_SAVE, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_SAVEAS, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_PRINT, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_EDIT, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_DEL, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_LOCK, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_DEEPLOCK, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_UNLOCK, !v);
toolBar()->setItemEnabled(BUTTON_TOOL_FIND, !v);
}
void PwM::new_slot()
{
init->createMainWnd();
}
//US ENH
void PwM::open_slot()
{
open_slot("");
}
void PwM::open_slot(QString fn)
{
openDoc(fn);
}
PwMDoc * PwM::openDoc(QString filename, bool openDeepLocked)
diff --git a/pwmanager/pwmanager/pwmviewstyle_0.cpp b/pwmanager/pwmanager/pwmviewstyle_0.cpp
index d82eb15..1d88a34 100644
--- a/pwmanager/pwmanager/pwmviewstyle_0.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle_0.cpp
@@ -1,132 +1,144 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include "pwmviewstyle_0.h"
#include "pwmview.h"
#include "listviewpwm.h"
#include "commentbox.h"
#include <klocale.h>
+#include <kglobal.h>
+#include <kiconloader.h>
#include "pwmprefs.h"
PwMViewStyle_0::PwMViewStyle_0(PwMView *view)
: QObject()
{
vbox1 = new QVBox(view);
- vbox1->setSpacing(3);
+ vbox1->setSpacing(0);
hbox1 = new QHBox(vbox1);
- hbox1->setSpacing(3);
+ hbox1->setSpacing(0);
categoriesTitle = new QLabel(hbox1);
- categoriesTitle->setText(i18n("Categories:"));
+ categoriesTitle->setText(i18n("Category:"));
categoriesCombo = new QComboBox(hbox1);
- renCatButton = new QPushButton(i18n("&Rename"), hbox1);
- delCatButton = new QPushButton(i18n("&Delete"), hbox1);
+ categoriesCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred ));
+ renCatButton = new QPushButton( hbox1);
+ renCatButton->setPixmap (KGlobal::iconLoader()->loadIcon("edit", KIcon::Small) );
+ int maxsi = renCatButton->sizeHint().height()+4;
+ renCatButton->setMinimumSize( maxsi, maxsi );
+ delCatButton = new QPushButton( hbox1);
+ delCatButton->setPixmap (KGlobal::iconLoader()->loadIcon("editdelete", KIcon::Small) );
+ maxsi = delCatButton->sizeHint().height()+4;
+ delCatButton->setMinimumSize( maxsi, maxsi );
+ delCatButton->setFocusPolicy( QWidget::NoFocus );
+ renCatButton->setFocusPolicy( QWidget::NoFocus );
+
#ifndef PWM_EMBEDDED
splitter1 = new QSplitter(vbox1);
splitter1->setOrientation(Qt::Vertical);
#else
splitter1 = new KDGanttMinimizeSplitter( Qt::Vertical, vbox1);
splitter1->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
//US topLayout->addWidget(mMiniSplitter );
#endif
lv = new ListViewPwM(splitter1);
commentBox = new CommentBox(splitter1);
// set sizes and styles
commentBox->resize(commentBox->size().width(), 60);
categoriesTitle->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
// connections
connect(categoriesCombo, SIGNAL(activated(int)),
view, SLOT(shiftToView()));
connect(renCatButton, SIGNAL(clicked()),
view, SLOT(renCatButton_slot()));
connect(delCatButton, SIGNAL(clicked()),
view, SLOT(delCatButton_slot()));
connect(lv, SIGNAL(toggleOverview()),
this, SLOT(toggleSplitter()));
}
PwMViewStyle_0::~PwMViewStyle_0()
{
delete vbox1;
}
void PwMViewStyle_0::toggleSplitter()
{
QValueList<int> si = splitter1->sizes();
splitter1->toggle();
QValueList<int> si2 = splitter1->sizes();
//qDebug("PwMViewStyle_0::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] );
if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) {
int diff = si[0]/2;
if ( diff > 200 )
diff = 200;
si[0] -= diff;
si[1] += diff;
splitter1->toggle();
splitter1->setSizes( si );
}
}
void PwMViewStyle_0::delCategory(const QString &cat)
{
PWM_ASSERT(categoriesCombo);
int i, count = categoriesCombo->count();
for (i = 0; i < count; ++i) {
if (categoriesCombo->text(i) == cat) {
categoriesCombo->removeItem(i);
return;
}
}
BUG();
}
void PwMViewStyle_0::selectCategory(const QString &cat)
{
PWM_ASSERT(categoriesCombo);
int i, count = categoriesCombo->count();
for (i = 0; i < count; ++i) {
if (categoriesCombo->text(i) == cat) {
categoriesCombo->setCurrentItem(i);
return;
}
}
// fall back to 0
categoriesCombo->setCurrentItem(0);
}
//US ENH: I need a place to load the view dependend settings. Eg. splittersize
void PwMViewStyle_0::restoreSettings(PWMPrefs* prefs)
{
//load and store the size of the listviewcolumns
lv->restoreLayout(prefs->getConfig(), "listview");
splitter1->setSizes( prefs->mCommentSplitter );
commentBox->setFont( prefs->mViewFont );
}
//US ENH: I need a place to load the view dependend settings. Eg. splittersize
void PwMViewStyle_0::saveSettings(PWMPrefs* prefs)
{
//store the size of the listviewcolumns
lv->saveLayout(prefs->getConfig(), "listview");
prefs->mCommentSplitter = splitter1->sizes();
}
diff --git a/pwmanager/pwmanager/pwmviewstyle_1.cpp b/pwmanager/pwmanager/pwmviewstyle_1.cpp
index 7294f34..e335a3f 100644
--- a/pwmanager/pwmanager/pwmviewstyle_1.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle_1.cpp
@@ -1,192 +1,192 @@
/***************************************************************************
* *
* copyright (C) 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include "pwmviewstyle_1.h"
#include "pwmview.h"
#include "listviewpwm.h"
#include "commentbox.h"
#include <klocale.h>
#include "pwmprefs.h"
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#define INITIAL_CATEGORIES_WIDTH 100
PwMViewStyle_1::PwMViewStyle_1(PwMView *view)
: QObject()
{
#ifndef PWM_EMBEDDED
splitter = new QSplitter(view);
#else
if ( QApplication::desktop()->width() > 240 ) {
splitter = new KDGanttMinimizeSplitter( Qt::Horizontal, view);
splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Left );
// topLayout = new QHBoxLayout( this );
// mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
// mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
} else {
splitter = new KDGanttMinimizeSplitter( Qt::Vertical, view);
splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
// topLayout = new QHBoxLayout( this );
// mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
// mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
}
//US topLayout->addWidget(mMiniSplitter );
#endif
vbox1 = new QVBox(splitter);
categoriesTitle = new QLabel(vbox1);
categoriesList = new QListBox(vbox1);
#ifndef PWM_EMBEDDED
splitter2 = new QSplitter(splitter);
splitter2->setOrientation(Qt::Vertical);
#else
splitter2 = new KDGanttMinimizeSplitter( Qt::Vertical, splitter);
splitter2->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
//US topLayout->addWidget(mMiniSplitter );
#endif
lv = new ListViewPwM(splitter2);
commentBox = new CommentBox(splitter2);
// set sizes and styles
//US commentBox->resize(commentBox->size().width(), 60);
QValueList<int> sizes;
#ifndef PWM_EMBEDDED
sizes.push_back(INITIAL_CATEGORIES_WIDTH);
sizes.push_back(view->height() - INITIAL_CATEGORIES_WIDTH);
#else
sizes.append(INITIAL_CATEGORIES_WIDTH);
sizes.append(view->height() - INITIAL_CATEGORIES_WIDTH);
#endif
//US splitter->setSizes(sizes);
categoriesTitle->setAlignment(Qt::AlignHCenter);
#ifndef PWM_EMBEDDED
categoriesTitle->setFrameShape(QFrame::MenuBarPanel);
#else
- categoriesTitle->setFrameShape(QFrame::StyledPanel);
+ //categoriesTitle->setFrameShape(QFrame::StyledPanel);
#endif
- categoriesTitle->setText(i18n("Categories:"));
+ categoriesTitle->setText(i18n("Category:"));
catCtxMenu = new QPopupMenu(view);
catCtxMenu->insertItem(i18n("&Rename"),
view, SLOT(renCatButton_slot()));
catCtxMenu->insertItem(i18n("&Delete"),
view, SLOT(delCatButton_slot()));
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( categoriesList->viewport(), QPEApplication::RightOnHold );
#endif
// connections
connect(categoriesList, SIGNAL(highlighted(int)),
view, SLOT(shiftToView()));
connect(categoriesList,
SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)),
this,
SLOT(catRightClick(QListBoxItem *, const QPoint &)));
connect(lv, SIGNAL(toggleOverview()),
this, SLOT(toggleSplitter()));
}
PwMViewStyle_1::~PwMViewStyle_1()
{
delete catCtxMenu;
delete splitter;
}
void PwMViewStyle_1::toggleSplitter()
{
QValueList<int> si = splitter2->sizes();
splitter2->toggle();
QValueList<int> si2 = splitter2->sizes();
//qDebug("PwMViewStyle_1::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] );
if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) {
int diff = si[0]/2;
if ( diff > 200 )
diff = 200;
si[0] -= diff;
si[1] += diff;
splitter2->toggle();
splitter2->setSizes( si );
}
}
void PwMViewStyle_1::catRightClick(QListBoxItem *item, const QPoint &point)
{
if (!item)
return;
catCtxMenu->move(point);
catCtxMenu->show();
}
void PwMViewStyle_1::delCategory(const QString &cat)
{
PWM_ASSERT(categoriesList);
int i, count = categoriesList->count();
for (i = 0; i < count; ++i) {
if (categoriesList->text(i) == cat) {
categoriesList->removeItem(i);
return;
}
}
BUG();
}
void PwMViewStyle_1::selectCategory(const QString &cat)
{
PWM_ASSERT(categoriesList);
int i, count = categoriesList->count();
for (i = 0; i < count; ++i) {
if (categoriesList->text(i) == cat) {
categoriesList->setCurrentItem(i);
return;
}
}
// fall back to 0
categoriesList->setCurrentItem(0);
}
//US ENH: I need a place to load the view dependend settings. Eg. splittersize
void PwMViewStyle_1::restoreSettings(PWMPrefs* prefs)
{
//load and store the size of the listviewcolumns
lv->restoreLayout(prefs->getConfig(), "listview");
splitter->setSizes( prefs->mCategorySplitter );
splitter2->setSizes( prefs->mCommentSplitter );
commentBox->setFont( prefs->mViewFont );
}
//US ENH: I need a place to load the view dependend settings. Eg. splittersize
void PwMViewStyle_1::saveSettings(PWMPrefs* prefs)
{
//store the size of the listviewcolumns
lv->saveLayout(prefs->getConfig(), "listview");
prefs->mCategorySplitter = splitter->sizes();
prefs->mCommentSplitter = splitter2->sizes();
}
#ifndef PWM_EMBEDDED
#include "pwmviewstyle_1.moc"
#endif