summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt8
-rw-r--r--bin/kdepim/kaddressbook/icons16/z_menu.pngbin0 -> 713 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/z_menu.pngbin0 -> 1017 bytes
-rw-r--r--bin/kdepim/korganizer/icons16/z_menu.pngbin0 -> 713 bytes
-rw-r--r--bin/kdepim/korganizer/iconsmini/z_menu.pngbin0 -> 572 bytes
-rw-r--r--bin/kdepim/korganizer/z_menu.pngbin0 -> 1017 bytes
-rw-r--r--kaddressbook/kabcore.cpp2
-rw-r--r--korganizer/kotodoviewitem.cpp7
-rw-r--r--korganizer/mainwindow.cpp29
-rw-r--r--pwmanager/pwmanager/listviewpwm.cpp8
-rw-r--r--pwmanager/pwmanager/listviewpwm.h2
-rw-r--r--pwmanager/pwmanager/pwmview.cpp2
-rw-r--r--pwmanager/pwmanager/pwmviewstyle.cpp4
-rw-r--r--pwmanager/pwmanager/pwmviewstyle.h2
14 files changed, 48 insertions, 16 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 657d1de..7438f9d 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,98 +1,106 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.0.15 ************
4
5PwM/Pi:
6Added keyboard shorcuts for
7- toggling summary view (space bar)
8- delete item (delete + backspace key)
9- add new item ( i + n key)
10
3********** VERSION 2.0.14 ************ 11********** VERSION 2.0.14 ************
4 12
5Made Passwordmanager PwM/Pi more userfriendly: 13Made Passwordmanager PwM/Pi more userfriendly:
6Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 14Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
7Fixed bug in KO/Pi todo printing. 15Fixed bug in KO/Pi todo printing.
8Made Qtopia calendar import possible on desktop . 16Made Qtopia calendar import possible on desktop .
9 17
10********** VERSION 2.0.13 ************ 18********** VERSION 2.0.13 ************
11 19
12Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. 20Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter.
13 21
14In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". 22In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down".
15 23
16OM/Pi: 24OM/Pi:
17Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. 25Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails.
18Added missing German translation. 26Added missing German translation.
19Added warning if path is specified in local folder settings of account config. 27Added warning if path is specified in local folder settings of account config.
20 28
21********** VERSION 2.0.12 ************ 29********** VERSION 2.0.12 ************
22 30
23KO/Pi: 31KO/Pi:
24Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. 32Fixed a bug in todo start/due date handling for non recurring todos with a start and due date.
25Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. 33Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes.
26Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. 34Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer.
27 35
28Fixed problem in pi-sync mode when wrong password was sent. 36Fixed problem in pi-sync mode when wrong password was sent.
29 37
30OM/Pi: 38OM/Pi:
31Fixed a crash when displaying mails with "Show mail as html" was checked in the config. 39Fixed a crash when displaying mails with "Show mail as html" was checked in the config.
32Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. 40Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled.
33 41
34********** VERSION 2.0.11 ************ 42********** VERSION 2.0.11 ************
35 43
36Fixed some problems in pi-sync mode 44Fixed some problems in pi-sync mode
37(e.g. details of events were not synced properly) 45(e.g. details of events were not synced properly)
38 46
39********** VERSION 2.0.10 ************ 47********** VERSION 2.0.10 ************
40 48
41KO/Pi: 49KO/Pi:
42In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. 50In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view.
43This is fixed. 51This is fixed.
44Changed the search dialog a bit to make it more user friendly. 52Changed the search dialog a bit to make it more user friendly.
45(E.g.: Removed message box about "no items found" and set key focus to search line edit after search). 53(E.g.: Removed message box about "no items found" and set key focus to search line edit after search).
46 54
47Added config option to hide the week number in KO/Pi toolbar. 55Added config option to hide the week number in KO/Pi toolbar.
48 56
49********** VERSION 2.0.9 ************ 57********** VERSION 2.0.9 ************
50 58
51Made month view icons for multiday events a bit nicer. 59Made month view icons for multiday events a bit nicer.
52Some minor fixes in KO/Pi 60Some minor fixes in KO/Pi
53(e.g. go to today did not work for new week view properly). 61(e.g. go to today did not work for new week view properly).
54 62
55 63
56********** VERSION 2.0.8 ************ 64********** VERSION 2.0.8 ************
57 65
58Fixed a problem in dependency info in the ipk files for the Zaurus. 66Fixed a problem in dependency info in the ipk files for the Zaurus.
59 67
60Added 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. 68Added 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.
61 69
62Added a "go today" button to the datepicker. 70Added a "go today" button to the datepicker.
63 71
64Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) 72Added "created" and "last modified" to event/todo viewer (and What'sThis viewer)
65and made it configureable to show these values. 73and made it configureable to show these values.
66 74
67Fixed a problem for events (from external iCal files) that do have a duration but no end date. 75Fixed a problem for events (from external iCal files) that do have a duration but no end date.
68 76
69 77
70********** VERSION 2.0.7 ************ 78********** VERSION 2.0.7 ************
71 79
72Added global application font settings 80Added global application font settings
73(for all KDE-Pim/Pi apps) to the general settings. 81(for all KDE-Pim/Pi apps) to the general settings.
74 82
75Fixed a problem in OM/Pi when trying to login to some IMAP servers 83Fixed a problem in OM/Pi when trying to login to some IMAP servers
76(like the IMAP server of Apple: mail.mac.com ) 84(like the IMAP server of Apple: mail.mac.com )
77 85
78Added recurring todos to KO/Pi. 86Added recurring todos to KO/Pi.
79 87
80 88
81********** VERSION 2.0.6 ************ 89********** VERSION 2.0.6 ************
82 90
83Some bugfixes in the pi-sync mode. 91Some bugfixes in the pi-sync mode.
84Added German translation for pi-sync mode. 92Added German translation for pi-sync mode.
85 93
86KO/Pi: 94KO/Pi:
87Made the todolist using alternate background. 95Made the todolist using alternate background.
88 96
89Other minor fixes in KO/Pi. 97Other minor fixes in KO/Pi.
90 98
91 99
92********** VERSION 2.0.5 ************ 100********** VERSION 2.0.5 ************
93 101
94Bugfixes in KO/Pi. 102Bugfixes in KO/Pi.
95 103
96********** VERSION 2.0.4 ************ 104********** VERSION 2.0.4 ************
97 105
98KO/Pi: 106KO/Pi:
diff --git a/bin/kdepim/kaddressbook/icons16/z_menu.png b/bin/kdepim/kaddressbook/icons16/z_menu.png
new file mode 100644
index 0000000..b32c8e5
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons16/z_menu.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/z_menu.png b/bin/kdepim/kaddressbook/icons22/z_menu.png
new file mode 100644
index 0000000..b1866a2
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons22/z_menu.png
Binary files differ
diff --git a/bin/kdepim/korganizer/icons16/z_menu.png b/bin/kdepim/korganizer/icons16/z_menu.png
new file mode 100644
index 0000000..b32c8e5
--- a/dev/null
+++ b/bin/kdepim/korganizer/icons16/z_menu.png
Binary files differ
diff --git a/bin/kdepim/korganizer/iconsmini/z_menu.png b/bin/kdepim/korganizer/iconsmini/z_menu.png
new file mode 100644
index 0000000..584791a
--- a/dev/null
+++ b/bin/kdepim/korganizer/iconsmini/z_menu.png
Binary files differ
diff --git a/bin/kdepim/korganizer/z_menu.png b/bin/kdepim/korganizer/z_menu.png
new file mode 100644
index 0000000..b1866a2
--- a/dev/null
+++ b/bin/kdepim/korganizer/z_menu.png
Binary files differ
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 1b17665..79f897b 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2035,193 +2035,193 @@ void KABCore::initActions()
2035 2035
2036 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 2036 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
2037 SLOT( setWhoAmI() ), actionCollection(), 2037 SLOT( setWhoAmI() ), actionCollection(),
2038 "set_personal" ); 2038 "set_personal" );
2039 2039
2040 2040
2041 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this, 2041 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this,
2042 SLOT( setCategories() ), actionCollection(), 2042 SLOT( setCategories() ), actionCollection(),
2043 "edit_set_categories" ); 2043 "edit_set_categories" );
2044 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this, 2044 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this,
2045 SLOT( editCategories() ), actionCollection(), 2045 SLOT( editCategories() ), actionCollection(),
2046 "edit__categories" ); 2046 "edit__categories" );
2047 2047
2048 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 2048 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
2049 SLOT( removeVoice() ), actionCollection(), 2049 SLOT( removeVoice() ), actionCollection(),
2050 "remove_voice" ); 2050 "remove_voice" );
2051 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this, 2051 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this,
2052 SLOT( setFormattedName() ), actionCollection(), 2052 SLOT( setFormattedName() ), actionCollection(),
2053 "set_formatted" ); 2053 "set_formatted" );
2054 2054
2055 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, 2055 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this,
2056 SLOT( manageCategories() ), actionCollection(), 2056 SLOT( manageCategories() ), actionCollection(),
2057 "remove_voice" ); 2057 "remove_voice" );
2058 2058
2059 2059
2060 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 2060 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
2061 SLOT( importFromOL() ), actionCollection(), 2061 SLOT( importFromOL() ), actionCollection(),
2062 "import_OL" ); 2062 "import_OL" );
2063#ifdef KAB_EMBEDDED 2063#ifdef KAB_EMBEDDED
2064 mActionLicence = new KAction( i18n( "Licence" ), 0, 2064 mActionLicence = new KAction( i18n( "Licence" ), 0,
2065 this, SLOT( showLicence() ), actionCollection(), 2065 this, SLOT( showLicence() ), actionCollection(),
2066 "licence_about_data" ); 2066 "licence_about_data" );
2067 mActionFaq = new KAction( i18n( "Faq" ), 0, 2067 mActionFaq = new KAction( i18n( "Faq" ), 0,
2068 this, SLOT( faq() ), actionCollection(), 2068 this, SLOT( faq() ), actionCollection(),
2069 "faq_about_data" ); 2069 "faq_about_data" );
2070 mActionWN = new KAction( i18n( "What's New?" ), 0, 2070 mActionWN = new KAction( i18n( "What's New?" ), 0,
2071 this, SLOT( whatsnew() ), actionCollection(), 2071 this, SLOT( whatsnew() ), actionCollection(),
2072 "wn" ); 2072 "wn" );
2073 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 2073 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
2074 this, SLOT( synchowto() ), actionCollection(), 2074 this, SLOT( synchowto() ), actionCollection(),
2075 "sync" ); 2075 "sync" );
2076 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 2076 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
2077 this, SLOT( kdesynchowto() ), actionCollection(), 2077 this, SLOT( kdesynchowto() ), actionCollection(),
2078 "kdesync" ); 2078 "kdesync" );
2079 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 2079 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
2080 this, SLOT( multisynchowto() ), actionCollection(), 2080 this, SLOT( multisynchowto() ), actionCollection(),
2081 "multisync" ); 2081 "multisync" );
2082 2082
2083 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 2083 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
2084 this, SLOT( createAboutData() ), actionCollection(), 2084 this, SLOT( createAboutData() ), actionCollection(),
2085 "kaddressbook_about_data" ); 2085 "kaddressbook_about_data" );
2086#endif //KAB_EMBEDDED 2086#endif //KAB_EMBEDDED
2087 2087
2088 clipboardDataChanged(); 2088 clipboardDataChanged();
2089 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2089 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2090 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2090 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2091} 2091}
2092 2092
2093//US we need this function, to plug all actions into the correct menues. 2093//US we need this function, to plug all actions into the correct menues.
2094// KDE uses a XML format to plug the actions, but we work her without this overhead. 2094// KDE uses a XML format to plug the actions, but we work her without this overhead.
2095void KABCore::addActionsManually() 2095void KABCore::addActionsManually()
2096{ 2096{
2097//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2097//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2098 2098
2099#ifdef KAB_EMBEDDED 2099#ifdef KAB_EMBEDDED
2100 QPopupMenu *fileMenu = new QPopupMenu( this ); 2100 QPopupMenu *fileMenu = new QPopupMenu( this );
2101 QPopupMenu *editMenu = new QPopupMenu( this ); 2101 QPopupMenu *editMenu = new QPopupMenu( this );
2102 QPopupMenu *helpMenu = new QPopupMenu( this ); 2102 QPopupMenu *helpMenu = new QPopupMenu( this );
2103 2103
2104 KToolBar* tb = mMainWindow->toolBar(); 2104 KToolBar* tb = mMainWindow->toolBar();
2105 2105
2106#ifndef DESKTOP_VERSION 2106#ifndef DESKTOP_VERSION
2107 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2107 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2108#endif 2108#endif
2109 QMenuBar* mb = mMainWindow->menuBar(); 2109 QMenuBar* mb = mMainWindow->menuBar();
2110 2110
2111 //US setup menubar. 2111 //US setup menubar.
2112 //Disable the following block if you do not want to have a menubar. 2112 //Disable the following block if you do not want to have a menubar.
2113 mb->insertItem( i18n("&File"), fileMenu ); 2113 mb->insertItem( i18n("&File"), fileMenu );
2114 mb->insertItem( i18n("&Edit"), editMenu ); 2114 mb->insertItem( i18n("&Edit"), editMenu );
2115 mb->insertItem( i18n("&View"), viewMenu ); 2115 mb->insertItem( i18n("&View"), viewMenu );
2116 mb->insertItem( i18n("&Settings"), settingsMenu ); 2116 mb->insertItem( i18n("&Settings"), settingsMenu );
2117#ifdef DESKTOP_VERSION 2117#ifdef DESKTOP_VERSION
2118 mb->insertItem( i18n("Synchronize"), syncMenu ); 2118 mb->insertItem( i18n("Synchronize"), syncMenu );
2119#else 2119#else
2120 mb->insertItem( i18n("Sync"), syncMenu ); 2120 mb->insertItem( i18n("Sync"), syncMenu );
2121#endif 2121#endif
2122 //mb->insertItem( i18n("&Change"), changeMenu ); 2122 //mb->insertItem( i18n("&Change"), changeMenu );
2123 mb->insertItem( i18n("&Help"), helpMenu ); 2123 mb->insertItem( i18n("&Help"), helpMenu );
2124 mIncSearchWidget = new IncSearchWidget( tb ); 2124 mIncSearchWidget = new IncSearchWidget( tb );
2125 // tb->insertWidget(-1, 0, mIncSearchWidget); 2125 // tb->insertWidget(-1, 0, mIncSearchWidget);
2126#ifndef DESKTOP_VERSION 2126#ifndef DESKTOP_VERSION
2127 } else { 2127 } else {
2128 //US setup toolbar 2128 //US setup toolbar
2129 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2129 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2130 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2130 QPopupMenu *popupBarTB = new QPopupMenu( this );
2131 menuBarTB->insertItem( "ME", popupBarTB); 2131 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
2132 tb->insertWidget(-1, 0, menuBarTB); 2132 tb->insertWidget(-1, 0, menuBarTB);
2133 mIncSearchWidget = new IncSearchWidget( tb ); 2133 mIncSearchWidget = new IncSearchWidget( tb );
2134 2134
2135 tb->enableMoving(false); 2135 tb->enableMoving(false);
2136 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2136 popupBarTB->insertItem( i18n("&File"), fileMenu );
2137 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2137 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2138 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2138 popupBarTB->insertItem( i18n("&View"), viewMenu );
2139 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2139 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2140 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2140 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2141 mViewManager->getFilterAction()->plug ( popupBarTB); 2141 mViewManager->getFilterAction()->plug ( popupBarTB);
2142 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2142 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2143 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2143 popupBarTB->insertItem( i18n("&Help"), helpMenu );
2144 if (QApplication::desktop()->width() > 320 ) { 2144 if (QApplication::desktop()->width() > 320 ) {
2145 // mViewManager->getFilterAction()->plug ( tb); 2145 // mViewManager->getFilterAction()->plug ( tb);
2146 } 2146 }
2147 } 2147 }
2148#endif 2148#endif
2149 // mActionQuit->plug ( mMainWindow->toolBar()); 2149 // mActionQuit->plug ( mMainWindow->toolBar());
2150 2150
2151 2151
2152 2152
2153 //US Now connect the actions with the menue entries. 2153 //US Now connect the actions with the menue entries.
2154#ifdef DESKTOP_VERSION 2154#ifdef DESKTOP_VERSION
2155 mActionPrint->plug( fileMenu ); 2155 mActionPrint->plug( fileMenu );
2156 mActionPrintDetails->plug( fileMenu ); 2156 mActionPrintDetails->plug( fileMenu );
2157 fileMenu->insertSeparator(); 2157 fileMenu->insertSeparator();
2158#endif 2158#endif
2159 mActionMail->plug( fileMenu ); 2159 mActionMail->plug( fileMenu );
2160 fileMenu->insertSeparator(); 2160 fileMenu->insertSeparator();
2161 2161
2162 mActionNewContact->plug( fileMenu ); 2162 mActionNewContact->plug( fileMenu );
2163 mActionNewContact->plug( tb ); 2163 mActionNewContact->plug( tb );
2164 2164
2165 mActionEditAddressee->plug( fileMenu ); 2165 mActionEditAddressee->plug( fileMenu );
2166 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2166 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2167 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2167 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2168 mActionEditAddressee->plug( tb ); 2168 mActionEditAddressee->plug( tb );
2169 2169
2170 fileMenu->insertSeparator(); 2170 fileMenu->insertSeparator();
2171 mActionSave->plug( fileMenu ); 2171 mActionSave->plug( fileMenu );
2172 fileMenu->insertItem( "&Import", ImportMenu ); 2172 fileMenu->insertItem( "&Import", ImportMenu );
2173 fileMenu->insertItem( "&Export", ExportMenu ); 2173 fileMenu->insertItem( "&Export", ExportMenu );
2174 fileMenu->insertItem( i18n("&Change"), changeMenu ); 2174 fileMenu->insertItem( i18n("&Change"), changeMenu );
2175#ifndef DESKTOP_VERSION 2175#ifndef DESKTOP_VERSION
2176 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); 2176 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu );
2177#endif 2177#endif
2178#if 0 2178#if 0
2179 // PENDING fix MailVCard 2179 // PENDING fix MailVCard
2180 fileMenu->insertSeparator(); 2180 fileMenu->insertSeparator();
2181 mActionMailVCard->plug( fileMenu ); 2181 mActionMailVCard->plug( fileMenu );
2182#endif 2182#endif
2183#ifndef DESKTOP_VERSION 2183#ifndef DESKTOP_VERSION
2184 if ( Ir::supported() ) mActionBR->plug( beamMenu ); 2184 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2185 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); 2185 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2186 if ( Ir::supported() ) mActionBeam->plug( beamMenu ); 2186 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2187#endif 2187#endif
2188 fileMenu->insertSeparator(); 2188 fileMenu->insertSeparator();
2189 mActionQuit->plug( fileMenu ); 2189 mActionQuit->plug( fileMenu );
2190#ifdef _OL_IMPORT_ 2190#ifdef _OL_IMPORT_
2191 mActionImportOL->plug( ImportMenu ); 2191 mActionImportOL->plug( ImportMenu );
2192#endif 2192#endif
2193 // edit menu 2193 // edit menu
2194 mActionUndo->plug( editMenu ); 2194 mActionUndo->plug( editMenu );
2195 mActionRedo->plug( editMenu ); 2195 mActionRedo->plug( editMenu );
2196 editMenu->insertSeparator(); 2196 editMenu->insertSeparator();
2197 mActionCut->plug( editMenu ); 2197 mActionCut->plug( editMenu );
2198 mActionCopy->plug( editMenu ); 2198 mActionCopy->plug( editMenu );
2199 mActionPaste->plug( editMenu ); 2199 mActionPaste->plug( editMenu );
2200 mActionDelete->plug( editMenu ); 2200 mActionDelete->plug( editMenu );
2201 editMenu->insertSeparator(); 2201 editMenu->insertSeparator();
2202 mActionSelectAll->plug( editMenu ); 2202 mActionSelectAll->plug( editMenu );
2203 2203
2204 mActionSetFormattedName->plug( changeMenu ); 2204 mActionSetFormattedName->plug( changeMenu );
2205 mActionRemoveVoice->plug( changeMenu ); 2205 mActionRemoveVoice->plug( changeMenu );
2206 // settings menu 2206 // settings menu
2207//US special menuentry to configure the addressbook resources. On KDE 2207//US special menuentry to configure the addressbook resources. On KDE
2208// you do that through the control center !!! 2208// you do that through the control center !!!
2209 mActionConfigResources->plug( settingsMenu ); 2209 mActionConfigResources->plug( settingsMenu );
2210 settingsMenu->insertSeparator(); 2210 settingsMenu->insertSeparator();
2211 2211
2212 mActionConfigKAddressbook->plug( settingsMenu ); 2212 mActionConfigKAddressbook->plug( settingsMenu );
2213 2213
2214 if ( mIsPart ) { 2214 if ( mIsPart ) {
2215 //US not implemented yet 2215 //US not implemented yet
2216 //mActionConfigShortcuts->plug( settingsMenu ); 2216 //mActionConfigShortcuts->plug( settingsMenu );
2217 //mActionConfigureToolbars->plug( settingsMenu ); 2217 //mActionConfigureToolbars->plug( settingsMenu );
2218 2218
2219 } else { 2219 } else {
2220 //US not implemented yet 2220 //US not implemented yet
2221 //mActionKeyBindings->plug( settingsMenu ); 2221 //mActionKeyBindings->plug( settingsMenu );
2222 } 2222 }
2223 2223
2224 settingsMenu->insertSeparator(); 2224 settingsMenu->insertSeparator();
2225 2225
2226 mActionJumpBar->plug( settingsMenu ); 2226 mActionJumpBar->plug( settingsMenu );
2227 mActionDetails->plug( settingsMenu ); 2227 mActionDetails->plug( settingsMenu );
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 70f00c6..6559119 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -271,194 +271,197 @@ void KOTodoViewItem::stateChange(bool state)
271 setSortKey(5,skeyd); 271 setSortKey(5,skeyd);
272 setSortKey(6,skeyt); 272 setSortKey(6,skeyt);
273 } 273 }
274 if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt); 274 if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt);
275 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 275 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
276 276
277 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 277 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
278 if (mTodo->percentComplete()<100) { 278 if (mTodo->percentComplete()<100) {
279 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 279 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
280 else setSortKey(2,QString::number(mTodo->percentComplete())); 280 else setSortKey(2,QString::number(mTodo->percentComplete()));
281 } 281 }
282 else { 282 else {
283 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 283 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
284 else setSortKey(2,QString::number(99)); 284 else setSortKey(2,QString::number(99));
285 } 285 }
286 if ( state ) { 286 if ( state ) {
287 QListViewItem * myChild = firstChild(); 287 QListViewItem * myChild = firstChild();
288 KOTodoViewItem *item; 288 KOTodoViewItem *item;
289 while( myChild ) { 289 while( myChild ) {
290 //qDebug("stateCH "); 290 //qDebug("stateCH ");
291 item = static_cast<KOTodoViewItem*>(myChild); 291 item = static_cast<KOTodoViewItem*>(myChild);
292 item->stateChange(state); 292 item->stateChange(state);
293 myChild = myChild->nextSibling(); 293 myChild = myChild->nextSibling();
294 } 294 }
295 } else { 295 } else {
296 QListViewItem * myChild = parent(); 296 QListViewItem * myChild = parent();
297 if ( myChild ) 297 if ( myChild )
298 (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); 298 (static_cast<KOTodoViewItem*>(myChild))->stateChange(state);
299 } 299 }
300 mTodoView->modified(true); 300 mTodoView->modified(true);
301 setMyPixmap(); 301 setMyPixmap();
302 mTodoView->setTodoModified( mTodo ); 302 mTodoView->setTodoModified( mTodo );
303} 303}
304 304
305bool KOTodoViewItem::isAlternate() 305bool KOTodoViewItem::isAlternate()
306{ 306{
307 307
308 KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); 308 KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
309 if (lv && lv->alternateBackground().isValid()) 309 if (lv && lv->alternateBackground().isValid())
310 { 310 {
311 KOTodoViewItem *above = 0; 311 KOTodoViewItem *above = 0;
312 above = static_cast<KOTodoViewItem *>(itemAbove()); 312 above = static_cast<KOTodoViewItem *>(itemAbove());
313 m_known = above ? above->m_known : true; 313 m_known = above ? above->m_known : true;
314 if (m_known) 314 if (m_known)
315 { 315 {
316 m_odd = above ? !above->m_odd : false; 316 m_odd = above ? !above->m_odd : false;
317 } 317 }
318 else 318 else
319 { 319 {
320 KOTodoViewItem *item; 320 KOTodoViewItem *item;
321 bool previous = true; 321 bool previous = true;
322 if (QListViewItem::parent()) 322 if (QListViewItem::parent())
323 { 323 {
324 item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); 324 item = static_cast<KOTodoViewItem *>(QListViewItem::parent());
325 if (item) 325 if (item)
326 previous = item->m_odd; 326 previous = item->m_odd;
327 item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); 327 item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild());
328 } 328 }
329 else 329 else
330 { 330 {
331 item = static_cast<KOTodoViewItem *>(lv->firstChild()); 331 item = static_cast<KOTodoViewItem *>(lv->firstChild());
332 } 332 }
333 333
334 while(item) 334 while(item)
335 { 335 {
336 item->m_odd = previous = !previous; 336 item->m_odd = previous = !previous;
337 item->m_known = true; 337 item->m_known = true;
338 item = static_cast<KOTodoViewItem *>(item->nextSibling()); 338 item = static_cast<KOTodoViewItem *>(item->nextSibling());
339 } 339 }
340 } 340 }
341 return m_odd; 341 return m_odd;
342 } 342 }
343 return false; 343 return false;
344} 344}
345 345
346void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) 346void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
347{ 347{
348 QColorGroup _cg = cg; 348 QColorGroup _cg = cg;
349 QColorGroup::ColorRole role; 349 QColorGroup::ColorRole role;
350 if ( KOPrefs::instance()->mTodoViewUsesForegroundColor ) 350 if ( KOPrefs::instance()->mTodoViewUsesForegroundColor )
351 role = QColorGroup::Text; 351 role = QColorGroup::Text;
352 else 352 else
353 role = QColorGroup::Base; 353 role = QColorGroup::Base;
354 //#ifndef KORG_NOLVALTERNATION 354 //#ifndef KORG_NOLVALTERNATION
355 if (isAlternate()) 355 if (isAlternate())
356 _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); 356 _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground());
357 bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; 357 bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors;
358 QColor colorToSet; 358 QColor colorToSet;
359 if ( setColor ) { 359 if ( setColor ) {
360 QStringList categories = mTodo->categories(); 360 QStringList categories = mTodo->categories();
361 QString cat = categories.first(); 361 QString cat = categories.first();
362 if ( !cat.isEmpty()) { 362 if ( !cat.isEmpty()) {
363 colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); 363 colorToSet = *(KOPrefs::instance()->categoryColor(cat) );
364 } else 364 } else
365 setColor = false; 365 setColor = false;
366 } 366 }
367 367 bool openMode = !isOpen();
368 int odue = mTodo->hasDueSubTodo( !isOpen()); 368 // maybe we are in flat-display-mode
369 if ( !firstChild() )
370 openMode = false;
371 int odue = mTodo->hasDueSubTodo( openMode );
369 if (odue == 2) { 372 if (odue == 2) {
370 colorToSet = KOPrefs::instance()->mTodoOverdueColor; 373 colorToSet = KOPrefs::instance()->mTodoOverdueColor;
371 setColor = true; 374 setColor = true;
372 } else if ( odue == 1 ) { 375 } else if ( odue == 1 ) {
373 colorToSet = KOPrefs::instance()->mTodoDueTodayColor; 376 colorToSet = KOPrefs::instance()->mTodoDueTodayColor;
374 setColor = true; 377 setColor = true;
375 } 378 }
376 379
377 380
378 if ( setColor ) { 381 if ( setColor ) {
379 _cg.setColor(role,colorToSet ); 382 _cg.setColor(role,colorToSet );
380 if ( role == QColorGroup::Base) { 383 if ( role == QColorGroup::Base) {
381 int rgb = colorToSet.red(); 384 int rgb = colorToSet.red();
382 rgb += colorToSet.blue()/2; 385 rgb += colorToSet.blue()/2;
383 rgb += colorToSet.green(); 386 rgb += colorToSet.green();
384 if ( rgb < 200 ) 387 if ( rgb < 200 )
385 _cg.setColor(QColorGroup::Text,Qt::white ); 388 _cg.setColor(QColorGroup::Text,Qt::white );
386 } 389 }
387 } 390 }
388 //#endif 391 //#endif
389 if ( column > 0 ){ 392 if ( column > 0 ){
390 if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { 393 if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) {
391 p->save(); 394 p->save();
392 int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); 395 int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5);
393 396
394 p->fillRect( 0, 0, width, height(), _cg.base() ); // background 397 p->fillRect( 0, 0, width, height(), _cg.base() ); // background
395 // p->setPen(Qt::black ); //border 398 // p->setPen(Qt::black ); //border
396 // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling 399 // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling
397 QColor fc = KOPrefs::instance()->mHighlightColor; 400 QColor fc = KOPrefs::instance()->mHighlightColor;
398 if ( mTodo->percentComplete() == 100 ) 401 if ( mTodo->percentComplete() == 100 )
399 fc = darkGreen; 402 fc = darkGreen;
400 p->drawRect( 2, 2, width-4, height()-4); 403 p->drawRect( 2, 2, width-4, height()-4);
401 p->fillRect( 3, 3, progress, height()-6, 404 p->fillRect( 3, 3, progress, height()-6,
402 fc ); 405 fc );
403 p->restore(); 406 p->restore();
404 } else { 407 } else {
405 QCheckListItem::paintCell(p, _cg, column, width, alignment); 408 QCheckListItem::paintCell(p, _cg, column, width, alignment);
406 } 409 }
407 return; 410 return;
408 } 411 }
409 412
410 int align = alignment; 413 int align = alignment;
411 414
412 if ( !p ) 415 if ( !p )
413 return; 416 return;
414 417
415 p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); 418 p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) );
416 419
417 QListView *lv = listView(); 420 QListView *lv = listView();
418 if ( !lv ) 421 if ( !lv )
419 return; 422 return;
420 int marg = 2;//lv->itemMargin(); 423 int marg = 2;//lv->itemMargin();
421 int r = 0; 424 int r = 0;
422 QCheckListItem::Type myType = QCheckListItem::CheckBox; 425 QCheckListItem::Type myType = QCheckListItem::CheckBox;
423 int BoxSize = 20; 426 int BoxSize = 20;
424 int boxOffset = 2; 427 int boxOffset = 2;
425 int xOffset = 2; 428 int xOffset = 2;
426 if (qApp->desktop()->width() < 300 ) { 429 if (qApp->desktop()->width() < 300 ) {
427 BoxSize = 14; 430 BoxSize = 14;
428 boxOffset = -1; 431 boxOffset = -1;
429 xOffset = 1; 432 xOffset = 1;
430 // marg = 0; 433 // marg = 0;
431 } 434 }
432 if ( height() < BoxSize ) { 435 if ( height() < BoxSize ) {
433 boxOffset = boxOffset - ((BoxSize - height())/2) ; 436 boxOffset = boxOffset - ((BoxSize - height())/2) ;
434 // qDebug("boxOffset %d height %d", boxOffset, height() ); 437 // qDebug("boxOffset %d height %d", boxOffset, height() );
435 BoxSize = height(); 438 BoxSize = height();
436 439
437 } 440 }
438 //bool winStyle = lv->style() == WindowsStyle; 441 //bool winStyle = lv->style() == WindowsStyle;
439 442
440 int lineStart = 5; 443 int lineStart = 5;
441 if ( myType == Controller ) { 444 if ( myType == Controller ) {
442 if ( !pixmap( 0 ) ) 445 if ( !pixmap( 0 ) )
443 r += BoxSize + 4; 446 r += BoxSize + 4;
444 } else { 447 } else {
445 ASSERT( lv ); //### 448 ASSERT( lv ); //###
446 //QFontMetrics fm( lv->font() ); 449 //QFontMetrics fm( lv->font() );
447 //int d = fm.height(); 450 //int d = fm.height();
448 int x = 0; 451 int x = 0;
449 int y = (height() - BoxSize) / 2; 452 int y = (height() - BoxSize) / 2;
450 //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); 453 //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) );
451 if ( myType == CheckBox ) { 454 if ( myType == CheckBox ) {
452 if ( isEnabled() ) 455 if ( isEnabled() )
453 p->setPen( QPen( _cg.text(), 1 ) ); 456 p->setPen( QPen( _cg.text(), 1 ) );
454 else 457 else
455 p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) ); 458 p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) );
456 p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); 459 p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 );
457 lineStart = x+marg; 460 lineStart = x+marg;
458 ///////////////////// 461 /////////////////////
459 x++; 462 x++;
460 y++; 463 y++;
461 if ( isOn() ) { 464 if ( isOn() ) {
462 QPointArray a( 7*2 ); 465 QPointArray a( 7*2 );
463 int i, xx, yy; 466 int i, xx, yy;
464 xx = x+xOffset+marg+(boxOffset/2); 467 xx = x+xOffset+marg+(boxOffset/2);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 006a8dd..019f41f 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -426,238 +426,241 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
426 mCalendar->checkAlarmForIncidence( 0, true); 426 mCalendar->checkAlarmForIncidence( 0, true);
427 //showMaximized(); 427 //showMaximized();
428 //raise(); 428 //raise();
429 hide(); 429 hide();
430 return; 430 return;
431 } 431 }
432 if ( cmsg == "-newCountdown" ) { 432 if ( cmsg == "-newCountdown" ) {
433 qDebug("newCountdown "); 433 qDebug("newCountdown ");
434 434
435 } 435 }
436 QString msg ; 436 QString msg ;
437 QString allmsg = cmsg; 437 QString allmsg = cmsg;
438 while ( allmsg.length() > 0 ) { 438 while ( allmsg.length() > 0 ) {
439 int nextC = allmsg.find( "-", 1 ); 439 int nextC = allmsg.find( "-", 1 );
440 if ( nextC == -1 ) { 440 if ( nextC == -1 ) {
441 msg = allmsg; 441 msg = allmsg;
442 allmsg = ""; 442 allmsg = "";
443 } else{ 443 } else{
444 msg = allmsg.left( nextC ); 444 msg = allmsg.left( nextC );
445 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 445 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
446 } 446 }
447 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 447 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
448 if ( msg == "-newEvent" ) { 448 if ( msg == "-newEvent" ) {
449 mView->newEvent(); 449 mView->newEvent();
450 } 450 }
451 if ( msg == "-newTodo" ) { 451 if ( msg == "-newTodo" ) {
452 mView->newTodo(); 452 mView->newTodo();
453 453
454 } 454 }
455 if ( msg == "-showWN" ) { 455 if ( msg == "-showWN" ) {
456 mView->viewManager()->showWhatsNextView(); 456 mView->viewManager()->showWhatsNextView();
457 } 457 }
458 if ( msg == "-showTodo" ) { 458 if ( msg == "-showTodo" ) {
459 mView->viewManager()->showTodoView(); 459 mView->viewManager()->showTodoView();
460 } 460 }
461 if ( msg == "-showList" ) { 461 if ( msg == "-showList" ) {
462 mView->viewManager()->showListView(); 462 mView->viewManager()->showListView();
463 } 463 }
464 else if ( msg == "-showDay" ) { 464 else if ( msg == "-showDay" ) {
465 mView->viewManager()->showDayView(); 465 mView->viewManager()->showDayView();
466 } 466 }
467 else if ( msg == "-showWWeek" ) { 467 else if ( msg == "-showWWeek" ) {
468 mView->viewManager()->showWorkWeekView(); 468 mView->viewManager()->showWorkWeekView();
469 } 469 }
470 else if ( msg == "-ringSync" ) { 470 else if ( msg == "-ringSync" ) {
471 mSyncManager->multiSync( false ); 471 mSyncManager->multiSync( false );
472 } 472 }
473 else if ( msg == "-showWeek" ) { 473 else if ( msg == "-showWeek" ) {
474 mView->viewManager()->showWeekView(); 474 mView->viewManager()->showWeekView();
475 } 475 }
476 else if ( msg == "-showTodo" ) { 476 else if ( msg == "-showTodo" ) {
477 mView->viewManager()->showTodoView(); 477 mView->viewManager()->showTodoView();
478 } 478 }
479 else if ( msg == "-showJournal" ) { 479 else if ( msg == "-showJournal" ) {
480 mView->dateNavigator()->selectDates( 1 ); 480 mView->dateNavigator()->selectDates( 1 );
481 mView->dateNavigator()->selectToday(); 481 mView->dateNavigator()->selectToday();
482 mView->viewManager()->showJournalView(); 482 mView->viewManager()->showJournalView();
483 } 483 }
484 else if ( msg == "-showKO" ) { 484 else if ( msg == "-showKO" ) {
485 mView->viewManager()->showNextXView(); 485 mView->viewManager()->showNextXView();
486 } 486 }
487 else if ( msg == "-showWNext" || msg == "nextView()" ) { 487 else if ( msg == "-showWNext" || msg == "nextView()" ) {
488 mView->viewManager()->showWhatsNextView(); 488 mView->viewManager()->showWhatsNextView();
489 } 489 }
490 else if ( msg == "-showNextXView" ) { 490 else if ( msg == "-showNextXView" ) {
491 mView->viewManager()->showNextXView(); 491 mView->viewManager()->showNextXView();
492 } 492 }
493 493
494 494
495 } 495 }
496 496
497 showMaximized(); 497 showMaximized();
498 raise(); 498 raise();
499} 499}
500 500
501QPixmap MainWindow::loadPixmap( QString name ) 501QPixmap MainWindow::loadPixmap( QString name )
502{ 502{
503 return SmallIcon( name ); 503 return SmallIcon( name );
504 504
505} 505}
506void MainWindow::initActions() 506void MainWindow::initActions()
507{ 507{
508 //KOPrefs::instance()->mShowFullMenu 508 //KOPrefs::instance()->mShowFullMenu
509 iconToolBar->clear(); 509 iconToolBar->clear();
510 KOPrefs *p = KOPrefs::instance(); 510 KOPrefs *p = KOPrefs::instance();
511 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 511 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
512 512
513 QPopupMenu *viewMenu = new QPopupMenu( this ); 513 QPopupMenu *viewMenu = new QPopupMenu( this );
514 QPopupMenu *actionMenu = new QPopupMenu( this ); 514 QPopupMenu *actionMenu = new QPopupMenu( this );
515 QPopupMenu *importMenu = new QPopupMenu( this ); 515 QPopupMenu *importMenu = new QPopupMenu( this );
516 selectFilterMenu = new QPopupMenu( this ); 516 selectFilterMenu = new QPopupMenu( this );
517 selectFilterMenu->setCheckable( true ); 517 selectFilterMenu->setCheckable( true );
518 syncMenu = new QPopupMenu( this ); 518 syncMenu = new QPopupMenu( this );
519 configureAgendaMenu = new QPopupMenu( this ); 519 configureAgendaMenu = new QPopupMenu( this );
520 configureToolBarMenu = new QPopupMenu( this ); 520 configureToolBarMenu = new QPopupMenu( this );
521 QPopupMenu *helpMenu = new QPopupMenu( this ); 521 QPopupMenu *helpMenu = new QPopupMenu( this );
522
523 QIconSet icon;
524 int pixWid = 22, pixHei = 22;
525 QString pathString = "";
526 if ( !p->mToolBarMiniIcons ) {
527 if ( QApplication::desktop()->width() < 480 ) {
528 pathString += "icons16/";
529 pixWid = 18; pixHei = 16;
530 }
531 } else {
532 pathString += "iconsmini/";
533 pixWid = 18; pixHei = 16;
534 }
522 if ( KOPrefs::instance()->mShowFullMenu ) { 535 if ( KOPrefs::instance()->mShowFullMenu ) {
523 QMenuBar *menuBar1; 536 QMenuBar *menuBar1;
524 menuBar1 = menuBar(); 537 menuBar1 = menuBar();
525 menuBar1->insertItem( i18n("File"), importMenu ); 538 menuBar1->insertItem( i18n("File"), importMenu );
526 menuBar1->insertItem( i18n("View"), viewMenu ); 539 menuBar1->insertItem( i18n("View"), viewMenu );
527 menuBar1->insertItem( i18n("Actions"), actionMenu ); 540 menuBar1->insertItem( i18n("Actions"), actionMenu );
528#ifdef DESKTOP_VERSION 541#ifdef DESKTOP_VERSION
529 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 542 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
530 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 543 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
531#else 544#else
532 menuBar1->insertItem( i18n("Sync"), syncMenu ); 545 menuBar1->insertItem( i18n("Sync"), syncMenu );
533 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 546 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
534#endif 547#endif
535 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 548 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
536 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 549 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
537 menuBar1->insertItem( i18n("Help"), helpMenu ); 550 menuBar1->insertItem( i18n("Help"), helpMenu );
538 } else { 551 } else {
539 QPEMenuBar *menuBar1; 552 QPEMenuBar *menuBar1;
540 menuBar1 = new QPEMenuBar( iconToolBar ); 553 menuBar1 = new QPEMenuBar( iconToolBar );
541 QPopupMenu *menuBar = new QPopupMenu( this ); 554 QPopupMenu *menuBar = new QPopupMenu( this );
542 menuBar1->insertItem( i18n("ME"), menuBar); 555 icon = loadPixmap( pathString + "z_menu" );
556 menuBar1->insertItem( icon.pixmap(), menuBar);
557 //menuBar1->insertItem( i18n("ME"), menuBar);
543 menuBar->insertItem( i18n("File"), importMenu ); 558 menuBar->insertItem( i18n("File"), importMenu );
544 menuBar->insertItem( i18n("View"), viewMenu ); 559 menuBar->insertItem( i18n("View"), viewMenu );
545 menuBar->insertItem( i18n("Actions"), actionMenu ); 560 menuBar->insertItem( i18n("Actions"), actionMenu );
546 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 561 menuBar->insertItem( i18n("Synchronize"), syncMenu );
547 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 562 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
548 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 563 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
549 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 564 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
550 menuBar->insertItem( i18n("Help"), helpMenu ); 565 menuBar->insertItem( i18n("Help"), helpMenu );
551 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 566 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
552 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 567 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
553 } 568 }
554 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 569 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
555 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 570 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
556 QIconSet icon;
557 int pixWid = 22, pixHei = 22;
558 QString pathString = "";
559 if ( !p->mToolBarMiniIcons ) {
560 if ( QApplication::desktop()->width() < 480 ) {
561 pathString += "icons16/";
562 pixWid = 18; pixHei = 16;
563 }
564 } else {
565 pathString += "iconsmini/";
566 pixWid = 18; pixHei = 16;
567 }
568 mWeekBgColor = iconToolBar->backgroundColor(); 571 mWeekBgColor = iconToolBar->backgroundColor();
569 mWeekPixmap.resize( pixWid , pixHei ); 572 mWeekPixmap.resize( pixWid , pixHei );
570 mWeekPixmap.fill( mWeekBgColor ); 573 mWeekPixmap.fill( mWeekBgColor );
571 icon = mWeekPixmap; 574 icon = mWeekPixmap;
572 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 575 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
573 if ( p-> mShowIconWeekNum ) 576 if ( p-> mShowIconWeekNum )
574 mWeekAction->addTo( iconToolBar ); 577 mWeekAction->addTo( iconToolBar );
575 mWeekFont = font(); 578 mWeekFont = font();
576 579
577 int fontPoint = mWeekFont.pointSize(); 580 int fontPoint = mWeekFont.pointSize();
578 QFontMetrics f( mWeekFont ); 581 QFontMetrics f( mWeekFont );
579 int fontWid = f.width( "30" ); 582 int fontWid = f.width( "30" );
580 while ( fontWid > pixWid ) { 583 while ( fontWid > pixWid ) {
581 --fontPoint; 584 --fontPoint;
582 mWeekFont.setPointSize( fontPoint ); 585 mWeekFont.setPointSize( fontPoint );
583 QFontMetrics f( mWeekFont ); 586 QFontMetrics f( mWeekFont );
584 fontWid = f.width( "30" ); 587 fontWid = f.width( "30" );
585 qDebug("dec-- "); 588 qDebug("dec-- ");
586 } 589 }
587 590
588 connect( mWeekAction, SIGNAL( activated() ), 591 connect( mWeekAction, SIGNAL( activated() ),
589 this, SLOT( weekAction() ) ); 592 this, SLOT( weekAction() ) );
590 593
591 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 594 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
592 595
593 //#endif 596 //#endif
594 // ****************** 597 // ******************
595 QAction *action; 598 QAction *action;
596 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 599 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
597 configureToolBarMenu->setCheckable( true ); 600 configureToolBarMenu->setCheckable( true );
598 601
599 602
600 configureAgendaMenu->setCheckable( true ); 603 configureAgendaMenu->setCheckable( true );
601 int iii ; 604 int iii ;
602 for ( iii = 1;iii<= 10 ;++iii ){ 605 for ( iii = 1;iii<= 10 ;++iii ){
603 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 606 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
604 } 607 }
605 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 608 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
606 609
607 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 610 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
608 this, SLOT( showConfigureAgenda( ) ) ); 611 this, SLOT( showConfigureAgenda( ) ) );
609 612
610 icon = loadPixmap( pathString + "configure" ); 613 icon = loadPixmap( pathString + "configure" );
611 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); 614 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this );
612 action->addTo( actionMenu ); 615 action->addTo( actionMenu );
613 connect( action, SIGNAL( activated() ), 616 connect( action, SIGNAL( activated() ),
614 mView, SLOT( edit_options() ) ); 617 mView, SLOT( edit_options() ) );
615 actionMenu->insertSeparator(); 618 actionMenu->insertSeparator();
616 619
617 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 620 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
618 action->addTo( actionMenu ); 621 action->addTo( actionMenu );
619 connect( action, SIGNAL( activated() ), 622 connect( action, SIGNAL( activated() ),
620 mView, SLOT( undo_delete() ) ); 623 mView, SLOT( undo_delete() ) );
621 actionMenu->insertSeparator(); 624 actionMenu->insertSeparator();
622 625
623 icon = loadPixmap( pathString + "newevent" ); 626 icon = loadPixmap( pathString + "newevent" );
624 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 627 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
625 configureToolBarMenu->insertSeparator(); 628 configureToolBarMenu->insertSeparator();
626 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 629 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
627 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 630 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
628 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 631 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
629 ne_action->addTo( actionMenu ); 632 ne_action->addTo( actionMenu );
630 connect( ne_action, SIGNAL( activated() ), 633 connect( ne_action, SIGNAL( activated() ),
631 mView, SLOT( newEvent() ) ); 634 mView, SLOT( newEvent() ) );
632 icon = loadPixmap( pathString + "newtodo" ); 635 icon = loadPixmap( pathString + "newtodo" );
633 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 636 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
634 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 637 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
635 nt_action->addTo( actionMenu ); 638 nt_action->addTo( actionMenu );
636 connect( nt_action, SIGNAL( activated() ), 639 connect( nt_action, SIGNAL( activated() ),
637 mView, SLOT( newTodo() ) ); 640 mView, SLOT( newTodo() ) );
638 641
639 icon = loadPixmap( pathString + "today" ); 642 icon = loadPixmap( pathString + "today" );
640 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 643 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
641 today_action->addTo( viewMenu ); 644 today_action->addTo( viewMenu );
642 connect( today_action, SIGNAL( activated() ), 645 connect( today_action, SIGNAL( activated() ),
643 mView, SLOT( goToday() ) ); 646 mView, SLOT( goToday() ) );
644 viewMenu->insertSeparator(); 647 viewMenu->insertSeparator();
645 648
646 icon = loadPixmap( pathString + "navi" ); 649 icon = loadPixmap( pathString + "navi" );
647 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 650 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
648 action->addTo( viewMenu ); 651 action->addTo( viewMenu );
649 connect( action, SIGNAL( activated() ), 652 connect( action, SIGNAL( activated() ),
650 mView, SLOT( toggleDateNavigatorWidget() ) ); 653 mView, SLOT( toggleDateNavigatorWidget() ) );
651 mToggleNav = action ; 654 mToggleNav = action ;
652 icon = loadPixmap( pathString + "filter" ); 655 icon = loadPixmap( pathString + "filter" );
653 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 656 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
654 action->addTo( viewMenu ); 657 action->addTo( viewMenu );
655 connect( action, SIGNAL( activated() ), 658 connect( action, SIGNAL( activated() ),
656 mView, SLOT( toggleFilter() ) ); 659 mView, SLOT( toggleFilter() ) );
657 mToggleFilter = action; 660 mToggleFilter = action;
658 icon = loadPixmap( pathString + "allday" ); 661 icon = loadPixmap( pathString + "allday" );
659 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 662 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
660 action->addTo( viewMenu ); 663 action->addTo( viewMenu );
661 connect( action, SIGNAL( activated() ), 664 connect( action, SIGNAL( activated() ),
662 mView, SLOT( toggleAllDaySize() ) ); 665 mView, SLOT( toggleAllDaySize() ) );
663 mToggleAllday = action; 666 mToggleAllday = action;
diff --git a/pwmanager/pwmanager/listviewpwm.cpp b/pwmanager/pwmanager/listviewpwm.cpp
index 8d46fff..0df9431 100644
--- a/pwmanager/pwmanager/listviewpwm.cpp
+++ b/pwmanager/pwmanager/listviewpwm.cpp
@@ -1,121 +1,129 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * copyright (C) 2004 by Michael Buesch * 3 * copyright (C) 2004 by Michael Buesch *
4 * email: mbuesch@freenet.de * 4 * email: mbuesch@freenet.de *
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License version 2 * 7 * it under the terms of the GNU General Public License version 2 *
8 * as published by the Free Software Foundation. * 8 * as published by the Free Software Foundation. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "listviewpwm.h" 20#include "listviewpwm.h"
21#include "pwmexception.h" 21#include "pwmexception.h"
22#include "pwmview.h" 22#include "pwmview.h"
23 23
24#include <qpainter.h> 24#include <qpainter.h>
25#include <qpixmap.h> 25#include <qpixmap.h>
26 26
27#include <kiconloader.h> 27#include <kiconloader.h>
28 28
29#ifdef PWM_EMBEDDED 29#ifdef PWM_EMBEDDED
30#include <kglobal.h> 30#include <kglobal.h>
31#endif 31#endif
32 32
33ListViewPwM::ListViewPwM(QWidget *parent, const char *name) 33ListViewPwM::ListViewPwM(QWidget *parent, const char *name)
34 : KListView(parent, name) 34 : KListView(parent, name)
35{ 35{
36 //setResizeMode(QListView::AllColumns); 36 //setResizeMode(QListView::AllColumns);
37 setAllColumnsShowFocus (true ); 37 setAllColumnsShowFocus (true );
38} 38}
39 39
40bool ListViewPwM::event(QEvent *e) 40bool ListViewPwM::event(QEvent *e)
41{ 41{
42 if (e->type() == QEvent::LayoutHint) 42 if (e->type() == QEvent::LayoutHint)
43 emit layoutChanged(); 43 emit layoutChanged();
44 if (e->type() == QEvent::KeyPress) { 44 if (e->type() == QEvent::KeyPress) {
45 QKeyEvent* ke = (QKeyEvent*) e; 45 QKeyEvent* ke = (QKeyEvent*) e;
46 if ( ke->key() == Qt::Key_Space) { 46 if ( ke->key() == Qt::Key_Space) {
47 emit toggleOverview(); 47 emit toggleOverview();
48 return true; 48 return true;
49 } 49 }
50 if ( ke->key() == Qt::Key_I || ke->key() == Qt::Key_N || ke->key() == Qt::Key_Insert) {
51 emit insertPW();
52 return true;
53 }
54 if ( ke->key() == Qt::Key_Delete || ke->key() == Qt::Key_Backspace) {
55 emit deletePW();
56 return true;
57 }
50 58
51 } 59 }
52 return KListView::event(e); 60 return KListView::event(e);
53} 61}
54 62
55 63
56QPixmap * ListViewItemPwM::onPix = 0; 64QPixmap * ListViewItemPwM::onPix = 0;
57QPixmap * ListViewItemPwM::offPix = 0; 65QPixmap * ListViewItemPwM::offPix = 0;
58 66
59ListViewItemPwM::ListViewItemPwM(QListView *parent) 67ListViewItemPwM::ListViewItemPwM(QListView *parent)
60 : QCheckListItem(parent, "", QCheckListItem::CheckBox) 68 : QCheckListItem(parent, "", QCheckListItem::CheckBox)
61{ 69{
62 if (!onPix) { 70 if (!onPix) {
63 PWM_ASSERT(!offPix); 71 PWM_ASSERT(!offPix);
64 KIconLoader* picons; 72 KIconLoader* picons;
65#ifndef PWM_EMBEDDED 73#ifndef PWM_EMBEDDED
66 KIconLoader il; 74 KIconLoader il;
67 picons = &il; 75 picons = &il;
68#else 76#else
69 picons = KGlobal::iconLoader(); 77 picons = KGlobal::iconLoader();
70#endif 78#endif
71 79
72 KIconLoader il; 80 KIconLoader il;
73#ifndef PWM_EMBEDDED 81#ifndef PWM_EMBEDDED
74 static QPixmap onP(picons->loadIcon("button_ok", KIcon::Small)); 82 static QPixmap onP(picons->loadIcon("button_ok", KIcon::Small));
75#else 83#else
76 static QPixmap onP(picons->loadIcon("decrypted", KIcon::Small)); 84 static QPixmap onP(picons->loadIcon("decrypted", KIcon::Small));
77#endif 85#endif
78 onPix = &onP; 86 onPix = &onP;
79 static QPixmap offP(picons->loadIcon("encrypted", KIcon::Small)); 87 static QPixmap offP(picons->loadIcon("encrypted", KIcon::Small));
80 offPix = &offP; 88 offPix = &offP;
81 } 89 }
82} 90}
83 91
84void ListViewItemPwM::paintCell(QPainter *p, const QColorGroup &cg, 92void ListViewItemPwM::paintCell(QPainter *p, const QColorGroup &cg,
85 int column, int width, int align) 93 int column, int width, int align)
86{ 94{
87 // qDebug("ListViewItemPwM::paintCell column=%i", column); 95 // qDebug("ListViewItemPwM::paintCell column=%i", column);
88 if (!p) 96 if (!p)
89 return; 97 return;
90 //US BUG: 98 //US BUG:
91 if (column != COLUMN_DESC) { 99 if (column != COLUMN_DESC) {
92 QCheckListItem::paintCell(p, cg, column, width, align); 100 QCheckListItem::paintCell(p, cg, column, width, align);
93 return; 101 return;
94 } 102 }
95 QPixmap *curPix = isOn() ? onPix : offPix; 103 QPixmap *curPix = isOn() ? onPix : offPix;
96 int pixSpace = curPix->width(); 104 int pixSpace = curPix->width();
97 pixSpace += 4; 105 pixSpace += 4;
98#ifndef PWM_EMBEDDED 106#ifndef PWM_EMBEDDED
99 QRect window(p->viewport()); 107 QRect window(p->viewport());
100 // clear the rectangle (we have to clear it first. see QT doc) 108 // clear the rectangle (we have to clear it first. see QT doc)
101 p->eraseRect(0, 0, pixSpace, window.height()); 109 p->eraseRect(0, 0, pixSpace, window.height());
102 // now draw the pixmap 110 // now draw the pixmap
103 int y = (height() - curPix->height()) / 2; 111 int y = (height() - curPix->height()) / 2;
104 p->drawPixmap(1, y, *curPix); 112 p->drawPixmap(1, y, *curPix);
105 window.moveLeft(pixSpace); 113 window.moveLeft(pixSpace);
106 p->setViewport(window); 114 p->setViewport(window);
107#else 115#else
108 p->eraseRect(0, 0, pixSpace, height()); 116 p->eraseRect(0, 0, pixSpace, height());
109 // now draw the pixmap 117 // now draw the pixmap
110 int y = (height() - curPix->height()) / 2; 118 int y = (height() - curPix->height()) / 2;
111 p->drawPixmap(1, y, *curPix); 119 p->drawPixmap(1, y, *curPix);
112 p->translate( pixSpace, 0 ); 120 p->translate( pixSpace, 0 );
113 121
114#endif 122#endif
115 QListViewItem::paintCell(p, cg, column, width - pixSpace, align); 123 QListViewItem::paintCell(p, cg, column, width - pixSpace, align);
116 124
117} 125}
118 126
119#ifndef PWM_EMBEDDED 127#ifndef PWM_EMBEDDED
120#include "listviewpwm.moc" 128#include "listviewpwm.moc"
121#endif 129#endif
diff --git a/pwmanager/pwmanager/listviewpwm.h b/pwmanager/pwmanager/listviewpwm.h
index 840ee73..51008b8 100644
--- a/pwmanager/pwmanager/listviewpwm.h
+++ b/pwmanager/pwmanager/listviewpwm.h
@@ -1,58 +1,60 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * copyright (C) 2004 by Michael Buesch * 3 * copyright (C) 2004 by Michael Buesch *
4 * email: mbuesch@freenet.de * 4 * email: mbuesch@freenet.de *
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License version 2 * 7 * it under the terms of the GNU General Public License version 2 *
8 * as published by the Free Software Foundation. * 8 * as published by the Free Software Foundation. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef __LISTVIEW_H 20#ifndef __LISTVIEW_H
21#define __LISTVIEW_H 21#define __LISTVIEW_H
22 22
23#include <klistview.h> 23#include <klistview.h>
24 24
25/** PwManager implementation of the list view. 25/** PwManager implementation of the list view.
26 * Derived from KListView. 26 * Derived from KListView.
27 */ 27 */
28class ListViewPwM : public KListView 28class ListViewPwM : public KListView
29{ 29{
30 Q_OBJECT 30 Q_OBJECT
31public: 31public:
32 ListViewPwM(QWidget *parent = 0, const char *name = 0); 32 ListViewPwM(QWidget *parent = 0, const char *name = 0);
33 33
34signals: 34signals:
35 void layoutChanged(); 35 void layoutChanged();
36 void toggleOverview(); 36 void toggleOverview();
37 void insertPW();
38 void deletePW( );
37 39
38protected: 40protected:
39 virtual bool event(QEvent *e); 41 virtual bool event(QEvent *e);
40}; 42};
41 43
42class ListViewItemPwM : public QCheckListItem 44class ListViewItemPwM : public QCheckListItem
43{ 45{
44public: 46public:
45 ListViewItemPwM(QListView *parent); 47 ListViewItemPwM(QListView *parent);
46 48
47protected: 49protected:
48 void paintCell(QPainter *p, const QColorGroup &cg, 50 void paintCell(QPainter *p, const QColorGroup &cg,
49 int column, int width, int align); 51 int column, int width, int align);
50 52
51protected: 53protected:
52 /** pixmap to display for an item with state "on" */ 54 /** pixmap to display for an item with state "on" */
53 static QPixmap *onPix; 55 static QPixmap *onPix;
54 /** pixmap to display for an item with state "off" */ 56 /** pixmap to display for an item with state "off" */
55 static QPixmap *offPix; 57 static QPixmap *offPix;
56}; 58};
57 59
58#endif 60#endif
diff --git a/pwmanager/pwmanager/pwmview.cpp b/pwmanager/pwmanager/pwmview.cpp
index 0092692..2533487 100644
--- a/pwmanager/pwmanager/pwmview.cpp
+++ b/pwmanager/pwmanager/pwmview.cpp
@@ -1,164 +1,166 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * copyright (C) 2003, 2004 by Michael Buesch * 3 * copyright (C) 2003, 2004 by Michael Buesch *
4 * email: mbuesch@freenet.de * 4 * email: mbuesch@freenet.de *
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License version 2 * 7 * it under the terms of the GNU General Public License version 2 *
8 * as published by the Free Software Foundation. * 8 * as published by the Free Software Foundation. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "pwmview.h" 20#include "pwmview.h"
21#include "pwmexception.h" 21#include "pwmexception.h"
22#include "globalstuff.h" 22#include "globalstuff.h"
23#include "pwm.h" 23#include "pwm.h"
24#include "rencatwnd.h" 24#include "rencatwnd.h"
25#ifndef PWM_EMBEDDED 25#ifndef PWM_EMBEDDED
26#include "configuration.h" 26#include "configuration.h"
27#else 27#else
28#include "pwmprefs.h" 28#include "pwmprefs.h"
29#endif 29#endif
30#include "commentbox.h" 30#include "commentbox.h"
31 31
32#include <kmessagebox.h> 32#include <kmessagebox.h>
33#include <klocale.h> 33#include <klocale.h>
34 34
35#include <qlineedit.h> 35#include <qlineedit.h>
36#include <qpoint.h> 36#include <qpoint.h>
37#include <qapplication.h> 37#include <qapplication.h>
38#include <qlayout.h> 38#include <qlayout.h>
39 39
40//US ENH: wouldn't it be a good idea if we could use this consts everywhere else. 40//US ENH: wouldn't it be a good idea if we could use this consts everywhere else.
41//US ENH: for examle in listviewpwm.cpp 41//US ENH: for examle in listviewpwm.cpp
42//US ENH: Because of that I transfer them into the headerfile. 42//US ENH: Because of that I transfer them into the headerfile.
43/* 43/*
44 #define COLUMN_DESC 0 44 #define COLUMN_DESC 0
45 #define COLUMN_NAME 1 45 #define COLUMN_NAME 1
46 #define COLUMN_PW 2 46 #define COLUMN_PW 2
47 #define COLUMN_URL 3 47 #define COLUMN_URL 3
48 #define COLUMN_LAUNCHER 4 48 #define COLUMN_LAUNCHER 4
49*/ 49*/
50 50
51PwMView::PwMView(PwM *_mainClass, 51PwMView::PwMView(PwM *_mainClass,
52 QWidget *parent, PwMDoc *_doc, 52 QWidget *parent, PwMDoc *_doc,
53 const char *name) 53 const char *name)
54 : PwMViewStyle(parent, name) 54 : PwMViewStyle(parent, name)
55{ 55{
56 PWM_ASSERT(_mainClass); 56 PWM_ASSERT(_mainClass);
57 PWM_ASSERT(parent); 57 PWM_ASSERT(parent);
58 PWM_ASSERT(_doc); 58 PWM_ASSERT(_doc);
59 setView(this); 59 setView(this);
60 doc = _doc; 60 doc = _doc;
61 doc->setListViewPointer(this); 61 doc->setListViewPointer(this);
62 mainClass = _mainClass; 62 mainClass = _mainClass;
63 resize(_mainClass->size()); 63 resize(_mainClass->size());
64 initStyle(conf()->confWndMainViewStyle()); 64 initStyle(conf()->confWndMainViewStyle());
65 initCtxMenu(); 65 initCtxMenu();
66 doc->setCurrentView(this); 66 doc->setCurrentView(this);
67 connect(doc, SIGNAL(dataChanged(PwMDoc *)), this, SLOT(updateView())); 67 connect(doc, SIGNAL(dataChanged(PwMDoc *)), this, SLOT(updateView()));
68 connect(this, SIGNAL(editPW()), mainClass, SLOT(editPwd_slot())); 68 connect(this, SIGNAL(editPW()), mainClass, SLOT(editPwd_slot()));
69 connect(this, SIGNAL(insertPW()), mainClass, SLOT(addPwd_slot()));
70 connect(this, SIGNAL(deletePW()), mainClass, SLOT(deletePwd_slot()));
69} 71}
70 72
71PwMView::~PwMView() 73PwMView::~PwMView()
72{ 74{
73} 75}
74 76
75void PwMView::initCtxMenu() 77void PwMView::initCtxMenu()
76{ 78{
77 ctxMenu = new QPopupMenu(this); 79 ctxMenu = new QPopupMenu(this);
78 ctxMenu->insertItem(i18n("&Add password"), mainClass, SLOT(addPwd_slot())); 80 ctxMenu->insertItem(i18n("&Add password"), mainClass, SLOT(addPwd_slot()));
79 ctxMenu->insertSeparator(); 81 ctxMenu->insertSeparator();
80 ctxMenu->insertItem(i18n("&Edit"), mainClass, SLOT(editPwd_slot())); 82 ctxMenu->insertItem(i18n("&Edit"), mainClass, SLOT(editPwd_slot()));
81 ctxMenu->insertItem(i18n("&Delete"), mainClass, SLOT(deletePwd_slot())); 83 ctxMenu->insertItem(i18n("&Delete"), mainClass, SLOT(deletePwd_slot()));
82 ctxMenu->insertSeparator(); 84 ctxMenu->insertSeparator();
83 ctxMenu->insertItem(i18n("copy password to clipboard"), 85 ctxMenu->insertItem(i18n("copy password to clipboard"),
84 this, SLOT(copyPwToClip())); 86 this, SLOT(copyPwToClip()));
85 ctxMenu->insertItem(i18n("copy username to clipboard"), 87 ctxMenu->insertItem(i18n("copy username to clipboard"),
86 this, SLOT(copyNameToClip())); 88 this, SLOT(copyNameToClip()));
87 ctxMenu->insertItem(i18n("copy description to clipboard"), 89 ctxMenu->insertItem(i18n("copy description to clipboard"),
88 this, SLOT(copyDescToClip())); 90 this, SLOT(copyDescToClip()));
89 ctxMenu->insertItem(i18n("copy url to clipboard"), 91 ctxMenu->insertItem(i18n("copy url to clipboard"),
90 this, SLOT(copyUrlToClip())); 92 this, SLOT(copyUrlToClip()));
91 ctxMenu->insertItem(i18n("copy launcher to clipboard"), 93 ctxMenu->insertItem(i18n("copy launcher to clipboard"),
92 this, SLOT(copyLauncherToClip())); 94 this, SLOT(copyLauncherToClip()));
93 ctxMenu->insertItem(i18n("copy comment to clipboard"), 95 ctxMenu->insertItem(i18n("copy comment to clipboard"),
94 this, SLOT(copyCommentToClip())); 96 this, SLOT(copyCommentToClip()));
95 ctxMenu->insertSeparator(); 97 ctxMenu->insertSeparator();
96 ctxMenu->insertItem(i18n("Execute \"Launcher\""), mainClass, 98 ctxMenu->insertItem(i18n("Execute \"Launcher\""), mainClass,
97 SLOT(execLauncher_slot())); 99 SLOT(execLauncher_slot()));
98 ctxMenu->insertItem(i18n("Go to \"URL\""), mainClass, 100 ctxMenu->insertItem(i18n("Go to \"URL\""), mainClass,
99 SLOT(goToURL_slot())); 101 SLOT(goToURL_slot()));
100} 102}
101 103
102void PwMView::resizeEvent(QResizeEvent *) 104void PwMView::resizeEvent(QResizeEvent *)
103{ 105{
104 resizeView(size()); 106 resizeView(size());
105} 107}
106 108
107void PwMView::refreshCommentTextEdit(QListViewItem *curItem) 109void PwMView::refreshCommentTextEdit(QListViewItem *curItem)
108{ 110{
109 PWM_ASSERT(commentBox); 111 PWM_ASSERT(commentBox);
110 if (!curItem) 112 if (!curItem)
111 return; 113 return;
112 string comment; 114 string comment;
113 PwMerror ret; 115 PwMerror ret;
114 ret = document()->getCommentByLvp_long(getCurrentCategory(), 116 ret = document()->getCommentByLvp_long(getCurrentCategory(),
115 lv->childCount() - lv->itemIndex(curItem) - 1, 117 lv->childCount() - lv->itemIndex(curItem) - 1,
116 &comment); 118 &comment);
117 if (ret == e_binEntry) { 119 if (ret == e_binEntry) {
118 commentBox->setContent(i18n("This is a binary entry.\n" 120 commentBox->setContent(i18n("This is a binary entry.\n"
119 "It is not a normal password-entry, as it contains " 121 "It is not a normal password-entry, as it contains "
120 "binary data, which PwManager can't display here.")); 122 "binary data, which PwManager can't display here."));
121 } else if (ret == e_normalEntry) { 123 } else if (ret == e_normalEntry) {
122 commentBox->setContent(comment.c_str()); 124 commentBox->setContent(comment.c_str());
123 } else { 125 } else {
124 BUG(); 126 BUG();
125 return; 127 return;
126 } 128 }
127 lv->ensureItemVisible(curItem); 129 lv->ensureItemVisible(curItem);
128} 130}
129 131
130void PwMView::keyReleaseEvent(QKeyEvent * /*e*/) 132void PwMView::keyReleaseEvent(QKeyEvent * /*e*/)
131{ 133{
132 refreshCommentTextEdit(lv->currentItem()); 134 refreshCommentTextEdit(lv->currentItem());
133} 135}
134 136
135bool PwMView::getCurEntryIndex(unsigned int *index) 137bool PwMView::getCurEntryIndex(unsigned int *index)
136{ 138{
137 QListViewItem *current = lv->currentItem(); 139 QListViewItem *current = lv->currentItem();
138 if (!current) 140 if (!current)
139 return false; 141 return false;
140 return getDocEntryIndex(index, current); 142 return getDocEntryIndex(index, current);
141} 143}
142 144
143bool PwMView::getDocEntryIndex(unsigned int *index, 145bool PwMView::getDocEntryIndex(unsigned int *index,
144 const QListViewItem *item) 146 const QListViewItem *item)
145{ 147{
146 vector<unsigned int> foundPositions; 148 vector<unsigned int> foundPositions;
147 PwMDataItem curItem; 149 PwMDataItem curItem;
148 curItem.desc = item->text(COLUMN_DESC).latin1(); 150 curItem.desc = item->text(COLUMN_DESC).latin1();
149 curItem.name = item->text(COLUMN_NAME).latin1(); 151 curItem.name = item->text(COLUMN_NAME).latin1();
150 document()->getCommentByLvp(getCurrentCategory(), 152 document()->getCommentByLvp(getCurrentCategory(),
151 lv->childCount() - lv->itemIndex(item) - 1, 153 lv->childCount() - lv->itemIndex(item) - 1,
152 &curItem.comment); 154 &curItem.comment);
153 curItem.url = item->text(COLUMN_URL).latin1(); 155 curItem.url = item->text(COLUMN_URL).latin1();
154 curItem.launcher = item->text(COLUMN_LAUNCHER).latin1(); 156 curItem.launcher = item->text(COLUMN_LAUNCHER).latin1();
155 document()->findEntry(getCurrentCategory(), curItem, SEARCH_IN_DESC | 157 document()->findEntry(getCurrentCategory(), curItem, SEARCH_IN_DESC |
156 SEARCH_IN_NAME | SEARCH_IN_COMMENT | SEARCH_IN_URL | 158 SEARCH_IN_NAME | SEARCH_IN_COMMENT | SEARCH_IN_URL |
157 SEARCH_IN_LAUNCHER, 159 SEARCH_IN_LAUNCHER,
158 &foundPositions, true); 160 &foundPositions, true);
159 if (foundPositions.size()) { 161 if (foundPositions.size()) {
160 *index = foundPositions[0]; 162 *index = foundPositions[0];
161 return true; 163 return true;
162 } 164 }
163 165
164 return false; 166 return false;
diff --git a/pwmanager/pwmanager/pwmviewstyle.cpp b/pwmanager/pwmanager/pwmviewstyle.cpp
index 5f25880..ee35472 100644
--- a/pwmanager/pwmanager/pwmviewstyle.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle.cpp
@@ -10,192 +10,196 @@
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12 12
13/*************************************************************************** 13/***************************************************************************
14 * copyright (C) 2004 by Ulf Schenk 14 * copyright (C) 2004 by Ulf Schenk
15 * This file is originaly based on version 1.0.1 of pwmanager 15 * This file is originaly based on version 1.0.1 of pwmanager
16 * and was modified to run on embedded devices that run microkde 16 * and was modified to run on embedded devices that run microkde
17 * 17 *
18 * $Id$ 18 * $Id$
19 **************************************************************************/ 19 **************************************************************************/
20 20
21#include "pwmviewstyle.h" 21#include "pwmviewstyle.h"
22#include "pwmexception.h" 22#include "pwmexception.h"
23#include "pwmviewstyle_0.h" 23#include "pwmviewstyle_0.h"
24#include "pwmviewstyle_1.h" 24#include "pwmviewstyle_1.h"
25#include "listviewpwm.h" 25#include "listviewpwm.h"
26#include "pwmview.h" 26#include "pwmview.h"
27#include "commentbox.h" 27#include "commentbox.h"
28#ifndef PWM_EMBEDDED 28#ifndef PWM_EMBEDDED
29#include "configuration.h" 29#include "configuration.h"
30#else 30#else
31#include "pwmprefs.h" 31#include "pwmprefs.h"
32#endif 32#endif
33 33
34PwMViewStyle::PwMViewStyle(QWidget *parent, const char *name) 34PwMViewStyle::PwMViewStyle(QWidget *parent, const char *name)
35 : QWidget(parent, name) 35 : QWidget(parent, name)
36{ 36{
37 curStyle = style_notset; 37 curStyle = style_notset;
38 s0 = 0; 38 s0 = 0;
39 s1 = 0; 39 s1 = 0;
40} 40}
41 41
42PwMViewStyle::~PwMViewStyle() 42PwMViewStyle::~PwMViewStyle()
43{ 43{
44 //US ENH : store the size of the listviewcolumns 44 //US ENH : store the size of the listviewcolumns
45 switch (curStyle) 45 switch (curStyle)
46 { 46 {
47 case style_0: 47 case style_0:
48 s0->saveSettings(PWMPrefs::instance()); 48 s0->saveSettings(PWMPrefs::instance());
49 break; 49 break;
50 case style_1: 50 case style_1:
51 s1->saveSettings(PWMPrefs::instance()); 51 s1->saveSettings(PWMPrefs::instance());
52 break; 52 break;
53 default: 53 default:
54 BUG(); 54 BUG();
55 } 55 }
56 56
57 57
58 PWMPrefs::instance()->writeConfig(); 58 PWMPrefs::instance()->writeConfig();
59 59
60 delete_ifnot_null(s0); 60 delete_ifnot_null(s0);
61 delete_ifnot_null(s1); 61 delete_ifnot_null(s1);
62} 62}
63 63
64void PwMViewStyle::editPassWord( QListViewItem * i ) 64void PwMViewStyle::editPassWord( QListViewItem * i )
65{ 65{
66 if ( !i ) 66 if ( !i )
67 return; 67 return;
68 emit editPW(); 68 emit editPW();
69} 69}
70void PwMViewStyle::initStyle(style_t style) 70void PwMViewStyle::initStyle(style_t style)
71{ 71{
72 printDebug(string("initializing style ") + tostr(style)); 72 printDebug(string("initializing style ") + tostr(style));
73 bool wasMaximized = v->isMaximized(); 73 bool wasMaximized = v->isMaximized();
74 if (v->isVisible()) 74 if (v->isVisible())
75 v->hide(); 75 v->hide();
76 switch (style) { 76 switch (style) {
77 case style_0: 77 case style_0:
78 delete_ifnot_null(s0); 78 delete_ifnot_null(s0);
79 delete_ifnot_null(s1); 79 delete_ifnot_null(s1);
80 s0 = new PwMViewStyle_0(v); 80 s0 = new PwMViewStyle_0(v);
81 lv = s0->getLv(); 81 lv = s0->getLv();
82 commentBox = s0->getCommentBox(); 82 commentBox = s0->getCommentBox();
83 break; 83 break;
84 case style_1: 84 case style_1:
85 delete_ifnot_null(s0); 85 delete_ifnot_null(s0);
86 delete_ifnot_null(s1); 86 delete_ifnot_null(s1);
87 s1 = new PwMViewStyle_1(v); 87 s1 = new PwMViewStyle_1(v);
88 lv = s1->getLv(); 88 lv = s1->getLv();
89 commentBox = s1->getCommentBox(); 89 commentBox = s1->getCommentBox();
90 break; 90 break;
91 default: 91 default:
92 BUG(); 92 BUG();
93 return; 93 return;
94 } 94 }
95 curStyle = style; 95 curStyle = style;
96 connect(lv, SIGNAL(pressed(QListViewItem *)), 96 connect(lv, SIGNAL(pressed(QListViewItem *)),
97 v, SLOT(handleToggle(QListViewItem *))); 97 v, SLOT(handleToggle(QListViewItem *)));
98 connect(lv, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint &, int)), 98 connect(lv, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint &, int)),
99 v, SLOT(handleRightClick(QListViewItem *, const QPoint &, int))); 99 v, SLOT(handleRightClick(QListViewItem *, const QPoint &, int)));
100 connect(lv, SIGNAL(clicked(QListViewItem *)), 100 connect(lv, SIGNAL(clicked(QListViewItem *)),
101 v, SLOT(refreshCommentTextEdit(QListViewItem *))); 101 v, SLOT(refreshCommentTextEdit(QListViewItem *)));
102 connect(lv, SIGNAL(returnPressed(QListViewItem *)), 102 connect(lv, SIGNAL(returnPressed(QListViewItem *)),
103 this, SLOT(editPassWord(QListViewItem *))); 103 this, SLOT(editPassWord(QListViewItem *)));
104 connect(lv, SIGNAL(doubleClicked(QListViewItem *)), 104 connect(lv, SIGNAL(doubleClicked(QListViewItem *)),
105 this, SLOT(editPassWord(QListViewItem *))); 105 this, SLOT(editPassWord(QListViewItem *)));
106 connect(lv, SIGNAL(insertPW()),
107 this, SIGNAL( insertPW() ));
108 connect(lv, SIGNAL(deletePW()),
109 this, SIGNAL( deletePW() ));
106 110
107 lv->addColumn(i18n("Description"), 180); 111 lv->addColumn(i18n("Description"), 180);
108 lv->addColumn(i18n("Username"), 150); 112 lv->addColumn(i18n("Username"), 150);
109 lv->addColumn(i18n("Password"), 150); 113 lv->addColumn(i18n("Password"), 150);
110 lv->addColumn(i18n("URL"), 180); 114 lv->addColumn(i18n("URL"), 180);
111 lv->addColumn(i18n("Launcher"), 120); 115 lv->addColumn(i18n("Launcher"), 120);
112 v->tmpReEnableSort(); 116 v->tmpReEnableSort();
113 117
114 //US ENH : load the size of the listviewcolumns 118 //US ENH : load the size of the listviewcolumns
115 switch (curStyle) 119 switch (curStyle)
116 { 120 {
117 case style_0: 121 case style_0:
118 s0->restoreSettings(PWMPrefs::instance()); 122 s0->restoreSettings(PWMPrefs::instance());
119 break; 123 break;
120 case style_1: 124 case style_1:
121 s1->restoreSettings(PWMPrefs::instance()); 125 s1->restoreSettings(PWMPrefs::instance());
122 break; 126 break;
123 default: 127 default:
124 BUG(); 128 BUG();
125 } 129 }
126 130
127 resizeView(v->size()); 131 resizeView(v->size());
128 v->updateView(); 132 v->updateView();
129 if (wasMaximized) { 133 if (wasMaximized) {
130 v->showMaximized(); 134 v->showMaximized();
131 } else { 135 } else {
132 v->show(); 136 v->show();
133 } 137 }
134 connect(lv, SIGNAL(layoutChanged()), 138 connect(lv, SIGNAL(layoutChanged()),
135 v, SLOT(reorgLp())); 139 v, SLOT(reorgLp()));
136} 140}
137 141
138void PwMViewStyle::resizeView(const QSize &size) 142void PwMViewStyle::resizeView(const QSize &size)
139{ 143{
140 switch (curStyle) { 144 switch (curStyle) {
141 case style_0: 145 case style_0:
142 PWM_ASSERT(s0); 146 PWM_ASSERT(s0);
143 s0->resize(size); 147 s0->resize(size);
144 return; 148 return;
145 case style_1: 149 case style_1:
146 PWM_ASSERT(s1); 150 PWM_ASSERT(s1);
147 s1->resize(size); 151 s1->resize(size);
148 return; 152 return;
149 default: 153 default:
150 BUG(); 154 BUG();
151 } 155 }
152} 156}
153 157
154QString PwMViewStyle::getCurrentCategory() 158QString PwMViewStyle::getCurrentCategory()
155{ 159{
156 switch (curStyle) { 160 switch (curStyle) {
157 case style_0: 161 case style_0:
158 PWM_ASSERT(s0); 162 PWM_ASSERT(s0);
159 return s0->getCurrentCategory(); 163 return s0->getCurrentCategory();
160 case style_1: 164 case style_1:
161 PWM_ASSERT(s1); 165 PWM_ASSERT(s1);
162 return s1->getCurrentCategory(); 166 return s1->getCurrentCategory();
163 default: 167 default:
164 BUG(); 168 BUG();
165 } 169 }
166 return ""; 170 return "";
167} 171}
168 172
169void PwMViewStyle::addCategory(const QString &cat) 173void PwMViewStyle::addCategory(const QString &cat)
170{ 174{
171 switch (curStyle) { 175 switch (curStyle) {
172 case style_0: 176 case style_0:
173 PWM_ASSERT(s0); 177 PWM_ASSERT(s0);
174 s0->addCategory(cat); 178 s0->addCategory(cat);
175 return; 179 return;
176 case style_1: 180 case style_1:
177 PWM_ASSERT(s1); 181 PWM_ASSERT(s1);
178 s1->addCategory(cat); 182 s1->addCategory(cat);
179 return; 183 return;
180 default: 184 default:
181 BUG(); 185 BUG();
182 } 186 }
183} 187}
184 188
185void PwMViewStyle::delCategory(const QString &cat) 189void PwMViewStyle::delCategory(const QString &cat)
186{ 190{
187 switch (curStyle) { 191 switch (curStyle) {
188 case style_0: 192 case style_0:
189 PWM_ASSERT(s0); 193 PWM_ASSERT(s0);
190 s0->delCategory(cat); 194 s0->delCategory(cat);
191 return; 195 return;
192 case style_1: 196 case style_1:
193 PWM_ASSERT(s1); 197 PWM_ASSERT(s1);
194 s1->delCategory(cat); 198 s1->delCategory(cat);
195 return; 199 return;
196 default: 200 default:
197 BUG(); 201 BUG();
198 } 202 }
199} 203}
200 204
201void PwMViewStyle::delAllCategories() 205void PwMViewStyle::delAllCategories()
diff --git a/pwmanager/pwmanager/pwmviewstyle.h b/pwmanager/pwmanager/pwmviewstyle.h
index 5656cbc..6c2d81c 100644
--- a/pwmanager/pwmanager/pwmviewstyle.h
+++ b/pwmanager/pwmanager/pwmviewstyle.h
@@ -15,99 +15,101 @@
15 * This file is originaly based on version 1.0.1 of pwmanager 15 * This file is originaly based on version 1.0.1 of pwmanager
16 * and was modified to run on embedded devices that run microkde 16 * and was modified to run on embedded devices that run microkde
17 * 17 *
18 * $Id$ 18 * $Id$
19 **************************************************************************/ 19 **************************************************************************/
20 20
21#ifndef PWMVIEWSTYLE_H 21#ifndef PWMVIEWSTYLE_H
22#define PWMVIEWSTYLE_H 22#define PWMVIEWSTYLE_H
23 23
24#include <qwidget.h> 24#include <qwidget.h>
25#include <qsplitter.h> 25#include <qsplitter.h>
26#include <qhbox.h> 26#include <qhbox.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qpopupmenu.h> 29#include <qpopupmenu.h>
30#ifndef PWM_EMBEDDED 30#ifndef PWM_EMBEDDED
31#include <qtextedit.h> 31#include <qtextedit.h>
32#else 32#else
33#include <qmultilineedit.h> 33#include <qmultilineedit.h>
34#endif 34#endif
35 35
36#include <qlabel.h> 36#include <qlabel.h>
37#include <qlistbox.h> 37#include <qlistbox.h>
38#include <qcombobox.h> 38#include <qcombobox.h>
39#include <qsize.h> 39#include <qsize.h>
40 40
41class ListViewPwM; 41class ListViewPwM;
42class PwMViewStyle_0; 42class PwMViewStyle_0;
43class PwMViewStyle_1; 43class PwMViewStyle_1;
44class PwMView; 44class PwMView;
45class QListViewItem; 45class QListViewItem;
46class CommentBox; 46class CommentBox;
47 47
48class PwMViewStyle : public QWidget 48class PwMViewStyle : public QWidget
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 51
52public: 52public:
53 enum style_t 53 enum style_t
54 { 54 {
55 style_notset= -1, 55 style_notset= -1,
56 style_0 = 0, 56 style_0 = 0,
57 style_1 = 1 57 style_1 = 1
58 }; 58 };
59 59
60public: 60public:
61 PwMViewStyle(QWidget *parent = 0, const char *name = 0); 61 PwMViewStyle(QWidget *parent = 0, const char *name = 0);
62 ~PwMViewStyle(); 62 ~PwMViewStyle();
63 63
64 /** initialize a new style */ 64 /** initialize a new style */
65 void initStyle(style_t style); 65 void initStyle(style_t style);
66 void initStyle(int style) 66 void initStyle(int style)
67 { initStyle(static_cast<style_t>(style)); } 67 { initStyle(static_cast<style_t>(style)); }
68 /** returns the currently used style */ 68 /** returns the currently used style */
69 style_t getCurStyle() 69 style_t getCurStyle()
70 { return curStyle; } 70 { return curStyle; }
71 void setView(PwMView *view) 71 void setView(PwMView *view)
72 { v = view; } 72 { v = view; }
73 73
74 /** returns the currently selected category */ 74 /** returns the currently selected category */
75 QString getCurrentCategory(); 75 QString getCurrentCategory();
76 76
77protected: 77protected:
78 /** add Category to the view */ 78 /** add Category to the view */
79 void addCategory(const QString &cat); 79 void addCategory(const QString &cat);
80 /** delete Category from view */ 80 /** delete Category from view */
81 void delCategory(const QString &cat); 81 void delCategory(const QString &cat);
82 /** delete all categories from view */ 82 /** delete all categories from view */
83 void delAllCategories(); 83 void delAllCategories();
84 /** select the specified category */ 84 /** select the specified category */
85 void selectCategory(const QString &cat); 85 void selectCategory(const QString &cat);
86 /** returns the number of categories in this view. 86 /** returns the number of categories in this view.
87 * This value dosn't say anything about the number of 87 * This value dosn't say anything about the number of
88 * categories in the document. 88 * categories in the document.
89 */ 89 */
90 int numCategories(); 90 int numCategories();
91 /** resize the view */ 91 /** resize the view */
92 void resizeView(const QSize &size); 92 void resizeView(const QSize &size);
93 ListViewPwM *lv; 93 ListViewPwM *lv;
94 CommentBox *commentBox; 94 CommentBox *commentBox;
95 95
96protected slots: 96protected slots:
97 void editPassWord( QListViewItem * ); 97 void editPassWord( QListViewItem * );
98 98
99private: 99private:
100 /** which style has the view? 100 /** which style has the view?
101 * KListBox on the left, 101 * KListBox on the left,
102 * or QComboBox on the top? 102 * or QComboBox on the top?
103 */ 103 */
104 style_t curStyle; 104 style_t curStyle;
105 105
106 PwMViewStyle_0 *s0; 106 PwMViewStyle_0 *s0;
107 PwMViewStyle_1 *s1; 107 PwMViewStyle_1 *s1;
108 PwMView *v; 108 PwMView *v;
109 signals: 109 signals:
110 void editPW(); 110 void editPW();
111 void insertPW();
112 void deletePW();
111 113
112}; 114};
113#endif 115#endif