author | zautrix <zautrix> | 2005-06-27 20:33:47 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-27 20:33:47 (UTC) |
commit | bf664c505e66f54dd03c3518386fdeab43108e56 (patch) (unidiff) | |
tree | 2e41ba8c43b8126f643c94ceecd1bcf83800cd43 | |
parent | d730e4b5cd81965f224b69efcc91dd58253f0b98 (diff) | |
download | kdepimpi-bf664c505e66f54dd03c3518386fdeab43108e56.zip kdepimpi-bf664c505e66f54dd03c3518386fdeab43108e56.tar.gz kdepimpi-bf664c505e66f54dd03c3518386fdeab43108e56.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | kabc/addresseedialog.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 14 |
3 files changed, 17 insertions, 6 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 21664de..b6472d7 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,73 +1,75 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.10 ************ | 3 | ********** VERSION 2.1.10 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. | 6 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. |
7 | When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. | ||
7 | 8 | ||
8 | KA/Pi: | 9 | KA/Pi: |
9 | Fixed two problems in csv export. | 10 | Fixed two problems in csv export. |
11 | Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. | ||
10 | 12 | ||
11 | ********** VERSION 2.1.9 ************ | 13 | ********** VERSION 2.1.9 ************ |
12 | 14 | ||
13 | KO/Pi: | 15 | KO/Pi: |
14 | Fixed some problems of the new search options in the search dialog. | 16 | Fixed some problems of the new search options in the search dialog. |
15 | Fixed some problems in the new resource config options. | 17 | Fixed some problems in the new resource config options. |
16 | Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. | 18 | Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. |
17 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: | 19 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: |
18 | Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. | 20 | Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. |
19 | 21 | ||
20 | Fixed a problem in recurrence range in syncing with DTM. | 22 | Fixed a problem in recurrence range in syncing with DTM. |
21 | 23 | ||
22 | KA/Pi: | 24 | KA/Pi: |
23 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) | 25 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) |
24 | 26 | ||
25 | PwM/Pi: | 27 | PwM/Pi: |
26 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. | 28 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. |
27 | 29 | ||
28 | ********** VERSION 2.1.8 ************ | 30 | ********** VERSION 2.1.8 ************ |
29 | 31 | ||
30 | KO/Pi: | 32 | KO/Pi: |
31 | Added info about the completion state of a todo in the ListView/Searchdialog. | 33 | Added info about the completion state of a todo in the ListView/Searchdialog. |
32 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. | 34 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. |
33 | Fixed some updating problems when changing the filter. | 35 | Fixed some updating problems when changing the filter. |
34 | 36 | ||
35 | KA/Pi: | 37 | KA/Pi: |
36 | In the addressee selection dialog now the formatted name is shown, if not empty. | 38 | In the addressee selection dialog now the formatted name is shown, if not empty. |
37 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. | 39 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. |
38 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. | 40 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. |
39 | 41 | ||
40 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. | 42 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. |
41 | Fixed the sorting for size in the file selector on the Z. | 43 | Fixed the sorting for size in the file selector on the Z. |
42 | 44 | ||
43 | Changed the color selection dialog on the Zaurus to a more user friendly version. | 45 | Changed the color selection dialog on the Zaurus to a more user friendly version. |
44 | 46 | ||
45 | ********** VERSION 2.1.7 ************ | 47 | ********** VERSION 2.1.7 ************ |
46 | 48 | ||
47 | KO/Pi: | 49 | KO/Pi: |
48 | Fixed several problems in the new Resource handling. | 50 | Fixed several problems in the new Resource handling. |
49 | Added more options to the search dialog. | 51 | Added more options to the search dialog. |
50 | Fixed a problem in the Month view. | 52 | Fixed a problem in the Month view. |
51 | Added more options to the dialog when setting a todo to stopped. | 53 | Added more options to the dialog when setting a todo to stopped. |
52 | 54 | ||
53 | Fixed two small problems in KO/Pi Alarm applet. | 55 | Fixed two small problems in KO/Pi Alarm applet. |
54 | 56 | ||
55 | ********** VERSION 2.1.6 ************ | 57 | ********** VERSION 2.1.6 ************ |
56 | 58 | ||
57 | This release is for testing only. | 59 | This release is for testing only. |
58 | 60 | ||
59 | KO/Pi: | 61 | KO/Pi: |
60 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. | 62 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. |
61 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. | 63 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. |
62 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. | 64 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. |
63 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. | 65 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. |
64 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. | 66 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. |
65 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. | 67 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. |
66 | 68 | ||
67 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. | 69 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. |
68 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. | 70 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. |
69 | Now on every sync the set of calendars is synced which are enabled in the resource view. | 71 | Now on every sync the set of calendars is synced which are enabled in the resource view. |
70 | 72 | ||
71 | A calendar is enabled in the resource view if the "eye" column is checked. | 73 | A calendar is enabled in the resource view if the "eye" column is checked. |
72 | You can set a calendar to be the default for new items( "+" column ). | 74 | You can set a calendar to be the default for new items( "+" column ). |
73 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. | 75 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. |
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 9197850..0cf75a0 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp | |||
@@ -2,128 +2,129 @@ | |||
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> | 26 | #include <qvbox.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | 28 | ||
29 | #include <klocale.h> | 29 | #include <klocale.h> |
30 | #include <kdebug.h> | 30 | #include <kdebug.h> |
31 | #include <kglobalsettings.h> | 31 | #include <kglobalsettings.h> |
32 | 32 | ||
33 | #include "stdaddressbook.h" | 33 | #include "stdaddressbook.h" |
34 | 34 | ||
35 | #include "addresseedialog.h" | 35 | #include "addresseedialog.h" |
36 | #include "KDGanttMinimizeSplitter.h" | 36 | #include "KDGanttMinimizeSplitter.h" |
37 | //#include "addresseedialog.moc" | 37 | //#include "addresseedialog.moc" |
38 | 38 | ||
39 | using namespace KABC; | 39 | using namespace KABC; |
40 | 40 | ||
41 | AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : | 41 | AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : |
42 | QListViewItem( parent ), | 42 | QListViewItem( parent ), |
43 | mAddressee( addressee ) | 43 | mAddressee( addressee ) |
44 | { | 44 | { |
45 | setText( Name,addressee.realName()); | 45 | setText( Name,addressee.realName()); |
46 | setText( Email, addressee.preferredEmail() ); | 46 | setText( Email, addressee.preferredEmail() ); |
47 | setText( Category, addressee.categories().join(";") ); | 47 | setText( Category, addressee.categories().join(";") ); |
48 | } | 48 | } |
49 | 49 | ||
50 | QString AddresseeItem::key( int column, bool ) const | 50 | QString AddresseeItem::key( int column, bool ) const |
51 | { | 51 | { |
52 | 52 | ||
53 | if (column == Email) { | 53 | if (column == Email) { |
54 | QString value = text(Email); | 54 | QString value = text(Email); |
55 | int val = value.findRev("@"); | 55 | int val = value.findRev("@"); |
56 | return value.mid( val) + value.left( val ); | 56 | return value.mid( val) + value.left( val ); |
57 | } | 57 | } |
58 | return text(column).lower(); | 58 | return text(column).lower(); |
59 | } | 59 | } |
60 | 60 | ||
61 | AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | 61 | AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : |
62 | KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), | 62 | KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), |
63 | Ok|Cancel, No, parent ), mMultiple( multiple ) | 63 | Ok|Cancel, No, parent ), mMultiple( multiple ) |
64 | { | 64 | { |
65 | qDebug("NEW AddresseeDialog "); | 65 | qDebug("NEW AddresseeDialog "); |
66 | |||
66 | QWidget *topWidget = plainPage(); | 67 | QWidget *topWidget = plainPage(); |
67 | 68 | ||
68 | QBoxLayout *topLayout = new QHBoxLayout( topWidget ); | 69 | QBoxLayout *topLayout = new QHBoxLayout( topWidget ); |
69 | 70 | ||
70 | 71 | ||
71 | KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget); | 72 | KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget); |
72 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 73 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
73 | 74 | ||
74 | topLayout->addWidget(mMiniSplitter ); | 75 | topLayout->addWidget(mMiniSplitter ); |
75 | 76 | ||
76 | QWidget *listWidget = new QWidget( mMiniSplitter ); | 77 | QWidget *listWidget = new QWidget( mMiniSplitter ); |
77 | 78 | ||
78 | QVBoxLayout *listLayout = new QVBoxLayout (listWidget) ; | 79 | QVBoxLayout *listLayout = new QVBoxLayout (listWidget) ; |
79 | //topLayout->addLayout( listLayout ); | 80 | //topLayout->addLayout( listLayout ); |
80 | 81 | ||
81 | mAddresseeList = new KListView( listWidget ); | 82 | mAddresseeList = new KListView( listWidget ); |
82 | mAddresseeList->addColumn( i18n("Name") ); | 83 | mAddresseeList->addColumn( i18n("Name") ); |
83 | mAddresseeList->addColumn( i18n("Email") ); | 84 | mAddresseeList->addColumn( i18n("Email") ); |
84 | mAddresseeList->addColumn( i18n("Category") ); | 85 | mAddresseeList->addColumn( i18n("Category") ); |
85 | mAddresseeList->setAllColumnsShowFocus( true ); | 86 | mAddresseeList->setAllColumnsShowFocus( true ); |
86 | mAddresseeList->setFullWidth( true ); | 87 | mAddresseeList->setFullWidth( true ); |
87 | listLayout->addWidget( mAddresseeList ); | 88 | listLayout->addWidget( mAddresseeList ); |
88 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), | 89 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), |
89 | SLOT( slotOk() ) ); | 90 | SLOT( slotOk() ) ); |
90 | 91 | ||
91 | //QHBox* searchBox = new QHBox ( listWidget ); | 92 | //QHBox* searchBox = new QHBox ( listWidget ); |
92 | mAddresseeEdit = new QLineEdit( listWidget ); | 93 | mAddresseeEdit = new QLineEdit( listWidget ); |
93 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), | 94 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), |
94 | SLOT( loadAddressBook() ) ); | 95 | SLOT( loadAddressBook() ) ); |
95 | mAddresseeEdit->setFocus(); | 96 | mAddresseeEdit->setFocus(); |
96 | QPushButton *searchButton = new QPushButton( i18n("Search!"), listWidget ); | 97 | QPushButton *searchButton = new QPushButton( i18n("Search!"), listWidget ); |
97 | connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) ); | 98 | connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) ); |
98 | 99 | ||
99 | QHBoxLayout *searchLayout = new QHBoxLayout (listLayout) ; | 100 | QHBoxLayout *searchLayout = new QHBoxLayout (listLayout) ; |
100 | searchLayout->addWidget( mAddresseeEdit ); | 101 | searchLayout->addWidget( mAddresseeEdit ); |
101 | searchLayout->addWidget( searchButton ); | 102 | searchLayout->addWidget( searchButton ); |
102 | //listLayout->addWidget( searchBox ); | 103 | //listLayout->addWidget( searchBox ); |
103 | 104 | ||
104 | if ( mMultiple ) { | 105 | if ( mMultiple ) { |
105 | //QBoxLayout *selectedLayout = new QVBoxLayout; | 106 | //QBoxLayout *selectedLayout = new QVBoxLayout; |
106 | //topLayout->addLayout( selectedLayout ); | 107 | //topLayout->addLayout( selectedLayout ); |
107 | //topLayout->setSpacing( spacingHint() ); | 108 | //topLayout->setSpacing( spacingHint() ); |
108 | 109 | ||
109 | QVBox *selectedGroup = new QVBox( mMiniSplitter ); | 110 | QVBox *selectedGroup = new QVBox( mMiniSplitter ); |
110 | new QLabel ( i18n("Selected:"), selectedGroup ); | 111 | new QLabel ( i18n("Selected:"), selectedGroup ); |
111 | //selectedLayout->addWidget( selectedGroup ); | 112 | //selectedLayout->addWidget( selectedGroup ); |
112 | 113 | ||
113 | mSelectedList = new KListView( selectedGroup ); | 114 | mSelectedList = new KListView( selectedGroup ); |
114 | mSelectedList->addColumn( i18n("Name") ); | 115 | mSelectedList->addColumn( i18n("Name") ); |
115 | mSelectedList->addColumn( i18n("Email") ); | 116 | mSelectedList->addColumn( i18n("Email") ); |
116 | mSelectedList->setAllColumnsShowFocus( true ); | 117 | mSelectedList->setAllColumnsShowFocus( true ); |
117 | mSelectedList->setFullWidth( true ); | 118 | mSelectedList->setFullWidth( true ); |
118 | //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), | 119 | //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), |
119 | // SLOT( removeSelected() ) ); | 120 | // SLOT( removeSelected() ) ); |
120 | connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ), | 121 | connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ), |
121 | SLOT( removeSelected() ) ); | 122 | SLOT( removeSelected() ) ); |
122 | connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ), | 123 | connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ), |
123 | SLOT( removeSelected() ) ); | 124 | SLOT( removeSelected() ) ); |
124 | 125 | ||
125 | #if 0 | 126 | #if 0 |
126 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); | 127 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); |
127 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); | 128 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); |
128 | 129 | ||
129 | #endif | 130 | #endif |
@@ -263,101 +264,105 @@ Addressee AddresseeDialog::addressee() | |||
263 | 264 | ||
264 | if (aItem) return aItem->addressee(); | 265 | if (aItem) return aItem->addressee(); |
265 | return Addressee(); | 266 | return Addressee(); |
266 | } | 267 | } |
267 | 268 | ||
268 | Addressee::List AddresseeDialog::addressees() | 269 | Addressee::List AddresseeDialog::addressees() |
269 | { | 270 | { |
270 | Addressee::List al; | 271 | Addressee::List al; |
271 | AddresseeItem *aItem = 0; | 272 | AddresseeItem *aItem = 0; |
272 | 273 | ||
273 | if ( mMultiple ) { | 274 | if ( mMultiple ) { |
274 | QListViewItem *item = mSelectedList->firstChild(); | 275 | QListViewItem *item = mSelectedList->firstChild(); |
275 | while( item ) { | 276 | while( item ) { |
276 | aItem = (AddresseeItem *)( item ); | 277 | aItem = (AddresseeItem *)( item ); |
277 | if ( aItem ) al.append( aItem->addressee() ); | 278 | if ( aItem ) al.append( aItem->addressee() ); |
278 | item = item->nextSibling(); | 279 | item = item->nextSibling(); |
279 | } | 280 | } |
280 | } | 281 | } |
281 | else | 282 | else |
282 | { | 283 | { |
283 | aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); | 284 | aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); |
284 | if (aItem) al.append( aItem->addressee() ); | 285 | if (aItem) al.append( aItem->addressee() ); |
285 | } | 286 | } |
286 | 287 | ||
287 | return al; | 288 | return al; |
288 | } | 289 | } |
289 | 290 | ||
290 | Addressee AddresseeDialog::getAddressee( QWidget *parent ) | 291 | Addressee AddresseeDialog::getAddressee( QWidget *parent ) |
291 | { | 292 | { |
292 | AddresseeDialog *dlg = new AddresseeDialog( parent ); | 293 | AddresseeDialog *dlg = new AddresseeDialog( parent ); |
293 | Addressee addressee; | 294 | Addressee addressee; |
294 | #ifdef DESKTOP_VERSION | 295 | #ifdef DESKTOP_VERSION |
295 | static int geoX = 0; | 296 | static int geoX = 0; |
296 | static int geoY = 0; | 297 | static int geoY = 0; |
297 | static int geoW = 0; | 298 | static int geoW = 0; |
298 | static int geoH = 0; | 299 | static int geoH = 0; |
299 | if ( !geoX && ! geoY && !geoW &&!geoH ) { | 300 | if ( !geoX && ! geoY && !geoW &&!geoH ) { |
300 | geoX = dlg->geometry().x(); | 301 | geoX = dlg->geometry().x(); |
301 | geoY = dlg->geometry().y(); | 302 | geoY = dlg->geometry().y(); |
302 | geoW = dlg->width(); | 303 | geoW = dlg->width(); |
303 | geoH = dlg->height(); | 304 | geoH = dlg->height(); |
304 | } else { | 305 | } else { |
305 | dlg->show(); | 306 | dlg->show(); |
306 | dlg->setGeometry(geoX , geoY,geoW , geoH ); | 307 | dlg->setGeometry(geoX , geoY,geoW , geoH ); |
307 | 308 | ||
308 | } | 309 | } |
309 | #endif | 310 | #endif |
310 | int result = dlg->exec(); | 311 | int result = dlg->exec(); |
311 | #ifdef DESKTOP_VERSION | 312 | #ifdef DESKTOP_VERSION |
312 | geoX = dlg->geometry().x(); | 313 | geoX = dlg->geometry().x(); |
313 | geoY = dlg->geometry().y(); | 314 | geoY = dlg->geometry().y(); |
314 | geoW = dlg->width(); | 315 | geoW = dlg->width(); |
315 | geoH = dlg->height(); | 316 | geoH = dlg->height(); |
316 | #endif | 317 | #endif |
317 | if ( result == QDialog::Accepted ) { | 318 | if ( result == QDialog::Accepted ) { |
318 | addressee = dlg->addressee(); | 319 | addressee = dlg->addressee(); |
319 | } | 320 | } |
320 | 321 | ||
321 | delete dlg; | 322 | delete dlg; |
322 | return addressee; | 323 | return addressee; |
323 | } | 324 | } |
324 | 325 | ||
325 | Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) | 326 | Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) |
326 | { | 327 | { |
327 | AddresseeDialog *dlg = new AddresseeDialog( parent, true ); | ||
328 | Addressee::List addressees; | 328 | Addressee::List addressees; |
329 | static bool running = false; | ||
330 | if ( running ) return addressees; | ||
331 | running = true; | ||
332 | AddresseeDialog *dlg = new AddresseeDialog( parent, true ); | ||
329 | static int geoX = 0; | 333 | static int geoX = 0; |
330 | static int geoY = 0; | 334 | static int geoY = 0; |
331 | static int geoW = 0; | 335 | static int geoW = 0; |
332 | static int geoH = 0; | 336 | static int geoH = 0; |
333 | if ( QApplication::desktop()->width() <= 640 ) | 337 | if ( QApplication::desktop()->width() <= 640 ) |
334 | dlg->showMaximized(); | 338 | dlg->showMaximized(); |
335 | else { | 339 | else { |
336 | if ( !geoX && ! geoY && !geoW &&!geoH ) { | 340 | if ( !geoX && ! geoY && !geoW &&!geoH ) { |
337 | geoX = dlg->geometry().x(); | 341 | geoX = dlg->geometry().x(); |
338 | geoY = dlg->geometry().y(); | 342 | geoY = dlg->geometry().y(); |
339 | geoW = dlg->width(); | 343 | geoW = dlg->width(); |
340 | geoH = dlg->height(); | 344 | geoH = dlg->height(); |
341 | } else { | 345 | } else { |
342 | dlg->show(); | 346 | dlg->show(); |
343 | dlg->setGeometry(geoX , geoY,geoW , geoH ); | 347 | dlg->setGeometry(geoX , geoY,geoW , geoH ); |
344 | 348 | ||
345 | } | 349 | } |
346 | } | 350 | } |
347 | int result = dlg->exec(); | 351 | int result = dlg->exec(); |
348 | geoX = dlg->geometry().x(); | 352 | geoX = dlg->geometry().x(); |
349 | geoY = dlg->geometry().y(); | 353 | geoY = dlg->geometry().y(); |
350 | geoW = dlg->width(); | 354 | geoW = dlg->width(); |
351 | geoH = dlg->height(); | 355 | geoH = dlg->height(); |
352 | if ( result == QDialog::Accepted ) { | 356 | if ( result == QDialog::Accepted ) { |
353 | addressees = dlg->addressees(); | 357 | addressees = dlg->addressees(); |
354 | } | 358 | } |
355 | 359 | ||
356 | delete dlg; | 360 | delete dlg; |
361 | running = false; | ||
357 | return addressees; | 362 | return addressees; |
358 | } | 363 | } |
359 | 364 | ||
360 | void AddresseeDialog::addressBookChanged() | 365 | void AddresseeDialog::addressBookChanged() |
361 | { | 366 | { |
362 | loadAddressBook(); | 367 | loadAddressBook(); |
363 | } | 368 | } |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index b107e2d..3715786 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2483,181 +2483,185 @@ void KABCore::setFormattedName() | |||
2483 | if ( modified ) | 2483 | if ( modified ) |
2484 | setModified( true ); | 2484 | setModified( true ); |
2485 | Addressee add; | 2485 | Addressee add; |
2486 | mDetails->setAddressee( add ); | 2486 | mDetails->setAddressee( add ); |
2487 | if ( count == 0 ) | 2487 | if ( count == 0 ) |
2488 | message(i18n("No contact changed!") ); | 2488 | message(i18n("No contact changed!") ); |
2489 | else | 2489 | else |
2490 | message(i18n("%1 contacts changed!").arg( count ) ); | 2490 | message(i18n("%1 contacts changed!").arg( count ) ); |
2491 | } | 2491 | } |
2492 | 2492 | ||
2493 | void KABCore::clipboardDataChanged() | 2493 | void KABCore::clipboardDataChanged() |
2494 | { | 2494 | { |
2495 | 2495 | ||
2496 | if ( mReadWrite ) | 2496 | if ( mReadWrite ) |
2497 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 2497 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
2498 | 2498 | ||
2499 | } | 2499 | } |
2500 | 2500 | ||
2501 | void KABCore::updateActionMenu() | 2501 | void KABCore::updateActionMenu() |
2502 | { | 2502 | { |
2503 | UndoStack *undo = UndoStack::instance(); | 2503 | UndoStack *undo = UndoStack::instance(); |
2504 | RedoStack *redo = RedoStack::instance(); | 2504 | RedoStack *redo = RedoStack::instance(); |
2505 | 2505 | ||
2506 | if ( undo->isEmpty() ) | 2506 | if ( undo->isEmpty() ) |
2507 | mActionUndo->setText( i18n( "Undo" ) ); | 2507 | mActionUndo->setText( i18n( "Undo" ) ); |
2508 | else | 2508 | else |
2509 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); | 2509 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); |
2510 | 2510 | ||
2511 | mActionUndo->setEnabled( !undo->isEmpty() ); | 2511 | mActionUndo->setEnabled( !undo->isEmpty() ); |
2512 | 2512 | ||
2513 | if ( !redo->top() ) | 2513 | if ( !redo->top() ) |
2514 | mActionRedo->setText( i18n( "Redo" ) ); | 2514 | mActionRedo->setText( i18n( "Redo" ) ); |
2515 | else | 2515 | else |
2516 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 2516 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
2517 | 2517 | ||
2518 | mActionRedo->setEnabled( !redo->isEmpty() ); | 2518 | mActionRedo->setEnabled( !redo->isEmpty() ); |
2519 | } | 2519 | } |
2520 | 2520 | ||
2521 | void KABCore::configureKeyBindings() | 2521 | void KABCore::configureKeyBindings() |
2522 | { | 2522 | { |
2523 | #ifndef KAB_EMBEDDED | 2523 | #ifndef KAB_EMBEDDED |
2524 | KKeyDialog::configure( actionCollection(), true ); | 2524 | KKeyDialog::configure( actionCollection(), true ); |
2525 | #else //KAB_EMBEDDED | 2525 | #else //KAB_EMBEDDED |
2526 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2526 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2527 | #endif //KAB_EMBEDDED | 2527 | #endif //KAB_EMBEDDED |
2528 | } | 2528 | } |
2529 | 2529 | ||
2530 | #ifdef KAB_EMBEDDED | 2530 | #ifdef KAB_EMBEDDED |
2531 | void KABCore::configureResources() | 2531 | void KABCore::configureResources() |
2532 | { | 2532 | { |
2533 | KRES::KCMKResources dlg( this, "" , 0 ); | 2533 | KRES::KCMKResources dlg( this, "" , 0 ); |
2534 | 2534 | ||
2535 | if ( !dlg.exec() ) | 2535 | if ( !dlg.exec() ) |
2536 | return; | 2536 | return; |
2537 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2537 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2538 | } | 2538 | } |
2539 | #endif //KAB_EMBEDDED | 2539 | #endif //KAB_EMBEDDED |
2540 | 2540 | ||
2541 | 2541 | ||
2542 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 2542 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
2543 | * for the attendees list of an event. | 2543 | * for the attendees list of an event. |
2544 | */ | 2544 | */ |
2545 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 2545 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
2546 | { | 2546 | { |
2547 | 2547 | qDebug("KABCore::requestForNameEmailUidList "); | |
2548 | bool ok = false; | 2548 | bool ok = false; |
2549 | mEmailSourceChannel = sourceChannel; | 2549 | mEmailSourceChannel = sourceChannel; |
2550 | mEmailSourceUID = uid; | 2550 | mEmailSourceUID = uid; |
2551 | callContactdialog(); | 2551 | QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); |
2552 | //callContactdialog(); | ||
2552 | #if 0 | 2553 | #if 0 |
2553 | int wid = uid.toInt( &ok ); | 2554 | int wid = uid.toInt( &ok ); |
2554 | qDebug("UID %s ", uid.latin1()); | 2555 | qDebug("UID %s ", uid.latin1()); |
2555 | if ( ok ) { | 2556 | if ( ok ) { |
2556 | if ( wid != QApplication::desktop()->width() ) { | 2557 | if ( wid != QApplication::desktop()->width() ) { |
2557 | qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); | 2558 | qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); |
2558 | message( i18n("Resizing, please wait...") ); | 2559 | message( i18n("Resizing, please wait...") ); |
2559 | mMainWindow->showMinimized(); | 2560 | mMainWindow->showMinimized(); |
2560 | /* | 2561 | /* |
2561 | { | 2562 | { |
2562 | QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); | 2563 | QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); |
2563 | } | 2564 | } |
2564 | */ | 2565 | */ |
2565 | QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); | 2566 | QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); |
2566 | return; | 2567 | return; |
2567 | } | 2568 | } |
2568 | 2569 | ||
2569 | } else { | 2570 | } else { |
2570 | qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); | 2571 | qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); |
2571 | } | 2572 | } |
2572 | callContactdialog(); | 2573 | callContactdialog(); |
2573 | //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); | 2574 | //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); |
2574 | #endif | 2575 | #endif |
2575 | } | 2576 | } |
2576 | void KABCore::resizeAndCallContactdialog() | 2577 | void KABCore::resizeAndCallContactdialog() |
2577 | { | 2578 | { |
2578 | updateMainWindow(); | 2579 | updateMainWindow(); |
2579 | QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) ); | 2580 | QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); |
2580 | } | 2581 | } |
2581 | 2582 | ||
2582 | void KABCore::callContactdialog() | 2583 | void KABCore::callContactdialog() |
2583 | { | 2584 | { |
2584 | QStringList nameList; | 2585 | static bool running = false; |
2586 | if (running) return; | ||
2587 | running = true; | ||
2588 | QStringList nameList; | ||
2585 | QStringList emailList; | 2589 | QStringList emailList; |
2586 | QStringList uidList; | 2590 | QStringList uidList; |
2587 | qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() ); | 2591 | qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() ); |
2588 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 2592 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
2589 | uint i=0; | 2593 | uint i=0; |
2590 | for (i=0; i < list.count(); i++) | 2594 | for (i=0; i < list.count(); i++) |
2591 | { | 2595 | { |
2592 | nameList.append(list[i].realName()); | 2596 | nameList.append(list[i].realName()); |
2593 | emailList.append(list[i].preferredEmail()); | 2597 | emailList.append(list[i].preferredEmail()); |
2594 | uidList.append(list[i].uid()); | 2598 | uidList.append(list[i].uid()); |
2595 | } | 2599 | } |
2596 | QString uid = mEmailSourceUID; | 2600 | QString uid = mEmailSourceUID; |
2597 | //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); | 2601 | //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); |
2598 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); | 2602 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); |
2599 | 2603 | running = false; | |
2600 | } | 2604 | } |
2601 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays | 2605 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays |
2602 | * to put them into the calendar. | 2606 | * to put them into the calendar. |
2603 | */ | 2607 | */ |
2604 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) | 2608 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) |
2605 | { | 2609 | { |
2606 | // qDebug("KABCore::requestForBirthdayList"); | 2610 | // qDebug("KABCore::requestForBirthdayList"); |
2607 | QStringList birthdayList; | 2611 | QStringList birthdayList; |
2608 | QStringList anniversaryList; | 2612 | QStringList anniversaryList; |
2609 | QStringList realNameList; | 2613 | QStringList realNameList; |
2610 | QStringList preferredEmailList; | 2614 | QStringList preferredEmailList; |
2611 | QStringList assembledNameList; | 2615 | QStringList assembledNameList; |
2612 | QStringList uidList; | 2616 | QStringList uidList; |
2613 | 2617 | ||
2614 | KABC::AddressBook::Iterator it; | 2618 | KABC::AddressBook::Iterator it; |
2615 | 2619 | ||
2616 | int count = 0; | 2620 | int count = 0; |
2617 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2621 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2618 | ++count; | 2622 | ++count; |
2619 | } | 2623 | } |
2620 | QProgressBar bar(count,0 ); | 2624 | QProgressBar bar(count,0 ); |
2621 | int w = 300; | 2625 | int w = 300; |
2622 | if ( QApplication::desktop()->width() < 320 ) | 2626 | if ( QApplication::desktop()->width() < 320 ) |
2623 | w = 220; | 2627 | w = 220; |
2624 | int h = bar.sizeHint().height() ; | 2628 | int h = bar.sizeHint().height() ; |
2625 | int dw = QApplication::desktop()->width(); | 2629 | int dw = QApplication::desktop()->width(); |
2626 | int dh = QApplication::desktop()->height(); | 2630 | int dh = QApplication::desktop()->height(); |
2627 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2631 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2628 | bar.show(); | 2632 | bar.show(); |
2629 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); | 2633 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); |
2630 | qApp->processEvents(); | 2634 | qApp->processEvents(); |
2631 | 2635 | ||
2632 | QDate bday; | 2636 | QDate bday; |
2633 | QString anni; | 2637 | QString anni; |
2634 | QString formattedbday; | 2638 | QString formattedbday; |
2635 | 2639 | ||
2636 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) | 2640 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) |
2637 | { | 2641 | { |
2638 | if ( ! bar.isVisible() ) | 2642 | if ( ! bar.isVisible() ) |
2639 | return; | 2643 | return; |
2640 | bar.setProgress( count++ ); | 2644 | bar.setProgress( count++ ); |
2641 | qApp->processEvents(); | 2645 | qApp->processEvents(); |
2642 | bday = (*it).birthday().date(); | 2646 | bday = (*it).birthday().date(); |
2643 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); | 2647 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); |
2644 | 2648 | ||
2645 | if ( bday.isValid() || !anni.isEmpty()) | 2649 | if ( bday.isValid() || !anni.isEmpty()) |
2646 | { | 2650 | { |
2647 | if (bday.isValid()) | 2651 | if (bday.isValid()) |
2648 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); | 2652 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); |
2649 | else | 2653 | else |
2650 | formattedbday = "NOTVALID"; | 2654 | formattedbday = "NOTVALID"; |
2651 | if (anni.isEmpty()) | 2655 | if (anni.isEmpty()) |
2652 | anni = "INVALID"; | 2656 | anni = "INVALID"; |
2653 | 2657 | ||
2654 | birthdayList.append(formattedbday); | 2658 | birthdayList.append(formattedbday); |
2655 | anniversaryList.append(anni); //should be ISODate | 2659 | anniversaryList.append(anni); //should be ISODate |
2656 | realNameList.append((*it).realName()); | 2660 | realNameList.append((*it).realName()); |
2657 | preferredEmailList.append((*it).preferredEmail()); | 2661 | preferredEmailList.append((*it).preferredEmail()); |
2658 | assembledNameList.append((*it).assembledName()); | 2662 | assembledNameList.append((*it).assembledName()); |
2659 | uidList.append((*it).uid()); | 2663 | uidList.append((*it).uid()); |
2660 | 2664 | ||
2661 | //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); | 2665 | //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); |
2662 | } | 2666 | } |
2663 | } | 2667 | } |