summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-10 13:54:08 (UTC)
committer zautrix <zautrix>2005-06-10 13:54:08 (UTC)
commit31fed261955dcb25d06052a8154ac4cc630b0f7d (patch) (unidiff)
treeef2b4fe35255f9bf387407b6756c112a67088ad6
parentd2f00fc2034450bc9a3cd1d2c3510bef1758d3bc (diff)
downloadkdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.zip
kdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.tar.gz
kdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.tar.bz2
fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodialogmanager.cpp3
-rw-r--r--korganizer/koeditordetails.cpp2
-rw-r--r--korganizer/koeditorgeneral.cpp2
-rw-r--r--korganizer/koprefsdialog.cpp50
-rw-r--r--korganizer/mainwindow.cpp2
-rw-r--r--korganizer/searchdialog.cpp23
-rw-r--r--korganizer/searchdialog.h3
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp91
-rw-r--r--microkde/kcolorbutton.cpp2
9 files changed, 131 insertions, 47 deletions
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index 3dfa344..5455098 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -1,355 +1,356 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2001 4 Copyright (c) 2001
5 Cornelius Schumacher <schumacher@kde.org> 5 Cornelius Schumacher <schumacher@kde.org>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <libkdepim/categoryeditdialog.h> 22#include <libkdepim/categoryeditdialog.h>
23 23
24#include "calendarview.h" 24#include "calendarview.h"
25#include "incomingdialog.h" 25#include "incomingdialog.h"
26#include "outgoingdialog.h" 26#include "outgoingdialog.h"
27#include "koprefsdialog.h" 27#include "koprefsdialog.h"
28#include "koeventeditor.h" 28#include "koeventeditor.h"
29#include "koprefs.h" 29#include "koprefs.h"
30#include "datenavigator.h" 30#include "datenavigator.h"
31#include "kotodoeditor.h" 31#include "kotodoeditor.h"
32#include "searchdialog.h" 32#include "searchdialog.h"
33#include "filtereditdialog.h" 33#include "filtereditdialog.h"
34#ifndef KORG_NOPLUGINS 34#ifndef KORG_NOPLUGINS
35#include "plugindialog.h" 35#include "plugindialog.h"
36#endif 36#endif
37#ifndef KORG_NOARCHIVE 37#ifndef KORG_NOARCHIVE
38#include "archivedialog.h" 38#include "archivedialog.h"
39#endif 39#endif
40 40
41#include "kconfig.h" 41#include "kconfig.h"
42#include "kodialogmanager.h" 42#include "kodialogmanager.h"
43#include <kapplication.h> 43#include <kapplication.h>
44 44
45KODialogManager::KODialogManager( CalendarView *mainView ) : 45KODialogManager::KODialogManager( CalendarView *mainView ) :
46 QObject(), mMainView( mainView ) 46 QObject(), mMainView( mainView )
47{ 47{
48 mOutgoingDialog = 0; 48 mOutgoingDialog = 0;
49 mIncomingDialog = 0; 49 mIncomingDialog = 0;
50 mOptionsDialog = 0; 50 mOptionsDialog = 0;
51 mSearchDialog = 0; 51 mSearchDialog = 0;
52 mArchiveDialog = 0; 52 mArchiveDialog = 0;
53 mFilterEditDialog = 0; 53 mFilterEditDialog = 0;
54 mPluginDialog = 0; 54 mPluginDialog = 0;
55 55
56 // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); 56 // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView);
57 //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); 57 //KOGlobals::fitDialogToScreen( mCategoryEditDialog );
58} 58}
59 59
60KODialogManager::~KODialogManager() 60KODialogManager::~KODialogManager()
61{ 61{
62 delete mOutgoingDialog; 62 delete mOutgoingDialog;
63 delete mIncomingDialog; 63 delete mIncomingDialog;
64 delete mOptionsDialog; 64 delete mOptionsDialog;
65 delete mSearchDialog; 65 delete mSearchDialog;
66#ifndef KORG_NOARCHIVE 66#ifndef KORG_NOARCHIVE
67 delete mArchiveDialog; 67 delete mArchiveDialog;
68#endif 68#endif
69 delete mFilterEditDialog; 69 delete mFilterEditDialog;
70#ifndef KORG_NOPLUGINS 70#ifndef KORG_NOPLUGINS
71 delete mPluginDialog; 71 delete mPluginDialog;
72#endif 72#endif
73} 73}
74 74
75OutgoingDialog *KODialogManager::outgoingDialog() 75OutgoingDialog *KODialogManager::outgoingDialog()
76{ 76{
77 createOutgoingDialog(); 77 createOutgoingDialog();
78 return mOutgoingDialog; 78 return mOutgoingDialog;
79} 79}
80 80
81void KODialogManager::createOutgoingDialog() 81void KODialogManager::createOutgoingDialog()
82{ 82{
83 if (!mOutgoingDialog) { 83 if (!mOutgoingDialog) {
84 mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); 84 mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView);
85 if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); 85 if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog);
86 connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), 86 connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)),
87 mMainView,SIGNAL(numOutgoingChanged(int))); 87 mMainView,SIGNAL(numOutgoingChanged(int)));
88 } 88 }
89} 89}
90 90
91void KODialogManager::showGlobalOptionsDialog( bool showSync ) 91void KODialogManager::showGlobalOptionsDialog( bool showSync )
92{ 92{
93 KPimPrefsGlobalDialog gc ( mMainView ); 93 KPimPrefsGlobalDialog gc ( mMainView );
94 if ( showSync ) 94 if ( showSync )
95 gc.showTZconfig(); 95 gc.showTZconfig();
96 gc.exec(); 96 gc.exec();
97} 97}
98void KODialogManager::showOptionsDialog( bool showSync ) 98void KODialogManager::showOptionsDialog( bool showSync )
99{ 99{
100 100
101 if (!mOptionsDialog) { 101 if (!mOptionsDialog) {
102 mOptionsDialog = new KOPrefsDialog(mMainView); 102 mOptionsDialog = new KOPrefsDialog(mMainView);
103 connect(mOptionsDialog,SIGNAL(configChanged()), 103 connect(mOptionsDialog,SIGNAL(configChanged()),
104 mMainView,SLOT(updateConfig())); 104 mMainView,SLOT(updateConfig()));
105 } 105 }
106 mOptionsDialog->readConfig(); 106 mOptionsDialog->readConfig();
107#ifndef DESKTOP_VERSION 107#ifndef DESKTOP_VERSION
108 mOptionsDialog->hideButtons();
108 mOptionsDialog->showMaximized(); 109 mOptionsDialog->showMaximized();
109#else 110#else
110 mOptionsDialog->show(); 111 mOptionsDialog->show();
111#endif 112#endif
112 113
113 mOptionsDialog->exec(); 114 mOptionsDialog->exec();
114 delete mOptionsDialog; 115 delete mOptionsDialog;
115 mOptionsDialog = 0; 116 mOptionsDialog = 0;
116} 117}
117void KODialogManager::showSyncOptions() 118void KODialogManager::showSyncOptions()
118{ 119{
119 showGlobalOptionsDialog( true ); 120 showGlobalOptionsDialog( true );
120 121
121} 122}
122void KODialogManager::showOutgoingDialog() 123void KODialogManager::showOutgoingDialog()
123{ 124{
124 createOutgoingDialog(); 125 createOutgoingDialog();
125 mOutgoingDialog->show(); 126 mOutgoingDialog->show();
126 mOutgoingDialog->raise(); 127 mOutgoingDialog->raise();
127} 128}
128 129
129IncomingDialog *KODialogManager::incomingDialog() 130IncomingDialog *KODialogManager::incomingDialog()
130{ 131{
131 createOutgoingDialog(); 132 createOutgoingDialog();
132 if (!mIncomingDialog) { 133 if (!mIncomingDialog) {
133 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); 134 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
134 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), 135 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
135 mMainView,SIGNAL(numIncomingChanged(int))); 136 mMainView,SIGNAL(numIncomingChanged(int)));
136 connect(mIncomingDialog,SIGNAL(calendarUpdated()), 137 connect(mIncomingDialog,SIGNAL(calendarUpdated()),
137 mMainView,SLOT(updateView())); 138 mMainView,SLOT(updateView()));
138 } 139 }
139 return mIncomingDialog; 140 return mIncomingDialog;
140} 141}
141 142
142void KODialogManager::createIncomingDialog() 143void KODialogManager::createIncomingDialog()
143{ 144{
144 createOutgoingDialog(); 145 createOutgoingDialog();
145 if (!mIncomingDialog) { 146 if (!mIncomingDialog) {
146 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); 147 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
147 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), 148 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
148 mMainView,SIGNAL(numIncomingChanged(int))); 149 mMainView,SIGNAL(numIncomingChanged(int)));
149 connect(mIncomingDialog,SIGNAL(calendarUpdated()), 150 connect(mIncomingDialog,SIGNAL(calendarUpdated()),
150 mMainView,SLOT(updateView())); 151 mMainView,SLOT(updateView()));
151 } 152 }
152} 153}
153 154
154void KODialogManager::showIncomingDialog() 155void KODialogManager::showIncomingDialog()
155{ 156{
156 createIncomingDialog(); 157 createIncomingDialog();
157 mIncomingDialog->show(); 158 mIncomingDialog->show();
158 mIncomingDialog->raise(); 159 mIncomingDialog->raise();
159} 160}
160/* 161/*
161void KODialogManager::showCategoryEditDialog() 162void KODialogManager::showCategoryEditDialog()
162{ 163{
163 mCategoryEditDialog->show(); 164 mCategoryEditDialog->show();
164} 165}
165*/ 166*/
166void KODialogManager::hideSearchDialog() 167void KODialogManager::hideSearchDialog()
167{ 168{
168 if (mSearchDialog) 169 if (mSearchDialog)
169 mSearchDialog->hide(); 170 mSearchDialog->hide();
170} 171}
171 172
172void KODialogManager::showSearchDialog() 173void KODialogManager::showSearchDialog()
173{ 174{
174 if (!mSearchDialog) { 175 if (!mSearchDialog) {
175 mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); 176 mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView);
176 KOListView * lview = mSearchDialog->listview(); 177 KOListView * lview = mSearchDialog->listview();
177 178
178 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), 179 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)),
179 mMainView, SLOT(showIncidence(Incidence *))); 180 mMainView, SLOT(showIncidence(Incidence *)));
180 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), 181 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)),
181 mMainView, SLOT(editIncidence(Incidence *))); 182 mMainView, SLOT(editIncidence(Incidence *)));
182 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), 183 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)),
183 mMainView, SLOT(deleteIncidence(Incidence *))); 184 mMainView, SLOT(deleteIncidence(Incidence *)));
184 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), 185 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)),
185 mMainView, SLOT(cloneIncidence(Incidence *))); 186 mMainView, SLOT(cloneIncidence(Incidence *)));
186 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), 187 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)),
187 mMainView, SLOT(beamIncidence(Incidence *))); 188 mMainView, SLOT(beamIncidence(Incidence *)));
188 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), 189 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)),
189 mMainView, SLOT(moveIncidence(Incidence *))); 190 mMainView, SLOT(moveIncidence(Incidence *)));
190 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), 191 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )),
191 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); 192 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> )));
192 193
193 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); 194 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig()));
194 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); 195 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList()));
195 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), 196 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ),
196 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 197 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
197#ifndef DESKTOP_VERSION 198#ifndef DESKTOP_VERSION
198 mSearchDialog->setMaximumSize( QApplication::desktop()->size()); 199 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
199 mSearchDialog->showMaximized(); 200 mSearchDialog->showMaximized();
200#else 201#else
201 KConfig *config = KOGlobals::config(); 202 KConfig *config = KOGlobals::config();
202 config->setGroup("WidgetLayout"); 203 config->setGroup("WidgetLayout");
203 QStringList list; 204 QStringList list;
204 list = config->readListEntry("SearchLayout"); 205 list = config->readListEntry("SearchLayout");
205 int x,y,w,h; 206 int x,y,w,h;
206 if ( ! list.isEmpty() ) { 207 if ( ! list.isEmpty() ) {
207 x = list[0].toInt(); 208 x = list[0].toInt();
208 y = list[1].toInt(); 209 y = list[1].toInt();
209 w = list[2].toInt(); 210 w = list[2].toInt();
210 h = list[3].toInt(); 211 h = list[3].toInt();
211 KApplication::testCoords( &x,&y,&w,&h ); 212 KApplication::testCoords( &x,&y,&w,&h );
212 mSearchDialog->setGeometry(x,y,w,h); 213 mSearchDialog->setGeometry(x,y,w,h);
213 214
214 } 215 }
215 216
216#endif 217#endif
217 } 218 }
218 // make sure the widget is on top again 219 // make sure the widget is on top again
219#ifdef DESKTOP_VERSION 220#ifdef DESKTOP_VERSION
220 mSearchDialog->show(); 221 mSearchDialog->show();
221#else 222#else
222 mSearchDialog->setMaximumSize( QApplication::desktop()->size()); 223 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
223 mSearchDialog->showMaximized(); 224 mSearchDialog->showMaximized();
224#endif 225#endif
225 mSearchDialog->raiseAndSelect(); 226 mSearchDialog->raiseAndSelect();
226} 227}
227 228
228SearchDialog * KODialogManager::getSearchDialog() 229SearchDialog * KODialogManager::getSearchDialog()
229{ 230{
230 return mSearchDialog; 231 return mSearchDialog;
231} 232}
232void KODialogManager::showArchiveDialog() 233void KODialogManager::showArchiveDialog()
233{ 234{
234#ifndef KORG_NOARCHIVE 235#ifndef KORG_NOARCHIVE
235 if (!mArchiveDialog) { 236 if (!mArchiveDialog) {
236 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); 237 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView);
237 connect(mArchiveDialog,SIGNAL(eventsDeleted()), 238 connect(mArchiveDialog,SIGNAL(eventsDeleted()),
238 mMainView,SLOT(updateView())); 239 mMainView,SLOT(updateView()));
239 } 240 }
240 mArchiveDialog->show(); 241 mArchiveDialog->show();
241 mArchiveDialog->raise(); 242 mArchiveDialog->raise();
242 243
243 // Workaround. 244 // Workaround.
244 QApplication::restoreOverrideCursor(); 245 QApplication::restoreOverrideCursor();
245#endif 246#endif
246} 247}
247 248
248void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) 249void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters)
249{ 250{
250 if (!mFilterEditDialog) { 251 if (!mFilterEditDialog) {
251 mFilterEditDialog = new FilterEditDialog(filters,mMainView); 252 mFilterEditDialog = new FilterEditDialog(filters,mMainView);
252 connect(mFilterEditDialog,SIGNAL(filterChanged()), 253 connect(mFilterEditDialog,SIGNAL(filterChanged()),
253 mMainView,SLOT(filterEdited())); 254 mMainView,SLOT(filterEdited()));
254 255
255 } 256 }
256 257
257#ifndef DESKTOP_VERSION 258#ifndef DESKTOP_VERSION
258 mFilterEditDialog->showMaximized(); 259 mFilterEditDialog->showMaximized();
259#else 260#else
260 mFilterEditDialog->show(); 261 mFilterEditDialog->show();
261#endif 262#endif
262 mFilterEditDialog->raise(); 263 mFilterEditDialog->raise();
263} 264}
264 265
265void KODialogManager::showPluginDialog() 266void KODialogManager::showPluginDialog()
266{ 267{
267#ifndef KORG_NOPLUGINS 268#ifndef KORG_NOPLUGINS
268 if (!mPluginDialog) { 269 if (!mPluginDialog) {
269 mPluginDialog = new PluginDialog(mMainView); 270 mPluginDialog = new PluginDialog(mMainView);
270 connect(mPluginDialog,SIGNAL(configChanged()), 271 connect(mPluginDialog,SIGNAL(configChanged()),
271 mMainView,SLOT(updateConfig())); 272 mMainView,SLOT(updateConfig()));
272 } 273 }
273 mPluginDialog->show(); 274 mPluginDialog->show();
274 mPluginDialog->raise(); 275 mPluginDialog->raise();
275#endif 276#endif
276} 277}
277 278
278KOEventEditor *KODialogManager::getEventEditor() 279KOEventEditor *KODialogManager::getEventEditor()
279{ 280{
280 KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), 281 KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(),
281 mMainView ); 282 mMainView );
282 283
283 connect(eventEditor,SIGNAL(eventAdded(Event *)), 284 connect(eventEditor,SIGNAL(eventAdded(Event *)),
284 mMainView,SLOT(eventAdded(Event *))); 285 mMainView,SLOT(eventAdded(Event *)));
285 connect(eventEditor,SIGNAL(eventChanged(Event *)), 286 connect(eventEditor,SIGNAL(eventChanged(Event *)),
286 mMainView,SLOT(eventChanged(Event *))); 287 mMainView,SLOT(eventChanged(Event *)));
287 connect(eventEditor,SIGNAL(eventDeleted()), 288 connect(eventEditor,SIGNAL(eventDeleted()),
288 mMainView,SLOT(eventDeleted())); 289 mMainView,SLOT(eventDeleted()));
289 connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), 290 connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)),
290 mMainView,SLOT(schedule_cancel(Incidence *))); 291 mMainView,SLOT(schedule_cancel(Incidence *)));
291 connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), 292 connect( eventEditor, SIGNAL(jumpToTime( const QDate &)),
292 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 293 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
293 connect( eventEditor, SIGNAL( showAgendaView( bool)), 294 connect( eventEditor, SIGNAL( showAgendaView( bool)),
294 mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); 295 mMainView->viewManager(), SLOT( showAgendaView( bool) ) );
295 296
296 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), 297 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
297 // eventEditor,SLOT(updateCategoryConfig())); 298 // eventEditor,SLOT(updateCategoryConfig()));
298 // connect(eventEditor,SIGNAL(editCategories()), 299 // connect(eventEditor,SIGNAL(editCategories()),
299 // mCategoryEditDialog,SLOT(show())); 300 // mCategoryEditDialog,SLOT(show()));
300 connect(eventEditor,SIGNAL(dialogClose(Incidence*)), 301 connect(eventEditor,SIGNAL(dialogClose(Incidence*)),
301 mMainView,SLOT(dialogClosing(Incidence*))); 302 mMainView,SLOT(dialogClosing(Incidence*)));
302 303
303 //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); 304 //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject()));
304 305
305#ifndef DESKTOP_VERSION 306#ifndef DESKTOP_VERSION
306 eventEditor->resize( QApplication::desktop()->width() -20, 100 ); 307 eventEditor->resize( QApplication::desktop()->width() -20, 100 );
307#endif 308#endif
308 return eventEditor; 309 return eventEditor;
309} 310}
310 311
311KOTodoEditor *KODialogManager::getTodoEditor() 312KOTodoEditor *KODialogManager::getTodoEditor()
312{ 313{
313 KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), 314 KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(),
314 mMainView ); 315 mMainView );
315 316
316 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), 317 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
317 // todoEditor,SLOT(updateCategoryConfig())); 318 // todoEditor,SLOT(updateCategoryConfig()));
318 // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); 319 // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show()));
319 320
320 connect(todoEditor,SIGNAL(todoAdded(Todo *)), 321 connect(todoEditor,SIGNAL(todoAdded(Todo *)),
321 mMainView,SLOT(todoAdded(Todo *))); 322 mMainView,SLOT(todoAdded(Todo *)));
322 connect(todoEditor,SIGNAL(todoChanged(Todo *)), 323 connect(todoEditor,SIGNAL(todoChanged(Todo *)),
323 mMainView,SLOT(todoChanged(Todo *))); 324 mMainView,SLOT(todoChanged(Todo *)));
324 connect(todoEditor,SIGNAL(todoDeleted()), 325 connect(todoEditor,SIGNAL(todoDeleted()),
325 mMainView,SLOT(todoDeleted())); 326 mMainView,SLOT(todoDeleted()));
326 connect(todoEditor,SIGNAL(dialogClose(Incidence*)), 327 connect(todoEditor,SIGNAL(dialogClose(Incidence*)),
327 mMainView,SLOT(dialogClosing(Incidence*))); 328 mMainView,SLOT(dialogClosing(Incidence*)));
328 connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), 329 connect( todoEditor, SIGNAL(jumpToTime( const QDate &)),
329 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 330 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
330 connect( todoEditor, SIGNAL( showAgendaView( bool)), 331 connect( todoEditor, SIGNAL( showAgendaView( bool)),
331 mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); 332 mMainView->viewManager(), SLOT( showAgendaView( bool) ) );
332 // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), 333 // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)),
333 // mMainView,SLOT(schedule_cancel(Incidence *))); 334 // mMainView,SLOT(schedule_cancel(Incidence *)));
334 //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); 335 //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject()));
335#ifndef DESKTOP_VERSION 336#ifndef DESKTOP_VERSION
336 todoEditor->resize( QApplication::desktop()->width() -20, 100 ); 337 todoEditor->resize( QApplication::desktop()->width() -20, 100 );
337#endif 338#endif
338 return todoEditor; 339 return todoEditor;
339} 340}
340 341
341void KODialogManager::updateSearchDialog() 342void KODialogManager::updateSearchDialog()
342{ 343{
343 if (mSearchDialog) mSearchDialog->updateView(); 344 if (mSearchDialog) mSearchDialog->updateView();
344} 345}
345 346
346void KODialogManager::setDocumentId( const QString &id ) 347void KODialogManager::setDocumentId( const QString &id )
347{ 348{
348 if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); 349 if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id );
349} 350}
350 351
351void KODialogManager::writeSettings( KConfig *config ) 352void KODialogManager::writeSettings( KConfig *config )
352{ 353{
353 if (mSearchDialog) 354 if (mSearchDialog)
354 mSearchDialog->listview()->writeSettings(config,"SearchListView Layout"); 355 mSearchDialog->listview()->writeSettings(config,"SearchListView Layout");
355} 356}
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index bdfc637..6ecf978 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -1,474 +1,474 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in thse hope that it will be useful, 10 This program is distributed in thse 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 <qfiledialog.h> 25#include <qfiledialog.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapp.h> 32#include <qapp.h>
33 33
34#include <klocale.h> 34#include <klocale.h>
35#include <kglobal.h> 35#include <kglobal.h>
36#include <kiconloader.h> 36#include <kiconloader.h>
37#include <kstandarddirs.h> 37#include <kstandarddirs.h>
38#include <kmessagebox.h> 38#include <kmessagebox.h>
39#ifndef KORG_NOKABC 39#ifndef KORG_NOKABC
40 40
41#ifdef DESKTOP_VERSION 41#ifdef DESKTOP_VERSION
42#include <kabc/addresseedialog.h> 42#include <kabc/addresseedialog.h>
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 || QApplication::desktop()->height() <= 240) {
91 int hei = 80; 91 int hei = 80;
92 if ( QApplication::desktop()->height() <= 240 ) 92 if ( QApplication::desktop()->height() <= 240 )
93 hei = 60; 93 hei = 60;
94 mListView->setFixedHeight(hei); 94 mListView->setFixedHeight(hei);
95 } 95 }
96 mListView->setAllColumnsShowFocus (true ); 96 mListView->setAllColumnsShowFocus (true );
97 //mListView->setSingleClick( true ); 97 //mListView->setSingleClick( true );
98 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), 98 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
99 SLOT(updateAttendeeInput())); 99 SLOT(updateAttendeeInput()));
100 100
101 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), 101 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )),
102 SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); 102 SLOT(itemClicked(QListViewItem * ,const QPoint& , int )));
103 103
104 mRsvpButton = new QCheckBox(this); 104 mRsvpButton = new QCheckBox(this);
105 mRsvpButton->setText(i18n("Request response")); 105 mRsvpButton->setText(i18n("Request response"));
106 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); 106 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
107 QLabel *attendeeLabel = new QLabel(this); 107 QLabel *attendeeLabel = new QLabel(this);
108 attendeeLabel->setText(i18n("Name:")); 108 attendeeLabel->setText(i18n("Name:"));
109 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); 109 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
110 mNameEdit = new QLineEdit(this); 110 mNameEdit = new QLineEdit(this);
111 connect(mNameEdit,SIGNAL(textChanged(const QString &)), 111 connect(mNameEdit,SIGNAL(textChanged(const QString &)),
112 SLOT(updateAttendeeItem())); 112 SLOT(updateAttendeeItem()));
113 113
114 mUidEdit = new QLineEdit(0); 114 mUidEdit = new QLineEdit(0);
115 mUidEdit->setText(""); 115 mUidEdit->setText("");
116 116
117 QLabel *emailLabel = new QLabel(this); 117 QLabel *emailLabel = new QLabel(this);
118 emailLabel->setText(i18n("Email:")); 118 emailLabel->setText(i18n("Email:"));
119 mEmailEdit = new QLineEdit(this); 119 mEmailEdit = new QLineEdit(this);
120 connect(mEmailEdit,SIGNAL(textChanged(const QString &)), 120 connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
121 SLOT(updateAttendeeItem())); 121 SLOT(updateAttendeeItem()));
122 122
123 QLabel *attendeeRoleLabel = new QLabel(this); 123 QLabel *attendeeRoleLabel = new QLabel(this);
124 attendeeRoleLabel->setText(i18n("Role:")); 124 attendeeRoleLabel->setText(i18n("Role:"));
125 mRoleCombo = new QComboBox(false,this); 125 mRoleCombo = new QComboBox(false,this);
126 mRoleCombo->insertStringList(Attendee::roleList()); 126 mRoleCombo->insertStringList(Attendee::roleList());
127 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 127 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
128 128
129 QLabel *statusLabel = new QLabel(this); 129 QLabel *statusLabel = new QLabel(this);
130 statusLabel->setText( i18n("Status:") ); 130 statusLabel->setText( i18n("Status:") );
131 131
132 mStatusCombo = new QComboBox(false,this); 132 mStatusCombo = new QComboBox(false,this);
133 mStatusCombo->insertStringList(Attendee::statusList()); 133 mStatusCombo->insertStringList(Attendee::statusList());
134 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 134 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
135 135
136 136
137 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); 137 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem()));
138 QWidget *buttonBox = new QWidget(this); 138 QWidget *buttonBox = new QWidget(this);
139 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); 139 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox);
140 140
141 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); 141 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox);
142 buttonLayout->addWidget(newButton); 142 buttonLayout->addWidget(newButton);
143 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); 143 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee()));
144 144
145 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); 145 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox);
146 buttonLayout->addWidget(mRemoveButton); 146 buttonLayout->addWidget(mRemoveButton);
147 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); 147 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee()));
148 148
149 // buttonLayout->addWidget(mAddressBookButton); 149 // buttonLayout->addWidget(mAddressBookButton);
150 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); 150 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook()));
151 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); 151 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () );
152 if ( QApplication::desktop()->height() <= 240 ) { 152 if ( QApplication::desktop()->height() <= 240 ) {
153 mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); 153 mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
154 mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); 154 mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
155 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); 155 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);
156 topLayout->addMultiCellWidget(mListView,1,1,0,5); 156 topLayout->addMultiCellWidget(mListView,1,1,0,5);
157 topLayout->addWidget(attendeeLabel,3,0); 157 topLayout->addWidget(attendeeLabel,3,0);
158 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); 158 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4);
159 topLayout->addWidget(emailLabel,4,0); 159 topLayout->addWidget(emailLabel,4,0);
160 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); 160 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4);
161 topLayout->addWidget(attendeeRoleLabel,5,0); 161 topLayout->addWidget(attendeeRoleLabel,5,0);
162 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); 162 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2);
163 topLayout->addWidget(statusLabel,5,3); 163 topLayout->addWidget(statusLabel,5,3);
164 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); 164 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5);
165 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,5); 165 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,5);
166 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 166 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
167 topLayout->addMultiCellWidget(buttonBox,3,4,5,5); 167 topLayout->addMultiCellWidget(buttonBox,3,4,5,5);
168 topLayout->setRowStretch(1,5); 168 topLayout->setRowStretch(1,5);
169 topLayout->setColStretch(0,0); 169 topLayout->setColStretch(0,0);
170 } else { 170 } else {
171 if (qApp->desktop()->width() < 640 ) { 171 if (qApp->desktop()->width() < 640 ) {
172 if ( qApp->desktop()->width() < 300 ) 172 if ( qApp->desktop()->width() < 300 )
173 topLayout->setSpacing(1); 173 topLayout->setSpacing(1);
174 ;//mListView->setFixedHeight(80); 174 ;//mListView->setFixedHeight(80);
175 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); 175 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3);
176 topLayout->addMultiCellWidget(mListView,1,1,0,3); 176 topLayout->addMultiCellWidget(mListView,1,1,0,3);
177 topLayout->addWidget(attendeeLabel,3,0); 177 topLayout->addWidget(attendeeLabel,3,0);
178 topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); 178 topLayout->addMultiCellWidget(mNameEdit,3,3,1,2);
179 topLayout->addWidget(emailLabel,4,0); 179 topLayout->addWidget(emailLabel,4,0);
180 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); 180 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2);
181 topLayout->addWidget(attendeeRoleLabel,5,0); 181 topLayout->addWidget(attendeeRoleLabel,5,0);
182 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); 182 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3);
183 topLayout->addWidget(statusLabel,6,0); 183 topLayout->addWidget(statusLabel,6,0);
184 topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); 184 topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3);
185 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); 185 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3);
186 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 186 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
187 topLayout->addMultiCellWidget(buttonBox,3,4,3,3); 187 topLayout->addMultiCellWidget(buttonBox,3,4,3,3);
188 topLayout->setRowStretch(1,2); 188 topLayout->setRowStretch(1,2);
189 topLayout->setColStretch(0,0); 189 topLayout->setColStretch(0,0);
190 topLayout->setColStretch(1,2); 190 topLayout->setColStretch(1,2);
191 topLayout->setColStretch(2,1); 191 topLayout->setColStretch(2,1);
192 topLayout->setColStretch(3,1); 192 topLayout->setColStretch(3,1);
193 } else { 193 } else {
194 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); 194 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);
195 topLayout->addMultiCellWidget(mListView,1,1,0,5); 195 topLayout->addMultiCellWidget(mListView,1,1,0,5);
196 topLayout->addWidget(attendeeLabel,3,0); 196 topLayout->addWidget(attendeeLabel,3,0);
197 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); 197 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4);
198 topLayout->addWidget(emailLabel,4,0); 198 topLayout->addWidget(emailLabel,4,0);
199 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); 199 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4);
200 topLayout->addWidget(attendeeRoleLabel,5,0); 200 topLayout->addWidget(attendeeRoleLabel,5,0);
201 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); 201 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2);
202 topLayout->addWidget(statusLabel,5,3); 202 topLayout->addWidget(statusLabel,5,3);
203 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); 203 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5);
204 topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); 204 topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5);
205 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 205 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
206 topLayout->addMultiCellWidget(buttonBox,3,4,5,5); 206 topLayout->addMultiCellWidget(buttonBox,3,4,5,5);
207 topLayout->setRowStretch(1,5); 207 topLayout->setRowStretch(1,5);
208 topLayout->setColStretch(0,0); 208 topLayout->setColStretch(0,0);
209 } 209 }
210 } 210 }
211// #if 0 211// #if 0
212// topLayout->setColStretch(2,1); 212// topLayout->setColStretch(2,1);
213// topLayout->addWidget(statusLabel,3,3); 213// topLayout->addWidget(statusLabel,3,3);
214// topLayout->addWidget(mStatusCombo,3,4); 214// topLayout->addWidget(mStatusCombo,3,4);
215// #else 215// #else
216// topLayout->addWidget(statusLabel,4,3); 216// topLayout->addWidget(statusLabel,4,3);
217// // topLayout->addWidget(mStatusCombo,4,3); 217// // topLayout->addWidget(mStatusCombo,4,3);
218// topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); 218// topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5);
219 219
220// #endif 220// #endif
221// // topLayout->setRowStretch(5,1); 221// // topLayout->setRowStretch(5,1);
222// topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); 222// topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1);
223// topLayout->addMultiCellWidget(buttonBox,2,3,5,5); 223// topLayout->addMultiCellWidget(buttonBox,2,3,5,5);
224// topLayout->setRowStretch(1,5); 224// topLayout->setRowStretch(1,5);
225// topLayout->setColStretch(0,0); 225// topLayout->setColStretch(0,0);
226 226
227#ifdef KORG_NOKABC 227#ifdef KORG_NOKABC
228 mAddressBookButton->hide(); 228 mAddressBookButton->hide();
229#endif 229#endif
230 230
231 updateAttendeeInput(); 231 updateAttendeeInput();
232#ifndef DESKTOP_VERSION 232#ifndef DESKTOP_VERSION
233//US listen for arriving address resultsets 233//US listen for arriving address resultsets
234 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&)),
235 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 235 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
236#endif 236#endif
237 237
238} 238}
239 239
240KOEditorDetails::~KOEditorDetails() 240KOEditorDetails::~KOEditorDetails()
241{ 241{
242} 242}
243 243
244void KOEditorDetails::removeAttendee() 244void KOEditorDetails::removeAttendee()
245{ 245{
246 AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem(); 246 AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem();
247 if (!aItem) return; 247 if (!aItem) return;
248 248
249 Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(), 249 Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(),
250 aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(), 250 aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(),
251 aItem->data()->uid()); 251 aItem->data()->uid());
252 mdelAttendees.append(delA); 252 mdelAttendees.append(delA);
253 253
254 delete aItem; 254 delete aItem;
255 255
256 updateAttendeeInput(); 256 updateAttendeeInput();
257} 257}
258 258
259 259
260void KOEditorDetails::openAddressBook() 260void KOEditorDetails::openAddressBook()
261{ 261{
262#ifndef KORG_NOKABC 262#ifndef KORG_NOKABC
263 263
264#ifdef DESKTOP_VERSION 264#ifdef DESKTOP_VERSION
265 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 265 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
266 uint i=0; 266 uint i=0;
267 for (i=0; i < list.count(); i++) { 267 for (i=0; i < list.count(); i++) {
268 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); 268 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) );
269 } 269 }
270#else 270#else
271 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 271 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
272 // the result should now arrive through method insertAttendees 272 // the result should now arrive through method insertAttendees
273#endif 273#endif
274 274
275 275
276#if 0 276#if 0
277 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); 277 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this);
278 if (!a.isEmpty()) { 278 if (!a.isEmpty()) {
279 insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) ); 279 insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) );
280 } 280 }
281#endif 281#endif
282#endif 282#endif
283} 283}
284 284
285 285
286void KOEditorDetails::addNewAttendee() 286void KOEditorDetails::addNewAttendee()
287{ 287{
288#if 0 288#if 0
289 // this is cool. If they didn't enter an email address, 289 // this is cool. If they didn't enter an email address,
290 // try to look it up in the address book and fill it in for them. 290 // try to look it up in the address book and fill it in for them.
291 if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) { 291 if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) {
292 KabAPI addrBook; 292 KabAPI addrBook;
293 QString name; 293 QString name;
294 std::list<AddressBook::Entry> entries; 294 std::list<AddressBook::Entry> entries;
295 name = mNameEdit->text(); 295 name = mNameEdit->text();
296 if (addrBook.init() == AddressBook::NoError) { 296 if (addrBook.init() == AddressBook::NoError) {
297 if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) { 297 if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) {
298 kdDebug() << "positive match" << endl; 298 kdDebug() << "positive match" << endl;
299 // take first email address 299 // take first email address
300 if (!entries.front().emails.isEmpty() && 300 if (!entries.front().emails.isEmpty() &&
301 entries.front().emails.first().length()>0) 301 entries.front().emails.first().length()>0)
302 mEmailEdit->setText(entries.front().emails.first()); 302 mEmailEdit->setText(entries.front().emails.first());
303 } 303 }
304 } 304 }
305 } 305 }
306#endif 306#endif
307 307
308 Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)")); 308 Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)"));
309 insertAttendee(a); 309 insertAttendee(a);
310} 310}
311 311
312//the map includes name/email pairs, that comes from Ka/Pi 312//the map includes name/email pairs, that comes from Ka/Pi
313void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) 313void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
314{ 314{
315 if (uid == this->name()) 315 if (uid == this->name())
316 { 316 {
317 for ( int i = 0; i < nameList.count(); i++) 317 for ( int i = 0; i < nameList.count(); i++)
318 { 318 {
319 QString _name = nameList[i]; 319 QString _name = nameList[i];
320 QString _email = emailList[i]; 320 QString _email = emailList[i];
321 QString _uid = uidList[i]; 321 QString _uid = uidList[i];
322 322
323 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid); 323 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid);
324 insertAttendee(a); 324 insertAttendee(a);
325 } 325 }
326 } 326 }
327 327
328} 328}
329 329
330void KOEditorDetails::insertAttendee(Attendee *a) 330void KOEditorDetails::insertAttendee(Attendee *a)
331{ 331{
332 AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild(); 332 AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild();
333 while (first) { 333 while (first) {
334 if ( first->data()->name() == a->name() && first->data()->email() == a->email() ) 334 if ( first->data()->name() == a->name() && first->data()->email() == a->email() )
335 return; 335 return;
336 first = (AttendeeListItem*) first->nextSibling(); 336 first = (AttendeeListItem*) first->nextSibling();
337 } 337 }
338 338
339 AttendeeListItem *item = new AttendeeListItem(a,mListView); 339 AttendeeListItem *item = new AttendeeListItem(a,mListView);
340 mListView->setSelected( item, true ); 340 mListView->setSelected( item, true );
341} 341}
342 342
343void KOEditorDetails::setDefaults() 343void KOEditorDetails::setDefaults()
344{ 344{
345 mRsvpButton->setChecked(true); 345 mRsvpButton->setChecked(true);
346 mListView->clear(); 346 mListView->clear();
347 mdelAttendees.clear(); 347 mdelAttendees.clear();
348 clearAttendeeInput(); 348 clearAttendeeInput();
349 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); 349 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email()));
350 350
351 mNameEdit->setText(""); 351 mNameEdit->setText("");
352 mUidEdit->setText(""); 352 mUidEdit->setText("");
353 mEmailEdit->setText(""); 353 mEmailEdit->setText("");
354 mRoleCombo->setCurrentItem( 0 ); 354 mRoleCombo->setCurrentItem( 0 );
355 mStatusCombo->setCurrentItem( 0 ); 355 mStatusCombo->setCurrentItem( 0 );
356 356
357} 357}
358 358
359void KOEditorDetails::readEvent(Incidence *event) 359void KOEditorDetails::readEvent(Incidence *event)
360{ 360{
361 setDefaults(); 361 setDefaults();
362 //mListView->clear(); 362 //mListView->clear();
363 //mdelAttendees.clear(); 363 //mdelAttendees.clear();
364 QPtrList<Attendee> tmpAList = event->attendees(); 364 QPtrList<Attendee> tmpAList = event->attendees();
365 Attendee *a; 365 Attendee *a;
366 for (a = tmpAList.first(); a; a = tmpAList.next()) 366 for (a = tmpAList.first(); a; a = tmpAList.next())
367 insertAttendee(new Attendee(*a)); 367 insertAttendee(new Attendee(*a));
368 368
369 mListView->setSelected( mListView->firstChild(), true ); 369 mListView->setSelected( mListView->firstChild(), true );
370 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); 370 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer()));
371} 371}
372 372
373void KOEditorDetails::writeEvent(Incidence *event) 373void KOEditorDetails::writeEvent(Incidence *event)
374{ 374{
375 event->clearAttendees(); 375 event->clearAttendees();
376 QListViewItem *item; 376 QListViewItem *item;
377 AttendeeListItem *a; 377 AttendeeListItem *a;
378 for (item = mListView->firstChild(); item; 378 for (item = mListView->firstChild(); item;
379 item = item->nextSibling()) { 379 item = item->nextSibling()) {
380 a = (AttendeeListItem *)item; 380 a = (AttendeeListItem *)item;
381 event->addAttendee(new Attendee(*(a->data()))); 381 event->addAttendee(new Attendee(*(a->data())));
382 } 382 }
383 event->setOrganizer(KOPrefs::instance()->email()); 383 event->setOrganizer(KOPrefs::instance()->email());
384} 384}
385 385
386void KOEditorDetails::cancelAttendeeEvent(Incidence *event) 386void KOEditorDetails::cancelAttendeeEvent(Incidence *event)
387{ 387{
388 event->clearAttendees(); 388 event->clearAttendees();
389 Attendee * att; 389 Attendee * att;
390 for (att=mdelAttendees.first();att;att=mdelAttendees.next()) { 390 for (att=mdelAttendees.first();att;att=mdelAttendees.next()) {
391 event->addAttendee(new Attendee(*att)); 391 event->addAttendee(new Attendee(*att));
392 } 392 }
393 mdelAttendees.clear(); 393 mdelAttendees.clear();
394} 394}
395 395
396bool KOEditorDetails::validateInput() 396bool KOEditorDetails::validateInput()
397{ 397{
398 return true; 398 return true;
399} 399}
400 400
401void KOEditorDetails::updateAttendeeInput() 401void KOEditorDetails::updateAttendeeInput()
402{ 402{
403 QListViewItem *item = mListView->selectedItem(); 403 QListViewItem *item = mListView->selectedItem();
404 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 404 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
405 if (aItem) { 405 if (aItem) {
406 fillAttendeeInput( aItem ); 406 fillAttendeeInput( aItem );
407 } else { 407 } else {
408 clearAttendeeInput(); 408 clearAttendeeInput();
409 } 409 }
410} 410}
411 411
412void KOEditorDetails::clearAttendeeInput() 412void KOEditorDetails::clearAttendeeInput()
413{ 413{
414 mNameEdit->setText(""); 414 mNameEdit->setText("");
415 mUidEdit->setText(""); 415 mUidEdit->setText("");
416 mEmailEdit->setText(""); 416 mEmailEdit->setText("");
417 mRoleCombo->setCurrentItem(0); 417 mRoleCombo->setCurrentItem(0);
418 mStatusCombo->setCurrentItem(0); 418 mStatusCombo->setCurrentItem(0);
419 mRsvpButton->setChecked(true); 419 mRsvpButton->setChecked(true);
420 setEnabledAttendeeInput( false ); 420 setEnabledAttendeeInput( false );
421} 421}
422 422
423void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) 423void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem )
424{ 424{
425 Attendee *a = aItem->data(); 425 Attendee *a = aItem->data();
426 mDisableItemUpdate = true; 426 mDisableItemUpdate = true;
427 mNameEdit->setText(a->name()); 427 mNameEdit->setText(a->name());
428 mUidEdit->setText(a->uid()); 428 mUidEdit->setText(a->uid());
429 mEmailEdit->setText(a->email()); 429 mEmailEdit->setText(a->email());
430 mRoleCombo->setCurrentItem(a->role()); 430 mRoleCombo->setCurrentItem(a->role());
431 mStatusCombo->setCurrentItem(a->status()); 431 mStatusCombo->setCurrentItem(a->status());
432 mRsvpButton->setChecked(a->RSVP()); 432 mRsvpButton->setChecked(a->RSVP());
433 433
434 mDisableItemUpdate = false; 434 mDisableItemUpdate = false;
435 435
436 setEnabledAttendeeInput( true ); 436 setEnabledAttendeeInput( true );
437} 437}
438 438
439void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) 439void KOEditorDetails::setEnabledAttendeeInput( bool enabled )
440{ 440{
441 mNameEdit->setEnabled( enabled ); 441 mNameEdit->setEnabled( enabled );
442 mEmailEdit->setEnabled( enabled ); 442 mEmailEdit->setEnabled( enabled );
443 mRoleCombo->setEnabled( enabled ); 443 mRoleCombo->setEnabled( enabled );
444 mStatusCombo->setEnabled( enabled ); 444 mStatusCombo->setEnabled( enabled );
445 mRsvpButton->setEnabled( enabled ); 445 mRsvpButton->setEnabled( enabled );
446 446
447 mRemoveButton->setEnabled( enabled ); 447 mRemoveButton->setEnabled( enabled );
448} 448}
449 449
450void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c ) 450void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c )
451{ 451{
452 if ( item && c == 4 ) { 452 if ( item && c == 4 ) {
453 mRsvpButton->setChecked( !mRsvpButton->isChecked() ); 453 mRsvpButton->setChecked( !mRsvpButton->isChecked() );
454 updateAttendeeItem(); 454 updateAttendeeItem();
455 } 455 }
456} 456}
457void KOEditorDetails::updateAttendeeItem() 457void KOEditorDetails::updateAttendeeItem()
458{ 458{
459 if (mDisableItemUpdate) return; 459 if (mDisableItemUpdate) return;
460 460
461 QListViewItem *item = mListView->selectedItem(); 461 QListViewItem *item = mListView->selectedItem();
462 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 462 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
463 if ( !aItem ) return; 463 if ( !aItem ) return;
464 464
465 Attendee *a = aItem->data(); 465 Attendee *a = aItem->data();
466 466
467 a->setName( mNameEdit->text() ); 467 a->setName( mNameEdit->text() );
468 a->setUid( mUidEdit->text() ); 468 a->setUid( mUidEdit->text() );
469 a->setEmail( mEmailEdit->text() ); 469 a->setEmail( mEmailEdit->text() );
470 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) ); 470 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) );
471 a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) ); 471 a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) );
472 a->setRSVP( mRsvpButton->isChecked() ); 472 a->setRSVP( mRsvpButton->isChecked() );
473 aItem->updateItem(); 473 aItem->updateItem();
474} 474}
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index bfe0aec..915c7ec 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -1,528 +1,528 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
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 <qwidget.h> 24#include <qwidget.h>
25#include <qtooltip.h> 25#include <qtooltip.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qfile.h> 33#include <qfile.h>
34 34
35 35
36#include <kglobal.h> 36#include <kglobal.h>
37#include <kdebug.h> 37#include <kdebug.h>
38#include <klocale.h> 38#include <klocale.h>
39#include <kiconloader.h> 39#include <kiconloader.h>
40#include <kmessagebox.h> 40#include <kmessagebox.h>
41#include <kfiledialog.h> 41#include <kfiledialog.h>
42#include <kstandarddirs.h> 42#include <kstandarddirs.h>
43 43
44#include <libkcal/todo.h> 44#include <libkcal/todo.h>
45#include <libkcal/event.h> 45#include <libkcal/event.h>
46#include <libkdepim/categoryselectdialog.h> 46#include <libkdepim/categoryselectdialog.h>
47#include <libkdepim/kdateedit.h> 47#include <libkdepim/kdateedit.h>
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 if ( QApplication::desktop()->height() < 320 ) 96 if ( QApplication::desktop()->height() < 320 )
97 headerLayout->addWidget(locationLabel,1,2); 97 headerLayout->addWidget(locationLabel,1,2);
98 else 98 else
99 headerLayout->addWidget(locationLabel,2,0); 99 headerLayout->addWidget(locationLabel,2,0);
100 100
101 mLocationEdit = new KOLocationBox(TRUE,parent,10); 101 mLocationEdit = new KOLocationBox(TRUE,parent,10);
102 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 102 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
103 if ( QApplication::desktop()->width() > 320 ) 103 if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 )
104 mLocationEdit->setMaximumHeight( hei + 6); 104 mLocationEdit->setMaximumHeight( hei + 6);
105 105
106 // mLocationEdit = new QLineEdit(parent); 106 // mLocationEdit = new QLineEdit(parent);
107 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 107 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
108 if ( QApplication::desktop()->height() < 320 ) { 108 if ( QApplication::desktop()->height() < 320 ) {
109 headerLayout->addWidget(mLocationEdit,1,3); 109 headerLayout->addWidget(mLocationEdit,1,3);
110 headerLayout->setColStretch( 1, 10); 110 headerLayout->setColStretch( 1, 10);
111 headerLayout->setColStretch( 3, 10); 111 headerLayout->setColStretch( 3, 10);
112 } 112 }
113 else { 113 else {
114 headerLayout->addWidget(mLocationEdit,2,1); 114 headerLayout->addWidget(mLocationEdit,2,1);
115 headerLayout->setColStretch( 1, 10); 115 headerLayout->setColStretch( 1, 10);
116 } 116 }
117} 117}
118void KOEditorGeneral::setFocusOn( int i ) 118void KOEditorGeneral::setFocusOn( int i )
119{ 119{
120 mNextFocus = i; 120 mNextFocus = i;
121 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); 121 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() ));
122} 122}
123void KOEditorGeneral::slotSetFocusOn() 123void KOEditorGeneral::slotSetFocusOn()
124{ 124{
125 mNextFocus; 125 mNextFocus;
126 if ( mNextFocus == 1 ) { 126 if ( mNextFocus == 1 ) {
127 mDescriptionEdit->setFocus(); 127 mDescriptionEdit->setFocus();
128 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); 128 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333);
129 } 129 }
130 if ( mNextFocus == 2 ) { 130 if ( mNextFocus == 2 ) {
131 mSummaryEdit->setFocus(); 131 mSummaryEdit->setFocus();
132 } 132 }
133} 133}
134void KOEditorGeneral::editCategories() 134void KOEditorGeneral::editCategories()
135{ 135{
136 // qDebug("KOEditorGeneral::editCategories() "); 136 // qDebug("KOEditorGeneral::editCategories() ");
137 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 137 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
138 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); 138 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &)));
139 //KOGlobals::fitDialogToScreen( csd ); 139 //KOGlobals::fitDialogToScreen( csd );
140 csd->setColorEnabled(); 140 csd->setColorEnabled();
141 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); 141 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) );
142 csd->exec(); 142 csd->exec();
143 delete csd; 143 delete csd;
144} 144}
145void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 145void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
146{ 146{
147 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 147 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
148 148
149 mCategoriesButton = new QPushButton(parent); 149 mCategoriesButton = new QPushButton(parent);
150 mCategoriesButton->setText(i18n("Categories...")); 150 mCategoriesButton->setText(i18n("Categories..."));
151 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 151 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
152 categoriesLayout->addWidget(mCategoriesButton); 152 categoriesLayout->addWidget(mCategoriesButton);
153 153
154 mCategoriesLabel = new QLabel(parent); 154 mCategoriesLabel = new QLabel(parent);
155 mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); 155 mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
156 categoriesLayout->addWidget(mCategoriesLabel,1); 156 categoriesLayout->addWidget(mCategoriesLabel,1);
157} 157}
158 158
159void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 159void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
160{ 160{
161 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 161 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
162 162
163 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 163 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
164 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 164 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
165 secrecyLayout->addWidget(mCancelBox); 165 secrecyLayout->addWidget(mCancelBox);
166 secrecyLayout->addWidget(secrecyLabel); 166 secrecyLayout->addWidget(secrecyLabel);
167 167
168 mSecrecyCombo = new QComboBox(parent); 168 mSecrecyCombo = new QComboBox(parent);
169 mSecrecyCombo->insertStringList(Incidence::secrecyList()); 169 mSecrecyCombo->insertStringList(Incidence::secrecyList());
170 secrecyLayout->addWidget(mSecrecyCombo); 170 secrecyLayout->addWidget(mSecrecyCombo);
171} 171}
172 172
173void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) 173void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout)
174{ 174{
175 mDescriptionEdit = new KTextEdit(parent); 175 mDescriptionEdit = new KTextEdit(parent);
176 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); 176 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont );
177 mDescriptionEdit->append(""); 177 mDescriptionEdit->append("");
178 mDescriptionEdit->setReadOnly(false); 178 mDescriptionEdit->setReadOnly(false);
179 mDescriptionEdit->setOverwriteMode(false); 179 mDescriptionEdit->setOverwriteMode(false);
180 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); 180 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth );
181 topLayout->addWidget(mDescriptionEdit); 181 topLayout->addWidget(mDescriptionEdit);
182#ifndef DESKTOP_VERSION 182#ifndef DESKTOP_VERSION
183 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); 183 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold );
184#endif 184#endif
185 185
186} 186}
187 187
188void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) 188void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
189{ 189{
190 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); 190 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout);
191 191
192 //mAlarmBell = new QLabel(parent); 192 //mAlarmBell = new QLabel(parent);
193 //mAlarmBell->setPixmap(SmallIcon("bell")); 193 //mAlarmBell->setPixmap(SmallIcon("bell"));
194 //alarmLayout->addWidget(mAlarmBell); 194 //alarmLayout->addWidget(mAlarmBell);
195 if ( QApplication::desktop()->width() < 320 ) 195 if ( QApplication::desktop()->width() < 320 )
196 mAlarmButton = new QCheckBox(i18n("Rem."),parent); 196 mAlarmButton = new QCheckBox(i18n("Rem."),parent);
197 else 197 else
198 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); 198 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent);
199 199
200 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); 200 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
201 alarmLayout->addWidget(mAlarmButton); 201 alarmLayout->addWidget(mAlarmButton);
202 202
203 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; 203 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
204 mAlarmTimeEdit->setButtonSymbols( QSpinBox::PlusMinus ); 204 mAlarmTimeEdit->setButtonSymbols( QSpinBox::PlusMinus );
205 alarmLayout->addWidget(mAlarmTimeEdit); 205 alarmLayout->addWidget(mAlarmTimeEdit);
206 mAlarmIncrCombo = new QComboBox(false, parent); 206 mAlarmIncrCombo = new QComboBox(false, parent);
207 if ( QApplication::desktop()->width() < 320 ) { 207 if ( QApplication::desktop()->width() < 320 ) {
208 mAlarmIncrCombo->insertItem(i18n("min")); 208 mAlarmIncrCombo->insertItem(i18n("min"));
209 mAlarmIncrCombo->insertItem(i18n("hou")); 209 mAlarmIncrCombo->insertItem(i18n("hou"));
210 mAlarmIncrCombo->insertItem(i18n("day")); 210 mAlarmIncrCombo->insertItem(i18n("day"));
211 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); 211 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() );
212 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); 212 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() );
213 } else { 213 } else {
214 mAlarmIncrCombo->insertItem(i18n("minute(s)")); 214 mAlarmIncrCombo->insertItem(i18n("minute(s)"));
215 mAlarmIncrCombo->insertItem(i18n("hour(s)")); 215 mAlarmIncrCombo->insertItem(i18n("hour(s)"));
216 mAlarmIncrCombo->insertItem(i18n("day(s)")); 216 mAlarmIncrCombo->insertItem(i18n("day(s)"));
217 } 217 }
218 218
219 // mAlarmIncrCombo->setMinimumHeight(20); 219 // mAlarmIncrCombo->setMinimumHeight(20);
220 alarmLayout->addWidget(mAlarmIncrCombo); 220 alarmLayout->addWidget(mAlarmIncrCombo);
221 mAlarmSoundButton = new QPushButton(parent); 221 mAlarmSoundButton = new QPushButton(parent);
222 mAlarmSoundButton->setPixmap(SmallIcon("playsound")); 222 mAlarmSoundButton->setPixmap(SmallIcon("playsound"));
223 mAlarmSoundButton->setToggleButton(true); 223 mAlarmSoundButton->setToggleButton(true);
224 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 224 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
225 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); 225 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound()));
226 alarmLayout->addWidget(mAlarmSoundButton); 226 alarmLayout->addWidget(mAlarmSoundButton);
227 227
228 mAlarmProgramButton = new QPushButton(parent); 228 mAlarmProgramButton = new QPushButton(parent);
229 mAlarmProgramButton->setPixmap(SmallIcon("run")); 229 mAlarmProgramButton->setPixmap(SmallIcon("run"));
230 mAlarmProgramButton->setToggleButton(true); 230 mAlarmProgramButton->setToggleButton(true);
231 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 231 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
232 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); 232 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram()));
233 alarmLayout->addWidget(mAlarmProgramButton); 233 alarmLayout->addWidget(mAlarmProgramButton);
234 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); 234 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 );
235 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); 235 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 );
236 // if ( KOPrefs::instance()->mCompactDialogs ) { 236 // if ( KOPrefs::instance()->mCompactDialogs ) {
237 // mAlarmSoundButton->hide(); 237 // mAlarmSoundButton->hide();
238 // mAlarmProgramButton->hide(); 238 // mAlarmProgramButton->hide();
239 // } 239 // }
240} 240}
241 241
242void KOEditorGeneral::pickAlarmSound() 242void KOEditorGeneral::pickAlarmSound()
243{ 243{
244 244
245 //qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); 245 //qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() );
246 246
247 bool oldState = mAlarmSoundButton->isOn(); 247 bool oldState = mAlarmSoundButton->isOn();
248 248
249 QString fileName(KFileDialog::getOpenFileName(mAlarmSound, 249 QString fileName(KFileDialog::getOpenFileName(mAlarmSound,
250 i18n("*.wav|Wav Files"), 0)); 250 i18n("*.wav|Wav Files"), 0));
251 if (!fileName.isEmpty()) { 251 if (!fileName.isEmpty()) {
252 mAlarmSound = fileName; 252 mAlarmSound = fileName;
253 QToolTip::remove(mAlarmSoundButton); 253 QToolTip::remove(mAlarmSoundButton);
254 QString dispStr = i18n("Playing '%1'").arg(fileName); 254 QString dispStr = i18n("Playing '%1'").arg(fileName);
255 QToolTip::add(mAlarmSoundButton, dispStr); 255 QToolTip::add(mAlarmSoundButton, dispStr);
256 mAlarmProgramButton->setOn(false); 256 mAlarmProgramButton->setOn(false);
257 mAlarmSoundButton->setOn(true); 257 mAlarmSoundButton->setOn(true);
258 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 258 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
259 } else { 259 } else {
260 mAlarmProgramButton->setOn(oldState); 260 mAlarmProgramButton->setOn(oldState);
261 mAlarmSoundButton->setOn(!oldState); 261 mAlarmSoundButton->setOn(!oldState);
262 262
263 263
264 } 264 }
265 265
266 if (mAlarmProgramButton->isOn()) 266 if (mAlarmProgramButton->isOn())
267 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 267 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
268 if ( mAlarmSoundButton->isOn()) 268 if ( mAlarmSoundButton->isOn())
269 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 269 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
270 270
271} 271}
272 272
273void KOEditorGeneral::pickAlarmProgram() 273void KOEditorGeneral::pickAlarmProgram()
274{ 274{
275 bool oldState = mAlarmProgramButton->isOn(); 275 bool oldState = mAlarmProgramButton->isOn();
276 276
277 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); 277 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0));
278 if (!fileName.isEmpty()) { 278 if (!fileName.isEmpty()) {
279 mAlarmProgram = fileName; 279 mAlarmProgram = fileName;
280 QToolTip::remove(mAlarmProgramButton); 280 QToolTip::remove(mAlarmProgramButton);
281 QString dispStr = i18n("Running '%1'").arg(fileName); 281 QString dispStr = i18n("Running '%1'").arg(fileName);
282 QToolTip::add(mAlarmProgramButton, dispStr); 282 QToolTip::add(mAlarmProgramButton, dispStr);
283 mAlarmSoundButton->setOn(false); 283 mAlarmSoundButton->setOn(false);
284 mAlarmProgramButton->setOn(true); 284 mAlarmProgramButton->setOn(true);
285 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 285 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
286 } else { 286 } else {
287 mAlarmProgramButton->setOn(!oldState); 287 mAlarmProgramButton->setOn(!oldState);
288 mAlarmSoundButton->setOn(oldState); 288 mAlarmSoundButton->setOn(oldState);
289 } 289 }
290 290
291 if (mAlarmProgramButton->isOn()) 291 if (mAlarmProgramButton->isOn())
292 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 292 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
293 if ( mAlarmSoundButton->isOn()) 293 if ( mAlarmSoundButton->isOn())
294 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 294 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
295 295
296} 296}
297 297
298 298
299QString KOEditorGeneral::getFittingPath( const QString s ) 299QString KOEditorGeneral::getFittingPath( const QString s )
300{ 300{
301 int maxlen = 50; 301 int maxlen = 50;
302 if ( QApplication::desktop()->width() < 640 ) { 302 if ( QApplication::desktop()->width() < 640 ) {
303 if ( QApplication::desktop()->width() < 320 ) 303 if ( QApplication::desktop()->width() < 320 )
304 maxlen = 22; 304 maxlen = 22;
305 else 305 else
306 maxlen = 35; 306 maxlen = 35;
307 } 307 }
308 if ( s.length() > maxlen ) { 308 if ( s.length() > maxlen ) {
309 return "..."+s.right(maxlen -3); 309 return "..."+s.right(maxlen -3);
310 } 310 }
311 return s; 311 return s;
312} 312}
313 313
314void KOEditorGeneral::enableAlarmEdit(bool enable) 314void KOEditorGeneral::enableAlarmEdit(bool enable)
315{ 315{
316 if ( enable ) { 316 if ( enable ) {
317 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { 317 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) {
318 mAlarmSoundButton->setOn( true ); 318 mAlarmSoundButton->setOn( true );
319 if ( mAlarmSound.isEmpty() ) 319 if ( mAlarmSound.isEmpty() )
320 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 320 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
321 else { 321 else {
322 if ( ! QFile::exists( mAlarmSound ) ) 322 if ( ! QFile::exists( mAlarmSound ) )
323 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 323 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
324 } 324 }
325 } 325 }
326 } 326 }
327 ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage); 327 ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage);
328 mAlarmTimeEdit->setEnabled(enable); 328 mAlarmTimeEdit->setEnabled(enable);
329 mAlarmSoundButton->setEnabled(enable); 329 mAlarmSoundButton->setEnabled(enable);
330 mAlarmProgramButton->setEnabled(enable); 330 mAlarmProgramButton->setEnabled(enable);
331 mAlarmIncrCombo->setEnabled(enable); 331 mAlarmIncrCombo->setEnabled(enable);
332} 332}
333 333
334void KOEditorGeneral::disableAlarmEdit(bool disable) 334void KOEditorGeneral::disableAlarmEdit(bool disable)
335{ 335{
336 enableAlarmEdit( !disable ); 336 enableAlarmEdit( !disable );
337} 337}
338 338
339void KOEditorGeneral::enableAlarm( bool enable ) 339void KOEditorGeneral::enableAlarm( bool enable )
340{ 340{
341 enableAlarmEdit( enable ); 341 enableAlarmEdit( enable );
342} 342}
343 343
344void KOEditorGeneral::alarmDisable(bool disable) 344void KOEditorGeneral::alarmDisable(bool disable)
345{ 345{
346 if (!disable) { 346 if (!disable) {
347 //mAlarmBell->setEnabled(true); 347 //mAlarmBell->setEnabled(true);
348 mAlarmButton->setEnabled(true); 348 mAlarmButton->setEnabled(true);
349 } else { 349 } else {
350 //mAlarmBell->setEnabled(false); 350 //mAlarmBell->setEnabled(false);
351 mAlarmButton->setEnabled(false); 351 mAlarmButton->setEnabled(false);
352 mAlarmButton->setChecked(false); 352 mAlarmButton->setChecked(false);
353 mAlarmTimeEdit->setEnabled(false); 353 mAlarmTimeEdit->setEnabled(false);
354 mAlarmSoundButton->setEnabled(false); 354 mAlarmSoundButton->setEnabled(false);
355 mAlarmProgramButton->setEnabled(false); 355 mAlarmProgramButton->setEnabled(false);
356 mAlarmIncrCombo->setEnabled(false); 356 mAlarmIncrCombo->setEnabled(false);
357 } 357 }
358} 358}
359 359
360void KOEditorGeneral::setCategories(const QString &str) 360void KOEditorGeneral::setCategories(const QString &str)
361{ 361{
362 mCategoriesLabel->setText(str); 362 mCategoriesLabel->setText(str);
363} 363}
364 364
365void KOEditorGeneral::setDefaults(bool allDay) 365void KOEditorGeneral::setDefaults(bool allDay)
366{ 366{
367#if 0 367#if 0
368 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); 368 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName());
369#endif 369#endif
370 370
371 mAlarmMessage = i18n("Edit new item"); 371 mAlarmMessage = i18n("Edit new item");
372 enableAlarmEdit( !allDay ); 372 enableAlarmEdit( !allDay );
373 373
374 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 374 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
375 int alarmTime; 375 int alarmTime;
376 int a[] = { 1,5,10,15,30,60,180, 1440 }; 376 int a[] = { 1,5,10,15,30,60,180, 1440 };
377 int index = KOPrefs::instance()->mAlarmTime; 377 int index = KOPrefs::instance()->mAlarmTime;
378 if (index < 0 || index > 7) { 378 if (index < 0 || index > 7) {
379 alarmTime = 15; 379 alarmTime = 15;
380 } else { 380 } else {
381 alarmTime = a[index]; 381 alarmTime = a[index];
382 } 382 }
383 mAlarmButton ->setChecked( false ); 383 mAlarmButton ->setChecked( false );
384 mAlarmTimeEdit->setValue(alarmTime); 384 mAlarmTimeEdit->setValue(alarmTime);
385 mAlarmIncrCombo->setCurrentItem(0); 385 mAlarmIncrCombo->setCurrentItem(0);
386 enableAlarmEdit( false ); 386 enableAlarmEdit( false );
387 //alarmDisable (false); 387 //alarmDisable (false);
388 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); 388 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic);
389 mCancelBox->setChecked( false ); 389 mCancelBox->setChecked( false );
390 mSummaryEdit->setEditText(""); 390 mSummaryEdit->setEditText("");
391 mLocationEdit->setEditText(""); 391 mLocationEdit->setEditText("");
392 mDescriptionEdit->setText(""); 392 mDescriptionEdit->setText("");
393 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 393 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
394 setCategories(""); 394 setCategories("");
395} 395}
396void KOEditorGeneral::setSecrecy( int num ) 396void KOEditorGeneral::setSecrecy( int num )
397{ 397{
398 mSecrecyCombo->setCurrentItem(num); 398 mSecrecyCombo->setCurrentItem(num);
399} 399}
400void KOEditorGeneral::readIncidence(Incidence *event) 400void KOEditorGeneral::readIncidence(Incidence *event)
401{ 401{
402 402
403 mAlarmMessage = event->summary(); 403 mAlarmMessage = event->summary();
404 if ( ! event->location().isEmpty() ) 404 if ( ! event->location().isEmpty() )
405 mAlarmMessage += " ("+event->location()+")"; 405 mAlarmMessage += " ("+event->location()+")";
406 mAlarmIncrCombo->setCurrentItem(0); 406 mAlarmIncrCombo->setCurrentItem(0);
407 mSummaryEdit->setEditText(event->summary()); 407 mSummaryEdit->setEditText(event->summary());
408 mLocationEdit->setEditText(event->location()); 408 mLocationEdit->setEditText(event->location());
409 mDescriptionEdit->setText(event->description()); 409 mDescriptionEdit->setText(event->description());
410 410
411#if 0 411#if 0
412 // organizer information 412 // organizer information
413 mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); 413 mOwnerLabel->setText(i18n("Owner: ") + event->organizer());
414#endif 414#endif
415 415
416 enableAlarmEdit( event->isAlarmEnabled() ); 416 enableAlarmEdit( event->isAlarmEnabled() );
417 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); 417 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) ");
418 if(!event->isAlarmEnabled()) { 418 if(!event->isAlarmEnabled()) {
419 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 419 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
420 int alarmTime; 420 int alarmTime;
421 int a[] = { 1,5,10,15,30,60,180, 1440 }; 421 int a[] = { 1,5,10,15,30,60,180, 1440 };
422 int index = KOPrefs::instance()->mAlarmTime; 422 int index = KOPrefs::instance()->mAlarmTime;
423 if (index < 0 || index > 7) { 423 if (index < 0 || index > 7) {
424 alarmTime = 15; 424 alarmTime = 15;
425 } else { 425 } else {
426 alarmTime = a[index]; 426 alarmTime = a[index];
427 } 427 }
428 mAlarmTimeEdit->setValue(alarmTime); 428 mAlarmTimeEdit->setValue(alarmTime);
429 } 429 }
430 mAlarmButton->setChecked( event->isAlarmEnabled() ); 430 mAlarmButton->setChecked( event->isAlarmEnabled() );
431 mSecrecyCombo->setCurrentItem(event->secrecy()); 431 mSecrecyCombo->setCurrentItem(event->secrecy());
432 mCancelBox->setChecked( event->cancelled() ); 432 mCancelBox->setChecked( event->cancelled() );
433 mAlarmProgramButton->setOn(false); 433 mAlarmProgramButton->setOn(false);
434 mAlarmSoundButton->setOn(false); 434 mAlarmSoundButton->setOn(false);
435 435
436 // set up alarm stuff 436 // set up alarm stuff
437 QPtrList<Alarm> alarms = event->alarms(); 437 QPtrList<Alarm> alarms = event->alarms();
438 Alarm* alarm; 438 Alarm* alarm;
439 mAlarmIncrCombo->setCurrentItem(0); 439 mAlarmIncrCombo->setCurrentItem(0);
440 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { 440 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) {
441 int offset; 441 int offset;
442 if ( alarm->hasTime() ) { 442 if ( alarm->hasTime() ) {
443 QDateTime t = alarm->time(); 443 QDateTime t = alarm->time();
444 offset = event->dtStart().secsTo( t ); 444 offset = event->dtStart().secsTo( t );
445 } else { 445 } else {
446 offset = alarm->startOffset().asSeconds(); 446 offset = alarm->startOffset().asSeconds();
447 } 447 }
448 if ( offset != 0 ) { 448 if ( offset != 0 ) {
449 offset = offset / -60; // make minutes 449 offset = offset / -60; // make minutes
450 if (offset % 60 == 0) { // divides evenly into hours? 450 if (offset % 60 == 0) { // divides evenly into hours?
451 offset = offset / 60; 451 offset = offset / 60;
452 mAlarmIncrCombo->setCurrentItem(1); 452 mAlarmIncrCombo->setCurrentItem(1);
453 if (offset % 24 == 0) { // divides evenly into days? 453 if (offset % 24 == 0) { // divides evenly into days?
454 offset = offset / 24; 454 offset = offset / 24;
455 mAlarmIncrCombo->setCurrentItem(2); 455 mAlarmIncrCombo->setCurrentItem(2);
456 } 456 }
457 } 457 }
458 } 458 }
459 mAlarmTimeEdit->setValue( offset ); 459 mAlarmTimeEdit->setValue( offset );
460 if (alarm->type() == Alarm::Procedure) { 460 if (alarm->type() == Alarm::Procedure) {
461 461
462 mAlarmProgram = alarm->programFile(); 462 mAlarmProgram = alarm->programFile();
463 mAlarmProgramButton->setOn(true); 463 mAlarmProgramButton->setOn(true);
464 QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); 464 QString dispStr = i18n("Running '%1'").arg(mAlarmProgram);
465 QToolTip::add(mAlarmProgramButton, dispStr); 465 QToolTip::add(mAlarmProgramButton, dispStr);
466 } 466 }
467 else if (alarm->type() == Alarm::Audio) { 467 else if (alarm->type() == Alarm::Audio) {
468 mAlarmSound = alarm->audioFile(); 468 mAlarmSound = alarm->audioFile();
469 if ( ! QFile::exists( mAlarmSound ) ) 469 if ( ! QFile::exists( mAlarmSound ) )
470 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 470 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
471 mAlarmSoundButton->setOn(true); 471 mAlarmSoundButton->setOn(true);
472 QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); 472 QString dispStr = i18n("Playing '%1'").arg(mAlarmSound);
473 QToolTip::add(mAlarmSoundButton, dispStr); 473 QToolTip::add(mAlarmSoundButton, dispStr);
474 } 474 }
475 mAlarmButton->setChecked(alarm->enabled()); 475 mAlarmButton->setChecked(alarm->enabled());
476 enableAlarmEdit( alarm->enabled() ); 476 enableAlarmEdit( alarm->enabled() );
477 //qDebug("nableAlarmEdit( alarm->enabled() )********* "); 477 //qDebug("nableAlarmEdit( alarm->enabled() )********* ");
478 // TODO: Deal with multiple alarms 478 // TODO: Deal with multiple alarms
479 break; // For now, stop after the first alarm 479 break; // For now, stop after the first alarm
480 } 480 }
481 481
482 setCategories(event->categoriesStr()); 482 setCategories(event->categoriesStr());
483} 483}
484 484
485void KOEditorGeneral::writeIncidence(Incidence *event) 485void KOEditorGeneral::writeIncidence(Incidence *event)
486{ 486{
487 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; 487 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl;
488 mLocationEdit->save(KOLocationBox::LOCATION); 488 mLocationEdit->save(KOLocationBox::LOCATION);
489 event->setSummary(mSummaryEdit->currentText()); 489 event->setSummary(mSummaryEdit->currentText());
490 event->setLocation(mLocationEdit->currentText()); 490 event->setLocation(mLocationEdit->currentText());
491 event->setDescription(mDescriptionEdit->text()); 491 event->setDescription(mDescriptionEdit->text());
492 event->setCategories(mCategoriesLabel->text()); 492 event->setCategories(mCategoriesLabel->text());
493 event->setSecrecy(mSecrecyCombo->currentItem()); 493 event->setSecrecy(mSecrecyCombo->currentItem());
494 event->setCancelled(mCancelBox->isChecked() );; 494 event->setCancelled(mCancelBox->isChecked() );;
495 // alarm stuff 495 // alarm stuff
496 if (mAlarmButton->isChecked()) { 496 if (mAlarmButton->isChecked()) {
497 if (event->alarms().count() == 0) 497 if (event->alarms().count() == 0)
498 event->newAlarm(); 498 event->newAlarm();
499 QPtrList<Alarm> alarms = event->alarms(); 499 QPtrList<Alarm> alarms = event->alarms();
500 Alarm *alarm; 500 Alarm *alarm;
501 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { 501 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {
502 alarm->setEnabled(true); 502 alarm->setEnabled(true);
503 int j = mAlarmTimeEdit->value()* -60; 503 int j = mAlarmTimeEdit->value()* -60;
504 if (mAlarmIncrCombo->currentItem() == 1) 504 if (mAlarmIncrCombo->currentItem() == 1)
505 j = j * 60; 505 j = j * 60;
506 else if (mAlarmIncrCombo->currentItem() == 2) 506 else if (mAlarmIncrCombo->currentItem() == 2)
507 j = j * (60 * 24); 507 j = j * (60 * 24);
508 alarm->setStartOffset( j ); 508 alarm->setStartOffset( j );
509 509
510 if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) { 510 if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) {
511 alarm->setProcedureAlarm(mAlarmProgram); 511 alarm->setProcedureAlarm(mAlarmProgram);
512 } 512 }
513 else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) 513 else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn())
514 alarm->setAudioAlarm(mAlarmSound); 514 alarm->setAudioAlarm(mAlarmSound);
515 else 515 else
516 alarm->setType(Alarm::Invalid); 516 alarm->setType(Alarm::Invalid);
517 //alarm->setAudioAlarm("default"); 517 //alarm->setAudioAlarm("default");
518 // TODO: Deal with multiple alarms 518 // TODO: Deal with multiple alarms
519 break; // For now, stop after the first alarm 519 break; // For now, stop after the first alarm
520 } 520 }
521 } else { 521 } else {
522 Alarm* alarm = event->alarms().first(); 522 Alarm* alarm = event->alarms().first();
523 if ( alarm ) { 523 if ( alarm ) {
524 alarm->setEnabled(false); 524 alarm->setEnabled(false);
525 alarm->setType(Alarm::Invalid); 525 alarm->setType(Alarm::Invalid);
526 } 526 }
527 } 527 }
528} 528}
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index b782bb1..3ee9a22 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,1497 +1,1539 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
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 <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kglobalsettings.h> 56#include <kglobalsettings.h>
57 57
58#include <kurlrequester.h> 58#include <kurlrequester.h>
59#include <klineedit.h> 59#include <klineedit.h>
60 60
61#if defined(USE_SOLARIS) 61#if defined(USE_SOLARIS)
62#include <sys/param.h> 62#include <sys/param.h>
63 63
64#define ZONEINFODIR "/usr/share/lib/zoneinfo" 64#define ZONEINFODIR "/usr/share/lib/zoneinfo"
65#define INITFILE "/etc/default/init" 65#define INITFILE "/etc/default/init"
66#endif 66#endif
67 67
68#include "koprefs.h" 68#include "koprefs.h"
69 69
70#include "koprefsdialog.h" 70#include "koprefsdialog.h"
71#include "kpimglobalprefs.h" 71#include "kpimglobalprefs.h"
72 72
73 73
74KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 74KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
75 KPrefsDialog(KOPrefs::instance(),parent,name,true) 75 KPrefsDialog(KOPrefs::instance(),parent,name,true)
76{ 76{
77 77
78 setFont( KGlobalSettings::generalMaxFont() ); 78 setFont( KGlobalSettings::generalMaxFont() );
79 setCaption( i18n("Preferences - some settings need a restart (nr)")); 79 setCaption( i18n("Preferences - some settings need a restart (nr)"));
80 mCategoryDict.setAutoDelete(true); 80 mCategoryDict.setAutoDelete(true);
81 81
82 KGlobal::locale()->insertCatalogue("timezones"); 82 KGlobal::locale()->insertCatalogue("timezones");
83 mSpacingHint = spacingHintSmall(); 83 mSpacingHint = spacingHintSmall();
84 mMarginHint = marginHintSmall(); 84 mMarginHint = marginHintSmall();
85#ifndef DESKTOP_VERSION 85#ifndef DESKTOP_VERSION
86 if ( QApplication::desktop()->height() == 480 ) 86 if ( QApplication::desktop()->height() == 480 )
87 hideButtons(); 87 hideButtons();
88#endif 88#endif
89 89
90 setupMainTab(); 90 setupMainTab();
91 // setupLocaleTab(); 91 // setupLocaleTab();
92 //setupTimeZoneTab(); 92 //setupTimeZoneTab();
93 setupTimeTab(); 93 setupTimeTab();
94 //setupLocaleDateTab(); 94 //setupLocaleDateTab();
95 setupFontsTab(); 95 setupFontsTab();
96 setupColorsTab(); 96 setupColorsTab();
97 setupViewsTab(); 97 setupViewsTab();
98 //setupSyncTab(); 98 //setupSyncTab();
99 //setupSyncAlgTab(); 99 //setupSyncAlgTab();
100 //setupPrinterTab(); 100 //setupPrinterTab();
101 //setupGroupSchedulingTab(); 101 //setupGroupSchedulingTab();
102 //setupGroupAutomationTab(); 102 //setupGroupAutomationTab();
103 103
104 104
105} 105}
106 106
107 107
108KOPrefsDialog::~KOPrefsDialog() 108KOPrefsDialog::~KOPrefsDialog()
109{ 109{
110} 110}
111void KOPrefsDialog::setupGlobalTab() 111void KOPrefsDialog::setupGlobalTab()
112{ 112{
113 113
114 114
115} 115}
116void KOPrefsDialog::setupLocaleDateTab() 116void KOPrefsDialog::setupLocaleDateTab()
117{ 117{
118#if 0 118#if 0
119QFrame *topFrame = addPage(i18n("Date Format"),0,0); 119QFrame *topFrame = addPage(i18n("Date Format"),0,0);
120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
121 topLayout->setSpacing(mSpacingHint); 121 topLayout->setSpacing(mSpacingHint);
122 topLayout->setMargin(mMarginHint); 122 topLayout->setMargin(mMarginHint);
123 int iii = 0; 123 int iii = 0;
124 124
125 125
126 KPrefsDialogWidRadios *syncPrefsGroup = 126 KPrefsDialogWidRadios *syncPrefsGroup =
127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
128 QString format; 128 QString format;
129 if ( QApplication::desktop()->width() < 480 ) 129 if ( QApplication::desktop()->width() < 480 )
130 format = "(%d.%m.%Y)"; 130 format = "(%d.%m.%Y)";
131 else 131 else
132 format = "(%d.%m.%Y|%A %d %B %Y)"; 132 format = "(%d.%m.%Y|%A %d %B %Y)";
133 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 133 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
134 if ( QApplication::desktop()->width() < 480 ) 134 if ( QApplication::desktop()->width() < 480 )
135 format = "(%m.%d.%Y)"; 135 format = "(%m.%d.%Y)";
136 else 136 else
137 format = "(%m.%d.%Y|%A %B %d %Y)"; 137 format = "(%m.%d.%Y|%A %B %d %Y)";
138 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 138 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
139 if ( QApplication::desktop()->width() < 480 ) 139 if ( QApplication::desktop()->width() < 480 )
140 format = "(%Y-%m-%d)"; 140 format = "(%Y-%m-%d)";
141 else 141 else
142 format = "(%Y-%m-%d|%A %Y %B %d)"; 142 format = "(%Y-%m-%d|%A %Y %B %d)";
143 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 143 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
144 syncPrefsGroup->addRadio(i18n("User defined")); 144 syncPrefsGroup->addRadio(i18n("User defined"));
145 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 145 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
146 ++iii; 146 ++iii;
147 ++iii; 147 ++iii;
148 QLabel * lab; 148 QLabel * lab;
149 mUserDateFormatLong = new QLineEdit(topFrame); 149 mUserDateFormatLong = new QLineEdit(topFrame);
150 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 150 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
151 topLayout->addWidget(lab ,iii,0); 151 topLayout->addWidget(lab ,iii,0);
152 topLayout->addWidget(mUserDateFormatLong,iii,1); 152 topLayout->addWidget(mUserDateFormatLong,iii,1);
153 ++iii; 153 ++iii;
154 mUserDateFormatShort = new QLineEdit(topFrame); 154 mUserDateFormatShort = new QLineEdit(topFrame);
155 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 155 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
156 topLayout->addWidget(lab ,iii,0); 156 topLayout->addWidget(lab ,iii,0);
157 topLayout->addWidget(mUserDateFormatShort,iii,1); 157 topLayout->addWidget(mUserDateFormatShort,iii,1);
158 ++iii; 158 ++iii;
159 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 159 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
161 ++iii; 161 ++iii;
162 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 162 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
164 ++iii; 164 ++iii;
165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
167 ++iii; 167 ++iii;
168#endif 168#endif
169 169
170} 170}
171 171
172void KOPrefsDialog::setupLocaleTab() 172void KOPrefsDialog::setupLocaleTab()
173{ 173{
174#if 0 174#if 0
175 QFrame *topFrame = addPage(i18n("Locale"),0,0); 175 QFrame *topFrame = addPage(i18n("Locale"),0,0);
176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
177 topLayout->setSpacing(mSpacingHint); 177 topLayout->setSpacing(mSpacingHint);
178 topLayout->setMargin(mMarginHint); 178 topLayout->setMargin(mMarginHint);
179 int iii = 0; 179 int iii = 0;
180 KPrefsDialogWidRadios *syncPrefsGroup = 180 KPrefsDialogWidRadios *syncPrefsGroup =
181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
182 syncPrefsGroup->addRadio(i18n("English")); 182 syncPrefsGroup->addRadio(i18n("English"));
183 syncPrefsGroup->addRadio(i18n("German")); 183 syncPrefsGroup->addRadio(i18n("German"));
184 syncPrefsGroup->addRadio(i18n("French")); 184 syncPrefsGroup->addRadio(i18n("French"));
185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
186 if ( QApplication::desktop()->width() < 300 ) 186 if ( QApplication::desktop()->width() < 300 )
187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
189 ++iii; 189 ++iii;
190 190
191 syncPrefsGroup = 191 syncPrefsGroup =
192 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 192 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
193 if ( QApplication::desktop()->width() > 300 ) 193 if ( QApplication::desktop()->width() > 300 )
194 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 194 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
195 syncPrefsGroup->addRadio(i18n("24:00")); 195 syncPrefsGroup->addRadio(i18n("24:00"));
196 syncPrefsGroup->addRadio(i18n("12:00am")); 196 syncPrefsGroup->addRadio(i18n("12:00am"));
197 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 197 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
198 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 198 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
199 ++iii; 199 ++iii;
200 KPrefsDialogWidBool *sb; 200 KPrefsDialogWidBool *sb;
201 if ( QApplication::desktop()->width() < 300 ) { 201 if ( QApplication::desktop()->width() < 300 ) {
202 sb = 202 sb =
203 addWidBool(i18n("Week starts on Sunday"), 203 addWidBool(i18n("Week starts on Sunday"),
204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
206 ++iii; 206 ++iii;
207 sb = 207 sb =
208 addWidBool(i18n("Use short date in (WN/E) view"), 208 addWidBool(i18n("Use short date in (WN/E) view"),
209 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 209 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
211 } 211 }
212 else { 212 else {
213 QWidget * hb = new QWidget( topFrame ); 213 QWidget * hb = new QWidget( topFrame );
214 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 214 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
215 sb = 215 sb =
216 addWidBool(i18n("Week starts on Sunday"), 216 addWidBool(i18n("Week starts on Sunday"),
217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
218 hbLayout->addWidget(sb->checkBox() ); 218 hbLayout->addWidget(sb->checkBox() );
219 sb = 219 sb =
220 addWidBool(i18n("Use short date in (WN/E) view"), 220 addWidBool(i18n("Use short date in (WN/E) view"),
221 &(KOPrefs::instance()->mShortDateInViewer),hb); 221 &(KOPrefs::instance()->mShortDateInViewer),hb);
222 hbLayout->addWidget(sb->checkBox() ); 222 hbLayout->addWidget(sb->checkBox() );
223 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 223 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
224 224
225 } 225 }
226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
227#if 0 227#if 0
228 ++iii; 228 ++iii;
229 sb = 229 sb =
230 addWidBool(i18n("Quick load/save (w/o Unicode)"), 230 addWidBool(i18n("Quick load/save (w/o Unicode)"),
231 &(KOPrefs::instance()->mUseQuicksave),topFrame); 231 &(KOPrefs::instance()->mUseQuicksave),topFrame);
232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
233#endif 233#endif
234#endif 234#endif
235} 235}
236 236
237void KOPrefsDialog::setupMainTab() 237void KOPrefsDialog::setupMainTab()
238{ 238{
239 QFrame *topFrame = addPage(i18n("General"),0,0); 239 QFrame *topFrame = addPage(i18n("General"),0,0);
240 // DesktopIcon("identity",KIcon::SizeMedium)); 240 // DesktopIcon("identity",KIcon::SizeMedium));
241 241
242 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 242 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
243 topLayout->setSpacing(mSpacingHint); 243 topLayout->setSpacing(mSpacingHint);
244 topLayout->setMargin(mMarginHint); 244 topLayout->setMargin(mMarginHint);
245 245
246 // KPrefsDialogWidBool *emailControlCenter = 246 // KPrefsDialogWidBool *emailControlCenter =
247// addWidBool(i18n("&Use email settings from Control Center"), 247// addWidBool(i18n("&Use email settings from Control Center"),
248// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 248// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
249// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 249// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
250 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 250 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
251 // SLOT(toggleEmailSettings(bool))); 251 // SLOT(toggleEmailSettings(bool)));
252 252
253 mNameEdit = new QLineEdit(topFrame); 253 mNameEdit = new QLineEdit(topFrame);
254 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 254 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
255 topLayout->addWidget(mNameLabel,0,0); 255 topLayout->addWidget(mNameLabel,0,0);
256 topLayout->addWidget(mNameEdit,0,1); 256 topLayout->addWidget(mNameEdit,0,1);
257 257
258 mEmailEdit = new QLineEdit(topFrame); 258 mEmailEdit = new QLineEdit(topFrame);
259 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 259 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
260 topLayout->addWidget(mEmailLabel,1,0); 260 topLayout->addWidget(mEmailLabel,1,0);
261 topLayout->addWidget(mEmailEdit,1,1); 261 topLayout->addWidget(mEmailEdit,1,1);
262 KPrefsDialogWidBool *wb; 262 KPrefsDialogWidBool *wb;
263 263
264 264
265 265
266 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), 266 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"),
267 &(KOPrefs::instance()->mShowFullMenu),topFrame); 267 &(KOPrefs::instance()->mShowFullMenu),topFrame);
268 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); 268 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1);
269 269
270 270
271 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), 271 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"),
272 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); 272 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame);
273 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); 273 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1);
274 274
275 275
276 KPrefsDialogWidBool *verticalScreen = 276 KPrefsDialogWidBool *verticalScreen =
277 addWidBool(i18n("Show vertical screen (Needs restart)"), 277 addWidBool(i18n("Show vertical screen (Needs restart)"),
278 &(KOPrefs::instance()->mVerticalScreen),topFrame); 278 &(KOPrefs::instance()->mVerticalScreen),topFrame);
279 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 279 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
280 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); 280 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1);
281 281
282 282
283 int iii = 5; 283 int iii = 5;
284 widbool = addWidBool(i18n("Block popup until mouse button release"), 284 widbool = addWidBool(i18n("Block popup until mouse button release"),
285 &(KOPrefs::instance()->mBlockPopupMenu),topFrame); 285 &(KOPrefs::instance()->mBlockPopupMenu),topFrame);
286 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); 286 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1);
287 ++iii; 287 ++iii;
288 if ( QApplication::desktop()->height() <= 240 ) {
289 topFrame = addPage(i18n("General") +" 2",0,0);
290 topLayout = new QGridLayout(topFrame,4,2);
291 topLayout->setSpacing(2);
292 topLayout->setMargin(3);
293 iii = 0;
294 }
288 QHBox *dummy = new QHBox(topFrame); 295 QHBox *dummy = new QHBox(topFrame);
289 new QLabel(i18n("Days in Next-X-Days:"),dummy); 296 new QLabel(i18n("Days in Next-X-Days:"),dummy);
290 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 297 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
291 298
292 topLayout->addMultiCellWidget(dummy,iii,iii,0,1); 299 topLayout->addMultiCellWidget(dummy,iii,iii,0,1);
293 300
294 ++iii; 301 ++iii;
295 302
296 303
297 // KPrefsDialogWidBool *bcc = 304 // KPrefsDialogWidBool *bcc =
298// addWidBool(i18n("Send copy to owner when mailing events"), 305// addWidBool(i18n("Send copy to owner when mailing events"),
299// &(KOPrefs::instance()->mBcc),topFrame); 306// &(KOPrefs::instance()->mBcc),topFrame);
300// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 307// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
301 308
302 309
303 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 310 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
304 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 311 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
305 312
306 // addWidBool(i18n("Enable automatic saving of calendar"), 313 // addWidBool(i18n("Enable automatic saving of calendar"),
307 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 314 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
308 315
309 QHBox *intervalBox = new QHBox(topFrame); 316 QHBox *intervalBox = new QHBox(topFrame);
310 // intervalBox->setSpacing(mSpacingHint); 317 // intervalBox->setSpacing(mSpacingHint);
311 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); 318 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1);
312 ++iii; 319 ++iii;
313 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 320 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
314 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 321 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
315 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 322 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
316 /* 323 /*
317 QHBox * agendasize = new QHBox ( topFrame ); 324 QHBox * agendasize = new QHBox ( topFrame );
318 325
319 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 326 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
320 327
321 328
322 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 329 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
323 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 330 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
324 */ 331 */
325 332
326 333
327 KPrefsDialogWidBool *ask = 334 KPrefsDialogWidBool *ask =
328 addWidBool(i18n("Ask for quit when closing KO/Pi"), 335 addWidBool(i18n("Ask for quit when closing KO/Pi"),
329 &(KOPrefs::instance()->mAskForQuit),topFrame); 336 &(KOPrefs::instance()->mAskForQuit),topFrame);
330 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1); 337 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1);
331 ++iii; 338 ++iii;
332 339
333 340
334 /* 341 /*
335 KPrefsDialogWidBool *confirmCheck = 342 KPrefsDialogWidBool *confirmCheck =
336 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 343 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
337 topFrame); 344 topFrame);
338 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 345 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
339 346
340 347
341 mEnableGroupScheduling = 348 mEnableGroupScheduling =
342 addWidBool(i18n("Enable group scheduling"), 349 addWidBool(i18n("Enable group scheduling"),
343 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 350 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
344 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 351 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
345 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 352 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
346 SLOT(warningGroupScheduling())); 353 SLOT(warningGroupScheduling()));
347 354
348 mEnableProjectView = 355 mEnableProjectView =
349 addWidBool(i18n("Enable project view"), 356 addWidBool(i18n("Enable project view"),
350 &(KOPrefs::instance()->mEnableProjectView),topFrame); 357 &(KOPrefs::instance()->mEnableProjectView),topFrame);
351 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 358 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
352 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 359 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
353 SLOT(warningProjectView())); 360 SLOT(warningProjectView()));
354 361
355 // Can't be disabled anymore 362 // Can't be disabled anymore
356 mEnableGroupScheduling->checkBox()->hide(); 363 mEnableGroupScheduling->checkBox()->hide();
357 364
358 // Disable setting, because this feature now becomes stable 365 // Disable setting, because this feature now becomes stable
359 mEnableProjectView->checkBox()->hide(); 366 mEnableProjectView->checkBox()->hide();
360 367
361 KPrefsDialogWidRadios *defaultFormatGroup = 368 KPrefsDialogWidRadios *defaultFormatGroup =
362 addWidRadios(i18n("Default Calendar Format"), 369 addWidRadios(i18n("Default Calendar Format"),
363 &(KOPrefs::instance()->mDefaultFormat),topFrame); 370 &(KOPrefs::instance()->mDefaultFormat),topFrame);
364 defaultFormatGroup->addRadio(i18n("vCalendar")); 371 defaultFormatGroup->addRadio(i18n("vCalendar"));
365 defaultFormatGroup->addRadio(i18n("iCalendar")); 372 defaultFormatGroup->addRadio(i18n("iCalendar"));
366 373
367 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 374 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
368 375
369 // Default format unconditionally is iCalendar 376 // Default format unconditionally is iCalendar
370 defaultFormatGroup->groupBox()->hide(); 377 defaultFormatGroup->groupBox()->hide();
371 378
372 KPrefsDialogWidRadios *mailClientGroup = 379 KPrefsDialogWidRadios *mailClientGroup =
373 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 380 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
374 topFrame); 381 topFrame);
375 mailClientGroup->addRadio(i18n("KMail")); 382 mailClientGroup->addRadio(i18n("KMail"));
376 mailClientGroup->addRadio(i18n("Sendmail")); 383 mailClientGroup->addRadio(i18n("Sendmail"));
377 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 384 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
378 385
379 KPrefsDialogWidBool *htmlsave = 386 KPrefsDialogWidBool *htmlsave =
380 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 387 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
381 topFrame); 388 topFrame);
382 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 389 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
383 390
384 KPrefsDialogWidRadios *destinationGroup = 391 KPrefsDialogWidRadios *destinationGroup =
385 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 392 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
386 topFrame); 393 topFrame);
387 destinationGroup->addRadio(i18n("be added to the standard resource")); 394 destinationGroup->addRadio(i18n("be added to the standard resource"));
388 destinationGroup->addRadio(i18n("be asked which resource to use")); 395 destinationGroup->addRadio(i18n("be asked which resource to use"));
389 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 396 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
390 397
391 topLayout->setRowStretch(14,1); 398 topLayout->setRowStretch(14,1);
392 */ 399 */
393} 400}
394 401
395 402
396void KOPrefsDialog::setupTimeTab() 403void KOPrefsDialog::setupTimeTab()
397{ 404{
398 QFrame *topFrame = addPage(i18n("Time"),0,0); 405 QFrame *topFrame = addPage(i18n("Time"),0,0);
399 // DesktopIcon("clock",KIcon::SizeMedium)); 406 // DesktopIcon("clock",KIcon::SizeMedium));
400 407
401 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 408 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
402 topLayout->setSpacing(mSpacingHint); 409 topLayout->setSpacing(mSpacingHint);
403 topLayout->setMargin(mMarginHint); 410 topLayout->setMargin(mMarginHint);
404 411
405 QHBox *dummy = new QHBox(topFrame); 412 QHBox *dummy = new QHBox(topFrame);
406 KPrefsDialogWidTime *dayBegins = 413 KPrefsDialogWidTime *dayBegins =
407 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 414 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
408 dummy); 415 dummy);
409 //topLayout->addWidget(dayBegins->label(),2,0); 416 //topLayout->addWidget(dayBegins->label(),2,0);
410 417
411 //topLayout->addWidget(dayBegins->spinBox(),2,1); 418 //topLayout->addWidget(dayBegins->spinBox(),2,1);
412 topLayout->addMultiCellWidget(dummy,0,0,0,1); 419 topLayout->addMultiCellWidget(dummy,0,0,0,1);
413 420
414 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 421 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
415 topFrame),1,0); 422 topFrame),1,0);
416 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 423 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
417 mStartTimeSpin->setSuffix(":00"); 424 mStartTimeSpin->setSuffix(":00");
418 topLayout->addWidget(mStartTimeSpin,1,1); 425 topLayout->addWidget(mStartTimeSpin,1,1);
419 426
420 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 427 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
421 topFrame),2,0); 428 topFrame),2,0);
422 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 429 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
423 mDefaultDurationSpin->setSuffix(":00"); 430 mDefaultDurationSpin->setSuffix(":00");
424 topLayout->addWidget(mDefaultDurationSpin,2,1); 431 topLayout->addWidget(mDefaultDurationSpin,2,1);
425 432
426 QStringList alarmList; 433 QStringList alarmList;
427 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 434 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
428 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 435 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
429 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 436 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
430 3,0); 437 3,0);
431 mAlarmTimeCombo = new QComboBox(topFrame); 438 mAlarmTimeCombo = new QComboBox(topFrame);
432 mAlarmTimeCombo->insertStringList(alarmList); 439 mAlarmTimeCombo->insertStringList(alarmList);
433 topLayout->addWidget(mAlarmTimeCombo,3,1); 440 topLayout->addWidget(mAlarmTimeCombo,3,1);
434 441 int iii = 4;
442 if ( QApplication::desktop()->height() <= 240 ) {
443 topFrame = addPage(i18n("Time") +" 2",0,0);
444 topLayout = new QGridLayout(topFrame,1,2);
445 topLayout->setSpacing(2);
446 topLayout->setMargin(3);
447 iii = 0;
448 }
435 449
436 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 450 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
437 i18n("Working Hours"), 451 i18n("Working Hours"),
438 topFrame); 452 topFrame);
439 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 453 topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1);
440 workingHoursGroup->layout()->setSpacing( 0 ); 454 workingHoursGroup->layout()->setSpacing( 0 );
441 workingHoursGroup->layout()->setMargin( 4 ); 455 workingHoursGroup->layout()->setMargin( 4 );
442 QHBox *workStartBox = new QHBox(workingHoursGroup); 456 QHBox *workStartBox = new QHBox(workingHoursGroup);
443 // workStartBox->setMargin( 0 ); 457 // workStartBox->setMargin( 0 );
444 addWidTime(i18n("Daily starting hour:"), 458 addWidTime(i18n("Daily starting hour:"),
445 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 459 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
446 460
447 QHBox *workEndBox = new QHBox(workingHoursGroup); 461 QHBox *workEndBox = new QHBox(workingHoursGroup);
448 //workEndBox->setMargin( 0 ); 462 //workEndBox->setMargin( 0 );
449 addWidTime(i18n("Daily ending hour:"), 463 addWidTime(i18n("Daily ending hour:"),
450 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 464 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
451 QVBox *excludeBox = new QVBox(workingHoursGroup); 465 QVBox *excludeBox = new QVBox(workingHoursGroup);
452 //excludeBox->setMargin( 0 ); 466 //excludeBox->setMargin( 0 );
453 addWidBool(i18n("Exclude holidays"), 467 addWidBool(i18n("Exclude holidays"),
454 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 468 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
455 469
456 addWidBool(i18n("Exclude Saturdays"), 470 addWidBool(i18n("Exclude Saturdays"),
457 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 471 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
458 472
459// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 473// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
460 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 474 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
461 // topFrame); 475 // topFrame);
462// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 476// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
463 477
464 // topLayout->setRowStretch(6,1); 478 // topLayout->setRowStretch(6,1);
465} 479}
466 480
467 481
468void KOPrefsDialog::setupViewsTab() 482void KOPrefsDialog::setupViewsTab()
469{ 483{
470 484
471 QFrame *topFrame = addPage(i18n("Views"),0,0); 485 QFrame *topFrame = addPage(i18n("Views"),0,0);
472 // DesktopIcon("viewmag",KIcon::SizeMedium)); 486 // DesktopIcon("viewmag",KIcon::SizeMedium));
473 487
474 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 488 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
475 topLayout->setSpacing(mSpacingHint); 489 topLayout->setSpacing(mSpacingHint);
476 topLayout->setMargin(mMarginHint); 490 topLayout->setMargin(mMarginHint);
477 491
478// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 492// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
479// topLayout->addLayout(dayBeginsLayout,0,0); 493// topLayout->addLayout(dayBeginsLayout,0,0);
480 494
481// KPrefsDialogWidTime *dayBegins = 495// KPrefsDialogWidTime *dayBegins =
482// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 496// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
483// topFrame); 497// topFrame);
484// dayBeginsLayout->addWidget(dayBegins->label()); 498// dayBeginsLayout->addWidget(dayBegins->label());
485// dayBeginsLayout->addStretch(1); 499// dayBeginsLayout->addStretch(1);
486// dayBeginsLayout->addWidget(dayBegins->spinBox()); 500// dayBeginsLayout->addWidget(dayBegins->spinBox());
487 501
488// QBoxLayout *nextDaysLayout = new QHBoxLayout; 502// QBoxLayout *nextDaysLayout = new QHBoxLayout;
489// topLayout->addLayout(nextDaysLayout,1,0); 503// topLayout->addLayout(nextDaysLayout,1,0);
490// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 504// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
491// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 505// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
492// nextDaysLayout->addStretch(1); 506// nextDaysLayout->addStretch(1);
493// nextDaysLayout->addWidget(mNextXDaysSpin); 507// nextDaysLayout->addWidget(mNextXDaysSpin);
494 508
495 509
496 int ii = 0; 510 int ii = 0;
497 KPrefsDialogWidBool *dummy = 511 KPrefsDialogWidBool *dummy =
498 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 512 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
499 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 513 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
500 topLayout->addWidget(dummy->checkBox(),ii++,0); 514 topLayout->addWidget(dummy->checkBox(),ii++,0);
501 515
502 516
503 517
504 518
505 519
506 520
507 // topLayout->addWidget(hourSizeGroup,ii++,0); 521 // topLayout->addWidget(hourSizeGroup,ii++,0);
508 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 522 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
509 //topLayout->setRowStretch(11,1); 523 //topLayout->setRowStretch(11,1);
510 524
511 525
512 526
513 527
514#if 0 528#if 0
515 529
516 topFrame = addPage(i18n("ViewChange"),0,0); 530 topFrame = addPage(i18n("ViewChange"),0,0);
517 // DesktopIcon("viewmag",KIcon::SizeMedium)); 531 // DesktopIcon("viewmag",KIcon::SizeMedium));
518 532
519 topLayout = new QGridLayout(topFrame,6,1); 533 topLayout = new QGridLayout(topFrame,6,1);
520 topLayout->setSpacing(mSpacingHint); 534 topLayout->setSpacing(mSpacingHint);
521 topLayout->setMargin(mMarginHint); 535 topLayout->setMargin(mMarginHint);
522 ii = 0; 536 ii = 0;
523 537
524#endif 538#endif
525 539
526 dummy = 540 dummy =
527 addWidBool(i18n("Hold fullscreen on view change"), 541 addWidBool(i18n("Hold fullscreen on view change"),
528 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 542 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
529 topLayout->addWidget(dummy->checkBox(),ii++,0); 543 topLayout->addWidget(dummy->checkBox(),ii++,0);
530 544
531 dummy = 545 dummy =
532 addWidBool(i18n("Hold non-fullscreen on view change"), 546 addWidBool(i18n("Hold non-fullscreen on view change"),
533 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 547 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
534 topLayout->addWidget(dummy->checkBox(),ii++,0); 548 topLayout->addWidget(dummy->checkBox(),ii++,0);
535 549
536 550
537 551
538 KPrefsDialogWidBool *fullViewMonth = 552 KPrefsDialogWidBool *fullViewMonth =
539 addWidBool(i18n("Next days view uses full window"), 553 addWidBool(i18n("Next days view uses full window"),
540 &(KOPrefs::instance()->mFullViewMonth),topFrame); 554 &(KOPrefs::instance()->mFullViewMonth),topFrame);
541 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 555 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
542 556
543 557
544 KPrefsDialogWidBool *fullViewTodo = 558 KPrefsDialogWidBool *fullViewTodo =
545 addWidBool(i18n("Event list view uses full window"), 559 addWidBool(i18n("Event list view uses full window"),
546 &(KOPrefs::instance()->mFullViewTodo),topFrame); 560 &(KOPrefs::instance()->mFullViewTodo),topFrame);
547 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 561 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
548 dummy = 562 dummy =
549 addWidBool(i18n("Listview uses monthly timespan"), 563 addWidBool(i18n("Listview uses monthly timespan"),
550 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 564 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
551 topLayout->addWidget(dummy->checkBox(),ii++,0); 565 topLayout->addWidget(dummy->checkBox(),ii++,0);
552 dummy = 566 dummy =
553 addWidBool(i18n("Highlight selection in Time Edit"), 567 addWidBool(i18n("Highlight selection in Time Edit"),
554 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 568 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
555 topLayout->addWidget( dummy->checkBox(), ii++,0); 569 topLayout->addWidget( dummy->checkBox(), ii++,0);
556 570
557 KPrefsDialogWidBool *dailyRecur = 571 KPrefsDialogWidBool *dailyRecur =
558 addWidBool(i18n("Show events that recur daily in date nav."), 572 addWidBool(i18n("Show events that recur daily in date nav."),
559 &(KOPrefs::instance()->mDailyRecur),topFrame); 573 &(KOPrefs::instance()->mDailyRecur),topFrame);
560 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 574 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
561 575
562 KPrefsDialogWidBool *weeklyRecur = 576 KPrefsDialogWidBool *weeklyRecur =
563 addWidBool(i18n("Show ev. that recur weekly in date nav."), 577 addWidBool(i18n("Show ev. that recur weekly in date nav."),
564 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 578 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
565 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 579 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
566 580
567#ifdef DESKTOP_VERSION 581#ifdef DESKTOP_VERSION
568 KPrefsDialogWidBool *enableToolTips = 582 KPrefsDialogWidBool *enableToolTips =
569 addWidBool(i18n("Enable tooltips displaying summary of ev."), 583 addWidBool(i18n("Enable tooltips displaying summary of ev."),
570 &(KOPrefs::instance()->mEnableToolTips),topFrame); 584 &(KOPrefs::instance()->mEnableToolTips),topFrame);
571 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 585 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
572#endif 586#endif
573 // ********************************************************* 587 // *********************************************************
574 588
575 topFrame = addPage(i18n("Agenda View"),0,0); 589 topFrame = addPage(i18n("Agenda View"),0,0);
576 // DesktopIcon("viewmag",KIcon::SizeMedium)); 590 // DesktopIcon("viewmag",KIcon::SizeMedium));
577 591
578 topLayout = new QGridLayout(topFrame,5,1); 592 topLayout = new QGridLayout(topFrame,5,1);
579 topLayout->setSpacing(mSpacingHint); 593 topLayout->setSpacing(mSpacingHint);
580 topLayout->setMargin(mMarginHint); 594 topLayout->setMargin(mMarginHint);
581 ii = 0; 595 ii = 0;
582 596
583 597
584 dummy = 598 dummy =
585 addWidBool(i18n("Show time in agenda items"), 599 addWidBool(i18n("Show time in agenda items"),
586 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 600 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
587 topLayout->addWidget(dummy->checkBox(),ii++,0); 601 topLayout->addWidget(dummy->checkBox(),ii++,0);
588 602
589 dummy = 603 dummy =
590 addWidBool(i18n("Highlight current day in agenda"), 604 addWidBool(i18n("Highlight current day in agenda"),
591 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 605 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
592 topLayout->addWidget(dummy->checkBox(),ii++,0); 606 topLayout->addWidget(dummy->checkBox(),ii++,0);
593 607
594 dummy = 608 dummy =
595 addWidBool(i18n("Use light color for highlight current day"), 609 addWidBool(i18n("Use light color for highlight current day"),
596 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 610 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
597 topLayout->addWidget(dummy->checkBox(),ii++,0); 611 topLayout->addWidget(dummy->checkBox(),ii++,0);
598 612
599 613
600 KPrefsDialogWidBool *marcusBainsEnabled = 614 KPrefsDialogWidBool *marcusBainsEnabled =
601 addWidBool(i18n("Show current time"), 615 addWidBool(i18n("Show current time"),
602 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 616 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
603 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 617 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
604 618
605 619
606 dummy = 620 dummy =
607 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 621 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
608 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 622 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
609 topLayout->addWidget(dummy->checkBox(),ii++,0); 623 topLayout->addWidget(dummy->checkBox(),ii++,0);
610 624
611 dummy = 625 dummy =
612 addWidBool(i18n("Set agenda to current time on change"), 626 addWidBool(i18n("Set agenda to current time on change"),
613 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 627 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
614 topLayout->addWidget(dummy->checkBox(),ii++,0); 628 topLayout->addWidget(dummy->checkBox(),ii++,0);
615 629
616 630
617 dummy = 631 dummy =
618 addWidBool(i18n("Allday Agenda view shows todos"), 632 addWidBool(i18n("Allday Agenda view shows todos"),
619 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 633 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
620 topLayout->addWidget(dummy->checkBox(),ii++,0); 634 topLayout->addWidget(dummy->checkBox(),ii++,0);
621 635
622 636
623 637
624 dummy = 638 dummy =
625 addWidBool(i18n("Agenda view shows completed todos"), 639 addWidBool(i18n("Agenda view shows completed todos"),
626 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame); 640 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame);
627 topLayout->addWidget(dummy->checkBox(),ii++,0); 641 topLayout->addWidget(dummy->checkBox(),ii++,0);
628 642
629 643
630 644
631 645
632 646
633 topFrame = addPage(i18n("Month View"),0,0); 647 topFrame = addPage(i18n("Month View"),0,0);
634 // DesktopIcon("viewmag",KIcon::SizeMedium)); 648 // DesktopIcon("viewmag",KIcon::SizeMedium));
635 649
636 topLayout = new QGridLayout(topFrame,5,1); 650 topLayout = new QGridLayout(topFrame,5,1);
637 topLayout->setSpacing(mSpacingHint); 651 topLayout->setSpacing(mSpacingHint);
638 topLayout->setMargin(mMarginHint); 652 topLayout->setMargin(mMarginHint);
639 ii = 0; 653 ii = 0;
640 QLabel *lab; 654 QLabel *lab;
641 QHBox *habo = new QHBox( topFrame ); 655 QHBox *habo = new QHBox( topFrame );
642 if ( QApplication::desktop()->width() <= 480 ) { 656 if ( QApplication::desktop()->width() <= 480 ) {
643 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 657 lab = new QLabel ( i18n("Show events that recur "), topFrame );
644 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 658 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
645 ii++; 659 ii++;
646 } else { 660 } else {
647 new QLabel ( i18n("Show events that recur "), habo ); 661 new QLabel ( i18n("Show events that recur "), habo );
648 } 662 }
649 dailyRecur = 663 dailyRecur =
650 addWidBool(i18n("daily"), 664 addWidBool(i18n("daily"),
651 &(KOPrefs::instance()->mMonthDailyRecur),habo); 665 &(KOPrefs::instance()->mMonthDailyRecur),habo);
652 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 666 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
653 667
654 weeklyRecur = 668 weeklyRecur =
655 addWidBool(i18n("weekly"), 669 addWidBool(i18n("weekly"),
656 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 670 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
657 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 671 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
658 ii++; 672 ii++;
659 673
660 674
661 habo = new QHBox( topFrame ); 675 habo = new QHBox( topFrame );
662 if ( QApplication::desktop()->width() <= 480 ) { 676 if ( QApplication::desktop()->width() <= 480 ) {
663 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 677 lab = new QLabel (i18n("Show in every cell ") , topFrame );
664 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 678 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
665 ii++; 679 ii++;
666 680
667 } else { 681 } else {
668 new QLabel ( i18n("Show in every cell "), habo ); 682 new QLabel ( i18n("Show in every cell "), habo );
669 } 683 }
670 weeklyRecur = 684 weeklyRecur =
671 addWidBool(i18n("short month"), 685 addWidBool(i18n("short month"),
672 &(KOPrefs::instance()->mMonthShowShort),habo); 686 &(KOPrefs::instance()->mMonthShowShort),habo);
673 weeklyRecur = 687 weeklyRecur =
674 addWidBool(i18n("icons"), 688 addWidBool(i18n("icons"),
675 &(KOPrefs::instance()->mMonthShowIcons),habo); 689 &(KOPrefs::instance()->mMonthShowIcons),habo);
676 weeklyRecur = 690 weeklyRecur =
677 addWidBool(i18n("times"), 691 addWidBool(i18n("times"),
678 &(KOPrefs::instance()->mMonthShowTimes),habo); 692 &(KOPrefs::instance()->mMonthShowTimes),habo);
679 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 693 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
680 ii++; 694 ii++;
681#ifdef DESKTOP_VERSION 695#ifdef DESKTOP_VERSION
682 KPrefsDialogWidBool *enableMonthScroll = 696 KPrefsDialogWidBool *enableMonthScroll =
683 addWidBool(i18n("Enable scrollbars in month view cells"), 697 addWidBool(i18n("Enable scrollbars in month view cells"),
684 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 698 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
685 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 699 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
686#endif 700#endif
687 dummy = 701 dummy =
688 addWidBool(i18n("Week view mode uses bigger font"), 702 addWidBool(i18n("Week view mode uses bigger font"),
689 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); 703 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame);
690 topLayout->addWidget(dummy->checkBox(),ii++,0); 704 topLayout->addWidget(dummy->checkBox(),ii++,0);
691 dummy = 705 dummy =
692 addWidBool(i18n("Show Sat/Sun together"), 706 addWidBool(i18n("Show Sat/Sun together"),
693 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 707 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
694 topLayout->addWidget(dummy->checkBox(),ii++,0); 708 topLayout->addWidget(dummy->checkBox(),ii++,0);
695 709
696 KPrefsDialogWidBool *coloredCategoriesInMonthView = 710 KPrefsDialogWidBool *coloredCategoriesInMonthView =
697 addWidBool(i18n("Month view uses category colors"), 711 addWidBool(i18n("Month view uses category colors"),
698 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 712 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
699 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 713 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
700 714
701 dummy = 715 dummy =
702 addWidBool(i18n("Category colors are applied to text"), 716 addWidBool(i18n("Category colors are applied to text"),
703 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 717 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
704 topLayout->addWidget(dummy->checkBox(),ii++,0); 718 topLayout->addWidget(dummy->checkBox(),ii++,0);
719
720
721
722 if ( QApplication::desktop()->height() <= 240 ) {
723 topFrame = addPage(i18n("Month View") +" 2",0,0);
724 topLayout = new QGridLayout(topFrame,4,1);
725 topLayout->setSpacing(2);
726 topLayout->setMargin(1);
727 ii = 0;
728 }
729
730
705 coloredCategoriesInMonthView = 731 coloredCategoriesInMonthView =
706 addWidBool(i18n("Month view uses day colors"), 732 addWidBool(i18n("Month view uses day colors"),
707 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 733 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
708 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 734 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
709 735
710 KPrefsDialogWidColor *holidayColor = 736 KPrefsDialogWidColor *holidayColor =
711 addWidColor(i18n("Day color odd months"), 737 addWidColor(i18n("Day color odd months"),
712 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 738 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
713 topLayout->addWidget(holidayColor->label(),ii,0); 739 topLayout->addWidget(holidayColor->label(),ii,0);
714 topLayout->addWidget(holidayColor->button(),ii++,1); 740 topLayout->addWidget(holidayColor->button(),ii++,1);
715 741
716 holidayColor = 742 holidayColor =
717 addWidColor(i18n("Day color even months"), 743 addWidColor(i18n("Day color even months"),
718 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 744 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
719 topLayout->addWidget(holidayColor->label(),ii,0); 745 topLayout->addWidget(holidayColor->label(),ii,0);
720 topLayout->addWidget(holidayColor->button(),ii++,1); 746 topLayout->addWidget(holidayColor->button(),ii++,1);
721 747
722 748
723 holidayColor = 749 holidayColor =
724 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 750 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
725 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 751 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
726 topLayout->addWidget(holidayColor->label(),ii,0); 752 topLayout->addWidget(holidayColor->label(),ii,0);
727 topLayout->addWidget(holidayColor->button(),ii++,1); 753 topLayout->addWidget(holidayColor->button(),ii++,1);
728 // *********************** What'sNext View 754 // *********************** What'sNext View
729 topFrame = addPage(i18n("What's Next View"),0,0); 755 topFrame = addPage(i18n("What's Next View"),0,0);
730 // DesktopIcon("viewmag",KIcon::SizeMedium)); 756 // DesktopIcon("viewmag",KIcon::SizeMedium));
731 757
732 topLayout = new QGridLayout(topFrame,4,1); 758 topLayout = new QGridLayout(topFrame,4,1);
733 topLayout->setSpacing(mSpacingHint); 759 topLayout->setSpacing(mSpacingHint);
734 topLayout->setMargin(mMarginHint); 760 topLayout->setMargin(mMarginHint);
735 ii = 0; 761 ii = 0;
736 762
737 763
738 QHBox* hdummy = new QHBox(topFrame); 764 QHBox* hdummy = new QHBox(topFrame);
739 new QLabel(i18n("Days in What's Next:"),hdummy); 765 new QLabel(i18n("Days in What's Next:"),hdummy);
740 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); 766 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy);
741 767
742 topLayout->addWidget(hdummy,ii++,0); 768 topLayout->addWidget(hdummy,ii++,0);
743 769
744 QHBox *prioBox = new QHBox(topFrame); 770 QHBox *prioBox = new QHBox(topFrame);
745 // intervalBox->setSpacing(mSpacingHint); 771 // intervalBox->setSpacing(mSpacingHint);
746 topLayout->addWidget(prioBox,ii++,0); 772 topLayout->addWidget(prioBox,ii++,0);
747 773
748 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); 774 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox);
749 mPrioSpin = new QSpinBox(0,5,1,prioBox); 775 mPrioSpin = new QSpinBox(0,5,1,prioBox);
750 if ( QApplication::desktop()->width() < 300 ) 776 if ( QApplication::desktop()->width() < 300 )
751 mPrioSpin->setFixedWidth( 40 ); 777 mPrioSpin->setFixedWidth( 40 );
752 778
753 KPrefsDialogWidBool *passwdk = 779 KPrefsDialogWidBool *passwdk =
754 780
755 addWidBool(i18n("Show events that are done"), 781 addWidBool(i18n("Show events that are done"),
756 &(KOPrefs::instance()->mWNViewShowsPast),topFrame); 782 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
757 topLayout->addWidget(passwdk->checkBox(), ii++,0); 783 topLayout->addWidget(passwdk->checkBox(), ii++,0);
758 passwdk = 784 passwdk =
759 addWidBool(i18n("Show parent To-Do's"), 785 addWidBool(i18n("Show parent To-Do's"),
760 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 786 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
761 topLayout->addWidget(passwdk->checkBox(), ii++,0); 787 topLayout->addWidget(passwdk->checkBox(), ii++,0);
762 788
763 passwdk = 789 passwdk =
764 addWidBool(i18n("Show location"), 790 addWidBool(i18n("Show location"),
765 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 791 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
766 topLayout->addWidget(passwdk->checkBox(), ii++,0); 792 topLayout->addWidget(passwdk->checkBox(), ii++,0);
767 793
768 794
769 passwdk = 795 passwdk =
770 addWidBool(i18n("Use short date in WN+Event view"), 796 addWidBool(i18n("Use short date in WN+Event view"),
771 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 797 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
772 topLayout->addWidget(passwdk->checkBox(), ii++,0); 798 topLayout->addWidget(passwdk->checkBox(), ii++,0);
773 799
774 800
775 801
776 802
777 // *********************** Todo View 803 // *********************** Todo View
778 804
779 topFrame = addPage(i18n("Todo View"),0,0); 805 topFrame = addPage(i18n("Todo View"),0,0);
780 // DesktopIcon("viewmag",KIcon::SizeMedium)); 806 // DesktopIcon("viewmag",KIcon::SizeMedium));
781 807
782 topLayout = new QGridLayout(topFrame,4,1); 808 topLayout = new QGridLayout(topFrame,4,1);
783 topLayout->setSpacing(mSpacingHint); 809 topLayout->setSpacing(mSpacingHint);
784 topLayout->setMargin(mMarginHint); 810 topLayout->setMargin(mMarginHint);
785 ii = 0; 811 ii = 0;
786dummy = 812dummy =
787 addWidBool(i18n("Hide not running Todos in To-do view"), 813 addWidBool(i18n("Hide not running Todos in To-do view"),
788 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); 814 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
789 topLayout->addWidget(dummy->checkBox(),ii++,0); 815 topLayout->addWidget(dummy->checkBox(),ii++,0);
790 816
791 817
792 KPrefsDialogWidBool *showCompletedTodo = 818 KPrefsDialogWidBool *showCompletedTodo =
793 addWidBool(i18n("To-do view shows completed Todos"), 819 addWidBool(i18n("To-do view shows completed Todos"),
794 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 820 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
795 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 821 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
796 dummy = 822 dummy =
797 addWidBool(i18n("To-do view shows complete as 'xx %'"), 823 addWidBool(i18n("To-do view shows complete as 'xx %'"),
798 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 824 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
799 topLayout->addWidget(dummy->checkBox(),ii++,0); 825 topLayout->addWidget(dummy->checkBox(),ii++,0);
800 826
801 dummy = 827 dummy =
802 addWidBool(i18n("Small To-do view uses smaller font"), 828 addWidBool(i18n("Small To-do view uses smaller font"),
803 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 829 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
804 topLayout->addWidget(dummy->checkBox(),ii++,0); 830 topLayout->addWidget(dummy->checkBox(),ii++,0);
805 831
806 832
807 833
808 dummy = 834 dummy =
809 addWidBool(i18n("Todo view uses category colors"), 835 addWidBool(i18n("Todo view uses category colors"),
810 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 836 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
811 topLayout->addWidget(dummy->checkBox(),ii++,0); 837 topLayout->addWidget(dummy->checkBox(),ii++,0);
812 838
813 839
814 QWidget* wid = new QWidget( topFrame ); 840 QWidget* wid = new QWidget( topFrame );
815 // Todo run today color 841 // Todo run today color
816 KPrefsDialogWidColor *todoRunColor = 842 KPrefsDialogWidColor *todoRunColor =
817 addWidColor(i18n("Color for running todos:"), 843 addWidColor(i18n("Color for running todos:"),
818 &(KOPrefs::instance()->mTodoRunColor),wid); 844 &(KOPrefs::instance()->mTodoRunColor),wid);
819 QHBoxLayout *widLayout = new QHBoxLayout(wid); 845 QHBoxLayout *widLayout = new QHBoxLayout(wid);
820 widLayout->addWidget( todoRunColor->label() ); 846 widLayout->addWidget( todoRunColor->label() );
821 widLayout->addWidget( todoRunColor->button() ); 847 widLayout->addWidget( todoRunColor->button() );
822 topLayout->addWidget(wid,ii++,0); 848 topLayout->addWidget(wid,ii++,0);
823 849
824 wid = new QWidget( topFrame ); 850 wid = new QWidget( topFrame );
825 // Todo due today color 851 // Todo due today color
826 KPrefsDialogWidColor *todoDueTodayColor = 852 KPrefsDialogWidColor *todoDueTodayColor =
827 addWidColor(i18n("Todo due today color:"), 853 addWidColor(i18n("Todo due today color:"),
828 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 854 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
829 widLayout = new QHBoxLayout(wid); 855 widLayout = new QHBoxLayout(wid);
830 widLayout->addWidget( todoDueTodayColor->label() ); 856 widLayout->addWidget( todoDueTodayColor->label() );
831 widLayout->addWidget( todoDueTodayColor->button() ); 857 widLayout->addWidget( todoDueTodayColor->button() );
832 topLayout->addWidget(wid,ii++,0); 858 topLayout->addWidget(wid,ii++,0);
833 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 859 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
834 860
835 // Todo overdue color 861 // Todo overdue color
836 wid = new QWidget( topFrame ); 862 wid = new QWidget( topFrame );
837 widLayout = new QHBoxLayout(wid); 863 widLayout = new QHBoxLayout(wid);
838 KPrefsDialogWidColor *todoOverdueColor = 864 KPrefsDialogWidColor *todoOverdueColor =
839 addWidColor(i18n("Todo overdue color:"), 865 addWidColor(i18n("Todo overdue color:"),
840 &(KOPrefs::instance()->mTodoOverdueColor),wid); 866 &(KOPrefs::instance()->mTodoOverdueColor),wid);
841 widLayout->addWidget(todoOverdueColor->label()); 867 widLayout->addWidget(todoOverdueColor->label());
842 widLayout->addWidget(todoOverdueColor->button()); 868 widLayout->addWidget(todoOverdueColor->button());
843 topLayout->addWidget(wid,ii++,0); 869 topLayout->addWidget(wid,ii++,0);
844 870
845 dummy = 871 dummy =
846 addWidBool(i18n("Colors are applied to text"), 872 addWidBool(i18n("Colors are applied to text"),
847 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 873 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
848 topLayout->addWidget(dummy->checkBox(),ii++,0); 874 topLayout->addWidget(dummy->checkBox(),ii++,0);
849 875
850 876
851 877
852 topFrame = addPage(i18n("View Options"),0,0); 878 topFrame = addPage(i18n("View Options"),0,0);
853 879
854 topLayout = new QGridLayout(topFrame,4,1); 880 topLayout = new QGridLayout(topFrame,4,1);
855 topLayout->setSpacing(mSpacingHint); 881 topLayout->setSpacing(mSpacingHint);
856 topLayout->setMargin(mMarginHint); 882 topLayout->setMargin(mMarginHint);
857 ii = 0; 883 ii = 0;
858 884
859 dummy = 885 dummy =
860 addWidBool(i18n("Show Sync Events"), 886 addWidBool(i18n("Show Sync Events"),
861 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 887 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
862 topLayout->addWidget(dummy->checkBox(), ii++,0); 888 topLayout->addWidget(dummy->checkBox(), ii++,0);
863 889
864 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); 890 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
865 topLayout->addWidget(lab ,ii++,0); 891 topLayout->addWidget(lab ,ii++,0);
866 892
867 dummy = addWidBool(i18n("Details"), 893 dummy = addWidBool(i18n("Details"),
868 &(KOPrefs::instance()->mEVshowDetails),topFrame); 894 &(KOPrefs::instance()->mEVshowDetails),topFrame);
869 topLayout->addWidget(dummy->checkBox(),ii++,0); 895 topLayout->addWidget(dummy->checkBox(),ii++,0);
870 dummy = addWidBool(i18n("Created time"), 896 dummy = addWidBool(i18n("Created time"),
871 &(KOPrefs::instance()->mEVshowCreated),topFrame); 897 &(KOPrefs::instance()->mEVshowCreated),topFrame);
872 topLayout->addWidget(dummy->checkBox(),ii++,0); 898 topLayout->addWidget(dummy->checkBox(),ii++,0);
873 dummy = addWidBool(i18n("Last modified time"), 899 dummy = addWidBool(i18n("Last modified time"),
874 &(KOPrefs::instance()->mEVshowChanged),topFrame); 900 &(KOPrefs::instance()->mEVshowChanged),topFrame);
875 topLayout->addWidget(dummy->checkBox(),ii++,0); 901 topLayout->addWidget(dummy->checkBox(),ii++,0);
876 902
877 903
878 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); 904 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame);
879 topLayout->addWidget(lab ,ii++,0); 905 topLayout->addWidget(lab ,ii++,0);
880 906
881 dummy = addWidBool(i18n("Details"), 907 dummy = addWidBool(i18n("Details"),
882 &(KOPrefs::instance()->mWTshowDetails),topFrame); 908 &(KOPrefs::instance()->mWTshowDetails),topFrame);
883 topLayout->addWidget(dummy->checkBox(),ii++,0); 909 topLayout->addWidget(dummy->checkBox(),ii++,0);
884 dummy = addWidBool(i18n("Created time"), 910 dummy = addWidBool(i18n("Created time"),
885 &(KOPrefs::instance()->mWTshowCreated),topFrame); 911 &(KOPrefs::instance()->mWTshowCreated),topFrame);
886 topLayout->addWidget(dummy->checkBox(),ii++,0); 912 topLayout->addWidget(dummy->checkBox(),ii++,0);
887 dummy = addWidBool(i18n("Last modified time"), 913 dummy = addWidBool(i18n("Last modified time"),
888 &(KOPrefs::instance()->mWTshowChanged),topFrame); 914 &(KOPrefs::instance()->mWTshowChanged),topFrame);
889 topLayout->addWidget(dummy->checkBox(),ii++,0); 915 topLayout->addWidget(dummy->checkBox(),ii++,0);
890 916
891 917
892 topFrame = addPage(i18n("Alarm"),0,0); 918 topFrame = addPage(i18n("Alarm"),0,0);
893 // DesktopIcon("viewmag",KIcon::SizeMedium)); 919 // DesktopIcon("viewmag",KIcon::SizeMedium));
894 920
895 topLayout = new QGridLayout(topFrame,2,1); 921 topLayout = new QGridLayout(topFrame,2,1);
896 topLayout->setSpacing(mSpacingHint); 922 topLayout->setSpacing(mSpacingHint);
897 topLayout->setMargin(mMarginHint); 923 topLayout->setMargin(mMarginHint);
898 int iii = 0; 924 int iii = 0;
899 925
900 dummy = 926 dummy =
901 addWidBool(i18n("Use internal alarm notification"), 927 addWidBool(i18n("Use internal alarm notification"),
902 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 928 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
903 topLayout->addWidget(dummy->checkBox(),iii++,0); 929 topLayout->addWidget(dummy->checkBox(),iii++,0);
904 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
905 930
906 topLayout->addWidget(lab ,iii++,0); 931 if ( QApplication::desktop()->height() > 240 ) {
932
933 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
934
935 topLayout->addWidget(lab ,iii++,0);
936 }
907#ifndef DESKTOP_VERSION 937#ifndef DESKTOP_VERSION
908 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 938 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
909#else 939#else
910 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 940 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
911 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 941 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
912#endif 942#endif
913 943
914 QHBox* dummyBox = new QHBox(topFrame); 944 QHBox* dummyBox = new QHBox(topFrame);
915 new QLabel(i18n("Play beeps count:"),dummyBox); 945 new QLabel(i18n("Play beeps count:"),dummyBox);
916 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 946 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
917 topLayout->addWidget(dummyBox,iii++,0); 947 topLayout->addWidget(dummyBox,iii++,0);
918 948
919 dummyBox = new QHBox(topFrame); 949 dummyBox = new QHBox(topFrame);
920 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 950 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
921 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 951 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
922 topLayout->addWidget(dummyBox,iii++,0); 952 topLayout->addWidget(dummyBox,iii++,0);
923 953
924 dummyBox = new QHBox(topFrame); 954 dummyBox = new QHBox(topFrame);
925 new QLabel(i18n("Default suspend time in min:"),dummyBox); 955 new QLabel(i18n("Default suspend time in min:"),dummyBox);
926 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 956 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
927 topLayout->addWidget(dummyBox,iii++,0); 957 topLayout->addWidget(dummyBox,iii++,0);
928 958
929 dummyBox = new QHBox(topFrame); 959 dummyBox = new QHBox(topFrame);
930 new QLabel(i18n("Auto suspend count:"),dummyBox); 960 new QLabel(i18n("Auto suspend count:"),dummyBox);
931 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 961 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
932 topLayout->addWidget(dummyBox,iii++,0); 962 topLayout->addWidget(dummyBox,iii++,0);
933 963
934 964
935 965
936 QHBox* hbo = new QHBox ( topFrame ); 966 QHBox* hbo = new QHBox ( topFrame );
937 mDefaultAlarmFile = new QLineEdit(hbo); 967 mDefaultAlarmFile = new QLineEdit(hbo);
938 QPushButton * loadTemplate = new QPushButton(hbo); 968 QPushButton * loadTemplate = new QPushButton(hbo);
939 QPixmap icon; 969 QPixmap icon;
940 if ( QApplication::desktop()->width() < 321 ) 970 if ( QApplication::desktop()->width() < 321 )
941 icon = SmallIcon("fileimport16"); 971 icon = SmallIcon("fileimport16");
942 else 972 else
943 icon = SmallIcon("fileimport"); 973 icon = SmallIcon("fileimport");
944 loadTemplate->setIconSet (icon ) ; 974 loadTemplate->setIconSet (icon ) ;
945 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 975 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
946 int size = loadTemplate->sizeHint().height(); 976 int size = loadTemplate->sizeHint().height();
947 loadTemplate->setFixedSize( size, size ); 977 loadTemplate->setFixedSize( size, size );
948 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 978 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
949 // topLayout->addWidget(lab ,iii++,0); 979 // topLayout->addWidget(lab ,iii++,0);
950 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 980 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
951 topLayout->addWidget(lab ,iii++,0); 981 topLayout->addWidget(lab ,iii++,0);
952 topLayout->addWidget(hbo,iii++,0); 982 topLayout->addWidget(hbo,iii++,0);
953 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 983 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
954 984
955// topLayout->addWidget(lab ,iii++,0); 985// topLayout->addWidget(lab ,iii++,0);
956// #ifndef DESKTOP_VERSION 986// #ifndef DESKTOP_VERSION
957// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 987// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
958// #else 988// #else
959// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 989// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
960// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 990// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
961// #endif 991// #endif
962 992
963 993
964} 994}
965 995
966void KOPrefsDialog::selectSoundFile() 996void KOPrefsDialog::selectSoundFile()
967{ 997{
968 QString fileName = mDefaultAlarmFile->text(); 998 QString fileName = mDefaultAlarmFile->text();
969 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 999 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
970 if ( fileName.length() > 0 ) 1000 if ( fileName.length() > 0 )
971 mDefaultAlarmFile->setText( fileName ); 1001 mDefaultAlarmFile->setText( fileName );
972} 1002}
973void KOPrefsDialog::setupFontsTab() 1003void KOPrefsDialog::setupFontsTab()
974{ 1004{
975 1005
976 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1006 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
977 // DesktopIcon("fonts",KIcon::SizeMedium)); 1007 // DesktopIcon("fonts",KIcon::SizeMedium));
978 1008
979 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1009 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
980 topLayout->setSpacing(1); 1010 topLayout->setSpacing(1);
981 topLayout->setMargin(3); 1011 topLayout->setMargin(3);
982 KPrefsDialogWidFont * tVFont; 1012 KPrefsDialogWidFont * tVFont;
983 int i = 0; 1013 int i = 0;
984 KPrefsDialogWidFont *timeLabelsFont = 1014 KPrefsDialogWidFont *timeLabelsFont =
985 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1015 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
986 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1016 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
987 topLayout->addWidget(timeLabelsFont->label(),i,0); 1017 topLayout->addWidget(timeLabelsFont->label(),i,0);
988 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1018 topLayout->addWidget(timeLabelsFont->preview(),i,1);
989 topLayout->addWidget(timeLabelsFont->button(),i,2); 1019 topLayout->addWidget(timeLabelsFont->button(),i,2);
990 ++i; 1020 ++i;
991 1021
992 1022
993 timeLabelsFont = 1023 timeLabelsFont =
994 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1024 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
995 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1025 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
996 topLayout->addWidget(timeLabelsFont->label(),i,0); 1026 topLayout->addWidget(timeLabelsFont->label(),i,0);
997 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1027 topLayout->addWidget(timeLabelsFont->preview(),i,1);
998 topLayout->addWidget(timeLabelsFont->button(),i,2); 1028 topLayout->addWidget(timeLabelsFont->button(),i,2);
999 ++i; 1029 ++i;
1000 1030
1001 KPrefsDialogWidFont *timeBarFont = 1031 KPrefsDialogWidFont *timeBarFont =
1002 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1032 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1003 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1033 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1004 topLayout->addWidget(timeBarFont->label(),i,0); 1034 topLayout->addWidget(timeBarFont->label(),i,0);
1005 topLayout->addWidget(timeBarFont->preview(),i,1); 1035 topLayout->addWidget(timeBarFont->preview(),i,1);
1006 topLayout->addWidget(timeBarFont->button(),i,2); 1036 topLayout->addWidget(timeBarFont->button(),i,2);
1007 ++i; 1037 ++i;
1008 1038
1009 1039
1010 KPrefsDialogWidFont *marcusBainsFont = 1040 KPrefsDialogWidFont *marcusBainsFont =
1011 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1041 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1012 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1042 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1013 topLayout->addWidget(marcusBainsFont->label(),i,0); 1043 topLayout->addWidget(marcusBainsFont->label(),i,0);
1014 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1044 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1015 topLayout->addWidget(marcusBainsFont->button(),i,2); 1045 topLayout->addWidget(marcusBainsFont->button(),i,2);
1016 ++i; 1046 ++i;
1017 1047
1018 tVFont = 1048 tVFont =
1019 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1049 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1020 &(KOPrefs::instance()->mEventViewFont),topFrame); 1050 &(KOPrefs::instance()->mEventViewFont),topFrame);
1021 topLayout->addWidget(tVFont->label(),i,0); 1051 topLayout->addWidget(tVFont->label(),i,0);
1022 topLayout->addWidget(tVFont->preview(),i,1); 1052 topLayout->addWidget(tVFont->preview(),i,1);
1023 topLayout->addWidget(tVFont->button(),i,2); 1053 topLayout->addWidget(tVFont->button(),i,2);
1024 ++i; 1054 ++i;
1025 1055
1026 1056
1027 1057
1028 tVFont = 1058 tVFont =
1029 addWidFont(i18n("Details"),i18n("EditorBox:"), 1059 addWidFont(i18n("Details"),i18n("EditorBox:"),
1030 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1060 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1031 topLayout->addWidget(tVFont->label(),i,0); 1061 topLayout->addWidget(tVFont->label(),i,0);
1032 topLayout->addWidget(tVFont->preview(),i,1); 1062 topLayout->addWidget(tVFont->preview(),i,1);
1033 topLayout->addWidget(tVFont->button(),i,2); 1063 topLayout->addWidget(tVFont->button(),i,2);
1034 ++i; 1064 ++i;
1035 1065
1036 1066
1037 1067
1038 topLayout->setColStretch(1,1); 1068 topLayout->setColStretch(1,1);
1039 topLayout->setRowStretch(4,1); 1069 topLayout->setRowStretch(4,1);
1040 1070
1041 1071
1042 i = 0; 1072 i = 0;
1043 topFrame = addPage(i18n("View Fonts"),0, 1073 topFrame = addPage(i18n("View Fonts"),0,
1044 DesktopIcon("fonts",KIcon::SizeMedium)); 1074 DesktopIcon("fonts",KIcon::SizeMedium));
1045 1075
1046 topLayout = new QGridLayout(topFrame,7,3); 1076 topLayout = new QGridLayout(topFrame,7,3);
1047 topLayout->setSpacing(1); 1077 topLayout->setSpacing(1);
1048 topLayout->setMargin(3); 1078 topLayout->setMargin(3);
1049 1079
1050 tVFont = 1080 tVFont =
1051 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1081 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1052 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1082 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1053 topLayout->addWidget(tVFont->label(),i,0); 1083 topLayout->addWidget(tVFont->label(),i,0);
1054 topLayout->addWidget(tVFont->preview(),i,1); 1084 topLayout->addWidget(tVFont->preview(),i,1);
1055 topLayout->addWidget(tVFont->button(),i,2); 1085 topLayout->addWidget(tVFont->button(),i,2);
1056 ++i; 1086 ++i;
1057 KPrefsDialogWidFont *agendaViewFont = 1087 KPrefsDialogWidFont *agendaViewFont =
1058 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1088 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1059 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1089 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1060 topLayout->addWidget(agendaViewFont->label(),i,0); 1090 topLayout->addWidget(agendaViewFont->label(),i,0);
1061 topLayout->addWidget(agendaViewFont->preview(),i,1); 1091 topLayout->addWidget(agendaViewFont->preview(),i,1);
1062 topLayout->addWidget(agendaViewFont->button(),i,2); 1092 topLayout->addWidget(agendaViewFont->button(),i,2);
1063 ++i; 1093 ++i;
1064 1094
1065 1095
1066 KPrefsDialogWidFont *monthViewFont = 1096 KPrefsDialogWidFont *monthViewFont =
1067 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1097 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1068 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1098 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1069 topLayout->addWidget(monthViewFont->label(),i,0); 1099 topLayout->addWidget(monthViewFont->label(),i,0);
1070 topLayout->addWidget(monthViewFont->preview(),i,1); 1100 topLayout->addWidget(monthViewFont->preview(),i,1);
1071 topLayout->addWidget(monthViewFont->button(),i,2); 1101 topLayout->addWidget(monthViewFont->button(),i,2);
1072 ++i; 1102 ++i;
1073 1103
1074 1104
1075 KPrefsDialogWidFont *lVFont = 1105 KPrefsDialogWidFont *lVFont =
1076 addWidFont(i18n("Event"),i18n("List View:"), 1106 addWidFont(i18n("Event"),i18n("List View:"),
1077 &(KOPrefs::instance()->mListViewFont),topFrame); 1107 &(KOPrefs::instance()->mListViewFont),topFrame);
1078 topLayout->addWidget(lVFont->label(),i,0); 1108 topLayout->addWidget(lVFont->label(),i,0);
1079 topLayout->addWidget(lVFont->preview(),i,1); 1109 topLayout->addWidget(lVFont->preview(),i,1);
1080 topLayout->addWidget(lVFont->button(),i,2); 1110 topLayout->addWidget(lVFont->button(),i,2);
1081 ++i; 1111 ++i;
1082 1112
1083 1113
1084 tVFont = 1114 tVFont =
1085 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1115 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1086 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1116 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1087 topLayout->addWidget(tVFont->label(),i,0); 1117 topLayout->addWidget(tVFont->label(),i,0);
1088 topLayout->addWidget(tVFont->preview(),i,1); 1118 topLayout->addWidget(tVFont->preview(),i,1);
1089 topLayout->addWidget(tVFont->button(),i,2); 1119 topLayout->addWidget(tVFont->button(),i,2);
1090 ++i; 1120 ++i;
1091 1121
1092 1122
1093 tVFont = 1123 tVFont =
1094 addWidFont(i18n("Today"),i18n("JournalView:"), 1124 addWidFont(i18n("Today"),i18n("JournalView:"),
1095 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1125 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1096 topLayout->addWidget(tVFont->label(),i,0); 1126 topLayout->addWidget(tVFont->label(),i,0);
1097 topLayout->addWidget(tVFont->preview(),i,1); 1127 topLayout->addWidget(tVFont->preview(),i,1);
1098 topLayout->addWidget(tVFont->button(),i,2); 1128 topLayout->addWidget(tVFont->button(),i,2);
1099 ++i; 1129 ++i;
1100 1130
1101 1131
1102 1132
1103 1133
1104 topLayout->setColStretch(1,1); 1134 topLayout->setColStretch(1,1);
1105 topLayout->setRowStretch(4,1); 1135 topLayout->setRowStretch(4,1);
1106 1136
1107 1137
1108 1138
1109 1139
1110} 1140}
1111 1141
1112void KOPrefsDialog::setupColorsTab() 1142void KOPrefsDialog::setupColorsTab()
1113{ 1143{
1114 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1144 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1115 // DesktopIcon("colorize",KIcon::SizeMedium)); 1145 // DesktopIcon("colorize",KIcon::SizeMedium));
1116 1146
1117 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1147 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1118 // topLayout->setSpacing(mSpacingHint); 1148 // topLayout->setSpacing(mSpacingHint);
1119 // topLayout->setMargin(mMarginHint); 1149 // topLayout->setMargin(mMarginHint);
1120 1150
1121 topLayout->setSpacing(2); 1151 topLayout->setSpacing(2);
1122 topLayout->setMargin(3); 1152 topLayout->setMargin(3);
1123 1153
1124 int ii = 1; 1154 int ii = 1;
1125 QGroupBox *categoryGroup ; 1155 QGroupBox *categoryGroup ;
1126 1156
1127 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1157 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1128 topFrame); 1158 topFrame);
1129 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1159 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1130 1160
1131 mCategoryCombo = new QComboBox(categoryGroup); 1161 mCategoryCombo = new QComboBox(categoryGroup);
1132 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1162 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1133 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1163 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1134 1164
1135 mCategoryButton = new KColorButton(categoryGroup); 1165 mCategoryButton = new KColorButton(categoryGroup);
1136 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1166 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1137 updateCategoryColor(); 1167 updateCategoryColor();
1138 1168
1139 1169
1140 // Holiday Color 1170 // Holiday Color
1141 1171
1142 KPrefsDialogWidColor *holidayColor = 1172 KPrefsDialogWidColor *holidayColor =
1143 addWidColor(i18n("Holiday color:"), 1173 addWidColor(i18n("Holiday color:"),
1144 &(KOPrefs::instance()->mHolidayColor),topFrame); 1174 &(KOPrefs::instance()->mHolidayColor),topFrame);
1145 topLayout->addWidget(holidayColor->label(),ii,0); 1175 topLayout->addWidget(holidayColor->label(),ii,0);
1146 topLayout->addWidget(holidayColor->button(),ii++,1); 1176 topLayout->addWidget(holidayColor->button(),ii++,1);
1147 1177
1148 // Highlight Color 1178 // Highlight Color
1149 KPrefsDialogWidColor *highlightColor = 1179 KPrefsDialogWidColor *highlightColor =
1150 addWidColor(i18n("Highlight color:"), 1180 addWidColor(i18n("Highlight color:"),
1151 &(KOPrefs::instance()->mHighlightColor),topFrame); 1181 &(KOPrefs::instance()->mHighlightColor),topFrame);
1152 topLayout->addWidget(highlightColor->label(),ii,0); 1182 topLayout->addWidget(highlightColor->label(),ii,0);
1153 topLayout->addWidget(highlightColor->button(),ii++,1); 1183 topLayout->addWidget(highlightColor->button(),ii++,1);
1154 1184
1155 // Event color 1185 // Event color
1156 KPrefsDialogWidColor *eventColor = 1186 KPrefsDialogWidColor *eventColor =
1157 addWidColor(i18n("Default event color:"), 1187 addWidColor(i18n("Default event color:"),
1158 &(KOPrefs::instance()->mEventColor),topFrame); 1188 &(KOPrefs::instance()->mEventColor),topFrame);
1159 topLayout->addWidget(eventColor->label(),ii,0); 1189 topLayout->addWidget(eventColor->label(),ii,0);
1160 topLayout->addWidget(eventColor->button(),ii++,1); 1190 topLayout->addWidget(eventColor->button(),ii++,1);
1161 eventColor = 1191 eventColor =
1162 addWidColor(i18n("Default todo done color:"), 1192 addWidColor(i18n("Default todo done color:"),
1163 &(KOPrefs::instance()->mTodoDoneColor),topFrame); 1193 &(KOPrefs::instance()->mTodoDoneColor),topFrame);
1164 topLayout->addWidget(eventColor->label(),ii,0); 1194 topLayout->addWidget(eventColor->label(),ii,0);
1165 topLayout->addWidget(eventColor->button(),ii++,1); 1195 topLayout->addWidget(eventColor->button(),ii++,1);
1166 1196
1197 if ( QApplication::desktop()->height() <= 240 ) {
1198 topFrame = addPage(i18n("Colors") +" 2",0,0);
1199 // DesktopIcon("colorize",KIcon::SizeMedium));
1200
1201 topLayout = new QGridLayout(topFrame,5,2);
1202 // topLayout->setSpacing(mSpacingHint);
1203 // topLayout->setMargin(mMarginHint);
1204
1205 topLayout->setSpacing(2);
1206 topLayout->setMargin(3);
1207 }
1208
1167 1209
1168 // agenda view background color 1210 // agenda view background color
1169 KPrefsDialogWidColor *agendaBgColor = 1211 KPrefsDialogWidColor *agendaBgColor =
1170 addWidColor(i18n("Agenda view background color:"), 1212 addWidColor(i18n("Agenda view background color:"),
1171 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1213 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1172 topLayout->addWidget(agendaBgColor->label(),ii,0); 1214 topLayout->addWidget(agendaBgColor->label(),ii,0);
1173 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1215 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1174 1216
1175 // working hours color 1217 // working hours color
1176 KPrefsDialogWidColor *workingHoursColor = 1218 KPrefsDialogWidColor *workingHoursColor =
1177 addWidColor(i18n("Working hours color:"), 1219 addWidColor(i18n("Working hours color:"),
1178 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1220 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1179 topLayout->addWidget(workingHoursColor->label(),ii,0); 1221 topLayout->addWidget(workingHoursColor->label(),ii,0);
1180 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1222 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1181 1223
1182 KPrefsDialogWidBool *sb = 1224 KPrefsDialogWidBool *sb =
1183 addWidBool(i18n("Use colors for application:"), 1225 addWidBool(i18n("Use colors for application:"),
1184 &(KOPrefs::instance()->mUseAppColors),topFrame); 1226 &(KOPrefs::instance()->mUseAppColors),topFrame);
1185 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1227 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1186 1228
1187 ii++; 1229 ii++;
1188 KPrefsDialogWidColor * workingHoursColor1 = 1230 KPrefsDialogWidColor * workingHoursColor1 =
1189 addWidColor(i18n("Buttons, menus, etc.:"), 1231 addWidColor(i18n("Buttons, menus, etc.:"),
1190 &(KOPrefs::instance()->mAppColor1),topFrame); 1232 &(KOPrefs::instance()->mAppColor1),topFrame);
1191 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1233 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1192 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1234 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1193 1235
1194 KPrefsDialogWidColor * workingHoursColor2 = 1236 KPrefsDialogWidColor * workingHoursColor2 =
1195 addWidColor(i18n("Frames, labels, etc.:"), 1237 addWidColor(i18n("Frames, labels, etc.:"),
1196 &(KOPrefs::instance()->mAppColor2),topFrame); 1238 &(KOPrefs::instance()->mAppColor2),topFrame);
1197 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1239 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1198 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1240 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1199 1241
1200 1242
1201 1243
1202} 1244}
1203 1245
1204void KOPrefsDialog::setCategoryColor() 1246void KOPrefsDialog::setCategoryColor()
1205{ 1247{
1206 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1248 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1207} 1249}
1208 1250
1209void KOPrefsDialog::updateCategoryColor() 1251void KOPrefsDialog::updateCategoryColor()
1210{ 1252{
1211 QString cat = mCategoryCombo->currentText(); 1253 QString cat = mCategoryCombo->currentText();
1212 QColor *color = mCategoryDict.find(cat); 1254 QColor *color = mCategoryDict.find(cat);
1213 if (!color) { 1255 if (!color) {
1214 color = KOPrefs::instance()->categoryColor(cat); 1256 color = KOPrefs::instance()->categoryColor(cat);
1215 } 1257 }
1216 if (color) { 1258 if (color) {
1217 mCategoryButton->setColor(*color); 1259 mCategoryButton->setColor(*color);
1218 } 1260 }
1219} 1261}
1220 1262
1221void KOPrefsDialog::setupPrinterTab() 1263void KOPrefsDialog::setupPrinterTab()
1222{ 1264{
1223 mPrinterTab = addPage(i18n("Printing"),0, 1265 mPrinterTab = addPage(i18n("Printing"),0,
1224 DesktopIcon("fileprint",KIcon::SizeMedium)); 1266 DesktopIcon("fileprint",KIcon::SizeMedium));
1225 1267
1226 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1268 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1227 topLayout->setSpacing(mSpacingHint); 1269 topLayout->setSpacing(mSpacingHint);
1228 topLayout->setMargin(mMarginHint); 1270 topLayout->setMargin(mMarginHint);
1229 1271
1230 topLayout->setRowStretch(4,1); 1272 topLayout->setRowStretch(4,1);
1231} 1273}
1232 1274
1233void KOPrefsDialog::setupGroupSchedulingTab() 1275void KOPrefsDialog::setupGroupSchedulingTab()
1234{ 1276{
1235#if 0 1277#if 0
1236 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1278 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1237 DesktopIcon("personal",KIcon::SizeMedium)); 1279 DesktopIcon("personal",KIcon::SizeMedium));
1238 1280
1239 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1281 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1240 topLayout->setSpacing(mSpacingHint); 1282 topLayout->setSpacing(mSpacingHint);
1241 topLayout->setMargin(mMarginHint); 1283 topLayout->setMargin(mMarginHint);
1242 1284
1243#if 0 1285#if 0
1244 KPrefsDialogWidRadios *schedulerGroup = 1286 KPrefsDialogWidRadios *schedulerGroup =
1245 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1287 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1246 topFrame); 1288 topFrame);
1247 schedulerGroup->addRadio("Dummy"); // Only for debugging 1289 schedulerGroup->addRadio("Dummy"); // Only for debugging
1248 schedulerGroup->addRadio(i18n("Mail client")); 1290 schedulerGroup->addRadio(i18n("Mail client"));
1249 1291
1250 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1292 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1251#endif 1293#endif
1252 1294
1253 KPrefsDialogWidRadios *sendGroup = 1295 KPrefsDialogWidRadios *sendGroup =
1254 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1296 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1255 topFrame); 1297 topFrame);
1256 sendGroup->addRadio(i18n("Send to outbox")); 1298 sendGroup->addRadio(i18n("Send to outbox"));
1257 sendGroup->addRadio(i18n("Send directly")); 1299 sendGroup->addRadio(i18n("Send directly"));
1258 1300
1259 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1301 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1260 1302
1261 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1303 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1262 mAMails = new QListView(topFrame); 1304 mAMails = new QListView(topFrame);
1263 mAMails->addColumn(i18n("Email"),300); 1305 mAMails->addColumn(i18n("Email"),300);
1264 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1306 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1265 1307
1266 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1308 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1267 aEmailsEdit = new QLineEdit(topFrame); 1309 aEmailsEdit = new QLineEdit(topFrame);
1268 aEmailsEdit->setEnabled(false); 1310 aEmailsEdit->setEnabled(false);
1269 topLayout->addWidget(aEmailsEdit,4,1); 1311 topLayout->addWidget(aEmailsEdit,4,1);
1270 1312
1271 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1313 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1272 topLayout->addWidget(add,5,0); 1314 topLayout->addWidget(add,5,0);
1273 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1315 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1274 topLayout->addWidget(del,5,1); 1316 topLayout->addWidget(del,5,1);
1275 1317
1276 //topLayout->setRowStretch(2,1); 1318 //topLayout->setRowStretch(2,1);
1277 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1319 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1278 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1320 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1279 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1321 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1280 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1322 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1281#endif 1323#endif
1282} 1324}
1283 1325
1284void KOPrefsDialog::setupGroupAutomationTab() 1326void KOPrefsDialog::setupGroupAutomationTab()
1285{ 1327{
1286 return; 1328 return;
1287 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1329 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1288 DesktopIcon("personal",KIcon::SizeMedium)); 1330 DesktopIcon("personal",KIcon::SizeMedium));
1289 1331
1290 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1332 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1291 topLayout->setSpacing(mSpacingHint); 1333 topLayout->setSpacing(mSpacingHint);
1292 topLayout->setMargin(mMarginHint); 1334 topLayout->setMargin(mMarginHint);
1293 1335
1294 KPrefsDialogWidRadios *autoRefreshGroup = 1336 KPrefsDialogWidRadios *autoRefreshGroup =
1295 addWidRadios(i18n("Auto Send Refresh"), 1337 addWidRadios(i18n("Auto Send Refresh"),
1296 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1338 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1297 autoRefreshGroup->addRadio(i18n("Never")); 1339 autoRefreshGroup->addRadio(i18n("Never"));
1298 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1340 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1299 //autoRefreshGroup->addRadio(i18n("selected emails")); 1341 //autoRefreshGroup->addRadio(i18n("selected emails"));
1300 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1342 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1301 1343
1302 KPrefsDialogWidRadios *autoInsertGroup = 1344 KPrefsDialogWidRadios *autoInsertGroup =
1303 addWidRadios(i18n("Auto Insert IMIP Replies"), 1345 addWidRadios(i18n("Auto Insert IMIP Replies"),
1304 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1346 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1305 autoInsertGroup->addRadio(i18n("Never")); 1347 autoInsertGroup->addRadio(i18n("Never"));
1306 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1348 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1307 //autoInsertGroup->addRadio(i18n("selected emails")); 1349 //autoInsertGroup->addRadio(i18n("selected emails"));
1308 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1350 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1309 1351
1310 KPrefsDialogWidRadios *autoRequestGroup = 1352 KPrefsDialogWidRadios *autoRequestGroup =
1311 addWidRadios(i18n("Auto Insert IMIP Requests"), 1353 addWidRadios(i18n("Auto Insert IMIP Requests"),
1312 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1354 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1313 autoRequestGroup->addRadio(i18n("Never")); 1355 autoRequestGroup->addRadio(i18n("Never"));
1314 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1356 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1315 //autoInsertGroup->addRadio(i18n("selected emails")); 1357 //autoInsertGroup->addRadio(i18n("selected emails"));
1316 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1358 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1317 1359
1318 KPrefsDialogWidRadios *autoFreeBusyGroup = 1360 KPrefsDialogWidRadios *autoFreeBusyGroup =
1319 addWidRadios(i18n("Auto Send FreeBusy Information"), 1361 addWidRadios(i18n("Auto Send FreeBusy Information"),
1320 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1362 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1321 autoFreeBusyGroup->addRadio(i18n("Never")); 1363 autoFreeBusyGroup->addRadio(i18n("Never"));
1322 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1364 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1323 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1365 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1324 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1366 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1325 1367
1326 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1368 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1327 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1369 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1328 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1370 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1329 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1371 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1330 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1372 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1331 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1373 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1332 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1374 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1333} 1375}
1334 1376
1335void KOPrefsDialog::showPrinterTab() 1377void KOPrefsDialog::showPrinterTab()
1336{ 1378{
1337 showPage(pageIndex(mPrinterTab)); 1379 showPage(pageIndex(mPrinterTab));
1338} 1380}
1339 1381
1340 1382
1341void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1383void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1342 const QStringList *tags) 1384 const QStringList *tags)
1343{ 1385{
1344 if (tags) { 1386 if (tags) {
1345 int i = tags->findIndex(text); 1387 int i = tags->findIndex(text);
1346 if (i > 0) combo->setCurrentItem(i); 1388 if (i > 0) combo->setCurrentItem(i);
1347 } else { 1389 } else {
1348 for(int i=0;i<combo->count();++i) { 1390 for(int i=0;i<combo->count();++i) {
1349 if (combo->text(i) == text) { 1391 if (combo->text(i) == text) {
1350 combo->setCurrentItem(i); 1392 combo->setCurrentItem(i);
1351 break; 1393 break;
1352 } 1394 }
1353 } 1395 }
1354 } 1396 }
1355} 1397}
1356 1398
1357void KOPrefsDialog::usrReadConfig() 1399void KOPrefsDialog::usrReadConfig()
1358{ 1400{
1359 1401
1360 mNameEdit->setText(KOPrefs::instance()->fullName()); 1402 mNameEdit->setText(KOPrefs::instance()->fullName());
1361 mEmailEdit->setText(KOPrefs::instance()->email()); 1403 mEmailEdit->setText(KOPrefs::instance()->email());
1362 1404
1363 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1405 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1364 1406
1365 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1407 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1366 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1408 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1367 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1409 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1368 1410
1369 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1411 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1370 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1412 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1371 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1413 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1372 // mAMails->clear(); 1414 // mAMails->clear();
1373 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1415 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1374// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1416// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1375// QListViewItem *item = new QListViewItem(mAMails); 1417// QListViewItem *item = new QListViewItem(mAMails);
1376// item->setText(0,*it); 1418// item->setText(0,*it);
1377// mAMails->insertItem(item); 1419// mAMails->insertItem(item);
1378// } 1420// }
1379 1421
1380 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1422 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1381 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1423 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1382 updateCategories(); 1424 updateCategories();
1383 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1425 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1384 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1426 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1385 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1427 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1386 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1428 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1387 1429
1388} 1430}
1389 1431
1390 1432
1391void KOPrefsDialog::usrWriteConfig() 1433void KOPrefsDialog::usrWriteConfig()
1392{ 1434{
1393 1435
1394 1436
1395 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1437 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1396 KOPrefs::instance()->setFullName(mNameEdit->text()); 1438 KOPrefs::instance()->setFullName(mNameEdit->text());
1397 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1439 KOPrefs::instance()->setEmail(mEmailEdit->text());
1398 1440
1399 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1441 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1400 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1442 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1401 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1443 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1402 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1444 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1403 1445
1404 QDictIterator<QColor> it(mCategoryDict); 1446 QDictIterator<QColor> it(mCategoryDict);
1405 while (it.current()) { 1447 while (it.current()) {
1406 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1448 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1407 ++it; 1449 ++it;
1408 } 1450 }
1409 1451
1410 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1452 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1411 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1453 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1412 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1454 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1413 1455
1414 KOPrefs::instance()->mAdditionalMails.clear(); 1456 KOPrefs::instance()->mAdditionalMails.clear();
1415 // QListViewItem *item; 1457 // QListViewItem *item;
1416 // item = mAMails->firstChild(); 1458 // item = mAMails->firstChild();
1417 // while (item) 1459 // while (item)
1418 // { 1460 // {
1419 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1461 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1420 // item = item->nextSibling(); 1462 // item = item->nextSibling();
1421 // } 1463 // }
1422 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1464 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1423 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1465 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1424 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1466 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1425 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1467 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1426 1468
1427} 1469}
1428 1470
1429void KOPrefsDialog::updateCategories() 1471void KOPrefsDialog::updateCategories()
1430{ 1472{
1431 mCategoryCombo->clear(); 1473 mCategoryCombo->clear();
1432 mCategoryDict.clear(); 1474 mCategoryDict.clear();
1433 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1475 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1434 updateCategoryColor(); 1476 updateCategoryColor();
1435} 1477}
1436 1478
1437void KOPrefsDialog::toggleEmailSettings(bool on) 1479void KOPrefsDialog::toggleEmailSettings(bool on)
1438{ 1480{
1439 if (on) { 1481 if (on) {
1440 mEmailEdit->setEnabled(false); 1482 mEmailEdit->setEnabled(false);
1441 mNameEdit->setEnabled(false); 1483 mNameEdit->setEnabled(false);
1442 mEmailLabel->setEnabled(false); 1484 mEmailLabel->setEnabled(false);
1443 mNameLabel->setEnabled(false); 1485 mNameLabel->setEnabled(false);
1444 1486
1445 KEMailSettings settings; 1487 KEMailSettings settings;
1446 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1488 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1447 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1489 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1448 } else { 1490 } else {
1449 mEmailEdit->setEnabled(true); 1491 mEmailEdit->setEnabled(true);
1450 mNameEdit->setEnabled(true); 1492 mNameEdit->setEnabled(true);
1451 mEmailLabel->setEnabled(true); 1493 mEmailLabel->setEnabled(true);
1452 mNameLabel->setEnabled(true); 1494 mNameLabel->setEnabled(true);
1453 } 1495 }
1454} 1496}
1455 1497
1456void KOPrefsDialog::addItem() 1498void KOPrefsDialog::addItem()
1457{ 1499{
1458 // aEmailsEdit->setEnabled(true); 1500 // aEmailsEdit->setEnabled(true);
1459// QListViewItem *item = new QListViewItem(mAMails); 1501// QListViewItem *item = new QListViewItem(mAMails);
1460// mAMails->insertItem(item); 1502// mAMails->insertItem(item);
1461// mAMails->setSelected(item,true); 1503// mAMails->setSelected(item,true);
1462// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1504// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1463} 1505}
1464 1506
1465void KOPrefsDialog::removeItem() 1507void KOPrefsDialog::removeItem()
1466{ 1508{
1467// QListViewItem *item; 1509// QListViewItem *item;
1468// item = mAMails->selectedItem(); 1510// item = mAMails->selectedItem();
1469// if (!item) return; 1511// if (!item) return;
1470// mAMails->takeItem(item); 1512// mAMails->takeItem(item);
1471// item = mAMails->selectedItem(); 1513// item = mAMails->selectedItem();
1472// if (!item) { 1514// if (!item) {
1473// aEmailsEdit->setText(""); 1515// aEmailsEdit->setText("");
1474// aEmailsEdit->setEnabled(false); 1516// aEmailsEdit->setEnabled(false);
1475// } 1517// }
1476// if (mAMails->childCount() == 0) { 1518// if (mAMails->childCount() == 0) {
1477// aEmailsEdit->setEnabled(false); 1519// aEmailsEdit->setEnabled(false);
1478// } 1520// }
1479} 1521}
1480 1522
1481void KOPrefsDialog::updateItem() 1523void KOPrefsDialog::updateItem()
1482{ 1524{
1483 // QListViewItem *item; 1525 // QListViewItem *item;
1484// item = mAMails->selectedItem(); 1526// item = mAMails->selectedItem();
1485// if (!item) return; 1527// if (!item) return;
1486// item->setText(0,aEmailsEdit->text()); 1528// item->setText(0,aEmailsEdit->text());
1487} 1529}
1488 1530
1489void KOPrefsDialog::updateInput() 1531void KOPrefsDialog::updateInput()
1490{ 1532{
1491// QListViewItem *item; 1533// QListViewItem *item;
1492// item = mAMails->selectedItem(); 1534// item = mAMails->selectedItem();
1493// if (!item) return; 1535// if (!item) return;
1494// aEmailsEdit->setEnabled(true); 1536// aEmailsEdit->setEnabled(true);
1495// aEmailsEdit->setText(item->text(0)); 1537// aEmailsEdit->setText(item->text(0));
1496} 1538}
1497 1539
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 2c04852..0cb0bce 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -116,1025 +116,1025 @@ class KOex2phonePrefs : public QDialog
116 lay->addWidget( cancel ); 116 lay->addWidget( cancel );
117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
119 resize( 220, 240 ); 119 resize( 220, 240 );
120 qApp->processEvents(); 120 qApp->processEvents();
121 int dw = QApplication::desktop()->width(); 121 int dw = QApplication::desktop()->width();
122 int dh = QApplication::desktop()->height(); 122 int dh = QApplication::desktop()->height();
123 move( (dw-width())/2, (dh - height() )/2 ); 123 move( (dw-width())/2, (dh - height() )/2 );
124 } 124 }
125 125
126public: 126public:
127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
128 QCheckBox* mWriteBackFuture; 128 QCheckBox* mWriteBackFuture;
129 QSpinBox* mWriteBackFutureWeeks; 129 QSpinBox* mWriteBackFutureWeeks;
130}; 130};
131 131
132int globalFlagBlockStartup; 132int globalFlagBlockStartup;
133MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : 133MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
134 QMainWindow( parent, name ) 134 QMainWindow( parent, name )
135{ 135{
136 136
137 mClosed = false; 137 mClosed = false;
138 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 138 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
139 QString confFile = locateLocal("config","korganizerrc"); 139 QString confFile = locateLocal("config","korganizerrc");
140 QFileInfo finf ( confFile ); 140 QFileInfo finf ( confFile );
141 bool showWarning = !finf.exists(); 141 bool showWarning = !finf.exists();
142 setIcon(SmallIcon( "ko24" ) ); 142 setIcon(SmallIcon( "ko24" ) );
143 mBlockAtStartup = true; 143 mBlockAtStartup = true;
144 mFlagKeyPressed = false; 144 mFlagKeyPressed = false;
145 setCaption("KO/Pi"); 145 setCaption("KO/Pi");
146 KOPrefs *p = KOPrefs::instance(); 146 KOPrefs *p = KOPrefs::instance();
147 KPimGlobalPrefs::instance()->setGlobalConfig(); 147 KPimGlobalPrefs::instance()->setGlobalConfig();
148 p->mCurrentDisplayedView = 0; 148 p->mCurrentDisplayedView = 0;
149 if ( p->mHourSize > 22 ) 149 if ( p->mHourSize > 22 )
150 p->mHourSize = 22; 150 p->mHourSize = 22;
151 QMainWindow::ToolBarDock tbd; 151 QMainWindow::ToolBarDock tbd;
152 if ( p->mToolBarHor ) { 152 if ( p->mToolBarHor ) {
153 if ( p->mToolBarUp ) 153 if ( p->mToolBarUp )
154 tbd = Bottom; 154 tbd = Bottom;
155 else 155 else
156 tbd = Top; 156 tbd = Top;
157 } 157 }
158 else { 158 else {
159 if ( p->mToolBarUp ) 159 if ( p->mToolBarUp )
160 tbd = Right; 160 tbd = Right;
161 else 161 else
162 tbd = Left; 162 tbd = Left;
163 } 163 }
164 if ( KOPrefs::instance()->mUseAppColors ) 164 if ( KOPrefs::instance()->mUseAppColors )
165 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 165 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
166 globalFlagBlockStartup = 1; 166 globalFlagBlockStartup = 1;
167 iconToolBar = new QPEToolBar( this ); 167 iconToolBar = new QPEToolBar( this );
168 addToolBar (iconToolBar , tbd ); 168 addToolBar (iconToolBar , tbd );
169 169
170#ifdef DESKTOP_VERSION 170#ifdef DESKTOP_VERSION
171 if ( KOPrefs::instance()->mShowIconFilter ) 171 if ( KOPrefs::instance()->mShowIconFilter )
172#else 172#else
173 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) 173 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
174#endif 174#endif
175 175
176{ 176{
177 if ( p->mToolBarHorF ) { 177 if ( p->mToolBarHorF ) {
178 if ( p->mToolBarUpF ) 178 if ( p->mToolBarUpF )
179 tbd = Bottom; 179 tbd = Bottom;
180 else 180 else
181 tbd = Top; 181 tbd = Top;
182 } 182 }
183 else { 183 else {
184 if ( p->mToolBarUpF ) 184 if ( p->mToolBarUpF )
185 tbd = Right; 185 tbd = Right;
186 else 186 else
187 tbd = Left; 187 tbd = Left;
188 } 188 }
189 filterToolBar = new QPEToolBar ( this ); 189 filterToolBar = new QPEToolBar ( this );
190 filterMenubar = new QMenuBar( 0 ); 190 filterMenubar = new QMenuBar( 0 );
191 QFontMetrics fm ( filterMenubar->font() ); 191 QFontMetrics fm ( filterMenubar->font() );
192 192
193 filterPopupMenu = new QPopupMenu( this ); 193 filterPopupMenu = new QPopupMenu( this );
194 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 194 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
195 QString addTest = "A"; 195 QString addTest = "A";
196 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 196 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
197#ifdef DESKTOP_VERSION 197#ifdef DESKTOP_VERSION
198 addTest = "AAABBBCCCx"; 198 addTest = "AAABBBCCCx";
199#else 199#else
200 addTest = "AAx"; 200 addTest = "AAx";
201#endif 201#endif
202 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 202 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
203 addToolBar (filterToolBar , tbd ); 203 addToolBar (filterToolBar , tbd );
204 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 204 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
205 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 205 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
206 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) 206 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
207 filterToolBar->hide(); 207 filterToolBar->hide();
208 } else { 208 } else {
209 filterToolBar = 0; 209 filterToolBar = 0;
210 filterMenubar = 0; 210 filterMenubar = 0;
211 filterPopupMenu = 0; 211 filterPopupMenu = 0;
212 } 212 }
213 if ( p->mShowIconOnetoolbar ) { 213 if ( p->mShowIconOnetoolbar ) {
214 viewToolBar = iconToolBar ; 214 viewToolBar = iconToolBar ;
215 navigatorToolBar = iconToolBar ; 215 navigatorToolBar = iconToolBar ;
216 } else { 216 } else {
217#ifndef DESKTOP_VERSION 217#ifndef DESKTOP_VERSION
218 setToolBarsMovable( false ); 218 setToolBarsMovable( false );
219#endif 219#endif
220 if ( p->mToolBarHorV ) { 220 if ( p->mToolBarHorV ) {
221 if ( p->mToolBarUpV ) 221 if ( p->mToolBarUpV )
222 tbd = Bottom; 222 tbd = Bottom;
223 else 223 else
224 tbd = Top; 224 tbd = Top;
225 } 225 }
226 else { 226 else {
227 if ( p->mToolBarUpV ) 227 if ( p->mToolBarUpV )
228 tbd = Right; 228 tbd = Right;
229 else 229 else
230 tbd = Left; 230 tbd = Left;
231 } 231 }
232 viewToolBar = new QPEToolBar( this ); 232 viewToolBar = new QPEToolBar( this );
233 addToolBar (viewToolBar , tbd ); 233 addToolBar (viewToolBar , tbd );
234 if ( p->mToolBarHorN ) { 234 if ( p->mToolBarHorN ) {
235 if ( p->mToolBarUpN ) 235 if ( p->mToolBarUpN )
236 tbd = Bottom; 236 tbd = Bottom;
237 else 237 else
238 tbd = Top; 238 tbd = Top;
239 } 239 }
240 else { 240 else {
241 if ( p->mToolBarUpN ) 241 if ( p->mToolBarUpN )
242 tbd = Right; 242 tbd = Right;
243 else 243 else
244 tbd = Left; 244 tbd = Left;
245 } 245 }
246 navigatorToolBar = new QPEToolBar( this ); 246 navigatorToolBar = new QPEToolBar( this );
247 addToolBar (navigatorToolBar , tbd ); 247 addToolBar (navigatorToolBar , tbd );
248 } 248 }
249 249
250 250
251 251
252 mCalendarModifiedFlag = false; 252 mCalendarModifiedFlag = false;
253 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 253 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
254 splash->setAlignment ( AlignCenter ); 254 splash->setAlignment ( AlignCenter );
255 setCentralWidget( splash ); 255 setCentralWidget( splash );
256#ifndef DESKTOP_VERSION 256#ifndef DESKTOP_VERSION
257 showMaximized(); 257 showMaximized();
258#endif 258#endif
259 259
260 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 260 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
261 setDefaultPreferences(); 261 setDefaultPreferences();
262 mCalendar = new CalendarLocal(); 262 mCalendar = new CalendarLocal();
263 mView = new CalendarView( mCalendar, this,"mCalendar " ); 263 mView = new CalendarView( mCalendar, this,"mCalendar " );
264 mView->hide(); 264 mView->hide();
265 //mView->resize(splash->size() ); 265 //mView->resize(splash->size() );
266 initActions(); 266 initActions();
267 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 267 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
268 mSyncManager->setBlockSave(false); 268 mSyncManager->setBlockSave(false);
269 mView->setSyncManager(mSyncManager); 269 mView->setSyncManager(mSyncManager);
270#ifndef DESKTOP_VERSION 270#ifndef DESKTOP_VERSION
271 iconToolBar->show(); 271 iconToolBar->show();
272 qApp->processEvents(); 272 qApp->processEvents();
273#endif 273#endif
274 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 274 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
275 int vh = height() ; 275 int vh = height() ;
276 int vw = width(); 276 int vw = width();
277 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 277 //qDebug("Toolbar hei %d ",iconToolBar->height() );
278 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 278 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
279 vh -= iconToolBar->height(); 279 vh -= iconToolBar->height();
280 } else { 280 } else {
281 vw -= iconToolBar->height(); 281 vw -= iconToolBar->height();
282 } 282 }
283 //mView->setMaximumSize( splash->size() ); 283 //mView->setMaximumSize( splash->size() );
284 //mView->resize( splash->size() ); 284 //mView->resize( splash->size() );
285 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 285 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
286 mView->readSettings(); 286 mView->readSettings();
287 bool newFile = false; 287 bool newFile = false;
288 if( !QFile::exists( defaultFileName() ) ) { 288 if( !QFile::exists( defaultFileName() ) ) {
289 QFileInfo finfo ( defaultFileName() ); 289 QFileInfo finfo ( defaultFileName() );
290 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 290 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
291 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; 291 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n";
292 finfo.setFile( oldFile ); 292 finfo.setFile( oldFile );
293 if (finfo.exists() ) { 293 if (finfo.exists() ) {
294 KMessageBox::information( this, message); 294 KMessageBox::information( this, message);
295 mView->openCalendar( oldFile ); 295 mView->openCalendar( oldFile );
296 qApp->processEvents(); 296 qApp->processEvents();
297 } else { 297 } else {
298 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 298 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
299 finfo.setFile( oldFile ); 299 finfo.setFile( oldFile );
300 if (finfo.exists() ) { 300 if (finfo.exists() ) {
301 KMessageBox::information( this, message); 301 KMessageBox::information( this, message);
302 mView->openCalendar( oldFile ); 302 mView->openCalendar( oldFile );
303 qApp->processEvents(); 303 qApp->processEvents();
304 } 304 }
305 } 305 }
306 mView->saveCalendar( defaultFileName() ); 306 mView->saveCalendar( defaultFileName() );
307 newFile = true; 307 newFile = true;
308 } 308 }
309 309
310 QTime neededSaveTime = QDateTime::currentDateTime().time(); 310 QTime neededSaveTime = QDateTime::currentDateTime().time();
311 mView->openCalendar( defaultFileName() ); 311 mView->openCalendar( defaultFileName() );
312 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 312 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
313 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 313 qDebug("KO: Calendar loading time: %d ms",msNeeded );
314 314
315 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 315 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
316 KOPrefs::instance()->setAllDefaults(); 316 KOPrefs::instance()->setAllDefaults();
317 int count = mView->addCategories(); 317 int count = mView->addCategories();
318 } 318 }
319 processIncidenceSelection( 0 ); 319 processIncidenceSelection( 0 );
320 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 320 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
321 SLOT( processIncidenceSelection( Incidence * ) ) ); 321 SLOT( processIncidenceSelection( Incidence * ) ) );
322 connect( mView, SIGNAL( modifiedChanged( bool ) ), 322 connect( mView, SIGNAL( modifiedChanged( bool ) ),
323 SLOT( slotModifiedChanged( bool ) ) ); 323 SLOT( slotModifiedChanged( bool ) ) );
324 324
325 325
326 connect( mView, SIGNAL( tempDisableBR(bool) ), 326 connect( mView, SIGNAL( tempDisableBR(bool) ),
327 SLOT( disableBR(bool) ) ); 327 SLOT( disableBR(bool) ) );
328 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 328 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
329 mView->setModified( false ); 329 mView->setModified( false );
330 mBlockAtStartup = false; 330 mBlockAtStartup = false;
331 mView->setModified( false ); 331 mView->setModified( false );
332 setCentralWidget( mView ); 332 setCentralWidget( mView );
333 globalFlagBlockStartup = 0; 333 globalFlagBlockStartup = 0;
334 mView->show(); 334 mView->show();
335 delete splash; 335 delete splash;
336 if ( newFile ) 336 if ( newFile )
337 mView->updateConfig(); 337 mView->updateConfig();
338 // qApp->processEvents(); 338 // qApp->processEvents();
339 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 339 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
340 //fillSyncMenu(); 340 //fillSyncMenu();
341 341
342 342
343 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 343 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
344 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 344 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
345 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 345 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
346 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 346 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
347 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 347 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
348 mSyncManager->setDefaultFileName( sentSyncFile()); 348 mSyncManager->setDefaultFileName( sentSyncFile());
349 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 349 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
350 mSyncManager->fillSyncMenu(); 350 mSyncManager->fillSyncMenu();
351 351
352 352
353 353
354 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 354 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
355 if ( showWarning ) { 355 if ( showWarning ) {
356 KMessageBox::information( this, 356 KMessageBox::information( this,
357 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 357 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
358 qApp->processEvents(); 358 qApp->processEvents();
359 mView->dialogManager()->showSyncOptions(); 359 mView->dialogManager()->showSyncOptions();
360 } 360 }
361 361
362 //US listen for result adressed from Ka/Pi 362 //US listen for result adressed from Ka/Pi
363#ifndef DESKTOP_VERSION 363#ifndef DESKTOP_VERSION
364 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 364 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
365#endif 365#endif
366#ifndef DESKTOP_VERSION 366#ifndef DESKTOP_VERSION
367 infrared = 0; 367 infrared = 0;
368#endif 368#endif
369 updateFilterToolbar(); 369 updateFilterToolbar();
370 updateWeek( mView->startDate() ); 370 updateWeek( mView->startDate() );
371 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 371 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
372 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 372 SLOT( updateWeekNum( const KCal::DateList & ) ) );
373 mBRdisabled = false; 373 mBRdisabled = false;
374 //toggleBeamReceive(); 374 //toggleBeamReceive();
375 int tiint= 3000; 375 int tiint= 3000;
376#ifndef DESKTOP_VERSION 376#ifndef DESKTOP_VERSION
377 tiint = 5000; 377 tiint = 5000;
378#endif 378#endif
379 QTimer::singleShot( tiint, mView, SLOT ( checkAlarms() )); 379 QTimer::singleShot( tiint, mView, SLOT ( checkAlarms() ));
380} 380}
381MainWindow::~MainWindow() 381MainWindow::~MainWindow()
382{ 382{
383 //qDebug("MainWindow::~MainWindow() "); 383 //qDebug("MainWindow::~MainWindow() ");
384 //save toolbar location 384 //save toolbar location
385 delete mCalendar; 385 delete mCalendar;
386 delete mSyncManager; 386 delete mSyncManager;
387#ifndef DESKTOP_VERSION 387#ifndef DESKTOP_VERSION
388 if ( infrared ) 388 if ( infrared )
389 delete infrared; 389 delete infrared;
390#endif 390#endif
391 391
392 392
393} 393}
394 394
395void MainWindow::disableBR(bool b) 395void MainWindow::disableBR(bool b)
396{ 396{
397#ifndef DESKTOP_VERSION 397#ifndef DESKTOP_VERSION
398 if ( b ) { 398 if ( b ) {
399 if ( infrared ) { 399 if ( infrared ) {
400 toggleBeamReceive(); 400 toggleBeamReceive();
401 mBRdisabled = true; 401 mBRdisabled = true;
402 } 402 }
403 mBRdisabled = true; 403 mBRdisabled = true;
404 } else { 404 } else {
405 if ( mBRdisabled ) { 405 if ( mBRdisabled ) {
406 mBRdisabled = false; 406 mBRdisabled = false;
407 //makes no sense,because other cal ap is probably running 407 //makes no sense,because other cal ap is probably running
408 // toggleBeamReceive(); 408 // toggleBeamReceive();
409 } 409 }
410 } 410 }
411#endif 411#endif
412 412
413} 413}
414bool MainWindow::beamReceiveEnabled() 414bool MainWindow::beamReceiveEnabled()
415{ 415{
416#ifndef DESKTOP_VERSION 416#ifndef DESKTOP_VERSION
417 return ( infrared != 0 ); 417 return ( infrared != 0 );
418#endif 418#endif
419 return false; 419 return false;
420} 420}
421 421
422void MainWindow::toggleBeamReceive() 422void MainWindow::toggleBeamReceive()
423{ 423{
424 if ( mBRdisabled ) 424 if ( mBRdisabled )
425 return; 425 return;
426#ifndef DESKTOP_VERSION 426#ifndef DESKTOP_VERSION
427 if ( infrared ) { 427 if ( infrared ) {
428 qDebug("KO: Disable BeamReceive "); 428 qDebug("KO: Disable BeamReceive ");
429 delete infrared; 429 delete infrared;
430 infrared = 0; 430 infrared = 0;
431 brAction->setOn(false); 431 brAction->setOn(false);
432 return; 432 return;
433 } 433 }
434 qDebug("KO: Enable BeamReceive "); 434 qDebug("KO: Enable BeamReceive ");
435 brAction->setOn(true); 435 brAction->setOn(true);
436 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; 436 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
437 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); 437 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
438#endif 438#endif
439} 439}
440void MainWindow::showMaximized () 440void MainWindow::showMaximized ()
441{ 441{
442#ifndef DESKTOP_VERSION 442#ifndef DESKTOP_VERSION
443 if ( ! globalFlagBlockStartup ) 443 if ( ! globalFlagBlockStartup )
444 if ( mClosed ) 444 if ( mClosed )
445 mView->goToday(); 445 mView->goToday();
446#endif 446#endif
447 QWidget::showMaximized () ; 447 QWidget::showMaximized () ;
448 mClosed = false; 448 mClosed = false;
449} 449}
450void MainWindow::closeEvent( QCloseEvent* ce ) 450void MainWindow::closeEvent( QCloseEvent* ce )
451{ 451{
452 452
453 453
454 454
455 if ( ! KOPrefs::instance()->mAskForQuit ) { 455 if ( ! KOPrefs::instance()->mAskForQuit ) {
456 saveOnClose(); 456 saveOnClose();
457 mClosed = true; 457 mClosed = true;
458 ce->accept(); 458 ce->accept();
459 return; 459 return;
460 460
461 } 461 }
462 462
463 switch( QMessageBox::information( this, "KO/Pi", 463 switch( QMessageBox::information( this, "KO/Pi",
464 i18n("Do you really want\nto close KO/Pi?"), 464 i18n("Do you really want\nto close KO/Pi?"),
465 i18n("Close"), i18n("No"), 465 i18n("Close"), i18n("No"),
466 0, 0 ) ) { 466 0, 0 ) ) {
467 case 0: 467 case 0:
468 saveOnClose(); 468 saveOnClose();
469 mClosed = true; 469 mClosed = true;
470 ce->accept(); 470 ce->accept();
471 break; 471 break;
472 case 1: 472 case 1:
473 ce->ignore(); 473 ce->ignore();
474 break; 474 break;
475 case 2: 475 case 2:
476 476
477 default: 477 default:
478 break; 478 break;
479 } 479 }
480 480
481 481
482} 482}
483 483
484void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 484void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
485{ 485{
486 QDataStream stream( data, IO_ReadOnly ); 486 QDataStream stream( data, IO_ReadOnly );
487 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 487 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
488 //QString datamess; 488 //QString datamess;
489 //qDebug("message "); 489 //qDebug("message ");
490 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 490 qDebug("KO: QCOP message received: %s ", cmsg.data() );
491 491
492 if ( cmsg == "setDocument(QString)" ) { 492 if ( cmsg == "setDocument(QString)" ) {
493 QDataStream stream( data, IO_ReadOnly ); 493 QDataStream stream( data, IO_ReadOnly );
494 QString fileName; 494 QString fileName;
495 stream >> fileName; 495 stream >> fileName;
496 //qDebug("filename %s ", fileName.latin1()); 496 //qDebug("filename %s ", fileName.latin1());
497 showMaximized(); 497 showMaximized();
498 raise(); 498 raise();
499 KOPrefs::instance()->mLastSyncedLocalFile = fileName ; 499 KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
500 mSyncManager->slotSyncMenu( 1002 ); 500 mSyncManager->slotSyncMenu( 1002 );
501 return; 501 return;
502 } 502 }
503 503
504 if ( cmsg == "-writeFile" ) { 504 if ( cmsg == "-writeFile" ) {
505 // I made from the "-writeFile" an "-writeAlarm" 505 // I made from the "-writeFile" an "-writeAlarm"
506 mView->viewManager()->showWhatsNextView(); 506 mView->viewManager()->showWhatsNextView();
507 mCalendar->checkAlarmForIncidence( 0, true); 507 mCalendar->checkAlarmForIncidence( 0, true);
508 showMaximized(); 508 showMaximized();
509 raise(); 509 raise();
510 return; 510 return;
511 511
512 } 512 }
513 if ( cmsg == "-writeFileSilent" ) { 513 if ( cmsg == "-writeFileSilent" ) {
514 // I made from the "-writeFile" an "-writeAlarm" 514 // I made from the "-writeFile" an "-writeAlarm"
515 // mView->viewManager()->showWhatsNextView(); 515 // mView->viewManager()->showWhatsNextView();
516 mCalendar->checkAlarmForIncidence( 0, true); 516 mCalendar->checkAlarmForIncidence( 0, true);
517 //showMaximized(); 517 //showMaximized();
518 //raise(); 518 //raise();
519 hide(); 519 hide();
520 return; 520 return;
521 } 521 }
522 if ( cmsg == "-newCountdown" ) { 522 if ( cmsg == "-newCountdown" ) {
523 qDebug("newCountdown "); 523 qDebug("newCountdown ");
524 524
525 } 525 }
526 QString msg ; 526 QString msg ;
527 QString allmsg = cmsg; 527 QString allmsg = cmsg;
528 while ( allmsg.length() > 0 ) { 528 while ( allmsg.length() > 0 ) {
529 int nextC = allmsg.find( "-", 1 ); 529 int nextC = allmsg.find( "-", 1 );
530 if ( nextC == -1 ) { 530 if ( nextC == -1 ) {
531 msg = allmsg; 531 msg = allmsg;
532 allmsg = ""; 532 allmsg = "";
533 } else{ 533 } else{
534 msg = allmsg.left( nextC ); 534 msg = allmsg.left( nextC );
535 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 535 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
536 } 536 }
537 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 537 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
538 if ( msg == "-newEvent" ) { 538 if ( msg == "-newEvent" ) {
539 mView->newEvent(); 539 mView->newEvent();
540 } 540 }
541 if ( msg == "-newTodo" ) { 541 if ( msg == "-newTodo" ) {
542 mView->newTodo(); 542 mView->newTodo();
543 543
544 } 544 }
545 if ( msg == "-showWN" ) { 545 if ( msg == "-showWN" ) {
546 mView->viewManager()->showWhatsNextView(); 546 mView->viewManager()->showWhatsNextView();
547 } 547 }
548 if ( msg == "-showTodo" ) { 548 if ( msg == "-showTodo" ) {
549 mView->viewManager()->showTodoView(); 549 mView->viewManager()->showTodoView();
550 } 550 }
551 if ( msg == "-showList" ) { 551 if ( msg == "-showList" ) {
552 mView->viewManager()->showListView(); 552 mView->viewManager()->showListView();
553 } 553 }
554 else if ( msg == "-showDay" ) { 554 else if ( msg == "-showDay" ) {
555 mView->viewManager()->showDayView(); 555 mView->viewManager()->showDayView();
556 } 556 }
557 else if ( msg == "-showWWeek" ) { 557 else if ( msg == "-showWWeek" ) {
558 mView->viewManager()->showWorkWeekView(); 558 mView->viewManager()->showWorkWeekView();
559 } 559 }
560 else if ( msg == "-ringSync" ) { 560 else if ( msg == "-ringSync" ) {
561 mSyncManager->multiSync( false ); 561 mSyncManager->multiSync( false );
562 } 562 }
563 else if ( msg == "-showWeek" ) { 563 else if ( msg == "-showWeek" ) {
564 mView->viewManager()->showWeekView(); 564 mView->viewManager()->showWeekView();
565 } 565 }
566 else if ( msg == "-showTodo" ) { 566 else if ( msg == "-showTodo" ) {
567 mView->viewManager()->showTodoView(); 567 mView->viewManager()->showTodoView();
568 } 568 }
569 else if ( msg == "-showJournal" ) { 569 else if ( msg == "-showJournal" ) {
570 mView->dateNavigator()->selectDates( 1 ); 570 mView->dateNavigator()->selectDates( 1 );
571 mView->dateNavigator()->selectToday(); 571 mView->dateNavigator()->selectToday();
572 mView->viewManager()->showJournalView(); 572 mView->viewManager()->showJournalView();
573 } 573 }
574 else if ( msg == "-showKO" ) { 574 else if ( msg == "-showKO" ) {
575 mView->viewManager()->showNextXView(); 575 mView->viewManager()->showNextXView();
576 } 576 }
577 else if ( msg == "-showWNext" ) { 577 else if ( msg == "-showWNext" ) {
578 mView->viewManager()->showWhatsNextView(); 578 mView->viewManager()->showWhatsNextView();
579 } 579 }
580 else if ( msg == "nextView()" ) { 580 else if ( msg == "nextView()" ) {
581 mView->viewManager()->showNextView(); 581 mView->viewManager()->showNextView();
582 } 582 }
583 else if ( msg == "-showNextXView" ) { 583 else if ( msg == "-showNextXView" ) {
584 mView->viewManager()->showNextXView(); 584 mView->viewManager()->showNextXView();
585 } 585 }
586 586
587 587
588 } 588 }
589 589
590 showMaximized(); 590 showMaximized();
591 raise(); 591 raise();
592} 592}
593 593
594QPixmap MainWindow::loadPixmap( QString name ) 594QPixmap MainWindow::loadPixmap( QString name )
595{ 595{
596 return SmallIcon( name ); 596 return SmallIcon( name );
597 597
598} 598}
599void MainWindow::setUsesBigPixmaps ( bool b ) 599void MainWindow::setUsesBigPixmaps ( bool b )
600{ 600{
601 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 601 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
602 if ( b ) 602 if ( b )
603 qDebug("KO: BigPixmaps are not supported "); 603 qDebug("KO: BigPixmaps are not supported ");
604} 604}
605void MainWindow::initActions() 605void MainWindow::initActions()
606{ 606{
607 //KOPrefs::instance()->mShowFullMenu 607 //KOPrefs::instance()->mShowFullMenu
608 iconToolBar->clear(); 608 iconToolBar->clear();
609 KOPrefs *p = KOPrefs::instance(); 609 KOPrefs *p = KOPrefs::instance();
610 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 610 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
611 611
612 QPopupMenu *viewMenu = new QPopupMenu( this ); 612 QPopupMenu *viewMenu = new QPopupMenu( this );
613 QPopupMenu *actionMenu = new QPopupMenu( this ); 613 QPopupMenu *actionMenu = new QPopupMenu( this );
614 QPopupMenu *importMenu = new QPopupMenu( this ); 614 QPopupMenu *importMenu = new QPopupMenu( this );
615 QPopupMenu *importMenu_X = new QPopupMenu( this ); 615 QPopupMenu *importMenu_X = new QPopupMenu( this );
616 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 616 QPopupMenu *exportMenu_X = new QPopupMenu( this );
617 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 617 QPopupMenu *beamMenu_X = new QPopupMenu( this );
618 selectFilterMenu = new QPopupMenu( this ); 618 selectFilterMenu = new QPopupMenu( this );
619 selectFilterMenu->setCheckable( true ); 619 selectFilterMenu->setCheckable( true );
620 syncMenu = new QPopupMenu( this ); 620 syncMenu = new QPopupMenu( this );
621 configureAgendaMenu = new QPopupMenu( this ); 621 configureAgendaMenu = new QPopupMenu( this );
622 configureToolBarMenu = new QPopupMenu( this ); 622 configureToolBarMenu = new QPopupMenu( this );
623 QPopupMenu *helpMenu = new QPopupMenu( this ); 623 QPopupMenu *helpMenu = new QPopupMenu( this );
624 QIconSet icon; 624 QIconSet icon;
625 int pixWid = 22, pixHei = 22; 625 int pixWid = 22, pixHei = 22;
626 QString pathString = ""; 626 QString pathString = "";
627 if ( !p->mToolBarMiniIcons ) { 627 if ( !p->mToolBarMiniIcons ) {
628 if ( QApplication::desktop()->width() < 480 ) { 628 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
629 pathString += "icons16/"; 629 pathString += "icons16/";
630 pixWid = 18; pixHei = 16; 630 pixWid = 18; pixHei = 16;
631 } 631 }
632 } else { 632 } else {
633 pathString += "iconsmini/"; 633 pathString += "iconsmini/";
634 pixWid = 18; pixHei = 16; 634 pixWid = 18; pixHei = 16;
635 } 635 }
636 if ( KOPrefs::instance()->mShowFullMenu ) { 636 if ( KOPrefs::instance()->mShowFullMenu ) {
637 QMenuBar *menuBar1; 637 QMenuBar *menuBar1;
638 menuBar1 = menuBar(); 638 menuBar1 = menuBar();
639 menuBar1->insertItem( i18n("File"), importMenu ); 639 menuBar1->insertItem( i18n("File"), importMenu );
640 menuBar1->insertItem( i18n("View"), viewMenu ); 640 menuBar1->insertItem( i18n("View"), viewMenu );
641 menuBar1->insertItem( i18n("Actions"), actionMenu ); 641 menuBar1->insertItem( i18n("Actions"), actionMenu );
642#ifdef DESKTOP_VERSION 642#ifdef DESKTOP_VERSION
643 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 643 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
644 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 644 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
645#else 645#else
646 menuBar1->insertItem( i18n("Sync"), syncMenu ); 646 menuBar1->insertItem( i18n("Sync"), syncMenu );
647 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 647 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
648#endif 648#endif
649 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 649 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
650 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 650 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
651 menuBar1->insertItem( i18n("Help"), helpMenu ); 651 menuBar1->insertItem( i18n("Help"), helpMenu );
652 } else { 652 } else {
653 QPEMenuBar *menuBar1; 653 QPEMenuBar *menuBar1;
654 menuBar1 = new QPEMenuBar( iconToolBar ); 654 menuBar1 = new QPEMenuBar( iconToolBar );
655 QPopupMenu *menuBar = new QPopupMenu( this ); 655 QPopupMenu *menuBar = new QPopupMenu( this );
656 icon = loadPixmap( pathString + "z_menu" ); 656 icon = loadPixmap( pathString + "z_menu" );
657 menuBar1->insertItem( icon.pixmap(), menuBar); 657 menuBar1->insertItem( icon.pixmap(), menuBar);
658 //menuBar1->insertItem( i18n("ME"), menuBar); 658 //menuBar1->insertItem( i18n("ME"), menuBar);
659 menuBar->insertItem( i18n("File"), importMenu ); 659 menuBar->insertItem( i18n("File"), importMenu );
660 menuBar->insertItem( i18n("View"), viewMenu ); 660 menuBar->insertItem( i18n("View"), viewMenu );
661 menuBar->insertItem( i18n("Actions"), actionMenu ); 661 menuBar->insertItem( i18n("Actions"), actionMenu );
662 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 662 menuBar->insertItem( i18n("Synchronize"), syncMenu );
663 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 663 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
664 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 664 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
665 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 665 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
666 menuBar->insertItem( i18n("Help"), helpMenu ); 666 menuBar->insertItem( i18n("Help"), helpMenu );
667 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 667 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
668 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 668 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
669 } 669 }
670 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 670 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
671 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 671 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
672 672
673 673
674 mWeekBgColor = iconToolBar->backgroundColor(); 674 mWeekBgColor = iconToolBar->backgroundColor();
675 mWeekPixmap.resize( pixWid , pixHei ); 675 mWeekPixmap.resize( pixWid , pixHei );
676 mWeekPixmap.fill( mWeekBgColor ); 676 mWeekPixmap.fill( mWeekBgColor );
677 icon = mWeekPixmap; 677 icon = mWeekPixmap;
678 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 678 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
679 if ( p-> mShowIconWeekNum ) 679 if ( p-> mShowIconWeekNum )
680 mWeekAction->addTo( iconToolBar ); 680 mWeekAction->addTo( iconToolBar );
681 mWeekFont = font(); 681 mWeekFont = font();
682 682
683 int fontPoint = mWeekFont.pointSize(); 683 int fontPoint = mWeekFont.pointSize();
684 QFontMetrics f( mWeekFont ); 684 QFontMetrics f( mWeekFont );
685 int fontWid = f.width( "30" ); 685 int fontWid = f.width( "30" );
686 while ( fontWid > pixWid ) { 686 while ( fontWid > pixWid ) {
687 --fontPoint; 687 --fontPoint;
688 mWeekFont.setPointSize( fontPoint ); 688 mWeekFont.setPointSize( fontPoint );
689 QFontMetrics f( mWeekFont ); 689 QFontMetrics f( mWeekFont );
690 fontWid = f.width( "30" ); 690 fontWid = f.width( "30" );
691 //qDebug("dec-- "); 691 //qDebug("dec-- ");
692 } 692 }
693 693
694 connect( mWeekAction, SIGNAL( activated() ), 694 connect( mWeekAction, SIGNAL( activated() ),
695 this, SLOT( weekAction() ) ); 695 this, SLOT( weekAction() ) );
696 696
697 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 697 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
698 if ( p->mShowIconFilterview ) { 698 if ( p->mShowIconFilterview ) {
699 icon = loadPixmap( pathString + "filter" ); 699 icon = loadPixmap( pathString + "filter" );
700 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 700 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
701 connect( actionFilterMenuTB, SIGNAL( activated() ), 701 connect( actionFilterMenuTB, SIGNAL( activated() ),
702 this, SLOT( fillFilterMenuTB() ) ); 702 this, SLOT( fillFilterMenuTB() ) );
703 actionFilterMenuTB->addTo( iconToolBar ); 703 actionFilterMenuTB->addTo( iconToolBar );
704 selectFilterMenuTB = new QPopupMenu( this ); 704 selectFilterMenuTB = new QPopupMenu( this );
705 selectFilterMenuTB->setCheckable( true ); 705 selectFilterMenuTB->setCheckable( true );
706 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 706 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
707 } 707 }
708 708
709 //#endif 709 //#endif
710 // ****************** 710 // ******************
711 QAction *action; 711 QAction *action;
712 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 712 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
713 configureToolBarMenu->setCheckable( true ); 713 configureToolBarMenu->setCheckable( true );
714 714
715 715
716 configureAgendaMenu->setCheckable( true ); 716 configureAgendaMenu->setCheckable( true );
717 int iii ; 717 int iii ;
718 for ( iii = 1;iii<= 10 ;++iii ){ 718 for ( iii = 1;iii<= 10 ;++iii ){
719 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 719 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
720 } 720 }
721 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 721 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
722 722
723 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 723 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
724 this, SLOT( showConfigureAgenda( ) ) ); 724 this, SLOT( showConfigureAgenda( ) ) );
725 725
726 icon = loadPixmap( pathString + "configure" ); 726 icon = loadPixmap( pathString + "configure" );
727 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); 727 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
728 action->addTo( actionMenu ); 728 action->addTo( actionMenu );
729 connect( action, SIGNAL( activated() ), 729 connect( action, SIGNAL( activated() ),
730 mView, SLOT( edit_options() ) ); 730 mView, SLOT( edit_options() ) );
731 icon = loadPixmap( pathString + "configure" ); 731 icon = loadPixmap( pathString + "configure" );
732 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); 732 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
733 action->addTo( actionMenu ); 733 action->addTo( actionMenu );
734 connect( action, SIGNAL( activated() ), 734 connect( action, SIGNAL( activated() ),
735 mView, SLOT( edit_global_options() ) ); 735 mView, SLOT( edit_global_options() ) );
736 actionMenu->insertSeparator(); 736 actionMenu->insertSeparator();
737 737
738 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 738 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
739 action->addTo( actionMenu ); 739 action->addTo( actionMenu );
740 connect( action, SIGNAL( activated() ), 740 connect( action, SIGNAL( activated() ),
741 mView, SLOT( undo_delete() ) ); 741 mView, SLOT( undo_delete() ) );
742 actionMenu->insertSeparator(); 742 actionMenu->insertSeparator();
743 743
744 icon = loadPixmap( pathString + "newevent" ); 744 icon = loadPixmap( pathString + "newevent" );
745 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 745 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
746 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 746 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
747 configureToolBarMenu->insertSeparator(); 747 configureToolBarMenu->insertSeparator();
748 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 748 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
749 configureToolBarMenu->insertSeparator(); 749 configureToolBarMenu->insertSeparator();
750 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 750 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
751 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 751 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
752 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 752 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
753 ne_action->addTo( actionMenu ); 753 ne_action->addTo( actionMenu );
754 connect( ne_action, SIGNAL( activated() ), 754 connect( ne_action, SIGNAL( activated() ),
755 mView, SLOT( newEvent() ) ); 755 mView, SLOT( newEvent() ) );
756 icon = loadPixmap( pathString + "newtodo" ); 756 icon = loadPixmap( pathString + "newtodo" );
757 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 757 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
758 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 758 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
759 nt_action->addTo( actionMenu ); 759 nt_action->addTo( actionMenu );
760 connect( nt_action, SIGNAL( activated() ), 760 connect( nt_action, SIGNAL( activated() ),
761 mView, SLOT( newTodo() ) ); 761 mView, SLOT( newTodo() ) );
762 762
763 icon = loadPixmap( pathString + "today" ); 763 icon = loadPixmap( pathString + "today" );
764 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 764 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
765 today_action->addTo( viewMenu ); 765 today_action->addTo( viewMenu );
766 connect( today_action, SIGNAL( activated() ), 766 connect( today_action, SIGNAL( activated() ),
767 mView, SLOT( goToday() ) ); 767 mView, SLOT( goToday() ) );
768 viewMenu->insertSeparator(); 768 viewMenu->insertSeparator();
769 769
770 // *********************** 770 // ***********************
771 if ( KOPrefs::instance()->mVerticalScreen ) { 771 if ( KOPrefs::instance()->mVerticalScreen ) {
772 icon = SmallIcon( "1updownarrow" ); 772 icon = SmallIcon( "1updownarrow" );
773 } else { 773 } else {
774 icon = SmallIcon("1leftrightarrow" ); 774 icon = SmallIcon("1leftrightarrow" );
775 } 775 }
776 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 776 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
777 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 777 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
778 FSaction->addTo( viewMenu ); 778 FSaction->addTo( viewMenu );
779 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 779 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
780 780
781 icon = loadPixmap( pathString + "navi" ); 781 icon = loadPixmap( pathString + "navi" );
782 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 782 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
783 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 783 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
784 action->addTo( viewMenu ); 784 action->addTo( viewMenu );
785 connect( action, SIGNAL( activated() ), 785 connect( action, SIGNAL( activated() ),
786 mView, SLOT( toggleDateNavigatorWidget() ) ); 786 mView, SLOT( toggleDateNavigatorWidget() ) );
787 mToggleNav = action ; 787 mToggleNav = action ;
788 icon = loadPixmap( pathString + "filter" ); 788 icon = loadPixmap( pathString + "filter" );
789 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 789 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
790 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 790 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
791 action->addTo( viewMenu ); 791 action->addTo( viewMenu );
792 connect( action, SIGNAL( activated() ), 792 connect( action, SIGNAL( activated() ),
793 mView, SLOT( toggleFilter() ) ); 793 mView, SLOT( toggleFilter() ) );
794 mToggleFilter = action; 794 mToggleFilter = action;
795 icon = loadPixmap( pathString + "allday" ); 795 icon = loadPixmap( pathString + "allday" );
796 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 796 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
797 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 797 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
798 action->addTo( viewMenu ); 798 action->addTo( viewMenu );
799 connect( action, SIGNAL( activated() ), 799 connect( action, SIGNAL( activated() ),
800 mView, SLOT( toggleAllDaySize() ) ); 800 mView, SLOT( toggleAllDaySize() ) );
801 mToggleAllday = action; 801 mToggleAllday = action;
802 802
803 803
804 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 804 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
805 mToggleNav, SLOT( setEnabled ( bool ) ) ); 805 mToggleNav, SLOT( setEnabled ( bool ) ) );
806 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 806 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
807 mToggleFilter, SLOT( setEnabled ( bool ) ) ); 807 mToggleFilter, SLOT( setEnabled ( bool ) ) );
808 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 808 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
809 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 809 mToggleAllday, SLOT( setEnabled ( bool ) ) );
810 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 810 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
811 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); 811 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) );
812 812
813 viewMenu->insertSeparator(); 813 viewMenu->insertSeparator();
814 icon = loadPixmap( pathString + "picker" ); 814 icon = loadPixmap( pathString + "picker" );
815 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 815 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
816 action->addTo( viewMenu ); 816 action->addTo( viewMenu );
817 connect( action, SIGNAL( activated() ), 817 connect( action, SIGNAL( activated() ),
818 mView, SLOT( showDatePicker() ) ); 818 mView, SLOT( showDatePicker() ) );
819 action->addTo( iconToolBar ); 819 action->addTo( iconToolBar );
820 viewMenu->insertSeparator(); 820 viewMenu->insertSeparator();
821 821
822 if ( p-> mShowIconToggleFull ) 822 if ( p-> mShowIconToggleFull )
823 FSaction->addTo( iconToolBar ); 823 FSaction->addTo( iconToolBar );
824 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 824 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
825 825
826 //******************** 826 //********************
827 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 827 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
828 828
829 829
830 icon = loadPixmap( pathString + "whatsnext" ); 830 icon = loadPixmap( pathString + "whatsnext" );
831 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 831 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
832 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 832 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
833 whatsnext_action->addTo( viewMenu ); 833 whatsnext_action->addTo( viewMenu );
834 connect( whatsnext_action, SIGNAL( activated() ), 834 connect( whatsnext_action, SIGNAL( activated() ),
835 mView->viewManager(), SLOT( showWhatsNextView() ) ); 835 mView->viewManager(), SLOT( showWhatsNextView() ) );
836 836
837 icon = loadPixmap( pathString + "xdays" ); 837 icon = loadPixmap( pathString + "xdays" );
838 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 838 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
839 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 839 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
840 xdays_action->addTo( viewMenu ); 840 xdays_action->addTo( viewMenu );
841 connect( xdays_action, SIGNAL( activated() ), 841 connect( xdays_action, SIGNAL( activated() ),
842 mView->viewManager(), SLOT( showNextXView() ) ); 842 mView->viewManager(), SLOT( showNextXView() ) );
843 843
844 844
845 icon = loadPixmap( pathString + "journal" ); 845 icon = loadPixmap( pathString + "journal" );
846 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 846 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
847 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 847 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
848 viewjournal_action->addTo( viewMenu ); 848 viewjournal_action->addTo( viewMenu );
849 connect( viewjournal_action, SIGNAL( activated() ), 849 connect( viewjournal_action, SIGNAL( activated() ),
850 mView->viewManager(), SLOT( showJournalView() ) ); 850 mView->viewManager(), SLOT( showJournalView() ) );
851 851
852 852
853 icon = loadPixmap( pathString + "day" ); 853 icon = loadPixmap( pathString + "day" );
854 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 854 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
855 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 855 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
856 day1_action->addTo( viewMenu ); 856 day1_action->addTo( viewMenu );
857 // action->addTo( toolBar ); 857 // action->addTo( toolBar );
858 connect( day1_action, SIGNAL( activated() ), 858 connect( day1_action, SIGNAL( activated() ),
859 mView->viewManager(), SLOT( showDayView() ) ); 859 mView->viewManager(), SLOT( showDayView() ) );
860 860
861 icon = loadPixmap( pathString + "workweek" ); 861 icon = loadPixmap( pathString + "workweek" );
862 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 862 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
863 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 863 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
864 day5_action->addTo( viewMenu ); 864 day5_action->addTo( viewMenu );
865 connect( day5_action, SIGNAL( activated() ), 865 connect( day5_action, SIGNAL( activated() ),
866 mView->viewManager(), SLOT( showWorkWeekView() ) ); 866 mView->viewManager(), SLOT( showWorkWeekView() ) );
867 867
868 icon = loadPixmap( pathString + "week" ); 868 icon = loadPixmap( pathString + "week" );
869 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 869 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
870 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 870 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
871 day7_action->addTo( viewMenu ); 871 day7_action->addTo( viewMenu );
872 connect( day7_action, SIGNAL( activated() ), 872 connect( day7_action, SIGNAL( activated() ),
873 mView->viewManager(), SLOT( showWeekView() ) ); 873 mView->viewManager(), SLOT( showWeekView() ) );
874 874
875 icon = loadPixmap( pathString + "workweek2" ); 875 icon = loadPixmap( pathString + "workweek2" );
876 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 876 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
877 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 877 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
878 day6_action->addTo( viewMenu ); 878 day6_action->addTo( viewMenu );
879 connect( day6_action, SIGNAL( activated() ), 879 connect( day6_action, SIGNAL( activated() ),
880 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 880 mView->viewManager(), SLOT( showMonthViewWeek() ) );
881 881
882 icon = loadPixmap( pathString + "month" ); 882 icon = loadPixmap( pathString + "month" );
883 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 883 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
884 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 884 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
885 month_action->addTo( viewMenu ); 885 month_action->addTo( viewMenu );
886 connect( month_action, SIGNAL( activated() ), 886 connect( month_action, SIGNAL( activated() ),
887 mView->viewManager(), SLOT( showMonthView() ) ); 887 mView->viewManager(), SLOT( showMonthView() ) );
888 888
889 icon = loadPixmap( pathString + "list" ); 889 icon = loadPixmap( pathString + "list" );
890 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 890 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
891 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 891 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
892 showlist_action->addTo( viewMenu ); 892 showlist_action->addTo( viewMenu );
893 connect( showlist_action, SIGNAL( activated() ), 893 connect( showlist_action, SIGNAL( activated() ),
894 mView->viewManager(), SLOT( showListView() ) ); 894 mView->viewManager(), SLOT( showListView() ) );
895 895
896 icon = loadPixmap( pathString + "todo" ); 896 icon = loadPixmap( pathString + "todo" );
897 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 897 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
898 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 898 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
899 todoview_action->addTo( viewMenu ); 899 todoview_action->addTo( viewMenu );
900 connect( todoview_action, SIGNAL( activated() ), 900 connect( todoview_action, SIGNAL( activated() ),
901 mView->viewManager(), SLOT( showTodoView() ) ); 901 mView->viewManager(), SLOT( showTodoView() ) );
902 902
903 903
904 904
905#if 0 905#if 0
906 action = new QAction( "view_timespan", "Time Span", 0, this ); 906 action = new QAction( "view_timespan", "Time Span", 0, this );
907 action->addTo( viewMenu ); 907 action->addTo( viewMenu );
908 connect( action, SIGNAL( activated() ), 908 connect( action, SIGNAL( activated() ),
909 mView->viewManager(), SLOT( showTimeSpanView() ) ); 909 mView->viewManager(), SLOT( showTimeSpanView() ) );
910#endif 910#endif
911 911
912 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 912 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
913 this ); 913 this );
914 mNewSubTodoAction->addTo( actionMenu ); 914 mNewSubTodoAction->addTo( actionMenu );
915 connect( mNewSubTodoAction, SIGNAL( activated() ), 915 connect( mNewSubTodoAction, SIGNAL( activated() ),
916 mView, SLOT( newSubTodo() ) ); 916 mView, SLOT( newSubTodo() ) );
917 917
918 actionMenu->insertSeparator(); 918 actionMenu->insertSeparator();
919 919
920 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 920 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
921 mShowAction->addTo( actionMenu ); 921 mShowAction->addTo( actionMenu );
922 connect( mShowAction, SIGNAL( activated() ), 922 connect( mShowAction, SIGNAL( activated() ),
923 mView, SLOT( showIncidence() ) ); 923 mView, SLOT( showIncidence() ) );
924 924
925 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 925 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
926 mEditAction->addTo( actionMenu ); 926 mEditAction->addTo( actionMenu );
927 connect( mEditAction, SIGNAL( activated() ), 927 connect( mEditAction, SIGNAL( activated() ),
928 mView, SLOT( editIncidence() ) ); 928 mView, SLOT( editIncidence() ) );
929 929
930 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 930 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
931 mDeleteAction->addTo( actionMenu ); 931 mDeleteAction->addTo( actionMenu );
932 connect( mDeleteAction, SIGNAL( activated() ), 932 connect( mDeleteAction, SIGNAL( activated() ),
933 mView, SLOT( deleteIncidence() ) ); 933 mView, SLOT( deleteIncidence() ) );
934 934
935 935
936 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 936 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
937 mCloneAction->addTo( actionMenu ); 937 mCloneAction->addTo( actionMenu );
938 connect( mCloneAction, SIGNAL( activated() ), 938 connect( mCloneAction, SIGNAL( activated() ),
939 mView, SLOT( cloneIncidence() ) ); 939 mView, SLOT( cloneIncidence() ) );
940 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 940 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
941 mMoveAction->addTo( actionMenu ); 941 mMoveAction->addTo( actionMenu );
942 connect( mMoveAction, SIGNAL( activated() ), 942 connect( mMoveAction, SIGNAL( activated() ),
943 mView, SLOT( moveIncidence() ) ); 943 mView, SLOT( moveIncidence() ) );
944 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 944 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
945 mBeamAction->addTo( actionMenu ); 945 mBeamAction->addTo( actionMenu );
946 connect( mBeamAction, SIGNAL( activated() ), 946 connect( mBeamAction, SIGNAL( activated() ),
947 mView, SLOT( beamIncidence() ) ); 947 mView, SLOT( beamIncidence() ) );
948 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 948 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
949 mCancelAction->addTo( actionMenu ); 949 mCancelAction->addTo( actionMenu );
950 connect( mCancelAction, SIGNAL( activated() ), 950 connect( mCancelAction, SIGNAL( activated() ),
951 mView, SLOT( toggleCancelIncidence() ) ); 951 mView, SLOT( toggleCancelIncidence() ) );
952 952
953 actionMenu->insertSeparator(); 953 actionMenu->insertSeparator();
954 954
955 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 955 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
956 this ); 956 this );
957 action->addTo( actionMenu ); 957 action->addTo( actionMenu );
958 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 958 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
959 959
960 icon = loadPixmap( pathString + "search" ); 960 icon = loadPixmap( pathString + "search" );
961 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 961 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
962 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 962 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
963 search_action->addTo( actionMenu ); 963 search_action->addTo( actionMenu );
964 connect( search_action, SIGNAL( activated() ), 964 connect( search_action, SIGNAL( activated() ),
965 mView->dialogManager(), SLOT( showSearchDialog() ) ); 965 mView->dialogManager(), SLOT( showSearchDialog() ) );
966 966
967 967
968 968
969 if ( KOPrefs::instance()->mShowFullMenu ) { 969 if ( KOPrefs::instance()->mShowFullMenu ) {
970 actionMenu->insertSeparator(); 970 actionMenu->insertSeparator();
971 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 971 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
972 972
973 } 973 }
974 // actionMenu->insertSeparator(); 974 // actionMenu->insertSeparator();
975 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 975 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
976 this ); 976 this );
977 action->addTo( importMenu_X ); 977 action->addTo( importMenu_X );
978 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 978 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
979 action = new QAction( "import_quick", i18n("Import last file"), 0, 979 action = new QAction( "import_quick", i18n("Import last file"), 0,
980 this ); 980 this );
981 action->addTo( importMenu_X ); 981 action->addTo( importMenu_X );
982 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 982 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
983 importMenu_X->insertSeparator(); 983 importMenu_X->insertSeparator();
984 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 984 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
985 this ); 985 this );
986 action->addTo( importMenu_X ); 986 action->addTo( importMenu_X );
987 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 987 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
988 //#ifndef DESKTOP_VERSION 988 //#ifndef DESKTOP_VERSION
989 importMenu_X->insertSeparator(); 989 importMenu_X->insertSeparator();
990 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 990 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
991 this ); 991 this );
992 action->addTo( importMenu_X ); 992 action->addTo( importMenu_X );
993 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 993 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
994 //#else 994 //#else
995#ifdef _OL_IMPORT_ 995#ifdef _OL_IMPORT_
996 importMenu_X->insertSeparator(); 996 importMenu_X->insertSeparator();
997 action = new QAction( "import_ol", i18n("Import from OL"), 0, 997 action = new QAction( "import_ol", i18n("Import from OL"), 0,
998 this ); 998 this );
999 action->addTo( importMenu_X ); 999 action->addTo( importMenu_X );
1000 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 1000 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
1001#endif 1001#endif
1002 //#endif 1002 //#endif
1003 1003
1004 //importMenu->insertSeparator(); 1004 //importMenu->insertSeparator();
1005 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 1005 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
1006 this ); 1006 this );
1007 action->addTo( importMenu ); 1007 action->addTo( importMenu );
1008 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 1008 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
1009 1009
1010 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 1010 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
1011 this ); 1011 this );
1012 action->addTo( importMenu ); 1012 action->addTo( importMenu );
1013 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 1013 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
1014 importMenu->insertSeparator(); 1014 importMenu->insertSeparator();
1015 importMenu->insertItem( i18n("Import"), importMenu_X ); 1015 importMenu->insertItem( i18n("Import"), importMenu_X );
1016 //importMenu->insertSeparator(); 1016 //importMenu->insertSeparator();
1017 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 1017 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
1018 this ); 1018 this );
1019 action->addTo( exportMenu_X ); 1019 action->addTo( exportMenu_X );
1020 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 1020 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
1021 1021
1022 1022
1023 //LR 1023 //LR
1024 QPopupMenu *ex2phone = new QPopupMenu( this ); 1024 QPopupMenu *ex2phone = new QPopupMenu( this );
1025 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1025 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1026 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1026 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1027 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 1027 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
1028 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 1028 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
1029 1029
1030 importMenu->insertItem( i18n("Export"), exportMenu_X ); 1030 importMenu->insertItem( i18n("Export"), exportMenu_X );
1031#ifndef DESKTOP_VERSION 1031#ifndef DESKTOP_VERSION
1032 //importMenu->insertSeparator(); 1032 //importMenu->insertSeparator();
1033 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 1033 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
1034 this ); 1034 this );
1035 brAction->addTo( beamMenu_X ); 1035 brAction->addTo( beamMenu_X );
1036 brAction->setToggleAction (true ) ; 1036 brAction->setToggleAction (true ) ;
1037 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 1037 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
1038 1038
1039 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 1039 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
1040 this ); 1040 this );
1041 action->addTo( beamMenu_X ); 1041 action->addTo( beamMenu_X );
1042 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 1042 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
1043 1043
1044 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 1044 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
1045 this ); 1045 this );
1046 action->addTo( beamMenu_X ); 1046 action->addTo( beamMenu_X );
1047 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 1047 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
1048 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 1048 importMenu->insertItem( i18n("Beam"), beamMenu_X );
1049#else 1049#else
1050 //importMenu->insertSeparator(); 1050 //importMenu->insertSeparator();
1051 icon = loadPixmap( pathString + "print" ); 1051 icon = loadPixmap( pathString + "print" );
1052 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 1052 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
1053 action->addTo( beamMenu_X ); 1053 action->addTo( beamMenu_X );
1054 connect( action, SIGNAL( activated() ), 1054 connect( action, SIGNAL( activated() ),
1055 this, SLOT( printCal() ) ); 1055 this, SLOT( printCal() ) );
1056 1056
1057 icon = loadPixmap( pathString + "print" ); 1057 icon = loadPixmap( pathString + "print" );
1058 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 1058 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
1059 action->addTo( beamMenu_X ); 1059 action->addTo( beamMenu_X );
1060 connect( action, SIGNAL( activated() ), 1060 connect( action, SIGNAL( activated() ),
1061 this, SLOT( printSel() ) ); 1061 this, SLOT( printSel() ) );
1062 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 1062 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
1063 action->addTo( beamMenu_X ); 1063 action->addTo( beamMenu_X );
1064 connect( action, SIGNAL( activated() ), 1064 connect( action, SIGNAL( activated() ),
1065 mView->viewManager(), SLOT( slotprintWNV() ) ); 1065 mView->viewManager(), SLOT( slotprintWNV() ) );
1066 1066
1067 1067
1068 icon = loadPixmap( pathString + "print" ); 1068 icon = loadPixmap( pathString + "print" );
1069 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); 1069 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this );
1070 action->addTo( beamMenu_X ); 1070 action->addTo( beamMenu_X );
1071 connect( action, SIGNAL( activated() ), 1071 connect( action, SIGNAL( activated() ),
1072 this, SLOT( printListView() ) ); 1072 this, SLOT( printListView() ) );
1073 1073
1074 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); 1074 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
1075 action->addTo( beamMenu_X ); 1075 action->addTo( beamMenu_X );
1076 connect( action, SIGNAL( activated() ), 1076 connect( action, SIGNAL( activated() ),
1077 mView, SLOT( slotprintSelInc() ) ); 1077 mView, SLOT( slotprintSelInc() ) );
1078 1078
1079 importMenu->insertItem( i18n("Print"), beamMenu_X ); 1079 importMenu->insertItem( i18n("Print"), beamMenu_X );
1080#endif 1080#endif
1081 importMenu->insertSeparator(); 1081 importMenu->insertSeparator();
1082 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 1082 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
1083 this ); 1083 this );
1084 action->addTo( importMenu ); 1084 action->addTo( importMenu );
1085 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 1085 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1086 importMenu->insertSeparator(); 1086 importMenu->insertSeparator();
1087 action = new QAction( "beam all", i18n("Save"), 0, 1087 action = new QAction( "beam all", i18n("Save"), 0,
1088 this ); 1088 this );
1089 action->addTo( importMenu ); 1089 action->addTo( importMenu );
1090 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 1090 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
1091 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 1091 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
1092 this ); 1092 this );
1093 action->addTo( importMenu ); 1093 action->addTo( importMenu );
1094 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 1094 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
1095 1095
1096 //menuBar->insertItem( "Configure",configureMenu ); 1096 //menuBar->insertItem( "Configure",configureMenu );
1097 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 1097 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
1098 icon = loadPixmap( "korganizer/korganizer" ); 1098 icon = loadPixmap( "korganizer/korganizer" );
1099 1099
1100 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 1100 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
1101 action->addTo( helpMenu ); 1101 action->addTo( helpMenu );
1102 connect( action, SIGNAL( activated() ), 1102 connect( action, SIGNAL( activated() ),
1103 SLOT( whatsNew() ) ); 1103 SLOT( whatsNew() ) );
1104 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 1104 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
1105 action->addTo( helpMenu ); 1105 action->addTo( helpMenu );
1106 connect( action, SIGNAL( activated() ), 1106 connect( action, SIGNAL( activated() ),
1107 SLOT( features() ) ); 1107 SLOT( features() ) );
1108 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 1108 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
1109 action->addTo( helpMenu ); 1109 action->addTo( helpMenu );
1110 connect( action, SIGNAL( activated() ), 1110 connect( action, SIGNAL( activated() ),
1111 SLOT( keyBindings() ) ); 1111 SLOT( keyBindings() ) );
1112 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); 1112 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this );
1113 action->addTo( helpMenu ); 1113 action->addTo( helpMenu );
1114 connect( action, SIGNAL( activated() ), 1114 connect( action, SIGNAL( activated() ),
1115 SLOT( storagehowto() ) ); 1115 SLOT( storagehowto() ) );
1116 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); 1116 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this );
1117 action->addTo( helpMenu ); 1117 action->addTo( helpMenu );
1118 connect( action, SIGNAL( activated() ), 1118 connect( action, SIGNAL( activated() ),
1119 SLOT( timetrackinghowto() ) ); 1119 SLOT( timetrackinghowto() ) );
1120 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 1120 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
1121 action->addTo( helpMenu ); 1121 action->addTo( helpMenu );
1122 connect( action, SIGNAL( activated() ), 1122 connect( action, SIGNAL( activated() ),
1123 SLOT( synchowto() ) ); 1123 SLOT( synchowto() ) );
1124 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 1124 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
1125 action->addTo( helpMenu ); 1125 action->addTo( helpMenu );
1126 connect( action, SIGNAL( activated() ), 1126 connect( action, SIGNAL( activated() ),
1127 SLOT( kdesynchowto() ) ); 1127 SLOT( kdesynchowto() ) );
1128 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 1128 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
1129 action->addTo( helpMenu ); 1129 action->addTo( helpMenu );
1130 connect( action, SIGNAL( activated() ), 1130 connect( action, SIGNAL( activated() ),
1131 SLOT( multisynchowto() ) ); 1131 SLOT( multisynchowto() ) );
1132 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 1132 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
1133 action->addTo( helpMenu ); 1133 action->addTo( helpMenu );
1134 connect( action, SIGNAL( activated() ), 1134 connect( action, SIGNAL( activated() ),
1135 SLOT( aboutAutoSaving() ) ); 1135 SLOT( aboutAutoSaving() ) );
1136 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 1136 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
1137 action->addTo( helpMenu ); 1137 action->addTo( helpMenu );
1138 connect( action, SIGNAL( activated() ), 1138 connect( action, SIGNAL( activated() ),
1139 SLOT( aboutKnownBugs() ) ); 1139 SLOT( aboutKnownBugs() ) );
1140 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 1140 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index ef2fc1c..7b3b543 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -1,471 +1,488 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qgroupbox.h> 27#include <qgroupbox.h>
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlistview.h> 29#include <qlistview.h>
30#include <qwhatsthis.h> 30#include <qwhatsthis.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33 33
34#include <klocale.h> 34#include <klocale.h>
35#include <kmessagebox.h> 35#include <kmessagebox.h>
36 36
37#include <libkdepim/kdateedit.h> 37#include <libkdepim/kdateedit.h>
38 38
39#include "koglobals.h" 39#include "koglobals.h"
40#include "koprefs.h" 40#include "koprefs.h"
41#include "klineedit.h" 41#include "klineedit.h"
42 42
43#include "calendarview.h" 43#include "calendarview.h"
44#include "koviewmanager.h" 44#include "koviewmanager.h"
45#include "searchdialog.h" 45#include "searchdialog.h"
46 46
47SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) 47SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
48 : QVBox( 0 ) 48 : QVBox( 0 )
49 49
50{ 50{
51 mCalendar = calendar; 51 mCalendar = calendar;
52 QFrame *topFrame = new QFrame( this ) ;//plainPage(); 52 QFrame *topFrame = new QFrame( this ) ;//plainPage();
53 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); 53 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint());
54 54
55 // Search expression 55 // Search expression
56 QHBoxLayout *subLayout = new QHBoxLayout(); 56 QHBoxLayout *subLayout = new QHBoxLayout();
57 layout->addLayout(subLayout); 57 layout->addLayout(subLayout);
58 /* 58 /*
59 searchLabel = new QLabel(topFrame); 59 searchLabel = new QLabel(topFrame);
60 searchLabel->setText(i18n("Search for:")); 60 searchLabel->setText(i18n("Search for:"));
61 subLayout->addWidget(searchLabel); 61 subLayout->addWidget(searchLabel);
62 */ 62 */
63 QPushButton *OkButton = new QPushButton( i18n("Search for:"), topFrame ); 63 QPushButton *OkButton = new QPushButton( i18n("Search for:"), topFrame );
64 //OkButton->setDefault( true ); 64 //OkButton->setDefault( true );
65 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); 65 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch()));
66 subLayout->addWidget(OkButton); 66 subLayout->addWidget(OkButton);
67 searchEdit = new KLineEdit(topFrame); 67 searchEdit = new KLineEdit(topFrame);
68 subLayout->addWidget(searchEdit); 68 subLayout->addWidget(searchEdit);
69 69
70 mAddItems = new QCheckBox(i18n("Add items"),topFrame); 70 mAddItems = new QCheckBox(i18n("Add items"),topFrame);
71 subLayout->addWidget(mAddItems); 71 subLayout->addWidget(mAddItems);
72 72
73 QPushButton *togButton = new QPushButton( "", topFrame );
74 subLayout->addWidget(togButton);
75 connect(togButton,SIGNAL(clicked()),SLOT(toggleCheckboxes()));
76 togButton->setPixmap(SmallIcon("1updownarrow"));
77 togButton->setMinimumWidth( togButton->sizeHint().height() );
73 searchEdit->setText("*"); // Find all events by default 78 searchEdit->setText("*"); // Find all events by default
74 searchEdit->setFocus(); 79 searchEdit->setFocus();
75 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); 80 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
76 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); 81 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch()));
77 // Subjects to search 82 // Subjects to search
78 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), 83 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
79 // topFrame); 84 // topFrame);
80 85
81 QHBox *incidenceGroup = new QHBox( topFrame ); 86 incidenceGroup = new QHBox( topFrame );
82 layout->addWidget(incidenceGroup); 87 layout->addWidget(incidenceGroup);
83 88
84 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); 89 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup);
85 //mSearchEvent->setChecked(true); 90 //mSearchEvent->setChecked(true);
86 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); 91 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup);
87 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); 92 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup);
88 93
89 QHBox *subjectGroup = new QHBox( topFrame ); 94 subjectGroup = new QHBox( topFrame );
90 layout->addWidget(subjectGroup); 95 layout->addWidget(subjectGroup);
91 96
92 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); 97 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup);
93 mSummaryCheck->setChecked(true); 98 mSummaryCheck->setChecked(true);
94 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); 99 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup);
95 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); 100 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup);
96 101
97 QHBox *attendeeGroup = new QHBox( topFrame ); 102 attendeeGroup = new QHBox( topFrame );
98 layout->addWidget(attendeeGroup ); 103 layout->addWidget(attendeeGroup );
99 new QLabel( i18n("Attendee:"),attendeeGroup ); 104 new QLabel( i18n("Attendee:"),attendeeGroup );
100 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); 105 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup );
101 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); 106 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup );
102 // Date range 107 // Date range
103 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), 108 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"),
104 // topFrame); 109 // topFrame);
105 // layout->addWidget(rangeGroup); 110 // layout->addWidget(rangeGroup);
106 111
107 QWidget *rangeWidget = new QWidget(topFrame); 112 QWidget *rangeWidget = new QWidget(topFrame);
108 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); 113 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint());
109 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); 114 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
110 mStartDate = new KDateEdit(rangeWidget); 115 mStartDate = new KDateEdit(rangeWidget);
111 rangeLayout->addWidget(mStartDate); 116 rangeLayout->addWidget(mStartDate);
112 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); 117 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget));
113 mEndDate = new KDateEdit(rangeWidget); 118 mEndDate = new KDateEdit(rangeWidget);
114 mEndDate->setDate(QDate::currentDate().addDays(365)); 119 mEndDate->setDate(QDate::currentDate().addDays(365));
115 rangeLayout->addWidget(mEndDate); 120 rangeLayout->addWidget(mEndDate);
116 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); 121 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
117 rangeLayout->addWidget( (QWidget*)wt ); 122 rangeLayout->addWidget( (QWidget*)wt );
118 layout->addWidget(rangeWidget); 123 layout->addWidget(rangeWidget);
119 // Results list view 124 // Results list view
120 listView = new KOListView(mCalendar,topFrame); 125 listView = new KOListView(mCalendar,topFrame);
121 layout->addWidget(listView); 126 layout->addWidget(listView);
122 //layout->setStretchFactor( listView, 333 ); 127 //layout->setStretchFactor( listView, 333 );
123 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) ); 128 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) );
124 //listView->setMaximumHeight( 50 ); 129 //listView->setMaximumHeight( 50 );
125 listView->readSettings(KOGlobals::config(),"SearchListView Layout"); 130 listView->readSettings(KOGlobals::config(),"SearchListView Layout");
126 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); 131 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
127 132
128 setCaption( i18n("KO/Pi Find: ")); 133 setCaption( i18n("KO/Pi Find: "));
129#ifdef DESKTOP_VERSION 134#ifdef DESKTOP_VERSION
130 OkButton = new QPushButton( i18n("Close"), this ); 135 OkButton = new QPushButton( i18n("Close"), this );
131 connect(OkButton,SIGNAL(clicked()),SLOT(hide())); 136 connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
132#endif 137#endif
133} 138}
134 139
135SearchDialog::~SearchDialog() 140SearchDialog::~SearchDialog()
136{ 141{
137 142
138} 143}
144void SearchDialog::toggleCheckboxes()
145{
146 if ( incidenceGroup->isVisible() ) {
147 incidenceGroup->hide() ;
148 subjectGroup->hide() ;
149 attendeeGroup->hide() ;
150 } else {
151 incidenceGroup->show() ;
152 subjectGroup->show() ;
153 attendeeGroup->show() ;
154 }
155}
139void SearchDialog::raiseAndSelect() 156void SearchDialog::raiseAndSelect()
140{ 157{
141 158
142 static int currentState = 0; 159 static int currentState = 0;
143 160
144 if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) 161 if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() )
145 currentState = 0; 162 currentState = 0;
146 int newState = 0; 163 int newState = 0;
147 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 164 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
148 newState = VIEW_J_VIEW; 165 newState = VIEW_J_VIEW;
149 } 166 }
150 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 167 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
151 newState = VIEW_T_VIEW; 168 newState = VIEW_T_VIEW;
152 } 169 }
153 else { 170 else {
154 newState = VIEW_A_VIEW; 171 newState = VIEW_A_VIEW;
155 } 172 }
156 if ( newState != currentState ) { 173 if ( newState != currentState ) {
157 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 174 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
158 if ( ! mSearchJournal->isChecked() ) { 175 if ( ! mSearchJournal->isChecked() ) {
159 mSearchJournal->setChecked( true ); 176 mSearchJournal->setChecked( true );
160 mSearchTodo->setChecked( false ); 177 mSearchTodo->setChecked( false );
161 mSearchEvent->setChecked( false ); 178 mSearchEvent->setChecked( false );
162 } 179 }
163 } 180 }
164 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 181 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
165 if ( ! mSearchTodo->isChecked() ) { 182 if ( ! mSearchTodo->isChecked() ) {
166 mSearchTodo->setChecked( true ); 183 mSearchTodo->setChecked( true );
167 mSearchJournal->setChecked( false ); 184 mSearchJournal->setChecked( false );
168 mSearchEvent->setChecked( false ); 185 mSearchEvent->setChecked( false );
169 } 186 }
170 } 187 }
171 else { 188 else {
172 if ( ! mSearchEvent->isChecked() ) { 189 if ( ! mSearchEvent->isChecked() ) {
173 mSearchEvent->setChecked( true ); 190 mSearchEvent->setChecked( true );
174 mSearchJournal->setChecked( false ); 191 mSearchJournal->setChecked( false );
175 mSearchTodo->setChecked( false ); 192 mSearchTodo->setChecked( false );
176 } 193 }
177 } 194 }
178 } 195 }
179 currentState = newState; 196 currentState = newState;
180 raise(); 197 raise();
181} 198}
182void SearchDialog::setFocusToList() 199void SearchDialog::setFocusToList()
183{ 200{
184 listView->resetFocus(); 201 listView->resetFocus();
185} 202}
186void SearchDialog::accept() 203void SearchDialog::accept()
187{ 204{
188 doSearch(); 205 doSearch();
189} 206}
190void SearchDialog::updateList() 207void SearchDialog::updateList()
191{ 208{
192 //listView->updateList(); 209 //listView->updateList();
193 if ( isVisible() ) { 210 if ( isVisible() ) {
194 updateView(); 211 updateView();
195 //qDebug("SearchDialog::updated "); 212 //qDebug("SearchDialog::updated ");
196 } 213 }
197 else { 214 else {
198 listView->clear(); 215 listView->clear();
199 //qDebug("SearchDialog::cleared "); 216 //qDebug("SearchDialog::cleared ");
200 217
201 } 218 }
202} 219}
203void SearchDialog::searchTextChanged( const QString &_text ) 220void SearchDialog::searchTextChanged( const QString &_text )
204{ 221{
205#if 0 222#if 0
206 enableButton( KDialogBase::User1, !_text.isEmpty() ); 223 enableButton( KDialogBase::User1, !_text.isEmpty() );
207#endif 224#endif
208} 225}
209 226
210void SearchDialog::doSearch() 227void SearchDialog::doSearch()
211{ 228{
212 QRegExp re; 229 QRegExp re;
213 230
214 re.setWildcard(true); // most people understand these better. 231 re.setWildcard(true); // most people understand these better.
215 re.setCaseSensitive(false); 232 re.setCaseSensitive(false);
216 QString st = searchEdit->text(); 233 QString st = searchEdit->text();
217 if ( st.right(1) != "*") 234 if ( st.right(1) != "*")
218 st += "*"; 235 st += "*";
219 re.setPattern(st); 236 re.setPattern(st);
220 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { 237 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) {
221 KMessageBox::sorry(this, 238 KMessageBox::sorry(this,
222 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals")); 239 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals"));
223 return; 240 return;
224 } 241 }
225 if (!re.isValid() ) { 242 if (!re.isValid() ) {
226 KMessageBox::sorry(this, 243 KMessageBox::sorry(this,
227 i18n("Invalid search expression,\ncannot perform " 244 i18n("Invalid search expression,\ncannot perform "
228 "the search.\nPlease enter a search expression\n" 245 "the search.\nPlease enter a search expression\n"
229 "using the wildcard characters\n '*' and '?'" 246 "using the wildcard characters\n '*' and '?'"
230 "where needed.")); 247 "where needed."));
231 return; 248 return;
232 } 249 }
233 search(re); 250 search(re);
234 listView->setStartDate( mStartDate->date() ); 251 listView->setStartDate( mStartDate->date() );
235 listView->showEvents(mMatchedEvents); 252 listView->showEvents(mMatchedEvents);
236 listView->addTodos(mMatchedTodos); 253 listView->addTodos(mMatchedTodos);
237 listView->addJournals(mMatchedJournals); 254 listView->addJournals(mMatchedJournals);
238 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { 255 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) {
239 setCaption(i18n("No items found. Use '*' and '?' where needed.")); 256 setCaption(i18n("No items found. Use '*' and '?' where needed."));
240 } else { 257 } else {
241 QString mess; 258 QString mess;
242 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); 259 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() );
243 setCaption( i18n("KO/Pi Find: ") + mess); 260 setCaption( i18n("KO/Pi Find: ") + mess);
244 261
245 } 262 }
246 searchEdit->setFocus(); 263 searchEdit->setFocus();
247} 264}
248void SearchDialog::updateConfig() 265void SearchDialog::updateConfig()
249{ 266{
250 listView->updateConfig(); 267 listView->updateConfig();
251} 268}
252void SearchDialog::updateView() 269void SearchDialog::updateView()
253{ 270{
254 //qDebug("SearchDialog::updateView() %d ", isVisible()); 271 //qDebug("SearchDialog::updateView() %d ", isVisible());
255 QRegExp re; 272 QRegExp re;
256 re.setWildcard(true); // most people understand these better. 273 re.setWildcard(true); // most people understand these better.
257 re.setCaseSensitive(false); 274 re.setCaseSensitive(false);
258 QString st = searchEdit->text(); 275 QString st = searchEdit->text();
259 if ( st.right(1) != "*") 276 if ( st.right(1) != "*")
260 st += "*"; 277 st += "*";
261 re.setPattern(st); 278 re.setPattern(st);
262 if (re.isValid()) { 279 if (re.isValid()) {
263 search(re); 280 search(re);
264 } else { 281 } else {
265 mMatchedEvents.clear(); 282 mMatchedEvents.clear();
266 mMatchedTodos.clear(); 283 mMatchedTodos.clear();
267 mMatchedJournals.clear(); 284 mMatchedJournals.clear();
268 } 285 }
269 listView->setStartDate( mStartDate->date() ); 286 listView->setStartDate( mStartDate->date() );
270 listView->showEvents(mMatchedEvents); 287 listView->showEvents(mMatchedEvents);
271 listView->addTodos(mMatchedTodos); 288 listView->addTodos(mMatchedTodos);
272 listView->addJournals(mMatchedJournals); 289 listView->addJournals(mMatchedJournals);
273} 290}
274 291
275void SearchDialog::search(const QRegExp &re) 292void SearchDialog::search(const QRegExp &re)
276{ 293{
277 QPtrList<Event> events = mCalendar->events( mStartDate->date(), 294 QPtrList<Event> events = mCalendar->events( mStartDate->date(),
278 mEndDate->date(), 295 mEndDate->date(),
279 false /*mInclusiveCheck->isChecked()*/ ); 296 false /*mInclusiveCheck->isChecked()*/ );
280 if ( !mAddItems->isChecked() ) 297 if ( !mAddItems->isChecked() )
281 mMatchedEvents.clear(); 298 mMatchedEvents.clear();
282 if ( mSearchEvent->isChecked() ) { 299 if ( mSearchEvent->isChecked() ) {
283 Event *ev; 300 Event *ev;
284 for(ev=events.first();ev;ev=events.next()) { 301 for(ev=events.first();ev;ev=events.next()) {
285 if (mSummaryCheck->isChecked()) { 302 if (mSummaryCheck->isChecked()) {
286#if QT_VERSION >= 0x030000 303#if QT_VERSION >= 0x030000
287 if (re.search(ev->summary()) != -1) 304 if (re.search(ev->summary()) != -1)
288#else 305#else
289 if (re.match(ev->summary()) != -1) 306 if (re.match(ev->summary()) != -1)
290#endif 307#endif
291 { 308 {
292 mMatchedEvents.append(ev); 309 mMatchedEvents.append(ev);
293 continue; 310 continue;
294 } 311 }
295#if QT_VERSION >= 0x030000 312#if QT_VERSION >= 0x030000
296 if (re.search(ev->location()) != -1) 313 if (re.search(ev->location()) != -1)
297#else 314#else
298 if (re.match(ev->location()) != -1) 315 if (re.match(ev->location()) != -1)
299#endif 316#endif
300 { 317 {
301 mMatchedEvents.append(ev); 318 mMatchedEvents.append(ev);
302 continue; 319 continue;
303 } 320 }
304 } 321 }
305 if (mDescriptionCheck->isChecked()) { 322 if (mDescriptionCheck->isChecked()) {
306#if QT_VERSION >= 0x030000 323#if QT_VERSION >= 0x030000
307 if (re.search(ev->description()) != -1) 324 if (re.search(ev->description()) != -1)
308#else 325#else
309 if (re.match(ev->description()) != -1) 326 if (re.match(ev->description()) != -1)
310#endif 327#endif
311 { 328 {
312 mMatchedEvents.append(ev); 329 mMatchedEvents.append(ev);
313 continue; 330 continue;
314 } 331 }
315 } 332 }
316 if (mCategoryCheck->isChecked()) { 333 if (mCategoryCheck->isChecked()) {
317#if QT_VERSION >= 0x030000 334#if QT_VERSION >= 0x030000
318 if (re.search(ev->categoriesStr()) != -1) 335 if (re.search(ev->categoriesStr()) != -1)
319#else 336#else
320 if (re.match(ev->categoriesStr()) != -1) 337 if (re.match(ev->categoriesStr()) != -1)
321#endif 338#endif
322 { 339 {
323 mMatchedEvents.append(ev); 340 mMatchedEvents.append(ev);
324 continue; 341 continue;
325 } 342 }
326 } 343 }
327 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 344 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
328 QPtrList<Attendee> tmpAList = ev->attendees(); 345 QPtrList<Attendee> tmpAList = ev->attendees();
329 Attendee *a; 346 Attendee *a;
330 for (a = tmpAList.first(); a; a = tmpAList.next()) { 347 for (a = tmpAList.first(); a; a = tmpAList.next()) {
331 if (mSearchAName->isChecked()) { 348 if (mSearchAName->isChecked()) {
332#if QT_VERSION >= 0x030000 349#if QT_VERSION >= 0x030000
333 if (re.search(a->name()) != -1) 350 if (re.search(a->name()) != -1)
334#else 351#else
335 if (re.match(a->name()) != -1) 352 if (re.match(a->name()) != -1)
336#endif 353#endif
337 { 354 {
338 mMatchedEvents.append(ev); 355 mMatchedEvents.append(ev);
339 break; 356 break;
340 } 357 }
341 } 358 }
342 if (mSearchAEmail->isChecked()) { 359 if (mSearchAEmail->isChecked()) {
343#if QT_VERSION >= 0x030000 360#if QT_VERSION >= 0x030000
344 if (re.search(a->email()) != -1) 361 if (re.search(a->email()) != -1)
345#else 362#else
346 if (re.match(a->email()) != -1) 363 if (re.match(a->email()) != -1)
347#endif 364#endif
348 { 365 {
349 mMatchedEvents.append(ev); 366 mMatchedEvents.append(ev);
350 break; 367 break;
351 } 368 }
352 } 369 }
353 } 370 }
354 } 371 }
355 } 372 }
356 } 373 }
357 QPtrList<Todo> todos = mCalendar->todos( ); 374 QPtrList<Todo> todos = mCalendar->todos( );
358 if ( !mAddItems->isChecked() ) 375 if ( !mAddItems->isChecked() )
359 mMatchedTodos.clear(); 376 mMatchedTodos.clear();
360 if ( mSearchTodo->isChecked() ) { 377 if ( mSearchTodo->isChecked() ) {
361 Todo *tod; 378 Todo *tod;
362 for(tod=todos.first();tod;tod=todos.next()) { 379 for(tod=todos.first();tod;tod=todos.next()) {
363 if (mSummaryCheck->isChecked()) { 380 if (mSummaryCheck->isChecked()) {
364#if QT_VERSION >= 0x030000 381#if QT_VERSION >= 0x030000
365 if (re.search(tod->summary()) != -1) 382 if (re.search(tod->summary()) != -1)
366#else 383#else
367 if (re.match(tod->summary()) != -1) 384 if (re.match(tod->summary()) != -1)
368#endif 385#endif
369 { 386 {
370 mMatchedTodos.append(tod); 387 mMatchedTodos.append(tod);
371 continue; 388 continue;
372 } 389 }
373 } 390 }
374 if (mDescriptionCheck->isChecked()) { 391 if (mDescriptionCheck->isChecked()) {
375#if QT_VERSION >= 0x030000 392#if QT_VERSION >= 0x030000
376 if (re.search(tod->description()) != -1) 393 if (re.search(tod->description()) != -1)
377#else 394#else
378 if (re.match(tod->description()) != -1) 395 if (re.match(tod->description()) != -1)
379#endif 396#endif
380 { 397 {
381 mMatchedTodos.append(tod); 398 mMatchedTodos.append(tod);
382 continue; 399 continue;
383 } 400 }
384 } 401 }
385 if (mCategoryCheck->isChecked()) { 402 if (mCategoryCheck->isChecked()) {
386#if QT_VERSION >= 0x030000 403#if QT_VERSION >= 0x030000
387 if (re.search(tod->categoriesStr()) != -1) 404 if (re.search(tod->categoriesStr()) != -1)
388#else 405#else
389 if (re.match(tod->categoriesStr()) != -1) 406 if (re.match(tod->categoriesStr()) != -1)
390#endif 407#endif
391 { 408 {
392 mMatchedTodos.append(tod); 409 mMatchedTodos.append(tod);
393 continue; 410 continue;
394 } 411 }
395 } 412 }
396 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 413 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
397 QPtrList<Attendee> tmpAList = tod->attendees(); 414 QPtrList<Attendee> tmpAList = tod->attendees();
398 Attendee *a; 415 Attendee *a;
399 for (a = tmpAList.first(); a; a = tmpAList.next()) { 416 for (a = tmpAList.first(); a; a = tmpAList.next()) {
400 if (mSearchAName->isChecked()) { 417 if (mSearchAName->isChecked()) {
401#if QT_VERSION >= 0x030000 418#if QT_VERSION >= 0x030000
402 if (re.search(a->name()) != -1) 419 if (re.search(a->name()) != -1)
403#else 420#else
404 if (re.match(a->name()) != -1) 421 if (re.match(a->name()) != -1)
405#endif 422#endif
406 { 423 {
407 mMatchedTodos.append(tod); 424 mMatchedTodos.append(tod);
408 break; 425 break;
409 } 426 }
410 } 427 }
411 if (mSearchAEmail->isChecked()) { 428 if (mSearchAEmail->isChecked()) {
412#if QT_VERSION >= 0x030000 429#if QT_VERSION >= 0x030000
413 if (re.search(a->email()) != -1) 430 if (re.search(a->email()) != -1)
414#else 431#else
415 if (re.match(a->email()) != -1) 432 if (re.match(a->email()) != -1)
416#endif 433#endif
417 { 434 {
418 mMatchedTodos.append(tod); 435 mMatchedTodos.append(tod);
419 break; 436 break;
420 } 437 }
421 } 438 }
422 } 439 }
423 } 440 }
424 } 441 }
425 } 442 }
426 if ( !mAddItems->isChecked() ) 443 if ( !mAddItems->isChecked() )
427 mMatchedJournals.clear(); 444 mMatchedJournals.clear();
428 if (mSearchJournal->isChecked() ) { 445 if (mSearchJournal->isChecked() ) {
429 QPtrList<Journal> journals = mCalendar->journals( ); 446 QPtrList<Journal> journals = mCalendar->journals( );
430 Journal* journ; 447 Journal* journ;
431 448
432 for(journ=journals.first();journ;journ=journals.next()) { 449 for(journ=journals.first();journ;journ=journals.next()) {
433 if ( journ->dtStart().date() <= mEndDate->date() 450 if ( journ->dtStart().date() <= mEndDate->date()
434 &&journ->dtStart().date() >= mStartDate->date()) { 451 &&journ->dtStart().date() >= mStartDate->date()) {
435#if QT_VERSION >= 0x030000 452#if QT_VERSION >= 0x030000
436 if (re.search(journ->description()) != -1) 453 if (re.search(journ->description()) != -1)
437#else 454#else
438 if (re.match(journ->description()) != -1) 455 if (re.match(journ->description()) != -1)
439#endif 456#endif
440 { 457 {
441 mMatchedJournals.append(journ); 458 mMatchedJournals.append(journ);
442 continue; 459 continue;
443 } 460 }
444 } 461 }
445 } 462 }
446 } 463 }
447 464
448} 465}
449 466
450void SearchDialog::keyPressEvent ( QKeyEvent *e) 467void SearchDialog::keyPressEvent ( QKeyEvent *e)
451{ 468{
452 switch ( e->key() ) { 469 switch ( e->key() ) {
453 case Qt::Key_Escape: 470 case Qt::Key_Escape:
454 close(); 471 close();
455 break; 472 break;
456 case Qt::Key_F: 473 case Qt::Key_F:
457 if ( e->state() == Qt::ControlButton ) { 474 if ( e->state() == Qt::ControlButton ) {
458 475
459 } 476 }
460 break; 477 break;
461 case Qt::Key_Return: 478 case Qt::Key_Return:
462 case Qt::Key_Enter: 479 case Qt::Key_Enter:
463 doSearch(); 480 doSearch();
464 break; 481 break;
465 482
466 default: 483 default:
467 e->ignore(); 484 e->ignore();
468 } 485 }
469} 486}
470 487
471//mMatchedJournals; 488//mMatchedJournals;
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index 11ad2f0..b345b98 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -1,96 +1,99 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef SEARCHDIALOG_H 24#ifndef SEARCHDIALOG_H
25#define SEARCHDIALOG_H 25#define SEARCHDIALOG_H
26 26
27#include <qregexp.h> 27#include <qregexp.h>
28 28
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30#include <qvbox.h> 30#include <qvbox.h>
31 31
32#include <libkcal/calendar.h> 32#include <libkcal/calendar.h>
33 33
34#include "kolistview.h" 34#include "kolistview.h"
35 35
36class KDateEdit; 36class KDateEdit;
37class QCheckBox; 37class QCheckBox;
38class QLineEdit; 38class QLineEdit;
39class KLineEdit; 39class KLineEdit;
40class QLabel; 40class QLabel;
41class CalendarView; 41class CalendarView;
42 42
43using namespace KCal; 43using namespace KCal;
44class SearchDialog : public QVBox 44class SearchDialog : public QVBox
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
47 public: 47 public:
48 SearchDialog(Calendar *calendar,CalendarView *parent=0); 48 SearchDialog(Calendar *calendar,CalendarView *parent=0);
49 virtual ~SearchDialog(); 49 virtual ~SearchDialog();
50 KOListView *listview(){ return listView;} 50 KOListView *listview(){ return listView;}
51 void updateView(); 51 void updateView();
52 void raiseAndSelect(); 52 void raiseAndSelect();
53 53
54 public slots: 54 public slots:
55 void changeEventDisplay(Event *, int) { updateView(); } 55 void changeEventDisplay(Event *, int) { updateView(); }
56 void updateConfig(); 56 void updateConfig();
57 void updateList(); 57 void updateList();
58 protected slots: 58 protected slots:
59 void setFocusToList(); 59 void setFocusToList();
60 void accept(); 60 void accept();
61 void doSearch(); 61 void doSearch();
62 void searchTextChanged( const QString &_text ); 62 void searchTextChanged( const QString &_text );
63 void toggleCheckboxes();
63 64
64 signals: 65 signals:
65 void showEventSignal(Event *); 66 void showEventSignal(Event *);
66 void editEventSignal(Event *); 67 void editEventSignal(Event *);
67 void deleteEventSignal(Event *); 68 void deleteEventSignal(Event *);
68 69
69 private: 70 private:
71
72 QHBox *incidenceGroup ,*subjectGroup ,*attendeeGroup;
70 void search(const QRegExp &); 73 void search(const QRegExp &);
71 74
72 Calendar *mCalendar; 75 Calendar *mCalendar;
73 76
74 QPtrList<Event> mMatchedEvents; 77 QPtrList<Event> mMatchedEvents;
75 QPtrList<Todo> mMatchedTodos; 78 QPtrList<Todo> mMatchedTodos;
76 QPtrList<Journal> mMatchedJournals; 79 QPtrList<Journal> mMatchedJournals;
77 80
78 QLabel *searchLabel; 81 QLabel *searchLabel;
79 KLineEdit *searchEdit; 82 KLineEdit *searchEdit;
80 KOListView *listView; 83 KOListView *listView;
81 84
82 KDateEdit *mStartDate; 85 KDateEdit *mStartDate;
83 KDateEdit *mEndDate; 86 KDateEdit *mEndDate;
84 QCheckBox *mSummaryCheck; 87 QCheckBox *mSummaryCheck;
85 QCheckBox *mDescriptionCheck; 88 QCheckBox *mDescriptionCheck;
86 QCheckBox *mCategoryCheck; 89 QCheckBox *mCategoryCheck;
87 QCheckBox *mSearchEvent; 90 QCheckBox *mSearchEvent;
88 QCheckBox *mSearchTodo; 91 QCheckBox *mSearchTodo;
89 QCheckBox *mSearchJournal; 92 QCheckBox *mSearchJournal;
90 QCheckBox *mSearchAName; 93 QCheckBox *mSearchAName;
91 QCheckBox *mSearchAEmail; 94 QCheckBox *mSearchAEmail;
92 QCheckBox *mAddItems; 95 QCheckBox *mAddItems;
93 void keyPressEvent ( QKeyEvent *e) ; 96 void keyPressEvent ( QKeyEvent *e) ;
94}; 97};
95 98
96#endif 99#endif
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 93538ec..d3797ae 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,963 +1,984 @@
1/* 1/*
2 This file is part of KdePim/Pi. 2 This file is part of KdePim/Pi.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
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/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qgroupbox.h> 34#include <qgroupbox.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qbuttongroup.h> 37#include <qbuttongroup.h>
38#include <qcheckbox.h> 38#include <qcheckbox.h>
39#include <qfile.h> 39#include <qfile.h>
40#include <qvbox.h> 40#include <qvbox.h>
41#include <qdir.h> 41#include <qdir.h>
42#include <qregexp.h> 42#include <qregexp.h>
43#include <qspinbox.h> 43#include <qspinbox.h>
44 44
45#include <kdialog.h> 45#include <kdialog.h>
46#include <kprefsdialog.h> 46#include <kprefsdialog.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobalsettings.h> 48#include <kglobalsettings.h>
49#include <kdateedit.h> 49#include <kdateedit.h>
50#include <kglobal.h> 50#include <kglobal.h>
51#include <stdlib.h> 51#include <stdlib.h>
52 52
53/*US 53/*US
54#include <qcheckbox.h> 54#include <qcheckbox.h>
55#include <qframe.h> 55#include <qframe.h>
56#include <qpushbutton.h> 56#include <qpushbutton.h>
57#include <qcombobox.h> 57#include <qcombobox.h>
58#include <qlineedit.h> 58#include <qlineedit.h>
59#include <qlabel.h> 59#include <qlabel.h>
60#include <qfile.h> 60#include <qfile.h>
61 61
62#include <kconfig.h> 62#include <kconfig.h>
63#include <kdebug.h> 63#include <kdebug.h>
64#include <kdialog.h> 64#include <kdialog.h>
65#include <klistview.h> 65#include <klistview.h>
66#include <klocale.h> 66#include <klocale.h>
67#include <kglobal.h> 67#include <kglobal.h>
68#include <kmessagebox.h> 68#include <kmessagebox.h>
69#include <kstandarddirs.h> 69#include <kstandarddirs.h>
70 70
71#ifndef KAB_EMBEDDED 71#ifndef KAB_EMBEDDED
72#include <ktrader.h> 72#include <ktrader.h>
73#else // KAB_EMBEDDED 73#else // KAB_EMBEDDED
74#include <mergewidget.h> 74#include <mergewidget.h>
75#include <distributionlistwidget.h> 75#include <distributionlistwidget.h>
76#endif // KAB_EMBEDDED 76#endif // KAB_EMBEDDED
77 77
78#include "addresseewidget.h" 78#include "addresseewidget.h"
79#include "extensionconfigdialog.h" 79#include "extensionconfigdialog.h"
80#include "extensionwidget.h" 80#include "extensionwidget.h"
81*/ 81*/
82 82
83#include "qapplication.h" 83#include "qapplication.h"
84 84
85#include "kpimglobalprefs.h" 85#include "kpimglobalprefs.h"
86 86
87#include "kdepimconfigwidget.h" 87#include "kdepimconfigwidget.h"
88#include <kprefs.h> 88#include <kprefs.h>
89#include <kmessagebox.h> 89#include <kmessagebox.h>
90 90
91 91
92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
93 : KPrefsWidget(prefs, parent, name ) 93 : KPrefsWidget(prefs, parent, name )
94{ 94{
95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
101 101
102 102
103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
104 KDialog::spacingHint() ); 104 KDialog::spacingHint() );
105 105
106 tabWidget = new QTabWidget( this ); 106 tabWidget = new QTabWidget( this );
107 topLayout->addWidget( tabWidget ); 107 topLayout->addWidget( tabWidget );
108 108
109 109
110 setupLocaleTab(); 110 setupLocaleTab();
111 setupLocaleDateTab(); 111 setupLocaleDateTab();
112 setupTimeZoneTab(); 112 setupTimeZoneTab();
113 setupExternalAppTab(); 113 setupExternalAppTab();
114 setupStoreTab(); 114 setupStoreTab();
115 setupBackupTab(); 115 setupBackupTab();
116} 116}
117void KDEPIMConfigWidget::showTimeZoneTab() 117void KDEPIMConfigWidget::showTimeZoneTab()
118{ 118{
119 tabWidget->setCurrentPage ( 3 ) ; 119 tabWidget->setCurrentPage ( 3 ) ;
120} 120}
121void KDEPIMConfigWidget::setupBackupTab() 121void KDEPIMConfigWidget::setupBackupTab()
122{ 122{
123 QVBox *colorPage = new QVBox( this ); 123 QVBox *colorPage = new QVBox( this );
124 tabWidget->addTab( colorPage, i18n( "Backup" ) ); 124 tabWidget->addTab( colorPage, i18n( "Backup" ) );
125 QWidget* topFrame = new QWidget( colorPage ); 125 QWidget* topFrame = new QWidget( colorPage );
126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), 127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"),
128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); 128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame);
129 topLayout->addWidget((QWidget*)sb->checkBox()); 129 topLayout->addWidget((QWidget*)sb->checkBox());
130 QWidget* bupFrame = new QWidget( topFrame ); 130 QWidget* bupFrame = new QWidget( topFrame );
131 topLayout->addWidget((bupFrame)); 131 topLayout->addWidget((bupFrame));
132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); 132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) );
133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); 133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame);
134 sb = addWidBool(i18n("Use standard backup dir"), 134 sb = addWidBool(i18n("Use standard backup dir"),
135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); 135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame);
136 bupLayout->addWidget((QWidget*)sb->checkBox()); 136 bupLayout->addWidget((QWidget*)sb->checkBox());
137 mBackupUrl = new KURLRequester( bupFrame ); 137 mBackupUrl = new KURLRequester( bupFrame );
138 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 138 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
139 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); 139 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) );
140 bupLayout->addWidget( mBackupUrl ); 140 bupLayout->addWidget( mBackupUrl );
141 141
142 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); 142 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir );
143 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); 143 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled );
144 QHBox *dummy = new QHBox(bupFrame); 144 QHBox *dummy = new QHBox(bupFrame);
145 new QLabel(i18n("Number of Backups:"),dummy); 145 new QLabel(i18n("Number of Backups:"),dummy);
146 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); 146 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy);
147 new QLabel(i18n(" "),dummy); 147 new QLabel(i18n(" "),dummy);
148 bupLayout->addWidget( dummy ); 148 bupLayout->addWidget( dummy );
149 149
150 dummy = new QHBox(bupFrame); 150 dummy = new QHBox(bupFrame);
151 new QLabel(i18n("Make backup every "),dummy); 151 new QLabel(i18n("Make backup every "),dummy);
152 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); 152 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
153 new QLabel(i18n(" days"),dummy); 153 new QLabel(i18n(" days"),dummy);
154 new QLabel(i18n(" "),dummy); 154 new QLabel(i18n(" "),dummy);
155 bupLayout->addWidget( dummy ); 155 bupLayout->addWidget( dummy );
156 QString localKdeDir; 156 QString localKdeDir;
157 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 157 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
158 if ( ! localKdeDir.isEmpty() ) { 158 if ( ! localKdeDir.isEmpty() ) {
159 sb->checkBox()->setEnabled( false ); 159 sb->checkBox()->setEnabled( false );
160 sb->checkBox()->setChecked( true ); 160 sb->checkBox()->setChecked( true );
161 mBackupUrl->setEnabled( false ); 161 mBackupUrl->setEnabled( false );
162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; 162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true;
163 } 163 }
164 164
165} 165}
166void KDEPIMConfigWidget::setupStoreTab() 166void KDEPIMConfigWidget::setupStoreTab()
167{ 167{
168 QVBox *colorPage = new QVBox( this ); 168 QVBox *colorPage = new QVBox( this );
169 tabWidget->addTab( colorPage, i18n( "Colors" ) ); 169 tabWidget->addTab( colorPage, i18n( "Colors" ) );
170 QWidget* cw = new QWidget( colorPage ); 170 QWidget* cw = new QWidget( colorPage );
171 KPrefsWidColor *holidayColor = 171 KPrefsWidColor *holidayColor =
172 addWidColor(i18n("Alternating background of list views"), 172 addWidColor(i18n("Alternating background of list views"),
173 &(KPimGlobalPrefs::instance()->mAlternateColor),cw); 173 &(KPimGlobalPrefs::instance()->mAlternateColor),cw);
174 QHBoxLayout *topLayout = new QHBoxLayout(cw); 174 QHBoxLayout *topLayout = new QHBoxLayout(cw);
175 topLayout->addWidget(holidayColor->label()); 175 topLayout->addWidget(holidayColor->label());
176 topLayout->addWidget( (QWidget* )holidayColor->button()); 176 topLayout->addWidget( (QWidget* )holidayColor->button());
177 177
178 178
179 QVBox *storePage = new QVBox( this ); 179 QVBox *storePage = new QVBox( this );
180 if ( QApplication::desktop()->height() > 240 )
180 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 181 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
181 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 182 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
182 mStoreUrl = new KURLRequester( storePage ); 183 mStoreUrl = new KURLRequester( storePage );
183 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 184 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
184#ifdef DESKTOP_VERSION 185#ifdef DESKTOP_VERSION
185 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; 186 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
186 QFileInfo fi ( confFile ); 187 QFileInfo fi ( confFile );
187 if ( fi.exists() ) { 188 if ( fi.exists() ) {
188 KConfig cfg ( confFile ); 189 KConfig cfg ( confFile );
189 cfg.setGroup("Global"); 190 cfg.setGroup("Global");
190 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); 191 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
191 if ( localKdeDir != "x_x_x" ) { 192 if ( localKdeDir != "x_x_x" ) {
192 mStoreUrl->setURL( localKdeDir ); 193 mStoreUrl->setURL( localKdeDir );
193 qDebug("Reading config from %s ", confFile.latin1()); 194 qDebug("Reading config from %s ", confFile.latin1());
194 } 195 }
195 } 196 }
196 197
197#endif 198#endif
198 new QLabel( i18n("New dirs are created automatically"), storePage ); 199 new QLabel( i18n("New dirs are created automatically"), storePage );
199 QHBox *bb = new QHBox( storePage ); 200 QHBox *bb = new QHBox( storePage );
200 QPushButton * pb; 201 QPushButton * pb;
201 if ( QApplication::desktop()->width() < 640 ) 202 if ( QApplication::desktop()->width() < 640 )
202 pb = new QPushButton ( i18n("Save"), bb ); 203 pb = new QPushButton ( i18n("Save"), bb );
203 else 204 else
204 pb = new QPushButton ( i18n("Save settings"), bb ); 205 pb = new QPushButton ( i18n("Save settings"), bb );
205 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 206 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
206 pb = new QPushButton ( i18n("Save standard"), bb ); 207 pb = new QPushButton ( i18n("Save standard"), bb );
207 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 208 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
208#ifdef DESKTOP_VERSION 209#ifdef DESKTOP_VERSION
209 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); 210 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
210 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); 211 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
211#endif 212#endif
212 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 213 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
213 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 214 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
214 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 215 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
215} 216}
216void KDEPIMConfigWidget::setLocalStore() 217void KDEPIMConfigWidget::setLocalStore()
217{ 218{
218 mStoreUrl->setURL( "LOCAL:kdepimpi" ); 219 mStoreUrl->setURL( "LOCAL:kdepimpi" );
219 saveStoreSettings(); 220 saveStoreSettings();
220 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); 221 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data.");
221 KMessageBox::information( this, message); 222 KMessageBox::information( this, message);
222} 223}
223void KDEPIMConfigWidget::setStandardStore() 224void KDEPIMConfigWidget::setStandardStore()
224{ 225{
225 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 226 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
226 saveStoreSettings(); 227 saveStoreSettings();
227} 228}
228void KDEPIMConfigWidget::saveStoreSettings() 229void KDEPIMConfigWidget::saveStoreSettings()
229{ 230{
230 if ( !mStoreUrl->url().isEmpty() ) { 231 if ( !mStoreUrl->url().isEmpty() ) {
231 QString path = QDir::homeDirPath(); 232 QString path = QDir::homeDirPath();
232 QString url = mStoreUrl->url(); 233 QString url = mStoreUrl->url();
233#ifdef DESKTOP_VERSION 234#ifdef DESKTOP_VERSION
234 if ( url.startsWith( "LOCAL:" ) ) { 235 if ( url.startsWith( "LOCAL:" ) ) {
235 path = qApp->applicationDirPath () ; 236 path = qApp->applicationDirPath () ;
236 } 237 }
237#endif 238#endif
238 KConfig cfg ( path + "/.microkdehome" ); 239 KConfig cfg ( path + "/.microkdehome" );
239 cfg.setGroup("Global"); 240 cfg.setGroup("Global");
240 cfg.writeEntry( "MICROKDEHOME", url ); 241 cfg.writeEntry( "MICROKDEHOME", url );
241 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); 242 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
242 cfg.sync(); 243 cfg.sync();
243 } else { 244 } else {
244 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 245 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
245 saveStoreSettings(); 246 saveStoreSettings();
246 } 247 }
247} 248}
248void KDEPIMConfigWidget::setupExternalAppTab() 249void KDEPIMConfigWidget::setupExternalAppTab()
249{ 250{
250 QWidget *externalAppsPage = new QWidget( this ); 251 QWidget *externalAppsPage = new QWidget( this );
251 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 252 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
252 KDialog::spacingHintSmall() ); 253 KDialog::spacingHintSmall() );
253 254
254 mExternalApps = new QComboBox( externalAppsPage ); 255 mExternalApps = new QComboBox( externalAppsPage );
255 256
256 QMap<ExternalAppHandler::Types, QString>::Iterator it; 257 QMap<ExternalAppHandler::Types, QString>::Iterator it;
257 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 258 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
258 mExternalApps->insertItem( it.data(), it.key() ); 259 mExternalApps->insertItem( it.data(), it.key() );
259 260
260 layout->addWidget( mExternalApps ); 261 layout->addWidget( mExternalApps );
261 262
262 connect( mExternalApps, SIGNAL( activated( int ) ), 263 connect( mExternalApps, SIGNAL( activated( int ) ),
263 this, SLOT (externalapp_changed( int ) ) ); 264 this, SLOT (externalapp_changed( int ) ) );
264 265
265 266
266 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 267 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
267 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 268 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
268 mExternalAppGroupBox->layout()->setMargin(4); 269 mExternalAppGroupBox->layout()->setMargin(4);
269 270
270 mClient = new QComboBox( mExternalAppGroupBox ); 271 mClient = new QComboBox( mExternalAppGroupBox );
271 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 272 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
272 273
273 connect( mClient, SIGNAL( activated( int ) ), 274 connect( mClient, SIGNAL( activated( int ) ),
274 this, SLOT (client_changed( int ) ) ); 275 this, SLOT (client_changed( int ) ) );
275 276
276 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 277 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
277 boxLayout->addWidget( lab, 1, 0 ); 278 boxLayout->addWidget( lab, 1, 0 );
278 mChannel = new QLineEdit(mExternalAppGroupBox); 279 mChannel = new QLineEdit(mExternalAppGroupBox);
279 mChannel->setReadOnly(true); 280 mChannel->setReadOnly(true);
280 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 281 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
281 282
282 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 283 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
283 boxLayout->addWidget( lab, 3, 0 ); 284 boxLayout->addWidget( lab, 3, 0 );
284 mMessage = new QLineEdit(mExternalAppGroupBox); 285 mMessage = new QLineEdit(mExternalAppGroupBox);
285 mMessage->setReadOnly(true); 286 mMessage->setReadOnly(true);
286 boxLayout->addWidget( mMessage , 4, 0); 287 boxLayout->addWidget( mMessage , 4, 0);
287 288
288 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 289 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
289 boxLayout->addWidget( lab, 3, 1 ); 290 boxLayout->addWidget( lab, 3, 1 );
290 mParameters = new QLineEdit(mExternalAppGroupBox); 291 mParameters = new QLineEdit(mExternalAppGroupBox);
291 mParameters->setReadOnly(true); 292 mParameters->setReadOnly(true);
292 boxLayout->addWidget( mParameters, 4, 1 ); 293 boxLayout->addWidget( mParameters, 4, 1 );
293 294 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
294 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 295 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
295 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 296
296 297
297 298 if ( QApplication::desktop()->height() > 240 ) {
298 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 299 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
299 boxLayout->addWidget( lab, 6, 0 ); 300 boxLayout->addWidget( lab, 6, 0 );
300 mMessage2 = new QLineEdit(mExternalAppGroupBox); 301 mMessage2 = new QLineEdit(mExternalAppGroupBox);
301 mMessage2->setReadOnly(true); 302 mMessage2->setReadOnly(true);
302 boxLayout->addWidget( mMessage2 , 7, 0); 303 boxLayout->addWidget( mMessage2 , 7, 0);
303 304
304 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 305 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
305 boxLayout->addWidget( lab, 6, 1 ); 306 boxLayout->addWidget( lab, 6, 1 );
306 mParameters2 = new QLineEdit(mExternalAppGroupBox); 307 mParameters2 = new QLineEdit(mExternalAppGroupBox);
307 mParameters2->setReadOnly(true); 308 mParameters2->setReadOnly(true);
308 boxLayout->addWidget( mParameters2, 7, 1 ); 309 boxLayout->addWidget( mParameters2, 7, 1 );
309 310
310 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 311 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
311 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 312 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
312 313 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
314 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
315 } else {
316 mMessage2 = 0;
317 mParameters2 = 0;
318 }
313 319
314 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 320 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
315 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 321 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
316 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 322 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
317 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
318 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
319 323
320 324
321 layout->addWidget( mExternalAppGroupBox ); 325 layout->addWidget( mExternalAppGroupBox );
322 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 326 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
323 327
324} 328}
325 329
326 330
327void KDEPIMConfigWidget::setupLocaleDateTab() 331void KDEPIMConfigWidget::setupLocaleDateTab()
328{ 332{
329 QWidget *topFrame = new QWidget( this ); 333 QWidget *topFrame = new QWidget( this );
330 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 334 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
331 335
332 topLayout->setSpacing(KDialog::spacingHintSmall()); 336 topLayout->setSpacing(KDialog::spacingHintSmall());
333 topLayout->setMargin(KDialog::marginHintSmall()); 337 topLayout->setMargin(KDialog::marginHintSmall());
334 int iii = 0; 338 int iii = 0;
335 339
336 340
337 KPrefsWidRadios *syncPrefsGroup = 341 KPrefsWidRadios *syncPrefsGroup =
338 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 342 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
339 QString format; 343 QString format;
340 if ( QApplication::desktop()->width() < 480 ) 344 if ( QApplication::desktop()->width() < 480 )
341 format = "(%d.%m.%Y)"; 345 format = "(%d.%m.%Y)";
342 else 346 else
343 format = "(%d.%m.%Y|%A %d %B %Y)"; 347 format = "(%d.%m.%Y|%A %d %B %Y)";
344 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 348 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
345 if ( QApplication::desktop()->width() < 480 ) 349 if ( QApplication::desktop()->width() < 480 )
346 format = "(%m.%d.%Y)"; 350 format = "(%m.%d.%Y)";
347 else 351 else
348 format = "(%m.%d.%Y|%A %B %d %Y)"; 352 format = "(%m.%d.%Y|%A %B %d %Y)";
349 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 353 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
350 if ( QApplication::desktop()->width() < 480 ) 354 if ( QApplication::desktop()->width() < 480 )
351 format = "(%Y-%m-%d)"; 355 format = "(%Y-%m-%d)";
352 else 356 else
353 format = "(%Y-%m-%d|%A %Y %B %d)"; 357 format = "(%Y-%m-%d|%A %Y %B %d)";
354 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 358 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
355 syncPrefsGroup->addRadio(i18n("User defined")); 359 syncPrefsGroup->addRadio(i18n("User defined"));
356 if ( QApplication::desktop()->width() < 480 ) { 360 if ( QApplication::desktop()->width() < 480 ) {
357 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 361 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
358 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 362 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
359 } 363 }
360 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 364 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
361 ++iii; 365 ++iii;
362 ++iii; 366 ++iii;
363 QLabel * lab; 367 QLabel * lab;
364 mUserDateFormatLong = new QLineEdit(topFrame); 368 mUserDateFormatLong = new QLineEdit(topFrame);
365 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 369 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
366 topLayout->addWidget(lab ,iii,0); 370 topLayout->addWidget(lab ,iii,0);
367 topLayout->addWidget(mUserDateFormatLong,iii,1); 371 topLayout->addWidget(mUserDateFormatLong,iii,1);
368 ++iii; 372 ++iii;
369 mUserDateFormatShort = new QLineEdit(topFrame); 373 mUserDateFormatShort = new QLineEdit(topFrame);
370 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 374 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
371 topLayout->addWidget(lab ,iii,0); 375 topLayout->addWidget(lab ,iii,0);
372 topLayout->addWidget(mUserDateFormatShort,iii,1); 376 topLayout->addWidget(mUserDateFormatShort,iii,1);
373 ++iii; 377 ++iii;
374 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 378 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
375 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 379 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
376 ++iii; 380 ++iii;
377 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 381 //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() );
378 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 382 if ( QApplication::desktop()->height() > 240 ) {
379 ++iii; 383 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
380 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 384 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
381 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 385 ++iii;
382 ++iii; 386 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
387 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
388 ++iii;
389 }
383 390
384 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 391 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
385 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 392 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
386 393
387 394
388 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 395 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
389} 396}
390 397
391void KDEPIMConfigWidget::setupLocaleTab() 398void KDEPIMConfigWidget::setupLocaleTab()
392{ 399{
393 400
394 QWidget *topFrame = new QWidget( this ); 401 QWidget *topFrame = new QWidget( this );
395 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 402 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
396 403
397 topLayout->setSpacing(KDialog::spacingHint()); 404 topLayout->setSpacing(KDialog::spacingHint());
398 topLayout->setMargin(KDialog::marginHint()); 405 topLayout->setMargin(KDialog::marginHint());
399 int iii = 0; 406 int iii = 0;
400 KPrefsWidRadios *syncPrefsGroup = 407 KPrefsWidRadios *syncPrefsGroup =
401 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 408 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
402 syncPrefsGroup->addRadio(i18n("English")); 409 syncPrefsGroup->addRadio(i18n("English"));
403 syncPrefsGroup->addRadio(i18n("German")); 410 syncPrefsGroup->addRadio(i18n("German"));
404 syncPrefsGroup->addRadio(i18n("French")); 411 syncPrefsGroup->addRadio(i18n("French"));
405 syncPrefsGroup->addRadio(i18n("Italian")); 412 syncPrefsGroup->addRadio(i18n("Italian"));
406 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 413 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
407 if ( QApplication::desktop()->width() < 300 ) { 414 if ( QApplication::desktop()->width() < 300 ) {
408 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 415 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
409 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 416 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
410 } 417 }
411 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 418 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
412 ++iii; 419 ++iii;
413 420
414 421
415 tabWidget->addTab( topFrame, i18n( "Language" ) ); 422 tabWidget->addTab( topFrame, i18n( "Language" ) );
416 topFrame = new QWidget( this ); 423 topFrame = new QWidget( this );
417 topLayout = new QGridLayout(topFrame,4,2); 424 topLayout = new QGridLayout(topFrame,4,2);
418 425
419 topLayout->setSpacing(KDialog::spacingHint()); 426 topLayout->setSpacing(KDialog::spacingHint());
420 topLayout->setMargin(KDialog::marginHint()); 427 topLayout->setMargin(KDialog::marginHint());
421 iii = 0; 428 iii = 0;
422 syncPrefsGroup = 429 syncPrefsGroup =
423 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 430 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
424 if ( QApplication::desktop()->width() > 300 ) 431 if ( QApplication::desktop()->width() > 300 )
425 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 432 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
426 syncPrefsGroup->addRadio(i18n("24:00")); 433 syncPrefsGroup->addRadio(i18n("24:00"));
427 syncPrefsGroup->addRadio(i18n("12:00am")); 434 syncPrefsGroup->addRadio(i18n("12:00am"));
428 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 435 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
429 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 436 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
430 ++iii; 437 ++iii;
431 438
432 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 439 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
433 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 440 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
434 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 441 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
435 ++iii; 442 ++iii;
436 443
437 444
438 tabWidget->addTab( topFrame, i18n( "Time Format" ) ); 445 tabWidget->addTab( topFrame, i18n( "Time Format" ) );
439 446
440} 447}
441 448
442 449
443void KDEPIMConfigWidget::setupTimeZoneTab() 450void KDEPIMConfigWidget::setupTimeZoneTab()
444{ 451{
445 QWidget *topFrame; 452 QWidget *topFrame;
446 QGridLayout *topLayout ; 453 QGridLayout *topLayout ;
447 454
448 455
449 456
450 457
451 458
452 459
453 topFrame = new QWidget( this ); 460 topFrame = new QWidget( this );
454 topLayout = new QGridLayout( topFrame, 5, 2); 461 topLayout = new QGridLayout( topFrame, 5, 2);
455 topLayout->setSpacing(KDialog::spacingHintSmall()); 462 topLayout->setSpacing(KDialog::spacingHintSmall());
456 topLayout->setMargin(KDialog::marginHintSmall()); 463 topLayout->setMargin(KDialog::marginHintSmall());
457 464
458 QHBox *timeZoneBox = new QHBox( topFrame ); 465 QHBox *timeZoneBox = new QHBox( topFrame );
459 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 466 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
460 467
461 new QLabel( i18n("Timezone:"), timeZoneBox ); 468 new QLabel( i18n("Timezone:"), timeZoneBox );
462 mTimeZoneCombo = new QComboBox( timeZoneBox ); 469 mTimeZoneCombo = new QComboBox( timeZoneBox );
463 if ( QApplication::desktop()->width() < 300 ) { 470 if ( QApplication::desktop()->width() < 300 ) {
464 mTimeZoneCombo->setMaximumWidth(150); 471 mTimeZoneCombo->setMaximumWidth(150);
465 } 472 }
466 473
467 QStringList list; 474 QStringList list;
468 list = KGlobal::locale()->timeZoneList(); 475 list = KGlobal::locale()->timeZoneList();
469 mTimeZoneCombo->insertStringList(list); 476 mTimeZoneCombo->insertStringList(list);
470 477
471 // find the currently set time zone and select it 478 // find the currently set time zone and select it
472 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 479 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
473 int nCurrentlySet = 11; 480 int nCurrentlySet = 11;
474 for (int i = 0; i < mTimeZoneCombo->count(); i++) 481 for (int i = 0; i < mTimeZoneCombo->count(); i++)
475 { 482 {
476 if (mTimeZoneCombo->text(i) == sCurrentlySet) 483 if (mTimeZoneCombo->text(i) == sCurrentlySet)
477 { 484 {
478 nCurrentlySet = i; 485 nCurrentlySet = i;
479 break; 486 break;
480 } 487 }
481 } 488 }
482 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 489 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
483 int iii = 1; 490 int iii = 1;
484 KPrefsWidBool *sb = 491 KPrefsWidBool *sb =
485 addWidBool(i18n("Add 30 min to selected Timezone"), 492 addWidBool(i18n("Add 30 min to selected Timezone"),
486 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); 493 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame);
487 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 494 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
488 ++iii; 495 ++iii;
489 sb = 496 sb =
490 addWidBool(i18n("Timezone has daylight saving"), 497 addWidBool(i18n("Timezone has daylight saving"),
491 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 498 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
492 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 499 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
493 ++iii; 500 ++iii;
494 QLabel* lab; 501 QLabel* lab;
495 502
496 lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 503 lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
497 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 504 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
498 ++iii; 505 ++iii;
499 506
500 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 507 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
501 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 508 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
502 ++iii; 509 ++iii;
503 lab = new QLabel( i18n("Daylight start:"), topFrame ); 510 lab = new QLabel( i18n("Daylight start:"), topFrame );
504 topLayout->addWidget(lab, iii,0); 511 topLayout->addWidget(lab, iii,0);
505 mStartDateSavingEdit = new KDateEdit(topFrame); 512 mStartDateSavingEdit = new KDateEdit(topFrame);
506 topLayout->addWidget(mStartDateSavingEdit, iii,1); 513 topLayout->addWidget(mStartDateSavingEdit, iii,1);
507 ++iii; 514 ++iii;
508 515
509 lab = new QLabel( i18n("Daylight end:"), topFrame ); 516 lab = new QLabel( i18n("Daylight end:"), topFrame );
510 topLayout->addWidget(lab, iii,0); 517 topLayout->addWidget(lab, iii,0);
511 mEndDateSavingEdit = new KDateEdit(topFrame); 518 mEndDateSavingEdit = new KDateEdit(topFrame);
512 topLayout->addWidget(mEndDateSavingEdit, iii,1); 519 topLayout->addWidget(mEndDateSavingEdit, iii,1);
513 ++iii; 520 ++iii;
514 QDate current ( 2001, 1,1); 521 QDate current ( 2001, 1,1);
515 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 522 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
516 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 523 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
517 524
518 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 525 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
519 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 526 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
520 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 527 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
521 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 528 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
522 529
523 530
524 topFrame = new QWidget( this ); 531 topFrame = new QWidget( this );
525 topLayout = new QGridLayout( topFrame, 3, 2); 532 topLayout = new QGridLayout( topFrame, 3, 2);
526 topLayout->setSpacing(KDialog::spacingHintSmall()); 533 topLayout->setSpacing(KDialog::spacingHintSmall());
527 topLayout->setMargin(KDialog::marginHintSmall()); 534 topLayout->setMargin(KDialog::marginHintSmall());
528 tabWidget->addTab( topFrame, i18n( "Fonts" ) ); 535 tabWidget->addTab( topFrame, i18n( "Fonts" ) );
529 536
530 QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame ); 537 QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame );
531 topLayout->addMultiCellWidget(labb,0,0,0,2); 538 topLayout->addMultiCellWidget(labb,0,0,0,2);
532 int i = 1; 539 int i = 1;
533 KPrefsWidFont *timeLabelsFont = 540 KPrefsWidFont *timeLabelsFont =
534 addWidFont(i18n("Kx/Pi"),i18n("Application Font"), 541 addWidFont(i18n("Kx/Pi"),i18n("Application Font"),
535 &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame); 542 &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame);
536 topLayout->addWidget(timeLabelsFont->label(),i,0); 543 topLayout->addWidget(timeLabelsFont->label(),i,0);
537 topLayout->addWidget(timeLabelsFont->preview(),i,1); 544 topLayout->addWidget(timeLabelsFont->preview(),i,1);
538 topLayout->addWidget(timeLabelsFont->button(),i,2); 545 topLayout->addWidget(timeLabelsFont->button(),i,2);
539} 546}
540 547
541void KDEPIMConfigWidget::externalapp_changed( int newApp ) 548void KDEPIMConfigWidget::externalapp_changed( int newApp )
542{ 549{
543 // first store the current data 550 // first store the current data
544 saveEditFieldSettings(); 551 saveEditFieldSettings();
545 552
546 // set mCurrentApp 553 // set mCurrentApp
547 mCurrentApp = (ExternalAppHandler::Types)newApp; 554 mCurrentApp = (ExternalAppHandler::Types)newApp;
548 555
549 // set mCurrentClient 556 // set mCurrentClient
550 switch(mCurrentApp) 557 switch(mCurrentApp)
551 { 558 {
552 case(ExternalAppHandler::EMAIL): 559 case(ExternalAppHandler::EMAIL):
553 mCurrentClient = mEmailClient; 560 mCurrentClient = mEmailClient;
554 break; 561 break;
555 case(ExternalAppHandler::PHONE): 562 case(ExternalAppHandler::PHONE):
556 mCurrentClient = mPhoneClient; 563 mCurrentClient = mPhoneClient;
557 break; 564 break;
558 case(ExternalAppHandler::SMS): 565 case(ExternalAppHandler::SMS):
559 mCurrentClient = mSMSClient; 566 mCurrentClient = mSMSClient;
560 break; 567 break;
561 case(ExternalAppHandler::FAX): 568 case(ExternalAppHandler::FAX):
562 mCurrentClient = mFaxClient; 569 mCurrentClient = mFaxClient;
563 break; 570 break;
564 case(ExternalAppHandler::PAGER): 571 case(ExternalAppHandler::PAGER):
565 mCurrentClient = mPagerClient; 572 mCurrentClient = mPagerClient;
566 break; 573 break;
567 case(ExternalAppHandler::SIP): 574 case(ExternalAppHandler::SIP):
568 mCurrentClient = mSipClient; 575 mCurrentClient = mSipClient;
569 break; 576 break;
570 default: 577 default:
571 return; 578 return;
572 } 579 }
573 580
574 // and at last update the widgets 581 // and at last update the widgets
575 updateClientWidgets(); 582 updateClientWidgets();
576} 583}
577 584
578 585
579 586
580void KDEPIMConfigWidget::client_changed( int newClient ) 587void KDEPIMConfigWidget::client_changed( int newClient )
581{ 588{
582 if (newClient == mCurrentClient) 589 if (newClient == mCurrentClient)
583 return; 590 return;
584 591
585 // first store the current data 592 // first store the current data
586 saveEditFieldSettings(); 593 saveEditFieldSettings();
587 594
588 595
589 //then reset the clientvariable 596 //then reset the clientvariable
590 mCurrentClient = newClient; 597 mCurrentClient = newClient;
591 598
592 // and at last update the widgets 599 // and at last update the widgets
593 updateClientWidgets(); 600 updateClientWidgets();
594 601
595 KPrefsWidget::modified(); 602 KPrefsWidget::modified();
596} 603}
597 604
598void KDEPIMConfigWidget::saveEditFieldSettings() 605void KDEPIMConfigWidget::saveEditFieldSettings()
599{ 606{
600 607
601 switch(mCurrentApp) 608 switch(mCurrentApp)
602 { 609 {
603 case(ExternalAppHandler::EMAIL): 610 case(ExternalAppHandler::EMAIL):
604 mEmailClient = mClient->currentItem(); 611 mEmailClient = mClient->currentItem();
605 break; 612 break;
606 case(ExternalAppHandler::PHONE): 613 case(ExternalAppHandler::PHONE):
607 mPhoneClient= mClient->currentItem(); 614 mPhoneClient= mClient->currentItem();
608 break; 615 break;
609 case(ExternalAppHandler::SMS): 616 case(ExternalAppHandler::SMS):
610 mSMSClient = mClient->currentItem(); 617 mSMSClient = mClient->currentItem();
611 break; 618 break;
612 case(ExternalAppHandler::FAX): 619 case(ExternalAppHandler::FAX):
613 mFaxClient = mClient->currentItem(); 620 mFaxClient = mClient->currentItem();
614 break; 621 break;
615 case(ExternalAppHandler::PAGER): 622 case(ExternalAppHandler::PAGER):
616 mPagerClient = mClient->currentItem(); 623 mPagerClient = mClient->currentItem();
617 break; 624 break;
618 case(ExternalAppHandler::SIP): 625 case(ExternalAppHandler::SIP):
619 mSipClient = mClient->currentItem(); 626 mSipClient = mClient->currentItem();
620 break; 627 break;
621 default: 628 default:
622 return; 629 return;
623 } 630 }
624 631
625 //store the current data back to the apropriate membervariables if we had set it to "other" 632 //store the current data back to the apropriate membervariables if we had set it to "other"
626 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 633 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
627 { 634 {
628 mEmailOtherChannel = mChannel->text(); 635 mEmailOtherChannel = mChannel->text();
629 mEmailOtherMessage = mMessage->text(); 636 mEmailOtherMessage = mMessage->text();
630 mEmailOtherMessageParameters = mParameters->text(); 637 mEmailOtherMessageParameters = mParameters->text();
631 mEmailOtherMessage2 = mMessage2->text(); 638 if ( mMessage2 )
632 mEmailOtherMessageParameters2 = mParameters2->text(); 639 mEmailOtherMessage2 = mMessage2->text();
640 if ( mParameters2 )
641 mEmailOtherMessageParameters2 = mParameters2->text();
633 } 642 }
634 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 643 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
635 { 644 {
636 mPhoneOtherChannel = mChannel->text(); 645 mPhoneOtherChannel = mChannel->text();
637 mPhoneOtherMessage = mMessage->text(); 646 mPhoneOtherMessage = mMessage->text();
638 mPhoneOtherMessageParameters = mParameters->text(); 647 mPhoneOtherMessageParameters = mParameters->text();
639 } 648 }
640 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 649 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
641 { 650 {
642 mSMSOtherChannel = mChannel->text(); 651 mSMSOtherChannel = mChannel->text();
643 mSMSOtherMessage = mMessage->text(); 652 mSMSOtherMessage = mMessage->text();
644 mSMSOtherMessageParameters = mParameters->text(); 653 mSMSOtherMessageParameters = mParameters->text();
645 } 654 }
646 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 655 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
647 { 656 {
648 mFaxOtherChannel = mChannel->text(); 657 mFaxOtherChannel = mChannel->text();
649 mFaxOtherMessage = mMessage->text(); 658 mFaxOtherMessage = mMessage->text();
650 mFaxOtherMessageParameters = mParameters->text(); 659 mFaxOtherMessageParameters = mParameters->text();
651 } 660 }
652 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 661 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
653 { 662 {
654 mPagerOtherChannel = mChannel->text(); 663 mPagerOtherChannel = mChannel->text();
655 mPagerOtherMessage = mMessage->text(); 664 mPagerOtherMessage = mMessage->text();
656 mPagerOtherMessageParameters = mParameters->text(); 665 mPagerOtherMessageParameters = mParameters->text();
657 } 666 }
658 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 667 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
659 { 668 {
660 mSipOtherChannel = mChannel->text(); 669 mSipOtherChannel = mChannel->text();
661 mSipOtherMessage = mMessage->text(); 670 mSipOtherMessage = mMessage->text();
662 mSipOtherMessageParameters = mParameters->text(); 671 mSipOtherMessageParameters = mParameters->text();
663 } 672 }
664 673
665 674
666} 675}
667 676
668void KDEPIMConfigWidget::updateClientWidgets() 677void KDEPIMConfigWidget::updateClientWidgets()
669{ 678{
670 bool blocked = signalsBlocked(); 679 bool blocked = signalsBlocked();
671 blockSignals( true ); 680 blockSignals( true );
672 681
673 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 682 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
674 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 683 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
675 if (it == mExternalAppsMap.end()) 684 if (it == mExternalAppsMap.end())
676 return; 685 return;
677 686
678 // update group box 687 // update group box
679 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 688 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
680 689
681 //update the entries in the client combobox 690 //update the entries in the client combobox
682 mClient->clear(); 691 mClient->clear();
683 692
684 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 693 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
685 DefaultAppItem* dai; 694 DefaultAppItem* dai;
686 for ( dai=items.first(); dai != 0; dai=items.next() ) 695 for ( dai=items.first(); dai != 0; dai=items.next() )
687 { 696 {
688 mClient->insertItem( i18n(dai->_label), dai->_id ); 697 mClient->insertItem( i18n(dai->_label), dai->_id );
689 698
690 if (dai->_id == mCurrentClient) 699 if (dai->_id == mCurrentClient)
691 { 700 {
692 //restore the edit fields with the data of the local membervariables if we had set it to "other". 701 //restore the edit fields with the data of the local membervariables if we had set it to "other".
693 //Otherwise take the default data from externalapphandler. 702 //Otherwise take the default data from externalapphandler.
694 mChannel->setText(dai->_channel); 703 mChannel->setText(dai->_channel);
695 mMessage->setText(dai->_message); 704 mMessage->setText(dai->_message);
696 mParameters->setText(dai->_parameters); 705 mParameters->setText(dai->_parameters);
697 mMessage2->setText(dai->_message2); 706 if ( mMessage2 )
707 mMessage2->setText(dai->_message2);
708 if ( mParameters2 )
698 mParameters2->setText(dai->_parameters2); 709 mParameters2->setText(dai->_parameters2);
699 710
700 711
701 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 712 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
702 { 713 {
703 mChannel->setText(mEmailOtherChannel); 714 mChannel->setText(mEmailOtherChannel);
704 mMessage->setText(mEmailOtherMessage); 715 mMessage->setText(mEmailOtherMessage);
705 mParameters->setText(mEmailOtherMessageParameters); 716 mParameters->setText(mEmailOtherMessageParameters);
717 if ( mMessage2 )
706 mMessage2->setText(mEmailOtherMessage2); 718 mMessage2->setText(mEmailOtherMessage2);
719 if ( mParameters2 )
707 mParameters2->setText(mEmailOtherMessageParameters2); 720 mParameters2->setText(mEmailOtherMessageParameters2);
708 } 721 }
709 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 722 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
710 { 723 {
711 mChannel->setText(mPhoneOtherChannel); 724 mChannel->setText(mPhoneOtherChannel);
712 mMessage->setText(mPhoneOtherMessage); 725 mMessage->setText(mPhoneOtherMessage);
713 mParameters->setText(mPhoneOtherMessageParameters); 726 mParameters->setText(mPhoneOtherMessageParameters);
714 } 727 }
715 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 728 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
716 { 729 {
717 mChannel->setText(mSMSOtherChannel); 730 mChannel->setText(mSMSOtherChannel);
718 mMessage->setText(mSMSOtherMessage); 731 mMessage->setText(mSMSOtherMessage);
719 mParameters->setText(mSMSOtherMessageParameters); 732 mParameters->setText(mSMSOtherMessageParameters);
720 } 733 }
721 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 734 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
722 { 735 {
723 mChannel->setText(mFaxOtherChannel); 736 mChannel->setText(mFaxOtherChannel);
724 mMessage->setText(mFaxOtherMessage); 737 mMessage->setText(mFaxOtherMessage);
725 mParameters->setText(mFaxOtherMessageParameters); 738 mParameters->setText(mFaxOtherMessageParameters);
726 } 739 }
727 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 740 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
728 { 741 {
729 mChannel->setText(mPagerOtherChannel); 742 mChannel->setText(mPagerOtherChannel);
730 mMessage->setText(mPagerOtherMessage); 743 mMessage->setText(mPagerOtherMessage);
731 mParameters->setText(mPagerOtherMessageParameters); 744 mParameters->setText(mPagerOtherMessageParameters);
732 } 745 }
733 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 746 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
734 { 747 {
735 mChannel->setText(mSipOtherChannel); 748 mChannel->setText(mSipOtherChannel);
736 mMessage->setText(mSipOtherMessage); 749 mMessage->setText(mSipOtherMessage);
737 mParameters->setText(mSipOtherMessageParameters); 750 mParameters->setText(mSipOtherMessageParameters);
738 } 751 }
739 } 752 }
740 753
741 } 754 }
742 755
743 bool readonly; 756 bool readonly;
744 bool enabled; 757 bool enabled;
745 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 758 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
746 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 759 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
747 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 760 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
748 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 761 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
749 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 762 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
750 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) 763 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)))
751 { 764 {
752 readonly = false; 765 readonly = false;
753 } 766 }
754 else 767 else
755 { 768 {
756 readonly = true; 769 readonly = true;
757 } 770 }
758 771
759 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) 772 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC))
760 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) 773 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC))
761 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) 774 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC))
762 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) 775 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC))
763 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) 776 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC))
764 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) 777 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC)))
765 { 778 {
766 enabled = false; 779 enabled = false;
767 } 780 }
768 else 781 else
769 { 782 {
770 enabled = true; 783 enabled = true;
771 } 784 }
772 785
773 786
774 mChannel->setReadOnly(readonly); 787 mChannel->setReadOnly(readonly);
775 mMessage->setReadOnly(readonly); 788 mMessage->setReadOnly(readonly);
776 mParameters->setReadOnly(readonly); 789 mParameters->setReadOnly(readonly);
790 if ( mMessage2 )
777 mMessage2->setReadOnly(readonly); 791 mMessage2->setReadOnly(readonly);
792 if ( mParameters2 )
778 mParameters2->setReadOnly(readonly); 793 mParameters2->setReadOnly(readonly);
779 794
780 mChannel->setEnabled(enabled); 795 mChannel->setEnabled(enabled);
781 mMessage->setEnabled(enabled); 796 mMessage->setEnabled(enabled);
782 mParameters->setEnabled(enabled); 797 mParameters->setEnabled(enabled);
798 if ( mMessage2 )
783 mMessage2->setEnabled(enabled); 799 mMessage2->setEnabled(enabled);
800 if ( mParameters2 )
784 mParameters2->setEnabled(enabled); 801 mParameters2->setEnabled(enabled);
785 802
786 803
787 804
788 mClient->setCurrentItem(mCurrentClient); 805 mClient->setCurrentItem(mCurrentClient);
789 806
790 807
791 // enable/disable the extra message/parameter field 808 // enable/disable the extra message/parameter field
792 if (mCurrentApp == ExternalAppHandler::EMAIL) 809 if (mCurrentApp == ExternalAppHandler::EMAIL)
793 { 810 {
794 } 811 }
795 else 812 else
796 { 813 {
814 if ( mMessage2 )
797 mMessage2->setText( "" ); 815 mMessage2->setText( "" );
816 if ( mParameters2 )
798 mParameters2->setText( "" ); 817 mParameters2->setText( "" );
799 } 818 }
800 819
801 if (enabled == true) { 820 if (enabled == true) {
821 if ( mMessage2 )
802 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 822 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
823 if ( mParameters2 )
803 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 824 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
804 } 825 }
805 826
806 827
807 blockSignals( blocked ); 828 blockSignals( blocked );
808 829
809} 830}
810 831
811void KDEPIMConfigWidget::usrReadConfig() 832void KDEPIMConfigWidget::usrReadConfig()
812{ 833{
813 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 834 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
814 835
815 bool blocked = signalsBlocked(); 836 bool blocked = signalsBlocked();
816 blockSignals( true ); 837 blockSignals( true );
817 838
818 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) 839 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir )
819 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 840 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
820 else 841 else
821 mBackupUrl->setURL(prefs->mBackupDatadir); 842 mBackupUrl->setURL(prefs->mBackupDatadir);
822 mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); 843 mBackupNumbersSpin->setValue( prefs->mBackupNumbers );
823 mBackupDayCountSpin->setValue( prefs->mBackupDayCount); 844 mBackupDayCountSpin->setValue( prefs->mBackupDayCount);
824 845
825 QString dummy = prefs->mUserDateFormatLong; 846 QString dummy = prefs->mUserDateFormatLong;
826 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 847 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
827 dummy = prefs->mUserDateFormatShort; 848 dummy = prefs->mUserDateFormatShort;
828 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 849 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
829 850
830 QDate current ( 2001, 1,1); 851 QDate current ( 2001, 1,1);
831 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); 852 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1));
832 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); 853 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1));
833 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); 854 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
834 855
835 mEmailClient = prefs->mEmailClient; 856 mEmailClient = prefs->mEmailClient;
836 mEmailOtherChannel = prefs->mEmailOtherChannel; 857 mEmailOtherChannel = prefs->mEmailOtherChannel;
837 mEmailOtherMessage = prefs->mEmailOtherMessage; 858 mEmailOtherMessage = prefs->mEmailOtherMessage;
838 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; 859 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters;
839 mEmailOtherMessage2 = prefs->mEmailOtherMessage2; 860 mEmailOtherMessage2 = prefs->mEmailOtherMessage2;
840 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; 861 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2;
841 862
842 mPhoneClient = prefs->mPhoneClient; 863 mPhoneClient = prefs->mPhoneClient;
843 mPhoneOtherChannel = prefs->mPhoneOtherChannel; 864 mPhoneOtherChannel = prefs->mPhoneOtherChannel;
844 mPhoneOtherMessage = prefs->mPhoneOtherMessage; 865 mPhoneOtherMessage = prefs->mPhoneOtherMessage;
845 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; 866 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters;
846 867
847 mFaxClient = prefs->mFaxClient; 868 mFaxClient = prefs->mFaxClient;
848 mFaxOtherChannel = prefs->mFaxOtherChannel; 869 mFaxOtherChannel = prefs->mFaxOtherChannel;
849 mFaxOtherMessage = prefs->mFaxOtherMessage; 870 mFaxOtherMessage = prefs->mFaxOtherMessage;
850 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; 871 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters;
851 872
852 mSMSClient = prefs->mSMSClient; 873 mSMSClient = prefs->mSMSClient;
853 mSMSOtherChannel = prefs->mSMSOtherChannel; 874 mSMSOtherChannel = prefs->mSMSOtherChannel;
854 mSMSOtherMessage = prefs->mSMSOtherMessage; 875 mSMSOtherMessage = prefs->mSMSOtherMessage;
855 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; 876 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters;
856 877
857 mPagerClient = prefs->mPagerClient; 878 mPagerClient = prefs->mPagerClient;
858 mPagerOtherChannel = prefs->mPagerOtherChannel; 879 mPagerOtherChannel = prefs->mPagerOtherChannel;
859 mPagerOtherMessage = prefs->mPagerOtherMessage; 880 mPagerOtherMessage = prefs->mPagerOtherMessage;
860 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; 881 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters;
861 882
862 mSipClient = prefs->mSipClient; 883 mSipClient = prefs->mSipClient;
863 mSipOtherChannel = prefs->mSipOtherChannel; 884 mSipOtherChannel = prefs->mSipOtherChannel;
864 mSipOtherMessage = prefs->mSipOtherMessage; 885 mSipOtherMessage = prefs->mSipOtherMessage;
865 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; 886 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters;
866 887
867 mCurrentApp = ExternalAppHandler::EMAIL; 888 mCurrentApp = ExternalAppHandler::EMAIL;
868 mCurrentClient = mEmailClient; 889 mCurrentClient = mEmailClient;
869 890
870 updateClientWidgets(); 891 updateClientWidgets();
871 892
872 blockSignals( blocked ); 893 blockSignals( blocked );
873 894
874} 895}
875 896
876void KDEPIMConfigWidget::usrWriteConfig() 897void KDEPIMConfigWidget::usrWriteConfig()
877{ 898{
878 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 899 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
879 900
880 saveEditFieldSettings(); 901 saveEditFieldSettings();
881 902
882 prefs->mBackupNumbers = mBackupNumbersSpin->value(); 903 prefs->mBackupNumbers = mBackupNumbersSpin->value();
883 prefs->mBackupDayCount = mBackupDayCountSpin->value(); 904 prefs->mBackupDayCount = mBackupDayCountSpin->value();
884 prefs->mBackupDatadir = mBackupUrl->url(); 905 prefs->mBackupDatadir = mBackupUrl->url();
885 906
886 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 907 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
887 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 908 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
888 909
889 prefs->mTimeZoneId = mTimeZoneCombo->currentText(); 910 prefs->mTimeZoneId = mTimeZoneCombo->currentText();
890 QDate date; 911 QDate date;
891 date = mStartDateSavingEdit->date(); 912 date = mStartDateSavingEdit->date();
892 int sub = 0; 913 int sub = 0;
893 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 914 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
894 sub = 1; 915 sub = 1;
895 prefs->mDaylightsavingStart = date.dayOfYear()-sub; 916 prefs->mDaylightsavingStart = date.dayOfYear()-sub;
896 date = mEndDateSavingEdit->date(); 917 date = mEndDateSavingEdit->date();
897 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 918 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
898 sub = 1; 919 sub = 1;
899 else 920 else
900 sub = 0; 921 sub = 0;
901 prefs->mDaylightsavingEnd = date.dayOfYear()-sub; 922 prefs->mDaylightsavingEnd = date.dayOfYear()-sub;
902 923
903 924
904 prefs->mEmailClient = mEmailClient; 925 prefs->mEmailClient = mEmailClient;
905 prefs->mEmailOtherChannel = mEmailOtherChannel; 926 prefs->mEmailOtherChannel = mEmailOtherChannel;
906 prefs->mEmailOtherMessage = mEmailOtherMessage; 927 prefs->mEmailOtherMessage = mEmailOtherMessage;
907 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; 928 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters;
908 prefs->mEmailOtherMessage2 = mEmailOtherMessage2; 929 prefs->mEmailOtherMessage2 = mEmailOtherMessage2;
909 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; 930 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2;
910 931
911 prefs->mPhoneClient = mPhoneClient; 932 prefs->mPhoneClient = mPhoneClient;
912 prefs->mPhoneOtherChannel = mPhoneOtherChannel; 933 prefs->mPhoneOtherChannel = mPhoneOtherChannel;
913 prefs->mPhoneOtherMessage = mPhoneOtherMessage; 934 prefs->mPhoneOtherMessage = mPhoneOtherMessage;
914 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; 935 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters;
915 936
916 prefs->mFaxClient = mFaxClient; 937 prefs->mFaxClient = mFaxClient;
917 prefs->mFaxOtherChannel = mFaxOtherChannel; 938 prefs->mFaxOtherChannel = mFaxOtherChannel;
918 prefs->mFaxOtherMessage = mFaxOtherMessage; 939 prefs->mFaxOtherMessage = mFaxOtherMessage;
919 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; 940 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
920 941
921 prefs->mSMSClient = mSMSClient; 942 prefs->mSMSClient = mSMSClient;
922 prefs->mSMSOtherChannel = mSMSOtherChannel; 943 prefs->mSMSOtherChannel = mSMSOtherChannel;
923 prefs->mSMSOtherMessage = mSMSOtherMessage; 944 prefs->mSMSOtherMessage = mSMSOtherMessage;
924 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; 945 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
925 946
926 prefs->mPagerClient = mPagerClient; 947 prefs->mPagerClient = mPagerClient;
927 prefs->mPagerOtherChannel = mPagerOtherChannel; 948 prefs->mPagerOtherChannel = mPagerOtherChannel;
928 prefs->mPagerOtherMessage = mPagerOtherMessage; 949 prefs->mPagerOtherMessage = mPagerOtherMessage;
929 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; 950 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
930 951
931 952
932 prefs->mSipClient = mSipClient; 953 prefs->mSipClient = mSipClient;
933 prefs->mSipOtherChannel = mSipOtherChannel; 954 prefs->mSipOtherChannel = mSipOtherChannel;
934 prefs->mSipOtherMessage = mSipOtherMessage; 955 prefs->mSipOtherMessage = mSipOtherMessage;
935 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; 956 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters;
936 957
937 //release the cache that other views can access the changed values instantanious 958 //release the cache that other views can access the changed values instantanious
938 ExternalAppHandler::instance()->loadConfig(); 959 ExternalAppHandler::instance()->loadConfig();
939 KPimGlobalPrefs::instance()->setGlobalConfig(); 960 KPimGlobalPrefs::instance()->setGlobalConfig();
940} 961}
941 962
942 963
943void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, 964void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text,
944 const QStringList *tags) 965 const QStringList *tags)
945{ 966{
946 if (tags) { 967 if (tags) {
947 int i = tags->findIndex(text); 968 int i = tags->findIndex(text);
948 if (i > 0) combo->setCurrentItem(i); 969 if (i > 0) combo->setCurrentItem(i);
949 } else { 970 } else {
950 for(int i=0;i<combo->count();++i) { 971 for(int i=0;i<combo->count();++i) {
951 if (combo->text(i) == text) { 972 if (combo->text(i) == text) {
952 combo->setCurrentItem(i); 973 combo->setCurrentItem(i);
953 break; 974 break;
954 } 975 }
955 } 976 }
956 } 977 }
957} 978}
958 979
959 980
960void KDEPIMConfigWidget::textChanged( const QString& text ) 981void KDEPIMConfigWidget::textChanged( const QString& text )
961{ 982{
962 emit changed( true ); 983 emit changed( true );
963} 984}
diff --git a/microkde/kcolorbutton.cpp b/microkde/kcolorbutton.cpp
index c7c6088..96dc256 100644
--- a/microkde/kcolorbutton.cpp
+++ b/microkde/kcolorbutton.cpp
@@ -1,47 +1,47 @@
1#include "kcolorbutton.h" 1#include "kcolorbutton.h"
2#include "kcolordialog.h" 2#include "kcolordialog.h"
3#include "qapplication.h" 3#include "qapplication.h"
4 4
5 5
6#include "qlayout.h" 6#include "qlayout.h"
7#ifdef DESKTOP_VERSION 7#ifdef DESKTOP_VERSION
8#include <qcolordialog.h> 8#include <qcolordialog.h>
9#endif 9#endif
10void KColorButton:: edit() 10void KColorButton:: edit()
11{ 11{
12 12
13#ifdef DESKTOP_VERSION 13#ifdef DESKTOP_VERSION
14 QColor col = QColorDialog::getColor ( mColor ); 14 QColor col = QColorDialog::getColor ( mColor );
15 if ( col.isValid () ) { 15 if ( col.isValid () ) {
16 mColor = col; 16 mColor = col;
17 setColor ( mColor ); 17 setColor ( mColor );
18 emit changed ( mColor ); 18 emit changed ( mColor );
19 } 19 }
20#else 20#else
21 KColorDialog* k = new KColorDialog( this ); 21 KColorDialog* k = new KColorDialog( this );
22 k->setColor( mColor ); 22 k->setColor( mColor );
23 int res = k->exec(); 23 int res = k->exec();
24 if ( res ) { 24 if ( res ) {
25 mColor = k->getColor(); 25 mColor = k->getColor();
26 setColor ( mColor ); 26 setColor ( mColor );
27 emit changed ( mColor ); 27 emit changed ( mColor );
28 } 28 }
29 delete k; 29 delete k;
30#endif 30#endif
31} 31}
32KColorButton::KColorButton( QWidget *p ):QPushButton( p ) 32KColorButton::KColorButton( QWidget *p ):QPushButton( p )
33{ 33{
34 int size = 24; 34 int size = 24;
35 if( QApplication::desktop()->width() < 480 ) 35 if( QApplication::desktop()->width() < 480 || QApplication::desktop()->height() <= 320 )
36 size = 18; 36 size = 18;
37 setFixedSize( size,size ); 37 setFixedSize( size,size );
38 connect ( this, SIGNAL( clicked() ), this ,SLOT (edit() )); 38 connect ( this, SIGNAL( clicked() ), this ,SLOT (edit() ));
39 39
40} 40}
41void KColorButton::setColor ( const QColor & c) 41void KColorButton::setColor ( const QColor & c)
42{ 42{
43 mColor = c; 43 mColor = c;
44 QPixmap pix ( height() - 4, width() - 4 ); 44 QPixmap pix ( height() - 4, width() - 4 );
45 pix.fill( c ); 45 pix.fill( c );
46 setPixmap ( pix ); 46 setPixmap ( pix );
47} 47}