summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt6
-rw-r--r--desktop/rpm/kdepim_rpm2
-rw-r--r--kabc/addresseedialog.cpp40
-rw-r--r--korganizer/koeventviewerdialog.cpp6
-rw-r--r--korganizer/kolistview.cpp2
-rw-r--r--korganizer/searchdialog.cpp9
-rw-r--r--korganizer/searchdialog.h4
-rw-r--r--microkde/kdialogbase.cpp8
-rw-r--r--version2
9 files changed, 59 insertions, 20 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 86ac9b5..dc22fc6 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,194 +1,200 @@
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.13 ************
4
5Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter.
6
7In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down".
8
3********** VERSION 2.0.12 ************ 9********** VERSION 2.0.12 ************
4 10
5KO/Pi: 11KO/Pi:
6Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. 12Fixed a bug in todo start/due date handling for non recurring todos with a start and due date.
7Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. 13Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes.
8Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. 14Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer.
9 15
10Fixed problem in pi-sync mode when wrong password was sent. 16Fixed problem in pi-sync mode when wrong password was sent.
11 17
12OM/Pi: 18OM/Pi:
13Fixed a crash when displaying mails with "Show mail as html" was checked in the config. 19Fixed a crash when displaying mails with "Show mail as html" was checked in the config.
14Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. 20Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled.
15 21
16********** VERSION 2.0.11 ************ 22********** VERSION 2.0.11 ************
17 23
18Fixed some problems in pi-sync mode 24Fixed some problems in pi-sync mode
19(e.g. details of events were not synced properly) 25(e.g. details of events were not synced properly)
20 26
21********** VERSION 2.0.10 ************ 27********** VERSION 2.0.10 ************
22 28
23KO/Pi: 29KO/Pi:
24In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. 30In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view.
25This is fixed. 31This is fixed.
26Changed the search dialog a bit to make it more user friendly. 32Changed the search dialog a bit to make it more user friendly.
27(E.g.: Removed message box about "no items found" and set key focus to search line edit after search). 33(E.g.: Removed message box about "no items found" and set key focus to search line edit after search).
28 34
29Added config option to hide the week number in KO/Pi toolbar. 35Added config option to hide the week number in KO/Pi toolbar.
30 36
31********** VERSION 2.0.9 ************ 37********** VERSION 2.0.9 ************
32 38
33Made month view icons for multiday events a bit nicer. 39Made month view icons for multiday events a bit nicer.
34Some minor fixes in KO/Pi 40Some minor fixes in KO/Pi
35(e.g. go to today did not work for new week view properly). 41(e.g. go to today did not work for new week view properly).
36 42
37 43
38********** VERSION 2.0.8 ************ 44********** VERSION 2.0.8 ************
39 45
40Fixed a problem in dependency info in the ipk files for the Zaurus. 46Fixed a problem in dependency info in the ipk files for the Zaurus.
41 47
42Added 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. 48Added 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.
43 49
44Added a "go today" button to the datepicker. 50Added a "go today" button to the datepicker.
45 51
46Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) 52Added "created" and "last modified" to event/todo viewer (and What'sThis viewer)
47and made it configureable to show these values. 53and made it configureable to show these values.
48 54
49Fixed a problem for events (from external iCal files) that do have a duration but no end date. 55Fixed a problem for events (from external iCal files) that do have a duration but no end date.
50 56
51 57
52********** VERSION 2.0.7 ************ 58********** VERSION 2.0.7 ************
53 59
54Added global application font settings 60Added global application font settings
55(for all KDE-Pim/Pi apps) to the general settings. 61(for all KDE-Pim/Pi apps) to the general settings.
56 62
57Fixed a problem in OM/Pi when trying to login to some IMAP servers 63Fixed a problem in OM/Pi when trying to login to some IMAP servers
58(like the IMAP server of Apple: mail.mac.com ) 64(like the IMAP server of Apple: mail.mac.com )
59 65
60Added recurring todos to KO/Pi. 66Added recurring todos to KO/Pi.
61 67
62 68
63********** VERSION 2.0.6 ************ 69********** VERSION 2.0.6 ************
64 70
65Some bugfixes in the pi-sync mode. 71Some bugfixes in the pi-sync mode.
66Added German translation for pi-sync mode. 72Added German translation for pi-sync mode.
67 73
68KO/Pi: 74KO/Pi:
69Made the todolist using alternate background. 75Made the todolist using alternate background.
70 76
71Other minor fixes in KO/Pi. 77Other minor fixes in KO/Pi.
72 78
73 79
74********** VERSION 2.0.5 ************ 80********** VERSION 2.0.5 ************
75 81
76Bugfixes in KO/Pi. 82Bugfixes in KO/Pi.
77 83
78********** VERSION 2.0.4 ************ 84********** VERSION 2.0.4 ************
79 85
80KO/Pi: 86KO/Pi:
81Fixed problem loading translations for summary/location edit boxes in event/todo editor. 87Fixed problem loading translations for summary/location edit boxes in event/todo editor.
82 88
83Added a general "select week number" to the toolbar. 89Added a general "select week number" to the toolbar.
84 90
85Fixed some small problem of the new features introduced in version 2.0.3. 91Fixed some small problem of the new features introduced in version 2.0.3.
86 92
87Made it possible to specify one specific category as category color, 93Made it possible to specify one specific category as category color,
88if more than one categories are selected. 94if more than one categories are selected.
89 95
90Fixed a bug in saving colors for categories with non-ascii characters. 96Fixed a bug in saving colors for categories with non-ascii characters.
91(Like, e.g. German Umlauts). 97(Like, e.g. German Umlauts).
92Propably you have to set your colors again for those categories. 98Propably you have to set your colors again for those categories.
93 99
94 100
95********** VERSION 2.0.3 ************ 101********** VERSION 2.0.3 ************
96 102
97KO/Pi: 103KO/Pi:
98Added feature for changing alarm settings for many items at once: 104Added feature for changing alarm settings for many items at once:
99Open list view (or search dialog), select the desired items and choose in 105Open list view (or search dialog), select the desired items and choose in
100the popup menu: Set alarm for selected... 106the popup menu: Set alarm for selected...
101 107
102Added to the event/todo viewer the option to send an email to 108Added to the event/todo viewer the option to send an email to
103all attendees or all selected (with RSVP) attendees. 109all attendees or all selected (with RSVP) attendees.
104 110
105Made the week-month mode changing in month view faster. 111Made the week-month mode changing in month view faster.
106 112
107Made month view better useable with keyboard. 113Made month view better useable with keyboard.
108Now TAB key jumps to next cell with an event/todo. 114Now TAB key jumps to next cell with an event/todo.
109Scroll in cell with coursor keys, scroll in time (next week) with 115Scroll in cell with coursor keys, scroll in time (next week) with
110Shift/Control + coursorkeys. 116Shift/Control + coursorkeys.
111 117
112Fixed bug that the todo view flat mode was reset after first view update. 118Fixed bug that the todo view flat mode was reset after first view update.
113 119
114If a todo is displayed closed in the todo view, 120If a todo is displayed closed in the todo view,
115it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. 121it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties.
116 122
117Added info about the numbers of years to the caption (title) information about a birthday event. 123Added info about the numbers of years to the caption (title) information about a birthday event.
118 124
119Made completion date in todo editor editable. 125Made completion date in todo editor editable.
120 126
121Added possibility to save/load templates for journals. 127Added possibility to save/load templates for journals.
122(Which is just a simple "save text to file" or "insert text from file". 128(Which is just a simple "save text to file" or "insert text from file".
123 129
124********** VERSION 2.0.2 ************ 130********** VERSION 2.0.2 ************
125 131
126KO/Pi: 132KO/Pi:
127Fixed the layout problem of the day label buttons 133Fixed the layout problem of the day label buttons
128of the agenda view introduced in version 2.0.1. 134of the agenda view introduced in version 2.0.1.
129 135
130Added WhatsThis support for the todo view and the list view. 136Added WhatsThis support for the todo view and the list view.
131 137
132Added a quite useful feature to the montview. 138Added a quite useful feature to the montview.
133Just click on the week numbers on the left. 139Just click on the week numbers on the left.
134And in the top right corner of month view/agenda view 140And in the top right corner of month view/agenda view
135there is now a "week number quick selector". 141there is now a "week number quick selector".
136(Click on the black triangle). 142(Click on the black triangle).
137 143
138Made the quite difficult timezone change in KO/Pi easy. 144Made the quite difficult timezone change in KO/Pi easy.
139 145
140OM/Pi: 146OM/Pi:
141Fixed too small icons on desktop. 147Fixed too small icons on desktop.
142Fixed non visible icons in mainwindow on Z with fastload enabled. 148Fixed non visible icons in mainwindow on Z with fastload enabled.
143Added signature file setting to smtp account config. 149Added signature file setting to smtp account config.
144And the signature can be edited and saved in the edit mail dialog. 150And the signature can be edited and saved in the edit mail dialog.
145That does mean: 151That does mean:
146Simply edit the signature for the selected smtp account in the 152Simply edit the signature for the selected smtp account in the
147edit new mail dialog and press the "save signature" button there. 153edit new mail dialog and press the "save signature" button there.
148Then the signature is saved to the file specified in the smtp account settings. 154Then the signature is saved to the file specified in the smtp account settings.
149If there is no file specified, it is saved automatically to the file 155If there is no file specified, it is saved automatically to the file
150kdepim/apps/kopiemail/<accountname>.sig. 156kdepim/apps/kopiemail/<accountname>.sig.
151 157
152 158
153 159
154********** VERSION 2.0.1 ************ 160********** VERSION 2.0.1 ************
155 161
156Oooops ... I forgot to test on the Zaurus 5500 ... 162Oooops ... I forgot to test on the Zaurus 5500 ...
157 163
158Fixed many problems of new (english) strings (and german translations) 164Fixed many problems of new (english) strings (and german translations)
159introduced in the latest versions, where the text was not fitting on the 165introduced in the latest versions, where the text was not fitting on the
160240x320 display of the Zaurus 5500. 166240x320 display of the Zaurus 5500.
161 167
162KO/Pi: 168KO/Pi:
163Added a popup menu ( press pen and hold to get popup ) to the agenda view 169Added a popup menu ( press pen and hold to get popup ) to the agenda view
164with many useful items (add event/todo, show next week, two weeks, month, journal). 170with many useful items (add event/todo, show next week, two weeks, month, journal).
165 171
166Added items to the todolist popup menu for: 172Added items to the todolist popup menu for:
167Display all opened, all closed or all todos flat. 173Display all opened, all closed or all todos flat.
168The "flat" view makes is possible to sort all todos after ,e.g., prio or date. 174The "flat" view makes is possible to sort all todos after ,e.g., prio or date.
169Made the reparenting of todos on the desktop possible via Drag&Drop. 175Made the reparenting of todos on the desktop possible via Drag&Drop.
170Fixed several bugs in setting the completed datetime for todos. 176Fixed several bugs in setting the completed datetime for todos.
171Added info about completed datetime of todos to the todo viewer. 177Added info about completed datetime of todos to the todo viewer.
172Now displaying a completed todo (with completed datetime set) in the agenda view 178Now displaying a completed todo (with completed datetime set) in the agenda view
173at the time of the completion. Such that now it is possible to see in the agenda view 179at the time of the completion. Such that now it is possible to see in the agenda view
174when what todo was completed. 180when what todo was completed.
175Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. 181Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos.
176Now the behaviour is: 182Now the behaviour is:
177Setting a parent to complete sets all (sub)childs to complete. 183Setting a parent to complete sets all (sub)childs to complete.
178Setting a parent to uncomplete does not change the childs. 184Setting a parent to uncomplete does not change the childs.
179Setting a child to uncomplete sets all parent to uncomplete. 185Setting a child to uncomplete sets all parent to uncomplete.
180Setting a child to complete does not change the parents. 186Setting a child to complete does not change the parents.
181 187
182Smart updating and double buffering of the daymatrix. 188Smart updating and double buffering of the daymatrix.
183Showing holidays in the day matrix. 189Showing holidays in the day matrix.
184Many other small performance updates. 190Many other small performance updates.
185 191
186Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. 192Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode.
187 193
188Now the translation file usertranslation.txt is supposed to be in utf8 format. 194Now the translation file usertranslation.txt is supposed to be in utf8 format.
189If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. 195If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu.
190 196
191 197
192********** VERSION 2.0.0 ************ 198********** VERSION 2.0.0 ************
193 199
194Stable release 2.0.0! 200Stable release 2.0.0!
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm
index 0d4c9d6..ff9f2dc 100644
--- a/desktop/rpm/kdepim_rpm
+++ b/desktop/rpm/kdepim_rpm
@@ -1,84 +1,84 @@
1Summary: A collection of PIM programs 1Summary: A collection of PIM programs
2Name: KDE-Pim-Pi 2Name: KDE-Pim-Pi
3Version: 2.0.12 3Version: 2.0.13
4Release: SuSE_9.2 4Release: SuSE_9.2
5Copyright:GPL 5Copyright:GPL
6Group: Productivity/Pim 6Group: Productivity/Pim
7Source:http://sourceforge.net/projects/kdepimpi/ 7Source:http://sourceforge.net/projects/kdepimpi/
8URL:http://sourceforge.net/projects/kdepimpi/ 8URL:http://sourceforge.net/projects/kdepimpi/
9Packager: zautrix 9Packager: zautrix
10 10
11%description 11%description
12This package contains the platform-independent PIM programs from 12This package contains the platform-independent PIM programs from
13www.pi-sync.net, compiled for SuSE 9.2: 13www.pi-sync.net, compiled for SuSE 9.2:
14KTimeTacker/Pi 14KTimeTacker/Pi
15KPhone/Pi 15KPhone/Pi
16KAddressbook/Pi 16KAddressbook/Pi
17KOrganizer/Pi 17KOrganizer/Pi
18PasswordManager/Pi 18PasswordManager/Pi
19KOPieMail/Pi 19KOPieMail/Pi
20 20
21These applications do not need anything from the KDE-desktop 21These applications do not need anything from the KDE-desktop
22at all to run on Linux. However, there is a dependency from 22at all to run on Linux. However, there is a dependency from
23two KDE libs, because a small command line program is included 23two KDE libs, because a small command line program is included
24to make it possible to sync with the KDE-desktop applications. 24to make it possible to sync with the KDE-desktop applications.
25 25
26These applications are independent from the KDE-desktop 26These applications are independent from the KDE-desktop
27environment. That means, nothing of your existing 27environment. That means, nothing of your existing
28KDE-desktop setup will be changed, or any data 28KDE-desktop setup will be changed, or any data
29(calendar-addressbook) used by the KDE-desktop 29(calendar-addressbook) used by the KDE-desktop
30applications will be changed or accessed. 30applications will be changed or accessed.
31These applications stores their data and config in 31These applications stores their data and config in
32$HOME/kdepim/ 32$HOME/kdepim/
33However, because the same file format is used, 33However, because the same file format is used,
34an easy exchange of data with the KDE-desktop 34an easy exchange of data with the KDE-desktop
35is possible. 35is possible.
36A small command line program is included 36A small command line program is included
37to make it possible to sync with the KDE-desktop applications. 37to make it possible to sync with the KDE-desktop applications.
38You do not need to call this program from the commandline, 38You do not need to call this program from the commandline,
39it is called from the KDE-Pim/Pi apps when you choose there: 39it is called from the KDE-Pim/Pi apps when you choose there:
40Sync with KDE_Desktop. 40Sync with KDE_Desktop.
41If something is going wrong, please start the 41If something is going wrong, please start the
42KDE-Pim/Pi program itself from the console to get detailed output. 42KDE-Pim/Pi program itself from the console to get detailed output.
43 43
44After installation, you should have a 44After installation, you should have a
45PIM-pi 45PIM-pi
46folder in your KDE start menu, where you can 46folder in your KDE start menu, where you can
47start the applications from. 47start the applications from.
48 48
49These programs makes it possible to sync your Zaurus easily 49These programs makes it possible to sync your Zaurus easily
50(with the KDE-Pim/Pi programs running on the Zaurus) 50(with the KDE-Pim/Pi programs running on the Zaurus)
51with the KDE-desktop calendar/addressbook data. 51with the KDE-desktop calendar/addressbook data.
52If you want to use that, you have to update your 52If you want to use that, you have to update your
53KDE-desktop to version 3.3.0 or higher. 53KDE-desktop to version 3.3.0 or higher.
54SuSE 9.2 contains KDE 3.3.0 such that no update is needed. 54SuSE 9.2 contains KDE 3.3.0 such that no update is needed.
55Actually - after the (non difficult) configuration is set up - 55Actually - after the (non difficult) configuration is set up -
56with two mouseklicks on the Zaurus, 56with two mouseklicks on the Zaurus,
57the Zaurus syncs with the corresponding KDE-Pim/Pi 57the Zaurus syncs with the corresponding KDE-Pim/Pi
58program on the Linux Desktop which syncs automatically 58program on the Linux Desktop which syncs automatically
59with the KDE-desktop data. 59with the KDE-desktop data.
60 60
61If you want to use the KDE-desktop calendar/addressbook applications, 61If you want to use the KDE-desktop calendar/addressbook applications,
62just install these apps in this package and use them as a syncing tool for the 62just install these apps in this package and use them as a syncing tool for the
63Zaurus <-> KDE-desktop sync. 63Zaurus <-> KDE-desktop sync.
64The sync requires a network connection from your Zaurus to 64The sync requires a network connection from your Zaurus to
65the PC. A detailed Sync HowTo is available in the 65the PC. A detailed Sync HowTo is available in the
66Help menu of the applications. 66Help menu of the applications.
67 67
68These applications makes it also possible, that you can sync 68These applications makes it also possible, that you can sync
69(or just export the data to) your mobile phone with your 69(or just export the data to) your mobile phone with your
70data of the KDE-desktop calendar/addressbook applications. 70data of the KDE-desktop calendar/addressbook applications.
71This is tested and working for Nokia mobile phones, 71This is tested and working for Nokia mobile phones,
72it may work with others as well. 72it may work with others as well.
73(More info about that: -> Sync HowTo) 73(More info about that: -> Sync HowTo)
74 74
75NOTE: 75NOTE:
76When using SuSE 9.1 you have to update your KDE to 3.3.x 76When using SuSE 9.1 you have to update your KDE to 3.3.x
77and you have to make an online update in SuSE 9.1 to make it 77and you have to make an online update in SuSE 9.1 to make it
78possible to get the infrared connection working, such that 78possible to get the infrared connection working, such that
79you can sync your (Nokia) mobile phone via infrared. 79you can sync your (Nokia) mobile phone via infrared.
80 80
81%files 81%files
82/opt/kde3/share/applnk/PIM-pi/ 82/opt/kde3/share/applnk/PIM-pi/
83/opt/kdepimpi/ 83/opt/kdepimpi/
84/usr/lib/libmicro* 84/usr/lib/libmicro*
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp
index 34f4160..b3429e3 100644
--- a/kabc/addresseedialog.cpp
+++ b/kabc/addresseedialog.cpp
@@ -1,293 +1,309 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qlayout.h> 21#include <qlayout.h>
22#include <qpushbutton.h> 22#include <qpushbutton.h>
23#include <qgroupbox.h> 23#include <qgroupbox.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qregexp.h> 25#include <qregexp.h>
26#include <qvbox.h>
27#include <qlabel.h>
26 28
27#include <klocale.h> 29#include <klocale.h>
28#include <kdebug.h> 30#include <kdebug.h>
29#include <kglobalsettings.h> 31#include <kglobalsettings.h>
30 32
31#include "stdaddressbook.h" 33#include "stdaddressbook.h"
32 34
33#include "addresseedialog.h" 35#include "addresseedialog.h"
36#include "KDGanttMinimizeSplitter.h"
34//#include "addresseedialog.moc" 37//#include "addresseedialog.moc"
35 38
36using namespace KABC; 39using namespace KABC;
37 40
38AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : 41AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) :
39 QListViewItem( parent ), 42 QListViewItem( parent ),
40 mAddressee( addressee ) 43 mAddressee( addressee )
41{ 44{
42 QString name = addressee.familyName()+", "+ addressee.givenName(); 45 QString name = addressee.familyName()+", "+ addressee.givenName();
43 if ( name.length() == 2 ) 46 if ( name.length() == 2 )
44 name = addressee.organization(); 47 name = addressee.organization();
45 setText( Name,name); 48 setText( Name,name);
46 setText( Email, addressee.preferredEmail() ); 49 setText( Email, addressee.preferredEmail() );
47} 50}
48 51
49QString AddresseeItem::key( int column, bool ) const 52QString AddresseeItem::key( int column, bool ) const
50{ 53{
51 54
52 if (column == Email) { 55 if (column == Email) {
53 QString value = text(Email); 56 QString value = text(Email);
54 int val = value.findRev("@"); 57 int val = value.findRev("@");
55 return value.mid( val) + value.left( val ); 58 return value.mid( val) + value.left( val );
56 } 59 }
57 return text(column).lower(); 60 return text(column).lower();
58} 61}
59 62
60AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : 63AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
61 KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), 64 KDialogBase( KDialogBase::Plain, i18n("Select Addressee"),
62 Ok|Cancel, Ok, parent ), mMultiple( multiple ) 65 Ok|Cancel, No, parent ), mMultiple( multiple )
63{ 66{
64 QWidget *topWidget = plainPage(); 67 QWidget *topWidget = plainPage();
65 68
66 QBoxLayout *topLayout = new QHBoxLayout( topWidget ); 69 QBoxLayout *topLayout = new QHBoxLayout( topWidget );
67 QBoxLayout *listLayout = new QVBoxLayout;
68 topLayout->addLayout( listLayout );
69 70
70 mAddresseeList = new KListView( topWidget ); 71
72 KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget);
73 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
74
75 topLayout->addWidget(mMiniSplitter );
76
77 QWidget *listWidget = new QWidget( mMiniSplitter );
78
79 QBoxLayout *listLayout = new QVBoxLayout (listWidget) ;
80 //topLayout->addLayout( listLayout );
81
82 mAddresseeList = new KListView( listWidget );
71 mAddresseeList->addColumn( i18n("Name") ); 83 mAddresseeList->addColumn( i18n("Name") );
72 mAddresseeList->addColumn( i18n("Email") ); 84 mAddresseeList->addColumn( i18n("Email") );
73 mAddresseeList->setAllColumnsShowFocus( true ); 85 mAddresseeList->setAllColumnsShowFocus( true );
74 mAddresseeList->setFullWidth( true ); 86 mAddresseeList->setFullWidth( true );
75 listLayout->addWidget( mAddresseeList ); 87 listLayout->addWidget( mAddresseeList );
76 connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), 88 connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ),
77 SLOT( slotOk() ) ); 89 SLOT( slotOk() ) );
78 90
79 mAddresseeEdit = new QLineEdit( topWidget ); 91 mAddresseeEdit = new QLineEdit( listWidget );
80 connect( mAddresseeEdit, SIGNAL( returnPressed() ), 92 connect( mAddresseeEdit, SIGNAL( returnPressed() ),
81 SLOT( loadAddressBook() ) ); 93 SLOT( loadAddressBook() ) );
82 mAddresseeEdit->setFocus(); 94 mAddresseeEdit->setFocus();
83 95
84 listLayout->addWidget( mAddresseeEdit ); 96 listLayout->addWidget( mAddresseeEdit );
85 97
86 if ( mMultiple ) { 98 if ( mMultiple ) {
87 QBoxLayout *selectedLayout = new QVBoxLayout; 99 //QBoxLayout *selectedLayout = new QVBoxLayout;
88 topLayout->addLayout( selectedLayout ); 100 //topLayout->addLayout( selectedLayout );
89 topLayout->setSpacing( spacingHint() ); 101 //topLayout->setSpacing( spacingHint() );
90 102
91 QGroupBox *selectedGroup = new QGroupBox( 1, Horizontal, i18n("Selected"), 103 QVBox *selectedGroup = new QVBox( mMiniSplitter );
92 topWidget ); 104 new QLabel ( i18n("Selected:"), selectedGroup );
93 selectedLayout->addWidget( selectedGroup ); 105 //selectedLayout->addWidget( selectedGroup );
94 106
95 mSelectedList = new KListView( selectedGroup ); 107 mSelectedList = new KListView( selectedGroup );
96 mSelectedList->addColumn( i18n("Name") ); 108 mSelectedList->addColumn( i18n("Name") );
97 mSelectedList->addColumn( i18n("Email") ); 109 mSelectedList->addColumn( i18n("Email") );
98 mSelectedList->setAllColumnsShowFocus( true ); 110 mSelectedList->setAllColumnsShowFocus( true );
99 mSelectedList->setFullWidth( true ); 111 mSelectedList->setFullWidth( true );
100 connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), 112 connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ),
101 SLOT( removeSelected() ) ); 113 SLOT( removeSelected() ) );
102 114
103 QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); 115 QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup );
104 connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); 116 connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) );
105 117
106 connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), 118 connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ),
107 SLOT( addSelected( QListViewItem * ) ) ); 119 SLOT( addSelected( QListViewItem * ) ) );
108 connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), 120 connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ),
109 SLOT( selectNextItem( QListViewItem * ) ) ); 121 SLOT( selectNextItem( QListViewItem * ) ) );
110 122
111 } 123 }
112 124
113 mAddressBook = StdAddressBook::self( true ); 125 mAddressBook = StdAddressBook::self( true );
114 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), 126 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ),
115 SLOT( addressBookChanged() ) ); 127 SLOT( addressBookChanged() ) );
116 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), 128 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ),
117 SLOT( addressBookChanged() ) ); 129 SLOT( addressBookChanged() ) );
118 130
119 loadAddressBook(); 131 loadAddressBook();
132 QValueList<int> splitterSize;
133 splitterSize.append( ( width() / 5 ) * 3 );
134 splitterSize.append( ( width() / 5 ) *2 );
135 mMiniSplitter->setSizes( splitterSize );
120} 136}
121 137
122AddresseeDialog::~AddresseeDialog() 138AddresseeDialog::~AddresseeDialog()
123{ 139{
124} 140}
125 141
126void AddresseeDialog::loadAddressBook() 142void AddresseeDialog::loadAddressBook()
127{ 143{
128 mAddresseeList->clear(); 144 mAddresseeList->clear();
129 mItemDict.clear(); 145 mItemDict.clear();
130 if ( mAddresseeEdit->text().isEmpty() ) { 146 if ( mAddresseeEdit->text().isEmpty() ) {
131 AddressBook::Iterator it; 147 AddressBook::Iterator it;
132 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 148 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
133 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 149 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
134 continue; 150 continue;
135 new AddresseeItem( mAddresseeList, (*it) ); 151 new AddresseeItem( mAddresseeList, (*it) );
136 } 152 }
137 return; 153 return;
138 } 154 }
139 //mAddresseeEdit->completionObject()->clear(); 155 //mAddresseeEdit->completionObject()->clear();
140 QRegExp re; 156 QRegExp re;
141 re.setWildcard(true); // most people understand these better. 157 re.setWildcard(true); // most people understand these better.
142 re.setCaseSensitive(false); 158 re.setCaseSensitive(false);
143 re.setPattern( "*"+ mAddresseeEdit->text() + "*"); 159 re.setPattern( "*"+ mAddresseeEdit->text() + "*");
144 160
145 AddressBook::Iterator it; 161 AddressBook::Iterator it;
146 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 162 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
147 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 163 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
148 continue; 164 continue;
149 QString name = (*it).familyName()+", "+ (*it).givenName(); 165 QString name = (*it).familyName()+", "+ (*it).givenName();
150 if ( name.length() == 2 ) 166 if ( name.length() == 2 )
151 name = (*it).realName(); 167 name = (*it).realName();
152 name += (*it).preferredEmail(); 168 name += (*it).preferredEmail();
153#if QT_VERSION >= 0x030000 169#if QT_VERSION >= 0x030000
154 if (re.search(name) != -1) 170 if (re.search(name) != -1)
155#else 171#else
156 if (re.match(name) != -1) 172 if (re.match(name) != -1)
157#endif 173#endif
158 AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); 174 AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) );
159 } 175 }
160} 176}
161 177
162void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item ) 178void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item )
163{ 179{
164 if ( str.isEmpty() ) return; 180 if ( str.isEmpty() ) return;
165 181
166 mItemDict.insert( str, item ); 182 mItemDict.insert( str, item );
167 //mAddresseeEdit->completionObject()->addItem( str ); 183 //mAddresseeEdit->completionObject()->addItem( str );
168} 184}
169 185
170void AddresseeDialog::selectItem( const QString &str ) 186void AddresseeDialog::selectItem( const QString &str )
171{ 187{
172 if ( str.isEmpty() ) return; 188 if ( str.isEmpty() ) return;
173 189
174 QListViewItem *item = mItemDict.find( str ); 190 QListViewItem *item = mItemDict.find( str );
175 if ( item ) { 191 if ( item ) {
176 mAddresseeList->blockSignals( true ); 192 mAddresseeList->blockSignals( true );
177 mAddresseeList->setSelected( item, true ); 193 mAddresseeList->setSelected( item, true );
178 mAddresseeList->ensureItemVisible( item ); 194 mAddresseeList->ensureItemVisible( item );
179 mAddresseeList->blockSignals( false ); 195 mAddresseeList->blockSignals( false );
180 } 196 }
181} 197}
182 198
183void AddresseeDialog::updateEdit( QListViewItem *item ) 199void AddresseeDialog::updateEdit( QListViewItem *item )
184{ 200{
185 mAddresseeEdit->setText( item->text( 0 ) ); 201 mAddresseeEdit->setText( item->text( 0 ) );
186 mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); 202 mAddresseeEdit->setSelection( 0, item->text( 0 ).length() );
187} 203}
188 204
189void AddresseeDialog::selectNextItem( QListViewItem *item ) 205void AddresseeDialog::selectNextItem( QListViewItem *item )
190{ 206{
191 addSelected( item ); 207 addSelected( item );
192 QListViewItem *next = item->nextSibling(); 208 QListViewItem *next = item->nextSibling();
193 if ( next ) { 209 if ( next ) {
194 next->setSelected( true ); 210 next->setSelected( true );
195 item->setSelected( false ); 211 item->setSelected( false );
196 mAddresseeList->setCurrentItem( next ); 212 mAddresseeList->setCurrentItem( next );
197 } 213 }
198} 214}
199void AddresseeDialog::addSelected( QListViewItem *item ) 215void AddresseeDialog::addSelected( QListViewItem *item )
200{ 216{
201 AddresseeItem *addrItem = (AddresseeItem *)( item ); 217 AddresseeItem *addrItem = (AddresseeItem *)( item );
202 if ( !addrItem ) return; 218 if ( !addrItem ) return;
203 219
204 Addressee a = addrItem->addressee(); 220 Addressee a = addrItem->addressee();
205 221
206 QListViewItem *selectedItem = mSelectedDict.find( a.uid() ); 222 QListViewItem *selectedItem = mSelectedDict.find( a.uid() );
207 if ( !selectedItem ) { 223 if ( !selectedItem ) {
208 selectedItem = new AddresseeItem( mSelectedList, a ); 224 selectedItem = new AddresseeItem( mSelectedList, a );
209 mSelectedDict.insert( a.uid(), selectedItem ); 225 mSelectedDict.insert( a.uid(), selectedItem );
210 } 226 }
211 227
212} 228}
213 229
214void AddresseeDialog::removeSelected() 230void AddresseeDialog::removeSelected()
215{ 231{
216 QListViewItem *item = mSelectedList->selectedItem(); 232 QListViewItem *item = mSelectedList->selectedItem();
217 AddresseeItem *addrItem = (AddresseeItem *)( item ); 233 AddresseeItem *addrItem = (AddresseeItem *)( item );
218 if ( !addrItem ) return; 234 if ( !addrItem ) return;
219 QListViewItem *next = item->nextSibling(); 235 QListViewItem *next = item->nextSibling();
220 mSelectedDict.remove( addrItem->addressee().uid() ); 236 mSelectedDict.remove( addrItem->addressee().uid() );
221 delete addrItem; 237 delete addrItem;
222 if ( next ) 238 if ( next )
223 next->setSelected( true ); 239 next->setSelected( true );
224} 240}
225 241
226Addressee AddresseeDialog::addressee() 242Addressee AddresseeDialog::addressee()
227{ 243{
228 AddresseeItem *aItem = 0; 244 AddresseeItem *aItem = 0;
229 245
230 if ( mMultiple ) 246 if ( mMultiple )
231 aItem = (AddresseeItem *)( mSelectedList->firstChild() ); 247 aItem = (AddresseeItem *)( mSelectedList->firstChild() );
232 else 248 else
233 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); 249 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() );
234 250
235 if (aItem) return aItem->addressee(); 251 if (aItem) return aItem->addressee();
236 return Addressee(); 252 return Addressee();
237} 253}
238 254
239Addressee::List AddresseeDialog::addressees() 255Addressee::List AddresseeDialog::addressees()
240{ 256{
241 Addressee::List al; 257 Addressee::List al;
242 AddresseeItem *aItem = 0; 258 AddresseeItem *aItem = 0;
243 259
244 if ( mMultiple ) { 260 if ( mMultiple ) {
245 QListViewItem *item = mSelectedList->firstChild(); 261 QListViewItem *item = mSelectedList->firstChild();
246 while( item ) { 262 while( item ) {
247 aItem = (AddresseeItem *)( item ); 263 aItem = (AddresseeItem *)( item );
248 if ( aItem ) al.append( aItem->addressee() ); 264 if ( aItem ) al.append( aItem->addressee() );
249 item = item->nextSibling(); 265 item = item->nextSibling();
250 } 266 }
251 } 267 }
252 else 268 else
253 { 269 {
254 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); 270 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() );
255 if (aItem) al.append( aItem->addressee() ); 271 if (aItem) al.append( aItem->addressee() );
256 } 272 }
257 273
258 return al; 274 return al;
259} 275}
260 276
261Addressee AddresseeDialog::getAddressee( QWidget *parent ) 277Addressee AddresseeDialog::getAddressee( QWidget *parent )
262{ 278{
263 AddresseeDialog *dlg = new AddresseeDialog( parent ); 279 AddresseeDialog *dlg = new AddresseeDialog( parent );
264 Addressee addressee; 280 Addressee addressee;
265 int result = dlg->exec(); 281 int result = dlg->exec();
266 282
267 if ( result == QDialog::Accepted ) { 283 if ( result == QDialog::Accepted ) {
268 addressee = dlg->addressee(); 284 addressee = dlg->addressee();
269 } 285 }
270 286
271 delete dlg; 287 delete dlg;
272 return addressee; 288 return addressee;
273} 289}
274 290
275Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) 291Addressee::List AddresseeDialog::getAddressees( QWidget *parent )
276{ 292{
277 AddresseeDialog *dlg = new AddresseeDialog( parent, true ); 293 AddresseeDialog *dlg = new AddresseeDialog( parent, true );
278 Addressee::List addressees; 294 Addressee::List addressees;
279 if ( QApplication::desktop()->width() <= 640 ) 295 if ( QApplication::desktop()->width() <= 640 )
280 dlg->showMaximized(); 296 dlg->showMaximized();
281 int result = dlg->exec(); 297 int result = dlg->exec();
282 if ( result == QDialog::Accepted ) { 298 if ( result == QDialog::Accepted ) {
283 addressees = dlg->addressees(); 299 addressees = dlg->addressees();
284 } 300 }
285 301
286 delete dlg; 302 delete dlg;
287 return addressees; 303 return addressees;
288} 304}
289 305
290void AddresseeDialog::addressBookChanged() 306void AddresseeDialog::addressBookChanged()
291{ 307{
292 loadAddressBook(); 308 loadAddressBook();
293} 309}
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index e2c8e6e..f606124 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -73,220 +73,226 @@ KOEventViewerDialog::~KOEventViewerDialog()
73void KOEventViewerDialog::showMe() 73void KOEventViewerDialog::showMe()
74{ 74{
75 75
76#ifdef DESKTOP_VERSION 76#ifdef DESKTOP_VERSION
77 int x,y,w,h; 77 int x,y,w,h;
78 x = geometry().x(); 78 x = geometry().x();
79 y = geometry().y(); 79 y = geometry().y();
80 w = width(); 80 w = width();
81 h = height(); 81 h = height();
82 show(); 82 show();
83 setGeometry(x,y,w,h); 83 setGeometry(x,y,w,h);
84#else 84#else
85 showMaximized(); 85 showMaximized();
86#endif 86#endif
87 raise(); 87 raise();
88 setActiveWindow(); 88 setActiveWindow();
89 mEventViewer->setFocus(); 89 mEventViewer->setFocus();
90 90
91} 91}
92void KOEventViewerDialog::setSyncMode( bool b ) 92void KOEventViewerDialog::setSyncMode( bool b )
93{ 93{
94 mSyncMode = b; 94 mSyncMode = b;
95 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); 95 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode );
96 if ( mSyncMode ) { 96 if ( mSyncMode ) {
97 findButton( Close )->setText( i18n("Cancel Sync")); 97 findButton( Close )->setText( i18n("Cancel Sync"));
98 findButton( Ok )->setText( i18n("Remote")); 98 findButton( Ok )->setText( i18n("Remote"));
99 findButton( User1 )->setText( i18n("Local")); 99 findButton( User1 )->setText( i18n("Local"));
100 } else { 100 } else {
101 findButton( Close )->setText( i18n("Close")); 101 findButton( Close )->setText( i18n("Close"));
102 findButton( Ok )->setText( i18n("Edit")); 102 findButton( Ok )->setText( i18n("Edit"));
103 findButton( User1 )->setText( i18n("Agenda")); 103 findButton( User1 )->setText( i18n("Agenda"));
104 } 104 }
105 mEventViewer->setSyncMode( b ); 105 mEventViewer->setSyncMode( b );
106} 106}
107void KOEventViewerDialog::setColorMode( int m ) 107void KOEventViewerDialog::setColorMode( int m )
108{ 108{
109 mEventViewer->setColorMode( m ); 109 mEventViewer->setColorMode( m );
110} 110}
111int KOEventViewerDialog::executeS( bool local ) 111int KOEventViewerDialog::executeS( bool local )
112{ 112{
113 mSyncResult = 3; 113 mSyncResult = 3;
114 if ( local ) 114 if ( local )
115 findButton( User1 )->setFocus(); 115 findButton( User1 )->setFocus();
116 else 116 else
117 findButton( Ok )->setFocus(); 117 findButton( Ok )->setFocus();
118 exec(); 118 exec();
119 return mSyncResult; 119 return mSyncResult;
120} 120}
121 121
122void KOEventViewerDialog::updateConfig() 122void KOEventViewerDialog::updateConfig()
123{ 123{
124 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 124 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
125 125
126} 126}
127void KOEventViewerDialog::setEvent(Event *event) 127void KOEventViewerDialog::setEvent(Event *event)
128{ 128{
129 mEventViewer->setEvent(event); 129 mEventViewer->setEvent(event);
130 mIncidence = event; 130 mIncidence = event;
131 mEventViewer->setFocus(); 131 mEventViewer->setFocus();
132 //findButton( Close )->setFocus(); 132 //findButton( Close )->setFocus();
133 if ( !mSyncMode ) { 133 if ( !mSyncMode ) {
134 findButton( User1 )->setText( i18n("Agenda")); 134 findButton( User1 )->setText( i18n("Agenda"));
135 } 135 }
136} 136}
137void KOEventViewerDialog::setIncidence(Incidence *in ) 137void KOEventViewerDialog::setIncidence(Incidence *in )
138{ 138{
139 if ( in->type() == "Event" ) 139 if ( in->type() == "Event" )
140 setEvent( (Event*) in ); 140 setEvent( (Event*) in );
141 else if ( in->type() =="Todo" ) 141 else if ( in->type() =="Todo" )
142 setTodo( (Todo*) in ); 142 setTodo( (Todo*) in );
143 else if ( in->type() =="Journal" ) 143 else if ( in->type() =="Journal" )
144 setJournal( (Journal*) in ); 144 setJournal( (Journal*) in );
145} 145}
146void KOEventViewerDialog::addIncidence(Incidence *in) 146void KOEventViewerDialog::addIncidence(Incidence *in)
147{ 147{
148 if ( in->type() == "Event" ) 148 if ( in->type() == "Event" )
149 addEvent( (Event*) in ); 149 addEvent( (Event*) in );
150 else if ( in->type() =="Todo" ) 150 else if ( in->type() =="Todo" )
151 mEventViewer->setTodo( (Todo*) in, false ); 151 mEventViewer->setTodo( (Todo*) in, false );
152 else if ( in->type() =="Journal" ) 152 else if ( in->type() =="Journal" )
153 mEventViewer->setJournal( (Journal*) in, false ); 153 mEventViewer->setJournal( (Journal*) in, false );
154 if ( mSyncMode ) { 154 if ( mSyncMode ) {
155 findButton( User1 )->setFocus(); 155 findButton( User1 )->setFocus();
156 setCaption(i18n("Conflict! Please choose entry")); 156 setCaption(i18n("Conflict! Please choose entry"));
157 } 157 }
158} 158}
159 159
160void KOEventViewerDialog::addEvent(Event *event) 160void KOEventViewerDialog::addEvent(Event *event)
161{ 161{
162 mEventViewer->addEvent(event); 162 mEventViewer->addEvent(event);
163 mIncidence = event; 163 mIncidence = event;
164 mEventViewer->setFocus(); 164 mEventViewer->setFocus();
165 //findButton( Close )->setFocus(); 165 //findButton( Close )->setFocus();
166 if ( !mSyncMode ) { 166 if ( !mSyncMode ) {
167 findButton( User1 )->setText( i18n("Agenda")); 167 findButton( User1 )->setText( i18n("Agenda"));
168 } 168 }
169} 169}
170 170
171void KOEventViewerDialog::setTodo(Todo *event) 171void KOEventViewerDialog::setTodo(Todo *event)
172{ 172{
173 mEventViewer->setTodo(event); 173 mEventViewer->setTodo(event);
174 mIncidence = (Incidence*)event; 174 mIncidence = (Incidence*)event;
175 mEventViewer->setFocus(); 175 mEventViewer->setFocus();
176 //findButton( Close )->setFocus(); 176 //findButton( Close )->setFocus();
177 if ( !mSyncMode ) { 177 if ( !mSyncMode ) {
178 findButton( User1 )->setText( i18n("Set complete")); 178 findButton( User1 )->setText( i18n("Set complete"));
179 } 179 }
180} 180}
181void KOEventViewerDialog::setJournal(Journal *j) 181void KOEventViewerDialog::setJournal(Journal *j)
182{ 182{
183 mEventViewer->setJournal(j); 183 mEventViewer->setJournal(j);
184 mIncidence = (Incidence*)j; 184 mIncidence = (Incidence*)j;
185 mEventViewer->setFocus(); 185 mEventViewer->setFocus();
186 //findButton( Close )->setFocus(); 186 //findButton( Close )->setFocus();
187 if ( !mSyncMode ) { 187 if ( !mSyncMode ) {
188 findButton( User1 )->setText( i18n("Agenda")); 188 findButton( User1 )->setText( i18n("Agenda"));
189 } 189 }
190} 190}
191 191
192void KOEventViewerDialog::addText(QString text) 192void KOEventViewerDialog::addText(QString text)
193{ 193{
194 mEventViewer->addText(text); 194 mEventViewer->addText(text);
195 mEventViewer->setFocus(); 195 mEventViewer->setFocus();
196 //findButton( Close )->setFocus(); 196 //findButton( Close )->setFocus();
197} 197}
198void KOEventViewerDialog::editIncidence() 198void KOEventViewerDialog::editIncidence()
199{ 199{
200 sendSignalViewerClosed = false; 200 sendSignalViewerClosed = false;
201 if ( mSyncMode ) { 201 if ( mSyncMode ) {
202 mSyncResult = 2; 202 mSyncResult = 2;
203 accept(); 203 accept();
204 return; 204 return;
205 } 205 }
206 if ( mIncidence ){ 206 if ( mIncidence ){
207#ifndef DESKTOP_VERSION 207#ifndef DESKTOP_VERSION
208 hide(); 208 hide();
209#endif 209#endif
210 emit editIncidence( mIncidence ); 210 emit editIncidence( mIncidence );
211 } 211 }
212} 212}
213void KOEventViewerDialog::showIncidence() 213void KOEventViewerDialog::showIncidence()
214{ 214{
215 sendSignalViewerClosed = false; 215 sendSignalViewerClosed = false;
216 if ( mSyncMode ) { 216 if ( mSyncMode ) {
217 mSyncResult = 1; 217 mSyncResult = 1;
218 accept(); 218 accept();
219 return; 219 return;
220 } 220 }
221 221
222 if ( mIncidence ){ 222 if ( mIncidence ){
223#ifndef DESKTOP_VERSION 223#ifndef DESKTOP_VERSION
224 hide(); 224 hide();
225#endif 225#endif
226 QDate date; 226 QDate date;
227 if ( mIncidence->type() == "Todo" ) { 227 if ( mIncidence->type() == "Todo" ) {
228 /* 228 /*
229 if ( ((Todo*)mIncidence)->hasDueDate() ) 229 if ( ((Todo*)mIncidence)->hasDueDate() )
230 date = ((Todo*)mIncidence)->dtDue().date(); 230 date = ((Todo*)mIncidence)->dtDue().date();
231 else { 231 else {
232 globalFlagBlockAgenda = 2; 232 globalFlagBlockAgenda = 2;
233 emit showAgendaView( false ); 233 emit showAgendaView( false );
234 return; 234 return;
235 } 235 }
236 */ 236 */
237 ((Todo*)mIncidence)->setCompleted( true ); 237 ((Todo*)mIncidence)->setCompleted( true );
238 ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() ); 238 ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() );
239 hide(); 239 hide();
240 emit todoCompleted(((Todo*)mIncidence)); 240 emit todoCompleted(((Todo*)mIncidence));
241 return; 241 return;
242 242
243 } else 243 } else
244 date = mIncidence->dtStart().date(); 244 date = mIncidence->dtStart().date();
245 globalFlagBlockAgenda = 1; 245 globalFlagBlockAgenda = 1;
246 emit showAgendaView( false ); 246 emit showAgendaView( false );
247 globalFlagBlockAgenda = 2; 247 globalFlagBlockAgenda = 2;
248 emit jumpToTime( date ); 248 emit jumpToTime( date );
249 } 249 }
250} 250}
251void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 251void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
252{ 252{
253 switch ( e->key() ) { 253 switch ( e->key() ) {
254 254
255 case Qt::Key_A : 255 case Qt::Key_A :
256 case Qt::Key_L : 256 case Qt::Key_L :
257 showIncidence(); 257 showIncidence();
258 break; 258 break;
259 case Qt::Key_E : 259 case Qt::Key_E :
260 case Qt::Key_R : 260 case Qt::Key_R :
261 editIncidence(); 261 editIncidence();
262 break; 262 break;
263 case Qt::Key_C: 263 case Qt::Key_C:
264 case Qt::Key_Escape: 264 case Qt::Key_Escape:
265 sendSignalViewerClosed = true;
265 close(); 266 close();
266 break; 267 break;
267 case Qt::Key_I: 268 case Qt::Key_I:
269#ifndef DESKTOP_VERSION
270 sendSignalViewerClosed = true;
271 close();
272#else
268 sendSignalViewerClosed = true; 273 sendSignalViewerClosed = true;
269 slotViewerClosed(); 274 slotViewerClosed();
270 //accept(); 275 //accept();
276#endif
271 break; 277 break;
272 default: 278 default:
273 KDialogBase::keyPressEvent ( e ); 279 KDialogBase::keyPressEvent ( e );
274 break; 280 break;
275 } 281 }
276 282
277} 283}
278void KOEventViewerDialog::hideEvent ( QHideEvent * e ) 284void KOEventViewerDialog::hideEvent ( QHideEvent * e )
279{ 285{
280 KDialogBase::hideEvent ( e ); 286 KDialogBase::hideEvent ( e );
281 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); 287 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) );
282} 288}
283 289
284void KOEventViewerDialog::slotViewerClosed() 290void KOEventViewerDialog::slotViewerClosed()
285{ 291{
286 if ( sendSignalViewerClosed ) { 292 if ( sendSignalViewerClosed ) {
287 //qDebug("KOEventViewerDialog::hideEvent "); 293 //qDebug("KOEventViewerDialog::hideEvent ");
288 emit signalViewerClosed(); 294 emit signalViewerClosed();
289 } 295 }
290 sendSignalViewerClosed = true; 296 sendSignalViewerClosed = true;
291} 297}
292 298
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 6acee75..710a9f9 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -894,297 +894,297 @@ void KOListView::changeEventDisplay(Event *event, int action)
894 case KOGlobals::EVENTADDED: 894 case KOGlobals::EVENTADDED:
895 addIncidence( event ); 895 addIncidence( event );
896 break; 896 break;
897 case KOGlobals::EVENTEDITED: 897 case KOGlobals::EVENTEDITED:
898 item = getItemForEvent(event); 898 item = getItemForEvent(event);
899 if (item) { 899 if (item) {
900 mUidDict.remove( event->uid() ); 900 mUidDict.remove( event->uid() );
901 delete item; 901 delete item;
902 addIncidence( event ); 902 addIncidence( event );
903 } 903 }
904 break; 904 break;
905 case KOGlobals::EVENTDELETED: 905 case KOGlobals::EVENTDELETED:
906 item = getItemForEvent(event); 906 item = getItemForEvent(event);
907 if (item) { 907 if (item) {
908 mUidDict.remove( event->uid() ); 908 mUidDict.remove( event->uid() );
909 delete item; 909 delete item;
910 } 910 }
911 break; 911 break;
912 default: 912 default:
913 ; 913 ;
914 } 914 }
915} 915}
916 916
917KOListViewItem *KOListView::getItemForEvent(Event *event) 917KOListViewItem *KOListView::getItemForEvent(Event *event)
918{ 918{
919 KOListViewItem *item = (KOListViewItem *)mListView->firstChild(); 919 KOListViewItem *item = (KOListViewItem *)mListView->firstChild();
920 while (item) { 920 while (item) {
921 if (item->data() == event) return item; 921 if (item->data() == event) return item;
922 item = (KOListViewItem *)item->nextSibling(); 922 item = (KOListViewItem *)item->nextSibling();
923 } 923 }
924 return 0; 924 return 0;
925} 925}
926 926
927void KOListView::defaultItemAction(QListViewItem *i) 927void KOListView::defaultItemAction(QListViewItem *i)
928{ 928{
929 KOListViewItem *item = static_cast<KOListViewItem *>( i ); 929 KOListViewItem *item = static_cast<KOListViewItem *>( i );
930 if ( item ) defaultAction( item->data() ); 930 if ( item ) defaultAction( item->data() );
931 931
932} 932}
933 933
934void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) 934void KOListView::popupMenu(QListViewItem *item,const QPoint &,int)
935{ 935{
936 mActiveItem = (KOListViewItem *)item; 936 mActiveItem = (KOListViewItem *)item;
937 if (mActiveItem) { 937 if (mActiveItem) {
938 Incidence *incidence = mActiveItem->data(); 938 Incidence *incidence = mActiveItem->data();
939 mPopupMenu->showIncidencePopup(incidence); 939 mPopupMenu->showIncidencePopup(incidence);
940 940
941 /* 941 /*
942 if ( incidence && incidence->type() == "Event" ) { 942 if ( incidence && incidence->type() == "Event" ) {
943 Event *event = static_cast<Event *>( incidence ); 943 Event *event = static_cast<Event *>( incidence );
944 mPopupMenu->showEventPopup(event); 944 mPopupMenu->showEventPopup(event);
945 } 945 }
946 */ 946 */
947 } 947 }
948} 948}
949 949
950void KOListView::readSettings(KConfig *config, QString setting) 950void KOListView::readSettings(KConfig *config, QString setting)
951{ 951{
952 // qDebug("KOListView::readSettings "); 952 // qDebug("KOListView::readSettings ");
953 mListView->restoreLayout(config,setting); 953 mListView->restoreLayout(config,setting);
954} 954}
955 955
956void KOListView::writeSettings(KConfig *config, QString setting) 956void KOListView::writeSettings(KConfig *config, QString setting)
957{ 957{
958 // qDebug("KOListView::writeSettings "); 958 // qDebug("KOListView::writeSettings ");
959 mListView->saveLayout(config, setting); 959 mListView->saveLayout(config, setting);
960} 960}
961 961
962void KOListView::processSelectionChange(QListViewItem *) 962void KOListView::processSelectionChange(QListViewItem *)
963{ 963{
964 964
965 KOListViewItem *item = 965 KOListViewItem *item =
966 static_cast<KOListViewItem *>( mListView->currentItem() ); 966 static_cast<KOListViewItem *>( mListView->currentItem() );
967 967
968 if ( !item ) { 968 if ( !item ) {
969 emit incidenceSelected( 0 ); 969 emit incidenceSelected( 0 );
970 } else { 970 } else {
971 emit incidenceSelected( item->data() ); 971 emit incidenceSelected( item->data() );
972 } 972 }
973} 973}
974 974
975void KOListView::clearSelection() 975void KOListView::clearSelection()
976{ 976{
977 mListView->selectAll( false ); 977 mListView->selectAll( false );
978} 978}
979void KOListView::allSelection() 979void KOListView::allSelection()
980{ 980{
981 mListView->selectAll( true ); 981 mListView->selectAll( true );
982} 982}
983 983
984void KOListView::clear() 984void KOListView::clear()
985{ 985{
986 mListView->clear(); 986 mListView->clear();
987 mUidDict.clear(); 987 mUidDict.clear();
988} 988}
989 989
990Incidence* KOListView::currentItem() 990Incidence* KOListView::currentItem()
991{ 991{
992 if ( mListView->currentItem() ) 992 if ( mListView->currentItem() )
993 return ((KOListViewItem*) mListView->currentItem())->data(); 993 return ((KOListViewItem*) mListView->currentItem())->data();
994 return 0; 994 return 0;
995} 995}
996void KOListView::keyPressEvent ( QKeyEvent *e) 996void KOListView::keyPressEvent ( QKeyEvent *e)
997{ 997{
998 998
999 if ( e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace ) { 999 if ( e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace ) {
1000 deleteAll(); 1000 deleteAll();
1001 return; 1001 return;
1002 } 1002 }
1003 1003
1004 e->ignore(); 1004 e->ignore();
1005} 1005}
1006void KOListViewListView::keyPressEvent ( QKeyEvent *e) 1006void KOListViewListView::keyPressEvent ( QKeyEvent *e)
1007{ 1007{
1008 1008
1009 switch ( e->key() ) { 1009 switch ( e->key() ) {
1010 case Qt::Key_Down: 1010 case Qt::Key_Down:
1011 if ( e->state() == ShiftButton ) { 1011 if ( e->state() == ShiftButton ) {
1012 QListViewItem* cn = currentItem(); 1012 QListViewItem* cn = currentItem();
1013 if ( !cn ) 1013 if ( !cn )
1014 cn = firstChild(); 1014 cn = firstChild();
1015 if ( !cn ) 1015 if ( !cn )
1016 return; 1016 return;
1017 while ( cn->nextSibling() ) 1017 while ( cn->nextSibling() )
1018 cn = cn->nextSibling(); 1018 cn = cn->nextSibling();
1019 setCurrentItem ( cn ); 1019 setCurrentItem ( cn );
1020 ensureItemVisible ( cn ); 1020 ensureItemVisible ( cn );
1021 1021
1022 e->accept(); 1022 e->accept();
1023 return; 1023 return;
1024 } 1024 }
1025 if ( e->state() == ControlButton ) { 1025 if ( e->state() == ControlButton ) {
1026 int count = childCount (); 1026 int count = childCount ();
1027 int jump = count / 5; 1027 int jump = count / 5;
1028 QListViewItem* cn; 1028 QListViewItem* cn;
1029 cn = currentItem(); 1029 cn = currentItem();
1030 if ( ! cn ) 1030 if ( ! cn )
1031 return; 1031 return;
1032 if ( jump == 0 ) 1032 if ( jump == 0 )
1033 jump = 1; 1033 jump = 1;
1034 while ( jump && cn->nextSibling() ) { 1034 while ( jump && cn->nextSibling() ) {
1035 cn = cn->nextSibling(); 1035 cn = cn->nextSibling();
1036 --jump; 1036 --jump;
1037 } 1037 }
1038 setCurrentItem ( cn ); 1038 setCurrentItem ( cn );
1039 ensureItemVisible ( cn ); 1039 ensureItemVisible ( cn );
1040 1040
1041 } else 1041 } else
1042 QListView::keyPressEvent ( e ) ; 1042 QListView::keyPressEvent ( e ) ;
1043 e->accept(); 1043 e->accept();
1044 break; 1044 break;
1045 1045
1046 case Qt::Key_Up: 1046 case Qt::Key_Up:
1047 if ( e->state() == ShiftButton ) { 1047 if ( e->state() == ShiftButton ) {
1048 QListViewItem* cn = firstChild(); 1048 QListViewItem* cn = firstChild();
1049 if ( cn ) { 1049 if ( cn ) {
1050 setCurrentItem ( cn ); 1050 setCurrentItem ( cn );
1051 ensureItemVisible ( cn ); 1051 ensureItemVisible ( cn );
1052 } 1052 }
1053 e->accept(); 1053 e->accept();
1054 return; 1054 return;
1055 } 1055 }
1056 if ( e->state() == ControlButton ) { 1056 if ( e->state() == ControlButton ) {
1057 int count = childCount (); 1057 int count = childCount ();
1058 int jump = count / 5; 1058 int jump = count / 5;
1059 QListViewItem* cn; 1059 QListViewItem* cn;
1060 cn = currentItem(); 1060 cn = currentItem();
1061 if ( ! cn ) 1061 if ( ! cn )
1062 return; 1062 return;
1063 if ( jump == 0 ) 1063 if ( jump == 0 )
1064 jump = 1; 1064 jump = 1;
1065 while ( jump && cn->itemAbove ()) { 1065 while ( jump && cn->itemAbove ()) {
1066 cn = cn->itemAbove (); 1066 cn = cn->itemAbove ();
1067 --jump; 1067 --jump;
1068 } 1068 }
1069 setCurrentItem ( cn ); 1069 setCurrentItem ( cn );
1070 ensureItemVisible ( cn ); 1070 ensureItemVisible ( cn );
1071 } else 1071 } else
1072 QListView::keyPressEvent ( e ) ; 1072 QListView::keyPressEvent ( e ) ;
1073 e->accept(); 1073 e->accept();
1074 break; 1074 break;
1075 case Qt::Key_I: { 1075 case Qt::Key_I: {
1076 QListViewItem* cn; 1076 QListViewItem* cn;
1077 cn = currentItem(); 1077 cn = currentItem();
1078 if ( cn ) { 1078 if ( cn ) {
1079 KOListViewItem* ci = (KOListViewItem*)( cn ); 1079 KOListViewItem* ci = (KOListViewItem*)( cn );
1080 if ( ci ){ 1080 if ( ci ){
1081 //emit showIncidence( ci->data()); 1081 //emit showIncidence( ci->data());
1082 cn = cn->nextSibling(); 1082 cn = cn->nextSibling();
1083 if ( cn ) { 1083 if ( cn ) {
1084 setCurrentItem ( cn ); 1084 setCurrentItem ( cn );
1085 ensureItemVisible ( cn ); 1085 ensureItemVisible ( cn );
1086 emit showIncidence( ci->data());
1087 } 1086 }
1087 emit showIncidence( ci->data());
1088 } 1088 }
1089 } 1089 }
1090 e->accept(); 1090 e->accept();
1091 } 1091 }
1092 break; 1092 break;
1093 case Qt::Key_Return: 1093 case Qt::Key_Return:
1094 case Qt::Key_Enter: 1094 case Qt::Key_Enter:
1095 { 1095 {
1096 QListViewItem* cn; 1096 QListViewItem* cn;
1097 cn = currentItem(); 1097 cn = currentItem();
1098 if ( cn ) { 1098 if ( cn ) {
1099 KOListViewItem* ci = (KOListViewItem*)( cn ); 1099 KOListViewItem* ci = (KOListViewItem*)( cn );
1100 if ( ci ){ 1100 if ( ci ){
1101 if ( e->state() == ShiftButton ) 1101 if ( e->state() == ShiftButton )
1102 ci->setSelected( false ); 1102 ci->setSelected( false );
1103 else 1103 else
1104 ci->setSelected( true ); 1104 ci->setSelected( true );
1105 cn = cn->nextSibling(); 1105 cn = cn->nextSibling();
1106 if ( cn ) { 1106 if ( cn ) {
1107 setCurrentItem ( cn ); 1107 setCurrentItem ( cn );
1108 ensureItemVisible ( cn ); 1108 ensureItemVisible ( cn );
1109 } 1109 }
1110 } 1110 }
1111 } 1111 }
1112 e->accept(); 1112 e->accept();
1113 } 1113 }
1114 break; 1114 break;
1115 default: 1115 default:
1116 e->ignore(); 1116 e->ignore();
1117 } 1117 }
1118} 1118}
1119KOListViewListView::KOListViewListView(KOListView * lv ) 1119KOListViewListView::KOListViewListView(KOListView * lv )
1120 : KListView( lv ) 1120 : KListView( lv )
1121{ 1121{
1122#ifndef DESKTOP_VERSION 1122#ifndef DESKTOP_VERSION
1123 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 1123 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
1124#endif 1124#endif
1125 mYMousePos = -1000; 1125 mYMousePos = -1000;
1126 setSelectionMode( QListView::Multi ); 1126 setSelectionMode( QListView::Multi );
1127 setMultiSelection( true); 1127 setMultiSelection( true);
1128 mAllowPopupMenu = true; 1128 mAllowPopupMenu = true;
1129 mMouseDown = false; 1129 mMouseDown = false;
1130 1130
1131} 1131}
1132void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1132void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1133{ 1133{
1134 if (!e) return; 1134 if (!e) return;
1135 QPoint vp = contentsToViewport(e->pos()); 1135 QPoint vp = contentsToViewport(e->pos());
1136 QListViewItem *item = itemAt(vp); 1136 QListViewItem *item = itemAt(vp);
1137 if (!item) { 1137 if (!item) {
1138 emit newEvent(); 1138 emit newEvent();
1139 return; 1139 return;
1140 } 1140 }
1141 KListView::contentsMouseDoubleClickEvent(e); 1141 KListView::contentsMouseDoubleClickEvent(e);
1142} 1142}
1143 1143
1144 1144
1145void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1145void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
1146{ 1146{
1147 //qDebug("contentsMousePressEvent++++ "); 1147 //qDebug("contentsMousePressEvent++++ ");
1148 if (! mMouseDown ) { 1148 if (! mMouseDown ) {
1149 mAllowPopupMenu = true; 1149 mAllowPopupMenu = true;
1150 mYMousePos = mapToGlobal( (e->pos())).y(); 1150 mYMousePos = mapToGlobal( (e->pos())).y();
1151 } 1151 }
1152 if ( e->button() == RightButton && mMouseDown ) 1152 if ( e->button() == RightButton && mMouseDown )
1153 return; 1153 return;
1154 if ( e->button() == LeftButton ) 1154 if ( e->button() == LeftButton )
1155 mMouseDown = true; 1155 mMouseDown = true;
1156 KListView::contentsMousePressEvent( e ); 1156 KListView::contentsMousePressEvent( e );
1157} 1157}
1158void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1158void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1159{ 1159{
1160 //qDebug("contentsMouseReleaseEv---- "); 1160 //qDebug("contentsMouseReleaseEv---- ");
1161 if ( ! mMouseDown ) { 1161 if ( ! mMouseDown ) {
1162 if ( e->button() == RightButton && ! mAllowPopupMenu ) 1162 if ( e->button() == RightButton && ! mAllowPopupMenu )
1163 return; 1163 return;
1164 QListViewItem* ci = currentItem(); 1164 QListViewItem* ci = currentItem();
1165 if ( ci ) 1165 if ( ci )
1166 ci->setSelected( true ); 1166 ci->setSelected( true );
1167 KListView::contentsMouseReleaseEvent(e); 1167 KListView::contentsMouseReleaseEvent(e);
1168 return; 1168 return;
1169 } 1169 }
1170 if ( e->button() == LeftButton ) 1170 if ( e->button() == LeftButton )
1171 mMouseDown = false; 1171 mMouseDown = false;
1172 if ( e->button() == RightButton && ! mAllowPopupMenu ) 1172 if ( e->button() == RightButton && ! mAllowPopupMenu )
1173 return; 1173 return;
1174 if ( e->button() == RightButton ) { 1174 if ( e->button() == RightButton ) {
1175 QListViewItem* ci = currentItem(); 1175 QListViewItem* ci = currentItem();
1176 if ( ci ) 1176 if ( ci )
1177 ci->setSelected( true ); 1177 ci->setSelected( true );
1178 } 1178 }
1179 KListView::contentsMouseReleaseEvent(e); 1179 KListView::contentsMouseReleaseEvent(e);
1180} 1180}
1181void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1181void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1182{ 1182{
1183 // qDebug("contentsMouseMoveEv....... "); 1183 // qDebug("contentsMouseMoveEv....... ");
1184 // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() ); 1184 // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() );
1185 int diff = mYMousePos - mapToGlobal( (e->pos())).y(); 1185 int diff = mYMousePos - mapToGlobal( (e->pos())).y();
1186 if ( diff < 0 ) diff = -diff; 1186 if ( diff < 0 ) diff = -diff;
1187 if ( diff > 20 ) 1187 if ( diff > 20 )
1188 mAllowPopupMenu = false; 1188 mAllowPopupMenu = false;
1189 KListView::contentsMouseMoveEvent(e); 1189 KListView::contentsMouseMoveEvent(e);
1190} 1190}
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index cef59a2..678e1bd 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -1,320 +1,327 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
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 as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qgroupbox.h> 27#include <qgroupbox.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlistview.h>
29#include <qwhatsthis.h> 30#include <qwhatsthis.h>
30#include <qlineedit.h> 31#include <qlineedit.h>
31#include <qpushbutton.h> 32#include <qpushbutton.h>
32 33
33#include <klocale.h> 34#include <klocale.h>
34#include <kmessagebox.h> 35#include <kmessagebox.h>
35 36
36#include <libkdepim/kdateedit.h> 37#include <libkdepim/kdateedit.h>
37 38
38#include "koglobals.h" 39#include "koglobals.h"
39#include "koprefs.h" 40#include "koprefs.h"
41#include "klineedit.h"
40 42
41#include "calendarview.h" 43#include "calendarview.h"
42#include "koviewmanager.h" 44#include "koviewmanager.h"
43#include "searchdialog.h" 45#include "searchdialog.h"
44 46
45SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) 47SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
46 : QVBox( 0 ) 48 : QVBox( 0 )
47 49
48{ 50{
49 mCalendar = calendar; 51 mCalendar = calendar;
50 QFrame *topFrame = new QFrame( this ) ;//plainPage(); 52 QFrame *topFrame = new QFrame( this ) ;//plainPage();
51 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); 53 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint());
52 54
53 // Search expression 55 // Search expression
54 QHBoxLayout *subLayout = new QHBoxLayout(); 56 QHBoxLayout *subLayout = new QHBoxLayout();
55 layout->addLayout(subLayout); 57 layout->addLayout(subLayout);
56 searchLabel = new QLabel(topFrame); 58 searchLabel = new QLabel(topFrame);
57 searchLabel->setText(i18n("Search for:")); 59 searchLabel->setText(i18n("Search for:"));
58 subLayout->addWidget(searchLabel); 60 subLayout->addWidget(searchLabel);
59 61
60 searchEdit = new QLineEdit(topFrame); 62 searchEdit = new KLineEdit(topFrame);
61 subLayout->addWidget(searchEdit); 63 subLayout->addWidget(searchEdit);
62 QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame ); 64 QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame );
63 //OkButton->setDefault( true ); 65 //OkButton->setDefault( true );
64 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); 66 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch()));
65 subLayout->addWidget(OkButton); 67 subLayout->addWidget(OkButton);
66 searchEdit->setText("*"); // Find all events by default 68 searchEdit->setText("*"); // Find all events by default
67 searchEdit->setFocus(); 69 searchEdit->setFocus();
68 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); 70 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
69 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); 71 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch()));
70 // Subjects to search 72 // Subjects to search
71 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), 73 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
72 // topFrame); 74 // topFrame);
73 75
74 QHBox *incidenceGroup = new QHBox( topFrame ); 76 QHBox *incidenceGroup = new QHBox( topFrame );
75 layout->addWidget(incidenceGroup); 77 layout->addWidget(incidenceGroup);
76 78
77 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); 79 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup);
78 mSearchEvent->setChecked(true); 80 mSearchEvent->setChecked(true);
79 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); 81 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup);
80 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); 82 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup);
81 83
82 QHBox *subjectGroup = new QHBox( topFrame ); 84 QHBox *subjectGroup = new QHBox( topFrame );
83 layout->addWidget(subjectGroup); 85 layout->addWidget(subjectGroup);
84 86
85 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); 87 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup);
86 mSummaryCheck->setChecked(true); 88 mSummaryCheck->setChecked(true);
87 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); 89 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup);
88 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); 90 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup);
89 91
90 QHBox *attendeeGroup = new QHBox( topFrame ); 92 QHBox *attendeeGroup = new QHBox( topFrame );
91 layout->addWidget(attendeeGroup ); 93 layout->addWidget(attendeeGroup );
92 new QLabel( i18n("Attendee:"),attendeeGroup ); 94 new QLabel( i18n("Attendee:"),attendeeGroup );
93 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); 95 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup );
94 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); 96 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup );
95 // Date range 97 // Date range
96 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), 98 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"),
97 // topFrame); 99 // topFrame);
98 // layout->addWidget(rangeGroup); 100 // layout->addWidget(rangeGroup);
99 101
100 QWidget *rangeWidget = new QWidget(topFrame); 102 QWidget *rangeWidget = new QWidget(topFrame);
101 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); 103 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint());
102 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); 104 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
103 mStartDate = new KDateEdit(rangeWidget); 105 mStartDate = new KDateEdit(rangeWidget);
104 rangeLayout->addWidget(mStartDate); 106 rangeLayout->addWidget(mStartDate);
105 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); 107 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget));
106 mEndDate = new KDateEdit(rangeWidget); 108 mEndDate = new KDateEdit(rangeWidget);
107 mEndDate->setDate(QDate::currentDate().addDays(365)); 109 mEndDate->setDate(QDate::currentDate().addDays(365));
108 rangeLayout->addWidget(mEndDate); 110 rangeLayout->addWidget(mEndDate);
109 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); 111 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
110 rangeLayout->addWidget( (QWidget*)wt ); 112 rangeLayout->addWidget( (QWidget*)wt );
111 layout->addWidget(rangeWidget); 113 layout->addWidget(rangeWidget);
112 // Results list view 114 // Results list view
113 listView = new KOListView(mCalendar,topFrame); 115 listView = new KOListView(mCalendar,topFrame);
114 layout->addWidget(listView); 116 layout->addWidget(listView);
115 117
116 listView->readSettings(KOGlobals::config(),"SearchListView Layout"); 118 listView->readSettings(KOGlobals::config(),"SearchListView Layout");
119 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
117 120
118 setCaption( i18n("KO/Pi Find: ")); 121 setCaption( i18n("KO/Pi Find: "));
119#ifdef DESKTOP_VERSION 122#ifdef DESKTOP_VERSION
120 OkButton = new QPushButton( i18n("Close"), this ); 123 OkButton = new QPushButton( i18n("Close"), this );
121 connect(OkButton,SIGNAL(clicked()),SLOT(hide())); 124 connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
122#endif 125#endif
123} 126}
124 127
125SearchDialog::~SearchDialog() 128SearchDialog::~SearchDialog()
126{ 129{
127 130
128} 131}
132void SearchDialog::setFocusToList()
133{
134 listView->resetFocus();
135}
129void SearchDialog::accept() 136void SearchDialog::accept()
130{ 137{
131 doSearch(); 138 doSearch();
132} 139}
133void SearchDialog::updateList() 140void SearchDialog::updateList()
134{ 141{
135 //listView->updateList(); 142 //listView->updateList();
136 if ( isVisible() ) { 143 if ( isVisible() ) {
137 updateView(); 144 updateView();
138 //qDebug("SearchDialog::updated "); 145 //qDebug("SearchDialog::updated ");
139 } 146 }
140 else { 147 else {
141 listView->clear(); 148 listView->clear();
142 //qDebug("SearchDialog::cleared "); 149 //qDebug("SearchDialog::cleared ");
143 150
144 } 151 }
145} 152}
146void SearchDialog::searchTextChanged( const QString &_text ) 153void SearchDialog::searchTextChanged( const QString &_text )
147{ 154{
148#if 0 155#if 0
149 enableButton( KDialogBase::User1, !_text.isEmpty() ); 156 enableButton( KDialogBase::User1, !_text.isEmpty() );
150#endif 157#endif
151} 158}
152 159
153void SearchDialog::doSearch() 160void SearchDialog::doSearch()
154{ 161{
155 QRegExp re; 162 QRegExp re;
156 163
157 re.setWildcard(true); // most people understand these better. 164 re.setWildcard(true); // most people understand these better.
158 re.setCaseSensitive(false); 165 re.setCaseSensitive(false);
159 re.setPattern(searchEdit->text()); 166 re.setPattern(searchEdit->text());
160 if (!re.isValid() ) { 167 if (!re.isValid() ) {
161 KMessageBox::sorry(this, 168 KMessageBox::sorry(this,
162 i18n("Invalid search expression,\ncannot perform " 169 i18n("Invalid search expression,\ncannot perform "
163 "the search.\nPlease enter a search expression\n" 170 "the search.\nPlease enter a search expression\n"
164 "using the wildcard characters\n '*' and '?'" 171 "using the wildcard characters\n '*' and '?'"
165 "where needed.")); 172 "where needed."));
166 return; 173 return;
167 } 174 }
168 175
169 search(re); 176 search(re);
170 177
171 listView->setStartDate( mStartDate->date() ); 178 listView->setStartDate( mStartDate->date() );
172 listView->showEvents(mMatchedEvents); 179 listView->showEvents(mMatchedEvents);
173 listView->addTodos(mMatchedTodos); 180 listView->addTodos(mMatchedTodos);
174 listView->addJournals(mMatchedJournals); 181 listView->addJournals(mMatchedJournals);
175 182
176 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { 183 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) {
177 setCaption(i18n("No items found. Use '*' and '?' where needed.")); 184 setCaption(i18n("No items found. Use '*' and '?' where needed."));
178 } else { 185 } else {
179 QString mess; 186 QString mess;
180 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); 187 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() );
181 setCaption( i18n("KO/Pi Find: ") + mess); 188 setCaption( i18n("KO/Pi Find: ") + mess);
182 189
183 } 190 }
184 searchEdit->setFocus(); 191 searchEdit->setFocus();
185} 192}
186void SearchDialog::updateConfig() 193void SearchDialog::updateConfig()
187{ 194{
188 listView->updateConfig(); 195 listView->updateConfig();
189} 196}
190void SearchDialog::updateView() 197void SearchDialog::updateView()
191{ 198{
192 199
193 QRegExp re; 200 QRegExp re;
194 re.setWildcard(true); // most people understand these better. 201 re.setWildcard(true); // most people understand these better.
195 re.setCaseSensitive(false); 202 re.setCaseSensitive(false);
196 re.setPattern(searchEdit->text()); 203 re.setPattern(searchEdit->text());
197 if (re.isValid()) { 204 if (re.isValid()) {
198 search(re); 205 search(re);
199 } else { 206 } else {
200 mMatchedEvents.clear(); 207 mMatchedEvents.clear();
201 mMatchedTodos.clear(); 208 mMatchedTodos.clear();
202 mMatchedJournals.clear(); 209 mMatchedJournals.clear();
203 } 210 }
204 listView->setStartDate( mStartDate->date() ); 211 listView->setStartDate( mStartDate->date() );
205 listView->showEvents(mMatchedEvents); 212 listView->showEvents(mMatchedEvents);
206 listView->addTodos(mMatchedTodos); 213 listView->addTodos(mMatchedTodos);
207 listView->addJournals(mMatchedJournals); 214 listView->addJournals(mMatchedJournals);
208} 215}
209 216
210void SearchDialog::search(const QRegExp &re) 217void SearchDialog::search(const QRegExp &re)
211{ 218{
212 QPtrList<Event> events = mCalendar->events( mStartDate->date(), 219 QPtrList<Event> events = mCalendar->events( mStartDate->date(),
213 mEndDate->date(), 220 mEndDate->date(),
214 false /*mInclusiveCheck->isChecked()*/ ); 221 false /*mInclusiveCheck->isChecked()*/ );
215 222
216 mMatchedEvents.clear(); 223 mMatchedEvents.clear();
217 if ( mSearchEvent->isChecked() ) { 224 if ( mSearchEvent->isChecked() ) {
218 Event *ev; 225 Event *ev;
219 for(ev=events.first();ev;ev=events.next()) { 226 for(ev=events.first();ev;ev=events.next()) {
220 if (mSummaryCheck->isChecked()) { 227 if (mSummaryCheck->isChecked()) {
221#if QT_VERSION >= 0x030000 228#if QT_VERSION >= 0x030000
222 if (re.search(ev->summary()) != -1) 229 if (re.search(ev->summary()) != -1)
223#else 230#else
224 if (re.match(ev->summary()) != -1) 231 if (re.match(ev->summary()) != -1)
225#endif 232#endif
226 { 233 {
227 mMatchedEvents.append(ev); 234 mMatchedEvents.append(ev);
228 continue; 235 continue;
229 } 236 }
230#if QT_VERSION >= 0x030000 237#if QT_VERSION >= 0x030000
231 if (re.search(ev->location()) != -1) 238 if (re.search(ev->location()) != -1)
232#else 239#else
233 if (re.match(ev->location()) != -1) 240 if (re.match(ev->location()) != -1)
234#endif 241#endif
235 { 242 {
236 mMatchedEvents.append(ev); 243 mMatchedEvents.append(ev);
237 continue; 244 continue;
238 } 245 }
239 } 246 }
240 if (mDescriptionCheck->isChecked()) { 247 if (mDescriptionCheck->isChecked()) {
241#if QT_VERSION >= 0x030000 248#if QT_VERSION >= 0x030000
242 if (re.search(ev->description()) != -1) 249 if (re.search(ev->description()) != -1)
243#else 250#else
244 if (re.match(ev->description()) != -1) 251 if (re.match(ev->description()) != -1)
245#endif 252#endif
246 { 253 {
247 mMatchedEvents.append(ev); 254 mMatchedEvents.append(ev);
248 continue; 255 continue;
249 } 256 }
250 } 257 }
251 if (mCategoryCheck->isChecked()) { 258 if (mCategoryCheck->isChecked()) {
252#if QT_VERSION >= 0x030000 259#if QT_VERSION >= 0x030000
253 if (re.search(ev->categoriesStr()) != -1) 260 if (re.search(ev->categoriesStr()) != -1)
254#else 261#else
255 if (re.match(ev->categoriesStr()) != -1) 262 if (re.match(ev->categoriesStr()) != -1)
256#endif 263#endif
257 { 264 {
258 mMatchedEvents.append(ev); 265 mMatchedEvents.append(ev);
259 continue; 266 continue;
260 } 267 }
261 } 268 }
262 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 269 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
263 QPtrList<Attendee> tmpAList = ev->attendees(); 270 QPtrList<Attendee> tmpAList = ev->attendees();
264 Attendee *a; 271 Attendee *a;
265 for (a = tmpAList.first(); a; a = tmpAList.next()) { 272 for (a = tmpAList.first(); a; a = tmpAList.next()) {
266 if (mSearchAName->isChecked()) { 273 if (mSearchAName->isChecked()) {
267#if QT_VERSION >= 0x030000 274#if QT_VERSION >= 0x030000
268 if (re.search(a->name()) != -1) 275 if (re.search(a->name()) != -1)
269#else 276#else
270 if (re.match(a->name()) != -1) 277 if (re.match(a->name()) != -1)
271#endif 278#endif
272 { 279 {
273 mMatchedEvents.append(ev); 280 mMatchedEvents.append(ev);
274 break; 281 break;
275 } 282 }
276 } 283 }
277 if (mSearchAEmail->isChecked()) { 284 if (mSearchAEmail->isChecked()) {
278#if QT_VERSION >= 0x030000 285#if QT_VERSION >= 0x030000
279 if (re.search(a->email()) != -1) 286 if (re.search(a->email()) != -1)
280#else 287#else
281 if (re.match(a->email()) != -1) 288 if (re.match(a->email()) != -1)
282#endif 289#endif
283 { 290 {
284 mMatchedEvents.append(ev); 291 mMatchedEvents.append(ev);
285 break; 292 break;
286 } 293 }
287 } 294 }
288 } 295 }
289 } 296 }
290 } 297 }
291 } 298 }
292 QPtrList<Todo> todos = mCalendar->todos( ); 299 QPtrList<Todo> todos = mCalendar->todos( );
293 mMatchedTodos.clear(); 300 mMatchedTodos.clear();
294 if ( mSearchTodo->isChecked() ) { 301 if ( mSearchTodo->isChecked() ) {
295 Todo *tod; 302 Todo *tod;
296 for(tod=todos.first();tod;tod=todos.next()) { 303 for(tod=todos.first();tod;tod=todos.next()) {
297 if (mSummaryCheck->isChecked()) { 304 if (mSummaryCheck->isChecked()) {
298#if QT_VERSION >= 0x030000 305#if QT_VERSION >= 0x030000
299 if (re.search(tod->summary()) != -1) 306 if (re.search(tod->summary()) != -1)
300#else 307#else
301 if (re.match(tod->summary()) != -1) 308 if (re.match(tod->summary()) != -1)
302#endif 309#endif
303 { 310 {
304 mMatchedTodos.append(tod); 311 mMatchedTodos.append(tod);
305 continue; 312 continue;
306 } 313 }
307 } 314 }
308 if (mDescriptionCheck->isChecked()) { 315 if (mDescriptionCheck->isChecked()) {
309#if QT_VERSION >= 0x030000 316#if QT_VERSION >= 0x030000
310 if (re.search(tod->description()) != -1) 317 if (re.search(tod->description()) != -1)
311#else 318#else
312 if (re.match(tod->description()) != -1) 319 if (re.match(tod->description()) != -1)
313#endif 320#endif
314 { 321 {
315 mMatchedTodos.append(tod); 322 mMatchedTodos.append(tod);
316 continue; 323 continue;
317 } 324 }
318 } 325 }
319 if (mCategoryCheck->isChecked()) { 326 if (mCategoryCheck->isChecked()) {
320#if QT_VERSION >= 0x030000 327#if QT_VERSION >= 0x030000
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index f4aad9e..b730ed5 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -1,92 +1,94 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
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 as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef SEARCHDIALOG_H 24#ifndef SEARCHDIALOG_H
25#define SEARCHDIALOG_H 25#define SEARCHDIALOG_H
26 26
27#include <qregexp.h> 27#include <qregexp.h>
28 28
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30#include <qvbox.h> 30#include <qvbox.h>
31 31
32#include <libkcal/calendar.h> 32#include <libkcal/calendar.h>
33 33
34#include "kolistview.h" 34#include "kolistview.h"
35 35
36class KDateEdit; 36class KDateEdit;
37class QCheckBox; 37class QCheckBox;
38class QLineEdit; 38class QLineEdit;
39class KLineEdit;
39class QLabel; 40class QLabel;
40class CalendarView; 41class CalendarView;
41 42
42using namespace KCal; 43using namespace KCal;
43class SearchDialog : public QVBox 44class SearchDialog : public QVBox
44{ 45{
45 Q_OBJECT 46 Q_OBJECT
46 public: 47 public:
47 SearchDialog(Calendar *calendar,CalendarView *parent=0); 48 SearchDialog(Calendar *calendar,CalendarView *parent=0);
48 virtual ~SearchDialog(); 49 virtual ~SearchDialog();
49 KOListView *listview(){ return listView;} 50 KOListView *listview(){ return listView;}
50 void updateView(); 51 void updateView();
51 52
52 public slots: 53 public slots:
53 void changeEventDisplay(Event *, int) { updateView(); } 54 void changeEventDisplay(Event *, int) { updateView(); }
54 void updateConfig(); 55 void updateConfig();
55 void updateList(); 56 void updateList();
56 protected slots: 57 protected slots:
58 void setFocusToList();
57 void accept(); 59 void accept();
58 void doSearch(); 60 void doSearch();
59 void searchTextChanged( const QString &_text ); 61 void searchTextChanged( const QString &_text );
60 62
61 signals: 63 signals:
62 void showEventSignal(Event *); 64 void showEventSignal(Event *);
63 void editEventSignal(Event *); 65 void editEventSignal(Event *);
64 void deleteEventSignal(Event *); 66 void deleteEventSignal(Event *);
65 67
66 private: 68 private:
67 void search(const QRegExp &); 69 void search(const QRegExp &);
68 70
69 Calendar *mCalendar; 71 Calendar *mCalendar;
70 72
71 QPtrList<Event> mMatchedEvents; 73 QPtrList<Event> mMatchedEvents;
72 QPtrList<Todo> mMatchedTodos; 74 QPtrList<Todo> mMatchedTodos;
73 QPtrList<Journal> mMatchedJournals; 75 QPtrList<Journal> mMatchedJournals;
74 76
75 QLabel *searchLabel; 77 QLabel *searchLabel;
76 QLineEdit *searchEdit; 78 KLineEdit *searchEdit;
77 KOListView *listView; 79 KOListView *listView;
78 80
79 KDateEdit *mStartDate; 81 KDateEdit *mStartDate;
80 KDateEdit *mEndDate; 82 KDateEdit *mEndDate;
81 QCheckBox *mSummaryCheck; 83 QCheckBox *mSummaryCheck;
82 QCheckBox *mDescriptionCheck; 84 QCheckBox *mDescriptionCheck;
83 QCheckBox *mCategoryCheck; 85 QCheckBox *mCategoryCheck;
84 QCheckBox *mSearchEvent; 86 QCheckBox *mSearchEvent;
85 QCheckBox *mSearchTodo; 87 QCheckBox *mSearchTodo;
86 QCheckBox *mSearchJournal; 88 QCheckBox *mSearchJournal;
87 QCheckBox *mSearchAName; 89 QCheckBox *mSearchAName;
88 QCheckBox *mSearchAEmail; 90 QCheckBox *mSearchAEmail;
89 void keyPressEvent ( QKeyEvent *e) ; 91 void keyPressEvent ( QKeyEvent *e) ;
90}; 92};
91 93
92#endif 94#endif
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp
index 801094a..f453331 100644
--- a/microkde/kdialogbase.cpp
+++ b/microkde/kdialogbase.cpp
@@ -1,271 +1,273 @@
1#include <qtabwidget.h> 1#include <qtabwidget.h>
2#include <qpushbutton.h> 2#include <qpushbutton.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qframe.h> 4#include <qframe.h>
5 5
6 6
7#include "klocale.h" 7#include "klocale.h"
8#include "kdebug.h" 8#include "kdebug.h"
9 9
10#include "kdialogbase.h" 10#include "kdialogbase.h"
11 11
12KDialogBase::KDialogBase() 12KDialogBase::KDialogBase()
13{ 13{
14} 14}
15 15
16KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal, 16KDialogBase::KDialogBase( QWidget *parent, const char *name, bool modal,
17 const QString &caption, 17 const QString &caption,
18 int buttonMask, ButtonCode defaultButton, 18 int buttonMask, ButtonCode defaultButton,
19 bool separator, 19 bool separator,
20 const QString &user1, 20 const QString &user1,
21 const QString &user2, 21 const QString &user2,
22 const QString &user3) : 22 const QString &user3) :
23 KDialog( parent, name, modal ) 23 KDialog( parent, name, modal )
24{ 24{
25 init( caption, buttonMask, user1, user2 ); 25 init( caption, buttonMask, user1, user2 );
26 if (findButton( defaultButton ) ) { 26 if (findButton( defaultButton ) ) {
27 (findButton( defaultButton ) )->setFocus(); 27 (findButton( defaultButton ) )->setFocus();
28 (findButton( defaultButton ) )->setDefault( true ); 28 (findButton( defaultButton ) )->setDefault( true );
29 } 29 }
30 30
31} 31}
32 32
33KDialogBase::KDialogBase( int dialogFace, const QString &caption, 33KDialogBase::KDialogBase( int dialogFace, const QString &caption,
34 int buttonMask, ButtonCode defaultButton, 34 int buttonMask, ButtonCode defaultButton,
35 QWidget *parent, const char *name, bool modal, 35 QWidget *parent, const char *name, bool modal,
36 bool separator, 36 bool separator,
37 const QString &user1, 37 const QString &user1,
38 const QString &user2, 38 const QString &user2,
39 const QString &user3) : 39 const QString &user3) :
40 KDialog( parent, name, modal ) 40 KDialog( parent, name, modal )
41{ 41{
42 init( caption, buttonMask, user1, user2 ); 42 init( caption, buttonMask, user1, user2 );
43 if (findButton( defaultButton ) ) 43 if (findButton( defaultButton ) ) {
44 (findButton( defaultButton ) )->setFocus(); 44 (findButton( defaultButton ) )->setFocus();
45 (findButton( defaultButton ) )->setDefault( true );
46 }
45 47
46} 48}
47 49
48KDialogBase::~KDialogBase() 50KDialogBase::~KDialogBase()
49{ 51{
50} 52}
51 53
52void KDialogBase::init( const QString &caption, int buttonMask, 54void KDialogBase::init( const QString &caption, int buttonMask,
53 const QString &user1 ,const QString &user2 ) 55 const QString &user1 ,const QString &user2 )
54{ 56{
55 mMainWidget = 0; 57 mMainWidget = 0;
56 mTabWidget = 0; 58 mTabWidget = 0;
57 mPlainPage = 0; 59 mPlainPage = 0;
58 mTopLayout = 0; 60 mTopLayout = 0;
59 if ( !caption.isEmpty() ) { 61 if ( !caption.isEmpty() ) {
60 setCaption( caption ); 62 setCaption( caption );
61 } 63 }
62 64
63 if ( buttonMask & User1 ) { 65 if ( buttonMask & User1 ) {
64 mUser1Button = new QPushButton( user1, this ); 66 mUser1Button = new QPushButton( user1, this );
65 connect( mUser1Button, SIGNAL( clicked() ), SLOT( slotUser1() ) ); 67 connect( mUser1Button, SIGNAL( clicked() ), SLOT( slotUser1() ) );
66 } else { 68 } else {
67 mUser1Button = 0; 69 mUser1Button = 0;
68 } 70 }
69 if ( buttonMask & User2 ) { 71 if ( buttonMask & User2 ) {
70 mUser2Button = new QPushButton( user2, this ); 72 mUser2Button = new QPushButton( user2, this );
71 connect( mUser2Button, SIGNAL( clicked() ), SLOT( slotUser2() ) ); 73 connect( mUser2Button, SIGNAL( clicked() ), SLOT( slotUser2() ) );
72 } else { 74 } else {
73 mUser2Button = 0; 75 mUser2Button = 0;
74 } 76 }
75 77
76 if ( buttonMask & Ok ) { 78 if ( buttonMask & Ok ) {
77 mOkButton = new QPushButton( i18n("Ok"), this ); 79 mOkButton = new QPushButton( i18n("Ok"), this );
78 connect( mOkButton, SIGNAL( clicked() ), SLOT( slotOk() ) ); 80 connect( mOkButton, SIGNAL( clicked() ), SLOT( slotOk() ) );
79 mOkButton->setDefault( true ); 81 //mOkButton->setDefault( true );
80 } else { 82 } else {
81 mOkButton = 0; 83 mOkButton = 0;
82 } 84 }
83 if ( buttonMask & Default ) { 85 if ( buttonMask & Default ) {
84 mDefaultButton = new QPushButton( i18n("Default"), this ); 86 mDefaultButton = new QPushButton( i18n("Default"), this );
85 connect( mDefaultButton, SIGNAL( clicked() ), SIGNAL( defaultClicked() ) ); 87 connect( mDefaultButton, SIGNAL( clicked() ), SIGNAL( defaultClicked() ) );
86 } else { 88 } else {
87 mDefaultButton = 0; 89 mDefaultButton = 0;
88 } 90 }
89 91
90 if ( buttonMask & Apply ) { 92 if ( buttonMask & Apply ) {
91 mApplyButton = new QPushButton( i18n("Apply"), this ); 93 mApplyButton = new QPushButton( i18n("Apply"), this );
92 connect( mApplyButton, SIGNAL( clicked() ), SLOT( slotApply() ) ); 94 connect( mApplyButton, SIGNAL( clicked() ), SLOT( slotApply() ) );
93 } else { 95 } else {
94 mApplyButton = 0; 96 mApplyButton = 0;
95 } 97 }
96 98
97 if ( buttonMask & Cancel ) { 99 if ( buttonMask & Cancel ) {
98 mCancelButton = new QPushButton( i18n("Cancel"), this ); 100 mCancelButton = new QPushButton( i18n("Cancel"), this );
99 connect( mCancelButton, SIGNAL( clicked() ), SLOT( slotCancel() ) ); 101 connect( mCancelButton, SIGNAL( clicked() ), SLOT( slotCancel() ) );
100 } else { 102 } else {
101 mCancelButton = 0; 103 mCancelButton = 0;
102 } 104 }
103 105
104 if ( buttonMask & Close ) { 106 if ( buttonMask & Close ) {
105 mCloseButton = new QPushButton( i18n("Close"), this ); 107 mCloseButton = new QPushButton( i18n("Close"), this );
106 connect( mCloseButton, SIGNAL( clicked() ), SLOT( slotClose() ) ); 108 connect( mCloseButton, SIGNAL( clicked() ), SLOT( slotClose() ) );
107 } else { 109 } else {
108 mCloseButton = 0; 110 mCloseButton = 0;
109 } 111 }
110} 112}
111 113
112QTabWidget *KDialogBase::tabWidget() 114QTabWidget *KDialogBase::tabWidget()
113{ 115{
114 if ( !mTabWidget ) { 116 if ( !mTabWidget ) {
115 mTabWidget = new QTabWidget( this ); 117 mTabWidget = new QTabWidget( this );
116 setMainWidget( mTabWidget ); 118 setMainWidget( mTabWidget );
117 } 119 }
118 return mTabWidget; 120 return mTabWidget;
119} 121}
120 122
121void KDialogBase::hideButtons() 123void KDialogBase::hideButtons()
122{ 124{
123 if ( mUser1Button ) mUser1Button->hide() ; 125 if ( mUser1Button ) mUser1Button->hide() ;
124 if ( mUser2Button ) mUser2Button->hide() ; 126 if ( mUser2Button ) mUser2Button->hide() ;
125 if ( mOkButton ) mOkButton->hide() ; 127 if ( mOkButton ) mOkButton->hide() ;
126 if ( mApplyButton ) mApplyButton->hide() ; 128 if ( mApplyButton ) mApplyButton->hide() ;
127 if ( mDefaultButton ) mDefaultButton->hide(); 129 if ( mDefaultButton ) mDefaultButton->hide();
128 if ( mCancelButton ) mCancelButton->hide() ; 130 if ( mCancelButton ) mCancelButton->hide() ;
129 if ( mCloseButton ) mCloseButton->hide() ; 131 if ( mCloseButton ) mCloseButton->hide() ;
130 132
131} 133}
132void KDialogBase::initLayout() 134void KDialogBase::initLayout()
133{ 135{
134 136
135 delete mTopLayout; 137 delete mTopLayout;
136 mTopLayout = new QVBoxLayout( this ); 138 mTopLayout = new QVBoxLayout( this );
137 mTopLayout->setMargin( marginHint() ); 139 mTopLayout->setMargin( marginHint() );
138 mTopLayout->setSpacing( spacingHint() ); 140 mTopLayout->setSpacing( spacingHint() );
139 141
140 mTopLayout->addWidget( mMainWidget ); 142 mTopLayout->addWidget( mMainWidget );
141 143
142 QBoxLayout *buttonLayout = new QHBoxLayout; 144 QBoxLayout *buttonLayout = new QHBoxLayout;
143 mTopLayout->addLayout( buttonLayout ); 145 mTopLayout->addLayout( buttonLayout );
144 146
145 if ( mUser1Button ) buttonLayout->addWidget( mUser1Button ); 147 if ( mUser1Button ) buttonLayout->addWidget( mUser1Button );
146 if ( mUser2Button ) buttonLayout->addWidget( mUser2Button ); 148 if ( mUser2Button ) buttonLayout->addWidget( mUser2Button );
147 if ( mOkButton ) buttonLayout->addWidget( mOkButton ); 149 if ( mOkButton ) buttonLayout->addWidget( mOkButton );
148 if ( mApplyButton ) buttonLayout->addWidget( mApplyButton ); 150 if ( mApplyButton ) buttonLayout->addWidget( mApplyButton );
149 if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton ); 151 if ( mDefaultButton ) buttonLayout->addWidget( mDefaultButton );
150 if ( mCancelButton ) buttonLayout->addWidget( mCancelButton ); 152 if ( mCancelButton ) buttonLayout->addWidget( mCancelButton );
151 if ( mCloseButton ) buttonLayout->addWidget( mCloseButton ); 153 if ( mCloseButton ) buttonLayout->addWidget( mCloseButton );
152} 154}
153 155
154QFrame *KDialogBase::addPage( const QString &name ) 156QFrame *KDialogBase::addPage( const QString &name )
155{ 157{
156// kdDebug() << "KDialogBase::addPage(): " << name << endl; 158// kdDebug() << "KDialogBase::addPage(): " << name << endl;
157 QFrame *frame = new QFrame( tabWidget() ); 159 QFrame *frame = new QFrame( tabWidget() );
158 tabWidget()->addTab( frame, name ); 160 tabWidget()->addTab( frame, name );
159 return frame; 161 return frame;
160} 162}
161 163
162QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & ) 164QFrame *KDialogBase::addPage( const QString &name, int, const QPixmap & )
163{ 165{
164 return addPage( name ); 166 return addPage( name );
165} 167}
166 168
167 169
168void KDialogBase::setMainWidget( QWidget *widget ) 170void KDialogBase::setMainWidget( QWidget *widget )
169{ 171{
170 kdDebug() << "KDialogBase::setMainWidget()" << endl; 172 kdDebug() << "KDialogBase::setMainWidget()" << endl;
171 173
172 mMainWidget = widget; 174 mMainWidget = widget;
173 initLayout(); 175 initLayout();
174} 176}
175 177
176void KDialogBase::setButtonText( ButtonCode id, const QString &text ) 178void KDialogBase::setButtonText( ButtonCode id, const QString &text )
177{ 179{
178 QPushButton *button = findButton( id ); 180 QPushButton *button = findButton( id );
179 if ( button ) { 181 if ( button ) {
180 button->setText( text ); 182 button->setText( text );
181 } 183 }
182} 184}
183 185
184void KDialogBase::enableButton( ButtonCode id, bool state ) 186void KDialogBase::enableButton( ButtonCode id, bool state )
185{ 187{
186 QPushButton *button = findButton( id ); 188 QPushButton *button = findButton( id );
187 if ( button ) { 189 if ( button ) {
188 button->setEnabled( state ); 190 button->setEnabled( state );
189 } 191 }
190} 192}
191 193
192QPushButton *KDialogBase::findButton( ButtonCode id ) 194QPushButton *KDialogBase::findButton( ButtonCode id )
193{ 195{
194 QPushButton *button = 0; 196 QPushButton *button = 0;
195 switch ( id ) { 197 switch ( id ) {
196 case Ok: 198 case Ok:
197 button = mOkButton; 199 button = mOkButton;
198 break; 200 break;
199 case Apply: 201 case Apply:
200 button = mApplyButton; 202 button = mApplyButton;
201 break; 203 break;
202 case User1: 204 case User1:
203 button = mUser1Button; 205 button = mUser1Button;
204 break; 206 break;
205 case User2: 207 case User2:
206 button = mUser2Button; 208 button = mUser2Button;
207 break; 209 break;
208 case Cancel: 210 case Cancel:
209 button = mCancelButton; 211 button = mCancelButton;
210 break; 212 break;
211 case Default: 213 case Default:
212 button = mDefaultButton; 214 button = mDefaultButton;
213 break; 215 break;
214 case Close: 216 case Close:
215 button = mCloseButton; 217 button = mCloseButton;
216 break; 218 break;
217 default: 219 default:
218 break; 220 break;
219 } 221 }
220 return button; 222 return button;
221} 223}
222 224
223void KDialogBase::enableButtonOK( bool state ) 225void KDialogBase::enableButtonOK( bool state )
224{ 226{
225 enableButton( Ok, state ); 227 enableButton( Ok, state );
226} 228}
227 229
228void KDialogBase::enableButtonApply( bool state ) 230void KDialogBase::enableButtonApply( bool state )
229{ 231{
230 enableButton( Apply, state ); 232 enableButton( Apply, state );
231} 233}
232 234
233void KDialogBase::showButton( ButtonCode id, bool show ) 235void KDialogBase::showButton( ButtonCode id, bool show )
234{ 236{
235 QPushButton *button = findButton( id ); 237 QPushButton *button = findButton( id );
236 if ( button ) { 238 if ( button ) {
237 if ( show ) button->show(); 239 if ( show ) button->show();
238 else button->hide(); 240 else button->hide();
239 } 241 }
240} 242}
241 243
242int KDialogBase::pageIndex( QWidget *widget ) const 244int KDialogBase::pageIndex( QWidget *widget ) const
243{ 245{
244 return 0; 246 return 0;
245} 247}
246 248
247 249
248bool KDialogBase::showPage( int index ) 250bool KDialogBase::showPage( int index )
249{ 251{
250 tabWidget()->setCurrentPage( index );return false; 252 tabWidget()->setCurrentPage( index );return false;
251} 253}
252 254
253QFrame *KDialogBase::plainPage() 255QFrame *KDialogBase::plainPage()
254{ 256{
255 if ( !mPlainPage ) { 257 if ( !mPlainPage ) {
256 mPlainPage = new QFrame( this ); 258 mPlainPage = new QFrame( this );
257 setMainWidget( mPlainPage ); 259 setMainWidget( mPlainPage );
258 } 260 }
259 return mPlainPage; 261 return mPlainPage;
260} 262}
261 263
262void KDialogBase::slotOk() 264void KDialogBase::slotOk()
263{ 265{
264 emit okClicked(); 266 emit okClicked();
265 accept(); 267 accept();
266} 268}
267 269
268void KDialogBase::slotApply() 270void KDialogBase::slotApply()
269{ 271{
270 emit applyClicked(); 272 emit applyClicked();
271} 273}
diff --git a/version b/version
index e90e80d..0ec83d8 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "2.0.12"; version = "2.0.13";