summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt6
-rw-r--r--korganizer/koeditordetails.cpp102
-rw-r--r--korganizer/koeditorgeneral.cpp16
-rw-r--r--korganizer/koeventeditor.cpp4
-rw-r--r--korganizer/kotodoeditor.cpp2
-rw-r--r--korganizer/searchdialog.cpp4
-rw-r--r--libkcal/todo.cpp6
-rw-r--r--microkde/kdatetbl.cpp17
8 files changed, 104 insertions, 53 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 41b2a81..e3c4e0a 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,50 +1,56 @@
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.1.4 ************
4
5Fixed two more bugs in the KA/Pi CSV import dialog:
6Made it possible to read multi-line fields and import it to the "Note" field.
7Fixed a problem in mapping custom fields, whatever a custem field is...
8
3********** VERSION 2.1.3 ************ 9********** VERSION 2.1.3 ************
4 10
5Changed the menu structure of the alarm applet: 11Changed the menu structure of the alarm applet:
6Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". 12Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List".
7 13
8Fixed several problems in the KA/Pi CSV import dialog: 14Fixed several problems in the KA/Pi CSV import dialog:
9Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. 15Added "Category", made codec configureable and made it possible to map many fields to the "Note" field.
10 16
11 17
12********** VERSION 2.1.2 ************ 18********** VERSION 2.1.2 ************
13 19
14Fixed a problem closing the alarm dialog on Zaurus with "OK" button. 20Fixed a problem closing the alarm dialog on Zaurus with "OK" button.
15 21
16Fixed a problem when importing data from Outlook with mutiple categories set. 22Fixed a problem when importing data from Outlook with mutiple categories set.
17 23
18Changed display of days in datenavigator: 24Changed display of days in datenavigator:
19Birthdays are now blue, not dark green. 25Birthdays are now blue, not dark green.
20When todo view is shown, no birtdays are shown and days with due todos are shown blue. 26When todo view is shown, no birtdays are shown and days with due todos are shown blue.
21When journal view is shown, only holidays are shown and days with journals are blue. 27When journal view is shown, only holidays are shown and days with journals are blue.
22 28
23Added Backup options to global config: 29Added Backup options to global config:
24You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). 30You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ).
25It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. 31It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again.
26The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. 32The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups.
27 33
28********** VERSION 2.1.1 ************ 34********** VERSION 2.1.1 ************
29 35
30Stable release 2.1.1! 36Stable release 2.1.1!
31 37
32KO/Pi: 38KO/Pi:
33Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. 39Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display.
34 40
35********** VERSION 2.1.0 ************ 41********** VERSION 2.1.0 ************
36 42
37Stable release 2.1.0! 43Stable release 2.1.0!
38 44
39Summary of changes/fixes compared to version 2.0.6: 45Summary of changes/fixes compared to version 2.0.6:
40 46
41Many bugs of version 2.0.6 fixed. 47Many bugs of version 2.0.6 fixed.
42Most of them were small bugs, but some of them were important. 48Most of them were small bugs, but some of them were important.
43It is recommended to use version 2.1.0 and not version 2.0.6. 49It is recommended to use version 2.1.0 and not version 2.0.6.
44 50
45Important changes: 51Important changes:
46 52
47Added recurring todos to KO/Pi. 53Added recurring todos to KO/Pi.
48 54
49Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. 55Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
50 56
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index 802261c..bdfc637 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -43,195 +43,215 @@
43#else //DESKTOP_VERSION 43#else //DESKTOP_VERSION
44#include <externalapphandler.h> 44#include <externalapphandler.h>
45#endif //DESKTOP_VERSION 45#endif //DESKTOP_VERSION
46 46
47#endif 47#endif
48 48
49#include <libkcal/incidence.h> 49#include <libkcal/incidence.h>
50 50
51#include "koprefs.h" 51#include "koprefs.h"
52 52
53#include "koeditordetails.h" 53#include "koeditordetails.h"
54 54
55template <> 55template <>
56CustomListViewItem<class Attendee *>::~CustomListViewItem() 56CustomListViewItem<class Attendee *>::~CustomListViewItem()
57{ 57{
58 delete mData; 58 delete mData;
59} 59}
60 60
61template <> 61template <>
62void CustomListViewItem<class Attendee *>::updateItem() 62void CustomListViewItem<class Attendee *>::updateItem()
63{ 63{
64 setText(0,mData->name()); 64 setText(0,mData->name());
65 setText(1,mData->email()); 65 setText(1,mData->email());
66 setText(2,mData->roleStr()); 66 setText(2,mData->roleStr());
67 setText(3,mData->statusStr()); 67 setText(3,mData->statusStr());
68 if (mData->RSVP() && !mData->email().isEmpty()) 68 if (mData->RSVP() && !mData->email().isEmpty())
69 setPixmap(4,SmallIcon("mailappt")); 69 setPixmap(4,SmallIcon("mailappt"));
70 else 70 else
71 setPixmap(4,SmallIcon("nomailappt")); 71 setPixmap(4,SmallIcon("nomailappt"));
72} 72}
73 73
74 74
75KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) 75KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
76 : QWidget( parent, name), mDisableItemUpdate( false ) 76 : QWidget( parent, name), mDisableItemUpdate( false )
77{ 77{
78 QGridLayout *topLayout = new QGridLayout(this); 78 QGridLayout *topLayout = new QGridLayout(this);
79 topLayout->setSpacing(spacing); 79 topLayout->setSpacing(spacing);
80 80
81 QString organizer = KOPrefs::instance()->email(); 81 QString organizer = KOPrefs::instance()->email();
82 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); 82 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this);
83 83
84 mListView = new KListView(this,"mListView"); 84 mListView = new KListView(this,"mListView");
85 mListView->addColumn(i18n("Name"),180); 85 mListView->addColumn(i18n("Name"),180);
86 mListView->addColumn(i18n("Email"),180); 86 mListView->addColumn(i18n("Email"),180);
87 mListView->addColumn(i18n("Role"),60); 87 mListView->addColumn(i18n("Role"),60);
88 mListView->addColumn(i18n("Status"),100); 88 mListView->addColumn(i18n("Status"),100);
89 mListView->addColumn(i18n("RSVP"),35); 89 mListView->addColumn(i18n("RSVP"),35);
90 if ( QApplication::desktop()->width() <= 320 ) { 90 if ( QApplication::desktop()->width() <= 320 ) {
91 //mListView->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding) ); 91 int hei = 80;
92 mListView->setFixedHeight(80); 92 if ( QApplication::desktop()->height() <= 240 )
93 hei = 60;
94 mListView->setFixedHeight(hei);
93 } 95 }
94 mListView->setAllColumnsShowFocus (true ); 96 mListView->setAllColumnsShowFocus (true );
95 //mListView->setSingleClick( true ); 97 //mListView->setSingleClick( true );
96 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), 98 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
97 SLOT(updateAttendeeInput())); 99 SLOT(updateAttendeeInput()));
98 100
99 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), 101 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )),
100 SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); 102 SLOT(itemClicked(QListViewItem * ,const QPoint& , int )));
101 103
102 mRsvpButton = new QCheckBox(this); 104 mRsvpButton = new QCheckBox(this);
103 mRsvpButton->setText(i18n("Request response")); 105 mRsvpButton->setText(i18n("Request response"));
104 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); 106 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
105 QLabel *attendeeLabel = new QLabel(this); 107 QLabel *attendeeLabel = new QLabel(this);
106 attendeeLabel->setText(i18n("Name:")); 108 attendeeLabel->setText(i18n("Name:"));
107 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); 109 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
108 mNameEdit = new QLineEdit(this); 110 mNameEdit = new QLineEdit(this);
109 connect(mNameEdit,SIGNAL(textChanged(const QString &)), 111 connect(mNameEdit,SIGNAL(textChanged(const QString &)),
110 SLOT(updateAttendeeItem())); 112 SLOT(updateAttendeeItem()));
111 113
112 mUidEdit = new QLineEdit(0); 114 mUidEdit = new QLineEdit(0);
113 mUidEdit->setText(""); 115 mUidEdit->setText("");
114 116
115 QLabel *emailLabel = new QLabel(this); 117 QLabel *emailLabel = new QLabel(this);
116 emailLabel->setText(i18n("Email:")); 118 emailLabel->setText(i18n("Email:"));
117 mEmailEdit = new QLineEdit(this); 119 mEmailEdit = new QLineEdit(this);
118 connect(mEmailEdit,SIGNAL(textChanged(const QString &)), 120 connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
119 SLOT(updateAttendeeItem())); 121 SLOT(updateAttendeeItem()));
120 122
121 QLabel *attendeeRoleLabel = new QLabel(this); 123 QLabel *attendeeRoleLabel = new QLabel(this);
122 attendeeRoleLabel->setText(i18n("Role:")); 124 attendeeRoleLabel->setText(i18n("Role:"));
123 mRoleCombo = new QComboBox(false,this); 125 mRoleCombo = new QComboBox(false,this);
124 mRoleCombo->insertStringList(Attendee::roleList()); 126 mRoleCombo->insertStringList(Attendee::roleList());
125 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 127 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
126 128
127 QLabel *statusLabel = new QLabel(this); 129 QLabel *statusLabel = new QLabel(this);
128 statusLabel->setText( i18n("Status:") ); 130 statusLabel->setText( i18n("Status:") );
129 131
130 mStatusCombo = new QComboBox(false,this); 132 mStatusCombo = new QComboBox(false,this);
131 mStatusCombo->insertStringList(Attendee::statusList()); 133 mStatusCombo->insertStringList(Attendee::statusList());
132 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 134 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
133 135
134 136
135 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); 137 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem()));
136 QWidget *buttonBox = new QWidget(this); 138 QWidget *buttonBox = new QWidget(this);
137 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); 139 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox);
138 140
139 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); 141 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox);
140 buttonLayout->addWidget(newButton); 142 buttonLayout->addWidget(newButton);
141 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); 143 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee()));
142 144
143 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); 145 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox);
144 buttonLayout->addWidget(mRemoveButton); 146 buttonLayout->addWidget(mRemoveButton);
145 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); 147 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee()));
146 148
147 // buttonLayout->addWidget(mAddressBookButton); 149 // buttonLayout->addWidget(mAddressBookButton);
148 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); 150 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook()));
149 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); 151 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () );
150 152 if ( QApplication::desktop()->height() <= 240 ) {
151 if (qApp->desktop()->width() < 640 ) { 153 mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
152 if ( qApp->desktop()->width() < 300 ) 154 mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
153 topLayout->setSpacing(1);
154 ;//mListView->setFixedHeight(80);
155 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3);
156 topLayout->addMultiCellWidget(mListView,1,1,0,3);
157 topLayout->addWidget(attendeeLabel,3,0);
158 topLayout->addMultiCellWidget(mNameEdit,3,3,1,2);
159 topLayout->addWidget(emailLabel,4,0);
160 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2);
161 topLayout->addWidget(attendeeRoleLabel,5,0);
162 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3);
163 topLayout->addWidget(statusLabel,6,0);
164 topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3);
165 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3);
166 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
167 topLayout->addMultiCellWidget(buttonBox,3,4,3,3);
168 topLayout->setRowStretch(1,2);
169 topLayout->setColStretch(0,0);
170 topLayout->setColStretch(1,2);
171 topLayout->setColStretch(2,1);
172 topLayout->setColStretch(3,1);
173
174 } else {
175 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); 155 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);
176 topLayout->addMultiCellWidget(mListView,1,1,0,5); 156 topLayout->addMultiCellWidget(mListView,1,1,0,5);
177 topLayout->addWidget(attendeeLabel,3,0); 157 topLayout->addWidget(attendeeLabel,3,0);
178 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); 158 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4);
179 topLayout->addWidget(emailLabel,4,0); 159 topLayout->addWidget(emailLabel,4,0);
180 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); 160 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4);
181 topLayout->addWidget(attendeeRoleLabel,5,0); 161 topLayout->addWidget(attendeeRoleLabel,5,0);
182 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); 162 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2);
183 topLayout->addWidget(statusLabel,5,3); 163 topLayout->addWidget(statusLabel,5,3);
184 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); 164 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5);
185 topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); 165 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,5);
186 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 166 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
187 topLayout->addMultiCellWidget(buttonBox,3,4,5,5); 167 topLayout->addMultiCellWidget(buttonBox,3,4,5,5);
188 topLayout->setRowStretch(1,5); 168 topLayout->setRowStretch(1,5);
189 topLayout->setColStretch(0,0); 169 topLayout->setColStretch(0,0);
170 } else {
171 if (qApp->desktop()->width() < 640 ) {
172 if ( qApp->desktop()->width() < 300 )
173 topLayout->setSpacing(1);
174 ;//mListView->setFixedHeight(80);
175 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3);
176 topLayout->addMultiCellWidget(mListView,1,1,0,3);
177 topLayout->addWidget(attendeeLabel,3,0);
178 topLayout->addMultiCellWidget(mNameEdit,3,3,1,2);
179 topLayout->addWidget(emailLabel,4,0);
180 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2);
181 topLayout->addWidget(attendeeRoleLabel,5,0);
182 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3);
183 topLayout->addWidget(statusLabel,6,0);
184 topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3);
185 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3);
186 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
187 topLayout->addMultiCellWidget(buttonBox,3,4,3,3);
188 topLayout->setRowStretch(1,2);
189 topLayout->setColStretch(0,0);
190 topLayout->setColStretch(1,2);
191 topLayout->setColStretch(2,1);
192 topLayout->setColStretch(3,1);
193 } else {
194 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);
195 topLayout->addMultiCellWidget(mListView,1,1,0,5);
196 topLayout->addWidget(attendeeLabel,3,0);
197 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4);
198 topLayout->addWidget(emailLabel,4,0);
199 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4);
200 topLayout->addWidget(attendeeRoleLabel,5,0);
201 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2);
202 topLayout->addWidget(statusLabel,5,3);
203 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5);
204 topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5);
205 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
206 topLayout->addMultiCellWidget(buttonBox,3,4,5,5);
207 topLayout->setRowStretch(1,5);
208 topLayout->setColStretch(0,0);
209 }
190 } 210 }
191// #if 0 211// #if 0
192// topLayout->setColStretch(2,1); 212// topLayout->setColStretch(2,1);
193// topLayout->addWidget(statusLabel,3,3); 213// topLayout->addWidget(statusLabel,3,3);
194// topLayout->addWidget(mStatusCombo,3,4); 214// topLayout->addWidget(mStatusCombo,3,4);
195// #else 215// #else
196// topLayout->addWidget(statusLabel,4,3); 216// topLayout->addWidget(statusLabel,4,3);
197// // topLayout->addWidget(mStatusCombo,4,3); 217// // topLayout->addWidget(mStatusCombo,4,3);
198// topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); 218// topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5);
199 219
200// #endif 220// #endif
201// // topLayout->setRowStretch(5,1); 221// // topLayout->setRowStretch(5,1);
202// topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); 222// topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1);
203// topLayout->addMultiCellWidget(buttonBox,2,3,5,5); 223// topLayout->addMultiCellWidget(buttonBox,2,3,5,5);
204// topLayout->setRowStretch(1,5); 224// topLayout->setRowStretch(1,5);
205// topLayout->setColStretch(0,0); 225// topLayout->setColStretch(0,0);
206 226
207#ifdef KORG_NOKABC 227#ifdef KORG_NOKABC
208 mAddressBookButton->hide(); 228 mAddressBookButton->hide();
209#endif 229#endif
210 230
211 updateAttendeeInput(); 231 updateAttendeeInput();
212#ifndef DESKTOP_VERSION 232#ifndef DESKTOP_VERSION
213//US listen for arriving address resultsets 233//US listen for arriving address resultsets
214 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 234 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
215 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 235 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
216#endif 236#endif
217 237
218} 238}
219 239
220KOEditorDetails::~KOEditorDetails() 240KOEditorDetails::~KOEditorDetails()
221{ 241{
222} 242}
223 243
224void KOEditorDetails::removeAttendee() 244void KOEditorDetails::removeAttendee()
225{ 245{
226 AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem(); 246 AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem();
227 if (!aItem) return; 247 if (!aItem) return;
228 248
229 Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(), 249 Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(),
230 aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(), 250 aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(),
231 aItem->data()->uid()); 251 aItem->data()->uid());
232 mdelAttendees.append(delA); 252 mdelAttendees.append(delA);
233 253
234 delete aItem; 254 delete aItem;
235 255
236 updateAttendeeInput(); 256 updateAttendeeInput();
237} 257}
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 0045b7f..bfe0aec 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -48,107 +48,117 @@
48 48
49#include "koprefs.h" 49#include "koprefs.h"
50#include "koglobals.h" 50#include "koglobals.h"
51 51
52#include "koeditorgeneral.h" 52#include "koeditorgeneral.h"
53#include "kolocationbox.h" 53#include "kolocationbox.h"
54#ifndef DESKTOP_VERSION 54#ifndef DESKTOP_VERSION
55#include <qpe/qpeapplication.h> 55#include <qpe/qpeapplication.h>
56#else 56#else
57#include <qapplication.h> 57#include <qapplication.h>
58#endif 58#endif
59 59
60KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : 60KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
61 QObject( parent, name) 61 QObject( parent, name)
62{ 62{
63 mNextFocus = 0; 63 mNextFocus = 0;
64} 64}
65 65
66KOEditorGeneral::~KOEditorGeneral() 66KOEditorGeneral::~KOEditorGeneral()
67{ 67{
68} 68}
69 69
70void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) 70void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
71{ 71{
72 QGridLayout *headerLayout = new QGridLayout(topLayout); 72 QGridLayout *headerLayout = new QGridLayout(topLayout);
73 73
74#if 0 74#if 0
75 mOwnerLabel = new QLabel(i18n("Owner:"),parent); 75 mOwnerLabel = new QLabel(i18n("Owner:"),parent);
76 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); 76 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1);
77#endif 77#endif
78 78
79 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); 79 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
80 headerLayout->addWidget(summaryLabel,1,0); 80 headerLayout->addWidget(summaryLabel,1,0);
81 81
82 mSummaryEdit = new KOLocationBox(TRUE,parent, 10); 82 mSummaryEdit = new KOLocationBox(TRUE,parent, 10);
83 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 83 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
84 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); 84 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) );
85 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); 85 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() );
86 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; 86 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2;
87 if ( QApplication::desktop()->width() > 320 ) 87 if ( QApplication::desktop()->width() > 320 )
88 mSummaryEdit->setMaximumHeight( hei +6 ); 88 mSummaryEdit->setMaximumHeight( hei +6 );
89 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); 89 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding );
90 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } 90 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink }
91 // mSummaryEdit = new QLineEdit(parent); 91 // mSummaryEdit = new QLineEdit(parent);
92 headerLayout->addWidget(mSummaryEdit,1,1); 92 headerLayout->addWidget(mSummaryEdit,1,1);
93 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 93 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
94 94
95 QLabel *locationLabel = new QLabel(i18n("Location:"),parent); 95 QLabel *locationLabel = new QLabel(i18n("Location:"),parent);
96 headerLayout->addWidget(locationLabel,2,0); 96 if ( QApplication::desktop()->height() < 320 )
97 headerLayout->addWidget(locationLabel,1,2);
98 else
99 headerLayout->addWidget(locationLabel,2,0);
97 100
98 mLocationEdit = new KOLocationBox(TRUE,parent,10); 101 mLocationEdit = new KOLocationBox(TRUE,parent,10);
99 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 102 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
100 if ( QApplication::desktop()->width() > 320 ) 103 if ( QApplication::desktop()->width() > 320 )
101 mLocationEdit->setMaximumHeight( hei + 6); 104 mLocationEdit->setMaximumHeight( hei + 6);
102 105
103 // mLocationEdit = new QLineEdit(parent); 106 // mLocationEdit = new QLineEdit(parent);
104 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 107 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
105 headerLayout->addWidget(mLocationEdit,2,1); 108 if ( QApplication::desktop()->height() < 320 ) {
106 headerLayout->setColStretch( 1, 10); 109 headerLayout->addWidget(mLocationEdit,1,3);
110 headerLayout->setColStretch( 1, 10);
111 headerLayout->setColStretch( 3, 10);
112 }
113 else {
114 headerLayout->addWidget(mLocationEdit,2,1);
115 headerLayout->setColStretch( 1, 10);
116 }
107} 117}
108void KOEditorGeneral::setFocusOn( int i ) 118void KOEditorGeneral::setFocusOn( int i )
109{ 119{
110 mNextFocus = i; 120 mNextFocus = i;
111 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); 121 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() ));
112} 122}
113void KOEditorGeneral::slotSetFocusOn() 123void KOEditorGeneral::slotSetFocusOn()
114{ 124{
115 mNextFocus; 125 mNextFocus;
116 if ( mNextFocus == 1 ) { 126 if ( mNextFocus == 1 ) {
117 mDescriptionEdit->setFocus(); 127 mDescriptionEdit->setFocus();
118 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); 128 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333);
119 } 129 }
120 if ( mNextFocus == 2 ) { 130 if ( mNextFocus == 2 ) {
121 mSummaryEdit->setFocus(); 131 mSummaryEdit->setFocus();
122 } 132 }
123} 133}
124void KOEditorGeneral::editCategories() 134void KOEditorGeneral::editCategories()
125{ 135{
126 // qDebug("KOEditorGeneral::editCategories() "); 136 // qDebug("KOEditorGeneral::editCategories() ");
127 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 137 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
128 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); 138 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &)));
129 //KOGlobals::fitDialogToScreen( csd ); 139 //KOGlobals::fitDialogToScreen( csd );
130 csd->setColorEnabled(); 140 csd->setColorEnabled();
131 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); 141 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) );
132 csd->exec(); 142 csd->exec();
133 delete csd; 143 delete csd;
134} 144}
135void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 145void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
136{ 146{
137 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 147 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
138 148
139 mCategoriesButton = new QPushButton(parent); 149 mCategoriesButton = new QPushButton(parent);
140 mCategoriesButton->setText(i18n("Categories...")); 150 mCategoriesButton->setText(i18n("Categories..."));
141 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 151 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
142 categoriesLayout->addWidget(mCategoriesButton); 152 categoriesLayout->addWidget(mCategoriesButton);
143 153
144 mCategoriesLabel = new QLabel(parent); 154 mCategoriesLabel = new QLabel(parent);
145 mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); 155 mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
146 categoriesLayout->addWidget(mCategoriesLabel,1); 156 categoriesLayout->addWidget(mCategoriesLabel,1);
147} 157}
148 158
149void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 159void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
150{ 160{
151 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 161 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
152 162
153 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 163 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
154 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 164 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index e23e680..02d4a78 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -9,156 +9,158 @@
9 9
10 This program is distributed in the hope that it will be useful, 10 This program 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 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qhbox.h> 27#include <qhbox.h>
28#include <qdir.h> 28#include <qdir.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#include <kiconloader.h> 33#include <kiconloader.h>
34#include <kstandarddirs.h> 34#include <kstandarddirs.h>
35#include <kdebug.h> 35#include <kdebug.h>
36#include <klocale.h> 36#include <klocale.h>
37#include <kfiledialog.h> 37#include <kfiledialog.h>
38#include <kmessagebox.h> 38#include <kmessagebox.h>
39#include <libkcal/calendarresources.h> 39#include <libkcal/calendarresources.h>
40#include <libkcal/resourcecalendar.h> 40#include <libkcal/resourcecalendar.h>
41#include <kresources/resourceselectdialog.h> 41#include <kresources/resourceselectdialog.h>
42 42
43#include <libkdepim/categoryselectdialog.h> 43#include <libkdepim/categoryselectdialog.h>
44#include <libkcal/calendarlocal.h> 44#include <libkcal/calendarlocal.h>
45#include <libkcal/icalformat.h> 45#include <libkcal/icalformat.h>
46 46
47#include "koprefs.h" 47#include "koprefs.h"
48 48
49#include "koeventeditor.h" 49#include "koeventeditor.h"
50extern int globalFlagBlockAgenda; 50extern int globalFlagBlockAgenda;
51 51
52KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) : 52KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) :
53 KOIncidenceEditor( i18n("Edit Event"), calendar, parent ) 53 KOIncidenceEditor( i18n("Edit Event"), calendar, parent )
54{ 54{
55 mEvent = 0; 55 mEvent = 0;
56 init(); 56 init();
57 if ( QApplication::desktop()->height() <= 240 )
58 hideButtons();
57} 59}
58 60
59KOEventEditor::~KOEventEditor() 61KOEventEditor::~KOEventEditor()
60{ 62{
61 //emit dialogClose( mEvent ); 63 //emit dialogClose( mEvent );
62} 64}
63 65
64void KOEventEditor::init() 66void KOEventEditor::init()
65{ 67{
66 68
67 setupGeneral(); 69 setupGeneral();
68 setupAttendeesTab(); 70 setupAttendeesTab();
69 setupRecurrence(); 71 setupRecurrence();
70 72
71 // Propagate date time settings to recurrence tab 73 // Propagate date time settings to recurrence tab
72 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), 74 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
73 mRecurrence,SLOT(setDateTimes(QDateTime,QDateTime))); 75 mRecurrence,SLOT(setDateTimes(QDateTime,QDateTime)));
74 connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)), 76 connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)),
75 mRecurrence,SLOT(setDateTimeStr(const QString &))); 77 mRecurrence,SLOT(setDateTimeStr(const QString &)));
76 78
77 // Category dialog 79 // Category dialog
78 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); 80 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
79 //connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)), 81 //connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)),
80 // mGeneral,SLOT(setCategories(const QString &))); 82 // mGeneral,SLOT(setCategories(const QString &)));
81 83
82 84
83} 85}
84 86
85void KOEventEditor::reload() 87void KOEventEditor::reload()
86{ 88{
87 if ( mEvent ) readEvent( mEvent ); 89 if ( mEvent ) readEvent( mEvent );
88} 90}
89 91
90void KOEventEditor::setSecrecy( int sec ) 92void KOEventEditor::setSecrecy( int sec )
91{ 93{
92 mGeneral->setSecrecy( sec ); 94 mGeneral->setSecrecy( sec );
93} 95}
94void KOEventEditor::setCategories( QString s ) 96void KOEventEditor::setCategories( QString s )
95{ 97{
96 mGeneral->setCategories(s); 98 mGeneral->setCategories(s);
97 99
98} 100}
99void KOEventEditor::setupGeneral() 101void KOEventEditor::setupGeneral()
100{ 102{
101 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); 103 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" );
102 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); 104 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
103 105
104 if( KOPrefs::instance()->mCompactDialogs ) { 106 if( KOPrefs::instance()->mCompactDialogs ) {
105 QFrame *topFrame = addPage(i18n("General")); 107 QFrame *topFrame = addPage(i18n("General"));
106 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 108 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
107 topLayout->setSpacing(spacingHint()-1); 109 topLayout->setSpacing(spacingHint()-1);
108 topLayout->setMargin(marginHint()-1); 110 topLayout->setMargin(marginHint()-1);
109 mGeneral->initHeader(topFrame,topLayout); 111 mGeneral->initHeader(topFrame,topLayout);
110 mGeneral->initTime(topFrame,topLayout); 112 mGeneral->initTime(topFrame,topLayout);
111// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 113// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
112 mGeneral->initAlarm(topFrame,topLayout); 114 mGeneral->initAlarm(topFrame,topLayout);
113 mGeneral->enableAlarm( false ); 115 mGeneral->enableAlarm( false );
114 116
115 QBoxLayout *buttonLayout; 117 QBoxLayout *buttonLayout;
116 if ( QApplication::desktop()->width() < 500 ) 118 if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 )
117 buttonLayout = new QVBoxLayout( topLayout ); 119 buttonLayout = new QVBoxLayout( topLayout );
118 else 120 else
119 buttonLayout = new QHBoxLayout( topLayout ); 121 buttonLayout = new QHBoxLayout( topLayout );
120 QHBox* buttonWidget = new QHBox (topFrame); 122 QHBox* buttonWidget = new QHBox (topFrame);
121 QIconSet icon; 123 QIconSet icon;
122 if ( QApplication::desktop()->width() < 321 ) 124 if ( QApplication::desktop()->width() < 321 )
123 icon = SmallIcon("fileexport16"); 125 icon = SmallIcon("fileexport16");
124 else 126 else
125 icon = SmallIcon("fileexport"); 127 icon = SmallIcon("fileexport");
126 QPushButton * loadTemplate = new QPushButton( buttonWidget); 128 QPushButton * loadTemplate = new QPushButton( buttonWidget);
127 QPushButton * saveTemplate = new QPushButton( buttonWidget); 129 QPushButton * saveTemplate = new QPushButton( buttonWidget);
128 saveTemplate->setIconSet (icon ) ; 130 saveTemplate->setIconSet (icon ) ;
129 int size = saveTemplate->sizeHint().height(); 131 int size = saveTemplate->sizeHint().height();
130 saveTemplate->setFixedSize( size, size ); 132 saveTemplate->setFixedSize( size, size );
131 if ( QApplication::desktop()->width() < 321 ) 133 if ( QApplication::desktop()->width() < 321 )
132 icon = SmallIcon("fileimport16"); 134 icon = SmallIcon("fileimport16");
133 else 135 else
134 icon = SmallIcon("fileimport"); 136 icon = SmallIcon("fileimport");
135 loadTemplate->setIconSet (icon ) ; 137 loadTemplate->setIconSet (icon ) ;
136 loadTemplate->setFixedSize( size, size ); 138 loadTemplate->setFixedSize( size, size );
137 buttonLayout->addWidget( buttonWidget ); 139 buttonLayout->addWidget( buttonWidget );
138 mGeneral->initCategories( topFrame, buttonLayout ); 140 mGeneral->initCategories( topFrame, buttonLayout );
139 141
140 topLayout->addStretch( 1 ); 142 topLayout->addStretch( 1 );
141 143
142 QFrame *topFrame2 = addPage(i18n("Details")); 144 QFrame *topFrame2 = addPage(i18n("Details"));
143 145
144 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); 146 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
145 topLayout2->setSpacing(spacingHint()); 147 topLayout2->setSpacing(spacingHint());
146 148
147 mGeneral->initClass(topFrame2,topLayout2); 149 mGeneral->initClass(topFrame2,topLayout2);
148 mGeneral->initSecrecy( topFrame2, topLayout2 ); 150 mGeneral->initSecrecy( topFrame2, topLayout2 );
149 mGeneral->initDescription(topFrame2,topLayout2); 151 mGeneral->initDescription(topFrame2,topLayout2);
150 152
151 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 153 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
152 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 154 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
153 } else { 155 } else {
154 QFrame *topFrame = addPage(i18n("General")); 156 QFrame *topFrame = addPage(i18n("General"));
155 157
156 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 158 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
157 topLayout->setSpacing(spacingHint()); 159 topLayout->setSpacing(spacingHint());
158 160
159 mGeneral->initHeader(topFrame,topLayout); 161 mGeneral->initHeader(topFrame,topLayout);
160 mGeneral->initTime(topFrame,topLayout); 162 mGeneral->initTime(topFrame,topLayout);
161 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 163 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
162 mGeneral->initAlarm(topFrame,alarmLineLayout); 164 mGeneral->initAlarm(topFrame,alarmLineLayout);
163 mGeneral->initClass(topFrame,alarmLineLayout); 165 mGeneral->initClass(topFrame,alarmLineLayout);
164 mGeneral->initDescription(topFrame,topLayout); 166 mGeneral->initDescription(topFrame,topLayout);
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 5513e8b..9073bca 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -14,96 +14,98 @@
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 <qtooltip.h> 25#include <qtooltip.h>
26#include <qframe.h> 26#include <qframe.h>
27#include <qpixmap.h> 27#include <qpixmap.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qhbox.h> 29#include <qhbox.h>
30#include <qdir.h> 30#include <qdir.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapplication.h> 32#include <qapplication.h>
33#include <qtabwidget.h> 33#include <qtabwidget.h>
34 34
35#include <kiconloader.h> 35#include <kiconloader.h>
36#include <klocale.h> 36#include <klocale.h>
37#include <kfiledialog.h> 37#include <kfiledialog.h>
38#include <kstandarddirs.h> 38#include <kstandarddirs.h>
39#include <kmessagebox.h> 39#include <kmessagebox.h>
40 40
41#include <libkdepim/categoryselectdialog.h> 41#include <libkdepim/categoryselectdialog.h>
42#include <libkcal/calendarlocal.h> 42#include <libkcal/calendarlocal.h>
43#include <libkcal/calendarresources.h> 43#include <libkcal/calendarresources.h>
44#include <libkcal/resourcecalendar.h> 44#include <libkcal/resourcecalendar.h>
45#include <libkcal/icalformat.h> 45#include <libkcal/icalformat.h>
46#include <kresources/resourceselectdialog.h> 46#include <kresources/resourceselectdialog.h>
47#include <libkdepim/kdateedit.h> 47#include <libkdepim/kdateedit.h>
48 48
49#include "koprefs.h" 49#include "koprefs.h"
50#include "kolocationbox.h" 50#include "kolocationbox.h"
51 51
52#include "kotodoeditor.h" 52#include "kotodoeditor.h"
53extern int globalFlagBlockAgenda; 53extern int globalFlagBlockAgenda;
54 54
55KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) : 55KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) :
56 KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent ) 56 KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent )
57{ 57{
58 mTodo = 0; 58 mTodo = 0;
59 mRelatedTodo = 0; 59 mRelatedTodo = 0;
60 findButton(User1)->hide(); 60 findButton(User1)->hide();
61 init(); 61 init();
62 if ( QApplication::desktop()->height() <= 240 )
63 hideButtons();
62} 64}
63 65
64KOTodoEditor::~KOTodoEditor() 66KOTodoEditor::~KOTodoEditor()
65{ 67{
66 emit dialogClose( mTodo ); 68 emit dialogClose( mTodo );
67} 69}
68 70
69void KOTodoEditor::init() 71void KOTodoEditor::init()
70{ 72{
71 setupGeneral(); 73 setupGeneral();
72 setupAttendeesTab(); 74 setupAttendeesTab();
73 setupRecurrence(); 75 setupRecurrence();
74 connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence())); 76 connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence()));
75 mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") ); 77 mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") );
76} 78}
77void KOTodoEditor::setupRecurrence() 79void KOTodoEditor::setupRecurrence()
78{ 80{
79 QFrame *topFrame = addPage( i18n("Recurrence") ); 81 QFrame *topFrame = addPage( i18n("Recurrence") );
80 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 82 QBoxLayout *topLayout = new QVBoxLayout( topFrame );
81 83
82 mRecurrence = new KOEditorRecurrence( topFrame ); 84 mRecurrence = new KOEditorRecurrence( topFrame );
83 topLayout->addWidget( mRecurrence ); 85 topLayout->addWidget( mRecurrence );
84} 86}
85 87
86void KOTodoEditor::setCategories( QString s ) 88void KOTodoEditor::setCategories( QString s )
87{ 89{
88 mGeneral->setCategories(s); 90 mGeneral->setCategories(s);
89} 91}
90void KOTodoEditor::setSecrecy( int sec ) 92void KOTodoEditor::setSecrecy( int sec )
91{ 93{
92 mGeneral->setSecrecy( sec ); 94 mGeneral->setSecrecy( sec );
93} 95}
94void KOTodoEditor::reload() 96void KOTodoEditor::reload()
95{ 97{
96 if ( mTodo ) readTodo( mTodo ); 98 if ( mTodo ) readTodo( mTodo );
97} 99}
98 100
99void KOTodoEditor::setupGeneral() 101void KOTodoEditor::setupGeneral()
100{ 102{
101 mGeneral = new KOEditorGeneralTodo(this); 103 mGeneral = new KOEditorGeneralTodo(this);
102 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); 104 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
103 105
104 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); 106 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
105 //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), 107 //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)),
106 // mGeneral,SLOT(setCategories(const QString &))); 108 // mGeneral,SLOT(setCategories(const QString &)));
107 109
108 if (KOPrefs::instance()->mCompactDialogs) { 110 if (KOPrefs::instance()->mCompactDialogs) {
109 QFrame *topFrame = addPage(i18n("General")); 111 QFrame *topFrame = addPage(i18n("General"));
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 007d1f3..59bf1a2 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -69,97 +69,99 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
69 searchEdit->setFocus(); 69 searchEdit->setFocus();
70 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); 70 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
71 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); 71 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch()));
72 // Subjects to search 72 // Subjects to search
73 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), 73 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
74 // topFrame); 74 // topFrame);
75 75
76 QHBox *incidenceGroup = new QHBox( topFrame ); 76 QHBox *incidenceGroup = new QHBox( topFrame );
77 layout->addWidget(incidenceGroup); 77 layout->addWidget(incidenceGroup);
78 78
79 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); 79 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup);
80 //mSearchEvent->setChecked(true); 80 //mSearchEvent->setChecked(true);
81 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); 81 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup);
82 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); 82 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup);
83 83
84 QHBox *subjectGroup = new QHBox( topFrame ); 84 QHBox *subjectGroup = new QHBox( topFrame );
85 layout->addWidget(subjectGroup); 85 layout->addWidget(subjectGroup);
86 86
87 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); 87 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup);
88 mSummaryCheck->setChecked(true); 88 mSummaryCheck->setChecked(true);
89 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); 89 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup);
90 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); 90 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup);
91 91
92 QHBox *attendeeGroup = new QHBox( topFrame ); 92 QHBox *attendeeGroup = new QHBox( topFrame );
93 layout->addWidget(attendeeGroup ); 93 layout->addWidget(attendeeGroup );
94 new QLabel( i18n("Attendee:"),attendeeGroup ); 94 new QLabel( i18n("Attendee:"),attendeeGroup );
95 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); 95 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup );
96 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); 96 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup );
97 // Date range 97 // Date range
98 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), 98 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"),
99 // topFrame); 99 // topFrame);
100 // layout->addWidget(rangeGroup); 100 // layout->addWidget(rangeGroup);
101 101
102 QWidget *rangeWidget = new QWidget(topFrame); 102 QWidget *rangeWidget = new QWidget(topFrame);
103 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); 103 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint());
104 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); 104 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
105 mStartDate = new KDateEdit(rangeWidget); 105 mStartDate = new KDateEdit(rangeWidget);
106 rangeLayout->addWidget(mStartDate); 106 rangeLayout->addWidget(mStartDate);
107 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); 107 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget));
108 mEndDate = new KDateEdit(rangeWidget); 108 mEndDate = new KDateEdit(rangeWidget);
109 mEndDate->setDate(QDate::currentDate().addDays(365)); 109 mEndDate->setDate(QDate::currentDate().addDays(365));
110 rangeLayout->addWidget(mEndDate); 110 rangeLayout->addWidget(mEndDate);
111 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); 111 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
112 rangeLayout->addWidget( (QWidget*)wt ); 112 rangeLayout->addWidget( (QWidget*)wt );
113 layout->addWidget(rangeWidget); 113 layout->addWidget(rangeWidget);
114 // Results list view 114 // Results list view
115 listView = new KOListView(mCalendar,topFrame); 115 listView = new KOListView(mCalendar,topFrame);
116 layout->addWidget(listView); 116 layout->addWidget(listView);
117 117 //layout->setStretchFactor( listView, 333 );
118 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) );
119 //listView->setMaximumHeight( 50 );
118 listView->readSettings(KOGlobals::config(),"SearchListView Layout"); 120 listView->readSettings(KOGlobals::config(),"SearchListView Layout");
119 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); 121 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
120 122
121 setCaption( i18n("KO/Pi Find: ")); 123 setCaption( i18n("KO/Pi Find: "));
122#ifdef DESKTOP_VERSION 124#ifdef DESKTOP_VERSION
123 OkButton = new QPushButton( i18n("Close"), this ); 125 OkButton = new QPushButton( i18n("Close"), this );
124 connect(OkButton,SIGNAL(clicked()),SLOT(hide())); 126 connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
125#endif 127#endif
126} 128}
127 129
128SearchDialog::~SearchDialog() 130SearchDialog::~SearchDialog()
129{ 131{
130 132
131} 133}
132void SearchDialog::raiseAndSelect() 134void SearchDialog::raiseAndSelect()
133{ 135{
134 136
135 static int currentState = 0; 137 static int currentState = 0;
136 138
137 if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) 139 if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() )
138 currentState = 0; 140 currentState = 0;
139 int newState = 0; 141 int newState = 0;
140 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 142 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
141 newState = VIEW_J_VIEW; 143 newState = VIEW_J_VIEW;
142 } 144 }
143 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 145 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
144 newState = VIEW_T_VIEW; 146 newState = VIEW_T_VIEW;
145 } 147 }
146 else { 148 else {
147 newState = VIEW_A_VIEW; 149 newState = VIEW_A_VIEW;
148 } 150 }
149 if ( newState != currentState ) { 151 if ( newState != currentState ) {
150 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 152 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
151 if ( ! mSearchJournal->isChecked() ) { 153 if ( ! mSearchJournal->isChecked() ) {
152 mSearchJournal->setChecked( true ); 154 mSearchJournal->setChecked( true );
153 mSearchTodo->setChecked( false ); 155 mSearchTodo->setChecked( false );
154 mSearchEvent->setChecked( false ); 156 mSearchEvent->setChecked( false );
155 } 157 }
156 } 158 }
157 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 159 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
158 if ( ! mSearchTodo->isChecked() ) { 160 if ( ! mSearchTodo->isChecked() ) {
159 mSearchTodo->setChecked( true ); 161 mSearchTodo->setChecked( true );
160 mSearchJournal->setChecked( false ); 162 mSearchJournal->setChecked( false );
161 mSearchEvent->setChecked( false ); 163 mSearchEvent->setChecked( false );
162 } 164 }
163 } 165 }
164 else { 166 else {
165 if ( ! mSearchEvent->isChecked() ) { 167 if ( ! mSearchEvent->isChecked() ) {
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index f7e38a7..d7431c7 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -67,97 +67,101 @@ void Todo::setRunningFalse( QString s )
67 return; 67 return;
68 mRunning = false; 68 mRunning = false;
69 mRunSaveTimer->stop(); 69 mRunSaveTimer->stop();
70 saveRunningInfoToFile( s ); 70 saveRunningInfoToFile( s );
71} 71}
72void Todo::setRunning( bool run ) 72void Todo::setRunning( bool run )
73{ 73{
74 if ( run == mRunning ) 74 if ( run == mRunning )
75 return; 75 return;
76 //qDebug("Todo::setRunning %d ", run); 76 //qDebug("Todo::setRunning %d ", run);
77 if ( !mRunSaveTimer ) { 77 if ( !mRunSaveTimer ) {
78 mRunSaveTimer = new QTimer ( this ); 78 mRunSaveTimer = new QTimer ( this );
79 connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); 79 connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) );
80 } 80 }
81 mRunning = run; 81 mRunning = run;
82 if ( mRunning ) { 82 if ( mRunning ) {
83 mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min 83 mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min
84 mRunStart = QDateTime::currentDateTime(); 84 mRunStart = QDateTime::currentDateTime();
85 } else { 85 } else {
86 mRunSaveTimer->stop(); 86 mRunSaveTimer->stop();
87 saveRunningInfoToFile(); 87 saveRunningInfoToFile();
88 } 88 }
89} 89}
90 90
91void Todo::saveRunningInfoToFile( QString comment ) 91void Todo::saveRunningInfoToFile( QString comment )
92{ 92{
93 //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); 93 //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1());
94 if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { 94 if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) {
95 qDebug("Running time < 30 seconds. Skipped. "); 95 qDebug("Running time < 30 seconds. Skipped. ");
96 return; 96 return;
97 } 97 }
98 QString dir = KGlobalSettings::timeTrackerDir(); 98 QString dir = KGlobalSettings::timeTrackerDir();
99 //qDebug("%s ", dir.latin1()); 99 //qDebug("%s ", dir.latin1());
100 QString file = "%1%2%3-%4%5%6-"; 100 QString file = "%1%2%3-%4%5%6-";
101 file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ); 101 file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 );
102 file.replace ( QRegExp (" "), "0" ); 102 file.replace ( QRegExp (" "), "0" );
103 file += uid(); 103 file += uid();
104 //qDebug("File %s ",file.latin1() ); 104 //qDebug("File %s ",file.latin1() );
105 CalendarLocal cal; 105 CalendarLocal cal;
106 cal.setLocalTime(); 106 cal.setLocalTime();
107 Todo * to = (Todo*) clone(); 107 Todo * to = (Todo*) clone();
108 to->setFloats( false ); 108 to->setFloats( false );
109 to->setDtStart( mRunStart ); 109 to->setDtStart( mRunStart );
110 to->setHasStartDate( true ); 110 to->setHasStartDate( true );
111 to->setDtDue( QDateTime::currentDateTime() ); 111 to->setDtDue( QDateTime::currentDateTime() );
112 to->setHasDueDate( true ); 112 to->setHasDueDate( true );
113 to->setUid( file ); 113 to->setUid( file );
114 if ( !comment.isEmpty() ) { 114 if ( !comment.isEmpty() ) {
115 to->setDescription( comment ); 115 QString des = to->description();
116 if ( des.isEmpty () )
117 to->setDescription( "TT-Note: " + comment );
118 else
119 to->setDescription( "TT-Note: " + comment +"\n" + des );
116 } 120 }
117 cal.addIncidence( to ); 121 cal.addIncidence( to );
118 ICalFormat format; 122 ICalFormat format;
119 file = dir +"/" +file +".ics"; 123 file = dir +"/" +file +".ics";
120 format.save( &cal, file ); 124 format.save( &cal, file );
121 saveParents(); 125 saveParents();
122 126
123} 127}
124void Todo::saveParents() 128void Todo::saveParents()
125{ 129{
126 if (!relatedTo() ) 130 if (!relatedTo() )
127 return; 131 return;
128 Incidence * inc = relatedTo(); 132 Incidence * inc = relatedTo();
129 if ( inc->type() != "Todo" ) 133 if ( inc->type() != "Todo" )
130 return; 134 return;
131 Todo* to = (Todo*)inc; 135 Todo* to = (Todo*)inc;
132 bool saveTodo = false; 136 bool saveTodo = false;
133 QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; 137 QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics";
134 QFileInfo fi ( file ); 138 QFileInfo fi ( file );
135 if ( fi.exists() ) { 139 if ( fi.exists() ) {
136 if ( fi.lastModified () < to->lastModified ()) 140 if ( fi.lastModified () < to->lastModified ())
137 saveTodo = true; 141 saveTodo = true;
138 } else { 142 } else {
139 saveTodo = true; 143 saveTodo = true;
140 } 144 }
141 if ( saveTodo ) { 145 if ( saveTodo ) {
142 CalendarLocal cal; 146 CalendarLocal cal;
143 cal.setLocalTime(); 147 cal.setLocalTime();
144 Todo * par = (Todo *) to->clone(); 148 Todo * par = (Todo *) to->clone();
145 cal.addIncidence( par ); 149 cal.addIncidence( par );
146 ICalFormat format; 150 ICalFormat format;
147 format.save( &cal, file ); 151 format.save( &cal, file );
148 } 152 }
149 to->saveParents(); 153 to->saveParents();
150} 154}
151 155
152int Todo::runTime() 156int Todo::runTime()
153{ 157{
154 if ( !mRunning ) 158 if ( !mRunning )
155 return 0; 159 return 0;
156 return mRunStart.secsTo( QDateTime::currentDateTime() ); 160 return mRunStart.secsTo( QDateTime::currentDateTime() );
157} 161}
158bool Todo::hasRunningSub() 162bool Todo::hasRunningSub()
159{ 163{
160 if ( mRunning ) 164 if ( mRunning )
161 return true; 165 return true;
162 Incidence *aTodo; 166 Incidence *aTodo;
163 for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) { 167 for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) {
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index 2d97c8c..4271b55 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -741,199 +741,204 @@ KPopupFrame::popup(const QPoint &pos)
741 show(); 741 show();
742} 742}
743 743
744int 744int
745KPopupFrame::exec(QPoint pos) 745KPopupFrame::exec(QPoint pos)
746{ 746{
747 popup(pos); 747 popup(pos);
748 repaint(); 748 repaint();
749 qApp->enter_loop(); 749 qApp->enter_loop();
750 hide(); 750 hide();
751 return result; 751 return result;
752} 752}
753 753
754int 754int
755KPopupFrame::exec(int x, int y) 755KPopupFrame::exec(int x, int y)
756{ 756{
757 return exec(QPoint(x, y)); 757 return exec(QPoint(x, y));
758} 758}
759 759
760void KPopupFrame::virtual_hook( int, void* ) 760void KPopupFrame::virtual_hook( int, void* )
761{ /*BASE::virtual_hook( id, data );*/ } 761{ /*BASE::virtual_hook( id, data );*/ }
762 762
763void KDateTable::virtual_hook( int, void* ) 763void KDateTable::virtual_hook( int, void* )
764{ /*BASE::virtual_hook( id, data );*/ } 764{ /*BASE::virtual_hook( id, data );*/ }
765 765
766//#include "kdatetbl.moc" 766//#include "kdatetbl.moc"
767 767
768 768
769KDateInternalWeekPicker::KDateInternalWeekPicker 769KDateInternalWeekPicker::KDateInternalWeekPicker
770(QWidget* parent, const char* name) 770(QWidget* parent, const char* name)
771 : QGridView(parent, name), 771 : QGridView(parent, name),
772 result(0) // invalid 772 result(0) // invalid
773{ 773{
774 QRect rect; 774 QRect rect;
775 QFont font; 775 QFont font;
776 // ----- 776 // -----
777 activeCol = -1; 777 activeCol = -1;
778 activeRow = -1; 778 activeRow = -1;
779 font=KGlobalSettings::generalFont(); 779 font=KGlobalSettings::generalFont();
780 int fontsize = 10; 780 int fontsize = 10;
781 int add = 2; 781 int add = 2;
782 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 782 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
783 add += 6; 783 add += 6;
784 font.setPointSize(fontsize+add); 784 font.setPointSize(fontsize+add);
785 setFont(font); 785 setFont(font);
786 setHScrollBarMode(AlwaysOff); 786 setHScrollBarMode(AlwaysOff);
787 setVScrollBarMode(AlwaysOff); 787 setVScrollBarMode(AlwaysOff);
788 setFrameStyle(QFrame::NoFrame); 788 setFrameStyle(QFrame::NoFrame);
789 setNumRows(13); 789 if ( QApplication::desktop()->height() > 240 ) {
790 setNumCols(4); 790 setNumRows(13);
791 setNumCols(4);
792 } else {
793 setNumRows(4);
794 setNumCols(13);
795 }
791 // enable to find drawing failures: 796 // enable to find drawing failures:
792 // setTableFlags(Tbl_clipCellPainting); 797 // setTableFlags(Tbl_clipCellPainting);
793#if 0 798#if 0
794 viewport()->setEraseColor(lightGray); // for consistency with the datepicker 799 viewport()->setEraseColor(lightGray); // for consistency with the datepicker
795#endif 800#endif
796 // ----- find the preferred size 801 // ----- find the preferred size
797 // (this is slow, possibly, but unfortunatly it is needed here): 802 // (this is slow, possibly, but unfortunatly it is needed here):
798 QFontMetrics metrics(font); 803 QFontMetrics metrics(font);
799 for(int i=1; i <= 52; ++i) 804 for(int i=1; i <= 52; ++i)
800 { 805 {
801 rect=metrics.boundingRect(QString::number( i )); 806 rect=metrics.boundingRect(QString::number( i ));
802 if(max.width()<rect.width()) max.setWidth(rect.width()); 807 if(max.width()<rect.width()) max.setWidth(rect.width());
803 if(max.height()<rect.height()) max.setHeight(rect.height()); 808 if(max.height()<rect.height()) max.setHeight(rect.height());
804 } 809 }
805 if ( QApplication::desktop()->width() > 640 ) { 810 if ( QApplication::desktop()->width() > 640 ) {
806 811
807 max.setWidth(max.width()+6); 812 max.setWidth(max.width()+6);
808 max.setHeight(max.height()+8); 813 max.setHeight(max.height()+8);
809 } 814 }
810} 815}
811 816
812QSize 817QSize
813KDateInternalWeekPicker::sizeHint() const 818KDateInternalWeekPicker::sizeHint() const
814{ 819{
815 return QSize((max.width()+6)*numCols()+2*frameWidth(), 820 return QSize((max.width()+6)*numCols()+2*frameWidth(),
816 (max.height()+6)*numRows()+2*frameWidth()); 821 (max.height()+6)*numRows()+2*frameWidth());
817} 822}
818 823
819int 824int
820KDateInternalWeekPicker::getResult() const 825KDateInternalWeekPicker::getResult() const
821{ 826{
822 return result; 827 return result;
823} 828}
824 829
825void 830void
826KDateInternalWeekPicker::setupPainter(QPainter *p) 831KDateInternalWeekPicker::setupPainter(QPainter *p)
827{ 832{
828 p->setPen(black); 833 p->setPen(black);
829} 834}
830 835
831void 836void
832KDateInternalWeekPicker::viewportResizeEvent(QResizeEvent*) 837KDateInternalWeekPicker::viewportResizeEvent(QResizeEvent*)
833{ 838{
834 setCellWidth(width()/4); 839 setCellWidth(width()/ numCols());
835 setCellHeight(height()/13); 840 setCellHeight(height()/ numRows());
836} 841}
837 842
838void 843void
839KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col) 844KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col)
840{ 845{
841 int index; 846 int index;
842 QString text; 847 QString text;
843 // ----- find the number of the cell: 848 // ----- find the number of the cell:
844 index=4*row+col+1; 849 index=numCols()*row+col+1;
845 text=QString::number( index ); 850 text=QString::number( index );
846 painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); 851 painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text);
847 if ( activeCol == col && activeRow == row ) 852 if ( activeCol == col && activeRow == row )
848 painter->drawRect( 0, 0, cellWidth(), cellHeight() ); 853 painter->drawRect( 0, 0, cellWidth(), cellHeight() );
849} 854}
850 855
851void 856void
852KDateInternalWeekPicker::contentsMousePressEvent(QMouseEvent *e) 857KDateInternalWeekPicker::contentsMousePressEvent(QMouseEvent *e)
853{ 858{
854 if(!isEnabled() || e->button() != LeftButton) 859 if(!isEnabled() || e->button() != LeftButton)
855 { 860 {
856 KNotifyClient::beep(); 861 KNotifyClient::beep();
857 return; 862 return;
858 } 863 }
859 // ----- 864 // -----
860 int row, col; 865 int row, col;
861 QPoint mouseCoord; 866 QPoint mouseCoord;
862 // ----- 867 // -----
863 mouseCoord = e->pos(); 868 mouseCoord = e->pos();
864 row=rowAt(mouseCoord.y()); 869 row=rowAt(mouseCoord.y());
865 col=columnAt(mouseCoord.x()); 870 col=columnAt(mouseCoord.x());
866 871
867 if(row<0 || col<0) 872 if(row<0 || col<0)
868 { // the user clicked on the frame of the table 873 { // the user clicked on the frame of the table
869 activeCol = -1; 874 activeCol = -1;
870 activeRow = -1; 875 activeRow = -1;
871 } else { 876 } else {
872 activeCol = col; 877 activeCol = col;
873 activeRow = row; 878 activeRow = row;
874 updateCell( row, col /*, false */ ); 879 updateCell( row, col /*, false */ );
875 } 880 }
876} 881}
877 882
878void 883void
879KDateInternalWeekPicker::contentsMouseMoveEvent(QMouseEvent *e) 884KDateInternalWeekPicker::contentsMouseMoveEvent(QMouseEvent *e)
880{ 885{
881 if (e->state() & LeftButton) 886 if (e->state() & LeftButton)
882 { 887 {
883 int row, col; 888 int row, col;
884 QPoint mouseCoord; 889 QPoint mouseCoord;
885 // ----- 890 // -----
886 mouseCoord = e->pos(); 891 mouseCoord = e->pos();
887 row=rowAt(mouseCoord.y()); 892 row=rowAt(mouseCoord.y());
888 col=columnAt(mouseCoord.x()); 893 col=columnAt(mouseCoord.x());
889 int tmpRow = -1, tmpCol = -1; 894 int tmpRow = -1, tmpCol = -1;
890 if(row<0 || col<0) 895 if(row<0 || col<0)
891 { // the user clicked on the frame of the table 896 { // the user clicked on the frame of the table
892 if ( activeCol > -1 ) 897 if ( activeCol > -1 )
893 { 898 {
894 tmpRow = activeRow; 899 tmpRow = activeRow;
895 tmpCol = activeCol; 900 tmpCol = activeCol;
896 } 901 }
897 activeCol = -1; 902 activeCol = -1;
898 activeRow = -1; 903 activeRow = -1;
899 } else { 904 } else {
900 bool differentCell = (activeRow != row || activeCol != col); 905 bool differentCell = (activeRow != row || activeCol != col);
901 if ( activeCol > -1 && differentCell) 906 if ( activeCol > -1 && differentCell)
902 { 907 {
903 tmpRow = activeRow; 908 tmpRow = activeRow;
904 tmpCol = activeCol; 909 tmpCol = activeCol;
905 } 910 }
906 if ( differentCell) 911 if ( differentCell)
907 { 912 {
908 activeRow = row; 913 activeRow = row;
909 activeCol = col; 914 activeCol = col;
910 updateCell( row, col /*, false */ ); // mark the new active cell 915 updateCell( row, col /*, false */ ); // mark the new active cell
911 } 916 }
912 } 917 }
913 if ( tmpRow > -1 ) // repaint the former active cell 918 if ( tmpRow > -1 ) // repaint the former active cell
914 updateCell( tmpRow, tmpCol /*, true */ ); 919 updateCell( tmpRow, tmpCol /*, true */ );
915 } 920 }
916} 921}
917 922
918void 923void
919KDateInternalWeekPicker::contentsMouseReleaseEvent(QMouseEvent *e) 924KDateInternalWeekPicker::contentsMouseReleaseEvent(QMouseEvent *e)
920{ 925{
921 if(!isEnabled()) 926 if(!isEnabled())
922 { 927 {
923 return; 928 return;
924 } 929 }
925 // ----- 930 // -----
926 int row, col, pos; 931 int row, col, pos;
927 QPoint mouseCoord; 932 QPoint mouseCoord;
928 // ----- 933 // -----
929 mouseCoord = e->pos(); 934 mouseCoord = e->pos();
930 row=rowAt(mouseCoord.y()); 935 row=rowAt(mouseCoord.y());
931 col=columnAt(mouseCoord.x()); 936 col=columnAt(mouseCoord.x());
932 if(row<0 || col<0) 937 if(row<0 || col<0)
933 { // the user clicked on the frame of the table 938 { // the user clicked on the frame of the table
934 emit(closeMe(0)); 939 emit(closeMe(0));
935 } 940 }
936 pos=4*row+col+1; 941 pos=numCols()*row+col+1;
937 result=pos; 942 result=pos;
938 emit(closeMe(1)); 943 emit(closeMe(1));
939} 944}