-rw-r--r-- | korganizer/kodialogmanager.cpp | 3 | ||||
-rw-r--r-- | korganizer/koeditordetails.cpp | 2 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 2 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 50 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 23 | ||||
-rw-r--r-- | korganizer/searchdialog.h | 3 |
7 files changed, 74 insertions, 11 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 | ||
45 | KODialogManager::KODialogManager( CalendarView *mainView ) : | 45 | KODialogManager::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 | ||
60 | KODialogManager::~KODialogManager() | 60 | KODialogManager::~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 | ||
75 | OutgoingDialog *KODialogManager::outgoingDialog() | 75 | OutgoingDialog *KODialogManager::outgoingDialog() |
76 | { | 76 | { |
77 | createOutgoingDialog(); | 77 | createOutgoingDialog(); |
78 | return mOutgoingDialog; | 78 | return mOutgoingDialog; |
79 | } | 79 | } |
80 | 80 | ||
81 | void KODialogManager::createOutgoingDialog() | 81 | void 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 | ||
91 | void KODialogManager::showGlobalOptionsDialog( bool showSync ) | 91 | void 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 | } |
98 | void KODialogManager::showOptionsDialog( bool showSync ) | 98 | void 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 | } |
117 | void KODialogManager::showSyncOptions() | 118 | void KODialogManager::showSyncOptions() |
118 | { | 119 | { |
119 | showGlobalOptionsDialog( true ); | 120 | showGlobalOptionsDialog( true ); |
120 | 121 | ||
121 | } | 122 | } |
122 | void KODialogManager::showOutgoingDialog() | 123 | void KODialogManager::showOutgoingDialog() |
123 | { | 124 | { |
124 | createOutgoingDialog(); | 125 | createOutgoingDialog(); |
125 | mOutgoingDialog->show(); | 126 | mOutgoingDialog->show(); |
126 | mOutgoingDialog->raise(); | 127 | mOutgoingDialog->raise(); |
127 | } | 128 | } |
128 | 129 | ||
129 | IncomingDialog *KODialogManager::incomingDialog() | 130 | IncomingDialog *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 | ||
142 | void KODialogManager::createIncomingDialog() | 143 | void 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 | ||
154 | void KODialogManager::showIncomingDialog() | 155 | void KODialogManager::showIncomingDialog() |
155 | { | 156 | { |
156 | createIncomingDialog(); | 157 | createIncomingDialog(); |
157 | mIncomingDialog->show(); | 158 | mIncomingDialog->show(); |
158 | mIncomingDialog->raise(); | 159 | mIncomingDialog->raise(); |
159 | } | 160 | } |
160 | /* | 161 | /* |
161 | void KODialogManager::showCategoryEditDialog() | 162 | void KODialogManager::showCategoryEditDialog() |
162 | { | 163 | { |
163 | mCategoryEditDialog->show(); | 164 | mCategoryEditDialog->show(); |
164 | } | 165 | } |
165 | */ | 166 | */ |
166 | void KODialogManager::hideSearchDialog() | 167 | void KODialogManager::hideSearchDialog() |
167 | { | 168 | { |
168 | if (mSearchDialog) | 169 | if (mSearchDialog) |
169 | mSearchDialog->hide(); | 170 | mSearchDialog->hide(); |
170 | } | 171 | } |
171 | 172 | ||
172 | void KODialogManager::showSearchDialog() | 173 | void 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 | ||
228 | SearchDialog * KODialogManager::getSearchDialog() | 229 | SearchDialog * KODialogManager::getSearchDialog() |
229 | { | 230 | { |
230 | return mSearchDialog; | 231 | return mSearchDialog; |
231 | } | 232 | } |
232 | void KODialogManager::showArchiveDialog() | 233 | void 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 | ||
248 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) | 249 | void 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 | ||
265 | void KODialogManager::showPluginDialog() | 266 | void 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 | ||
278 | KOEventEditor *KODialogManager::getEventEditor() | 279 | KOEventEditor *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 | ||
311 | KOTodoEditor *KODialogManager::getTodoEditor() | 312 | KOTodoEditor *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 | ||
341 | void KODialogManager::updateSearchDialog() | 342 | void KODialogManager::updateSearchDialog() |
342 | { | 343 | { |
343 | if (mSearchDialog) mSearchDialog->updateView(); | 344 | if (mSearchDialog) mSearchDialog->updateView(); |
344 | } | 345 | } |
345 | 346 | ||
346 | void KODialogManager::setDocumentId( const QString &id ) | 347 | void KODialogManager::setDocumentId( const QString &id ) |
347 | { | 348 | { |
348 | if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); | 349 | if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); |
349 | } | 350 | } |
350 | 351 | ||
351 | void KODialogManager::writeSettings( KConfig *config ) | 352 | void 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 | ||
55 | template <> | 55 | template <> |
56 | CustomListViewItem<class Attendee *>::~CustomListViewItem() | 56 | CustomListViewItem<class Attendee *>::~CustomListViewItem() |
57 | { | 57 | { |
58 | delete mData; | 58 | delete mData; |
59 | } | 59 | } |
60 | 60 | ||
61 | template <> | 61 | template <> |
62 | void CustomListViewItem<class Attendee *>::updateItem() | 62 | void 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 | ||
75 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | 75 | KOEditorDetails::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 | ||
240 | KOEditorDetails::~KOEditorDetails() | 240 | KOEditorDetails::~KOEditorDetails() |
241 | { | 241 | { |
242 | } | 242 | } |
243 | 243 | ||
244 | void KOEditorDetails::removeAttendee() | 244 | void 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 | ||
260 | void KOEditorDetails::openAddressBook() | 260 | void 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 | ||
286 | void KOEditorDetails::addNewAttendee() | 286 | void 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 |
313 | void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | 313 | void 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 | ||
330 | void KOEditorDetails::insertAttendee(Attendee *a) | 330 | void 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 | ||
343 | void KOEditorDetails::setDefaults() | 343 | void 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 | ||
359 | void KOEditorDetails::readEvent(Incidence *event) | 359 | void 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 | ||
373 | void KOEditorDetails::writeEvent(Incidence *event) | 373 | void 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 | ||
386 | void KOEditorDetails::cancelAttendeeEvent(Incidence *event) | 386 | void 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 | ||
396 | bool KOEditorDetails::validateInput() | 396 | bool KOEditorDetails::validateInput() |
397 | { | 397 | { |
398 | return true; | 398 | return true; |
399 | } | 399 | } |
400 | 400 | ||
401 | void KOEditorDetails::updateAttendeeInput() | 401 | void 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 | ||
412 | void KOEditorDetails::clearAttendeeInput() | 412 | void 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 | ||
423 | void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) | 423 | void 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 | ||
439 | void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) | 439 | void 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 | ||
450 | void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c ) | 450 | void 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 | } |
457 | void KOEditorDetails::updateAttendeeItem() | 457 | void 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 | ||
60 | KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : | 60 | KOEditorGeneral::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 | ||
66 | KOEditorGeneral::~KOEditorGeneral() | 66 | KOEditorGeneral::~KOEditorGeneral() |
67 | { | 67 | { |
68 | } | 68 | } |
69 | 69 | ||
70 | void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | 70 | void 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 | } |
118 | void KOEditorGeneral::setFocusOn( int i ) | 118 | void 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 | } |
123 | void KOEditorGeneral::slotSetFocusOn() | 123 | void 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 | } |
134 | void KOEditorGeneral::editCategories() | 134 | void 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 | } |
145 | void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) | 145 | void 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 | ||
159 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) | 159 | void 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 | ||
173 | void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) | 173 | void 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 | ||
188 | void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) | 188 | void 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 | ||
242 | void KOEditorGeneral::pickAlarmSound() | 242 | void 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 | ||
273 | void KOEditorGeneral::pickAlarmProgram() | 273 | void 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 | ||
299 | QString KOEditorGeneral::getFittingPath( const QString s ) | 299 | QString 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 | ||
314 | void KOEditorGeneral::enableAlarmEdit(bool enable) | 314 | void 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 | ||
334 | void KOEditorGeneral::disableAlarmEdit(bool disable) | 334 | void KOEditorGeneral::disableAlarmEdit(bool disable) |
335 | { | 335 | { |
336 | enableAlarmEdit( !disable ); | 336 | enableAlarmEdit( !disable ); |
337 | } | 337 | } |
338 | 338 | ||
339 | void KOEditorGeneral::enableAlarm( bool enable ) | 339 | void KOEditorGeneral::enableAlarm( bool enable ) |
340 | { | 340 | { |
341 | enableAlarmEdit( enable ); | 341 | enableAlarmEdit( enable ); |
342 | } | 342 | } |
343 | 343 | ||
344 | void KOEditorGeneral::alarmDisable(bool disable) | 344 | void 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 | ||
360 | void KOEditorGeneral::setCategories(const QString &str) | 360 | void KOEditorGeneral::setCategories(const QString &str) |
361 | { | 361 | { |
362 | mCategoriesLabel->setText(str); | 362 | mCategoriesLabel->setText(str); |
363 | } | 363 | } |
364 | 364 | ||
365 | void KOEditorGeneral::setDefaults(bool allDay) | 365 | void 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 | } |
396 | void KOEditorGeneral::setSecrecy( int num ) | 396 | void KOEditorGeneral::setSecrecy( int num ) |
397 | { | 397 | { |
398 | mSecrecyCombo->setCurrentItem(num); | 398 | mSecrecyCombo->setCurrentItem(num); |
399 | } | 399 | } |
400 | void KOEditorGeneral::readIncidence(Incidence *event) | 400 | void 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 | ||
485 | void KOEditorGeneral::writeIncidence(Incidence *event) | 485 | void 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 | ||
74 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 74 | KOPrefsDialog::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 | ||
108 | KOPrefsDialog::~KOPrefsDialog() | 108 | KOPrefsDialog::~KOPrefsDialog() |
109 | { | 109 | { |
110 | } | 110 | } |
111 | void KOPrefsDialog::setupGlobalTab() | 111 | void KOPrefsDialog::setupGlobalTab() |
112 | { | 112 | { |
113 | 113 | ||
114 | 114 | ||
115 | } | 115 | } |
116 | void KOPrefsDialog::setupLocaleDateTab() | 116 | void KOPrefsDialog::setupLocaleDateTab() |
117 | { | 117 | { |
118 | #if 0 | 118 | #if 0 |
119 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 119 | QFrame *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 | ||
172 | void KOPrefsDialog::setupLocaleTab() | 172 | void 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 | ||
237 | void KOPrefsDialog::setupMainTab() | 237 | void 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 | ||
396 | void KOPrefsDialog::setupTimeTab() | 403 | void 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 | ||
468 | void KOPrefsDialog::setupViewsTab() | 482 | void 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; |
786 | dummy = | 812 | dummy = |
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 | ||
966 | void KOPrefsDialog::selectSoundFile() | 996 | void 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 | } |
973 | void KOPrefsDialog::setupFontsTab() | 1003 | void 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 | ||
1112 | void KOPrefsDialog::setupColorsTab() | 1142 | void 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 | ||
1204 | void KOPrefsDialog::setCategoryColor() | 1246 | void 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 | ||
1209 | void KOPrefsDialog::updateCategoryColor() | 1251 | void 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 | ||
1221 | void KOPrefsDialog::setupPrinterTab() | 1263 | void 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 | ||
1233 | void KOPrefsDialog::setupGroupSchedulingTab() | 1275 | void 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 | ||
1284 | void KOPrefsDialog::setupGroupAutomationTab() | 1326 | void 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 | ||
1335 | void KOPrefsDialog::showPrinterTab() | 1377 | void KOPrefsDialog::showPrinterTab() |
1336 | { | 1378 | { |
1337 | showPage(pageIndex(mPrinterTab)); | 1379 | showPage(pageIndex(mPrinterTab)); |
1338 | } | 1380 | } |
1339 | 1381 | ||
1340 | 1382 | ||
1341 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, | 1383 | void 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 | ||
1357 | void KOPrefsDialog::usrReadConfig() | 1399 | void 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 | ||
1391 | void KOPrefsDialog::usrWriteConfig() | 1433 | void 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 | ||
1429 | void KOPrefsDialog::updateCategories() | 1471 | void 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 | ||
1437 | void KOPrefsDialog::toggleEmailSettings(bool on) | 1479 | void 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 | ||
1456 | void KOPrefsDialog::addItem() | 1498 | void 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 | ||
1465 | void KOPrefsDialog::removeItem() | 1507 | void 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 | ||
1481 | void KOPrefsDialog::updateItem() | 1523 | void 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 | ||
1489 | void KOPrefsDialog::updateInput() | 1531 | void 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 | |||
@@ -1,2517 +1,2517 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | #include <qpainter.h> | 5 | #include <qpainter.h> |
6 | #include <qwhatsthis.h> | 6 | #include <qwhatsthis.h> |
7 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qtextcodec.h> | 10 | #include <qtextcodec.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qdir.h> | 12 | #include <qdir.h> |
13 | #include <qapp.h> | 13 | #include <qapp.h> |
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qspinbox.h> | 16 | #include <qspinbox.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qmap.h> | 18 | #include <qmap.h> |
19 | #include <qwmatrix.h> | 19 | #include <qwmatrix.h> |
20 | #include <qtextbrowser.h> | 20 | #include <qtextbrowser.h> |
21 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
22 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpemenubar.h> | 24 | #include <qpe/qpemenubar.h> |
25 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qtopia/alarmserver.h> | 28 | #include <qtopia/alarmserver.h> |
29 | #include <qtopia/qcopenvelope_qws.h> | 29 | #include <qtopia/qcopenvelope_qws.h> |
30 | #include <unistd.h> // for sleep | 30 | #include <unistd.h> // for sleep |
31 | #else | 31 | #else |
32 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
33 | #include <qtoolbar.h> | 33 | #include <qtoolbar.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | //#include <resource.h> | 35 | //#include <resource.h> |
36 | 36 | ||
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendarlocal.h> | 38 | #include <libkcal/calendarlocal.h> |
39 | #include <libkcal/todo.h> | 39 | #include <libkcal/todo.h> |
40 | #include <libkcal/phoneformat.h> | 40 | #include <libkcal/phoneformat.h> |
41 | #include <libkdepim/ksyncprofile.h> | 41 | #include <libkdepim/ksyncprofile.h> |
42 | #include <libkdepim/phoneaccess.h> | 42 | #include <libkdepim/phoneaccess.h> |
43 | #include <libkcal/kincidenceformatter.h> | 43 | #include <libkcal/kincidenceformatter.h> |
44 | #include <libkdepim/kpimglobalprefs.h> | 44 | #include <libkdepim/kpimglobalprefs.h> |
45 | 45 | ||
46 | #include "calendarview.h" | 46 | #include "calendarview.h" |
47 | #include "koviewmanager.h" | 47 | #include "koviewmanager.h" |
48 | #include "datenavigator.h" | 48 | #include "datenavigator.h" |
49 | #include "koagendaview.h" | 49 | #include "koagendaview.h" |
50 | #include "koagenda.h" | 50 | #include "koagenda.h" |
51 | #include "kodialogmanager.h" | 51 | #include "kodialogmanager.h" |
52 | #include "kdialogbase.h" | 52 | #include "kdialogbase.h" |
53 | #include "kapplication.h" | 53 | #include "kapplication.h" |
54 | #include "kofilterview.h" | 54 | #include "kofilterview.h" |
55 | #include "kstandarddirs.h" | 55 | #include "kstandarddirs.h" |
56 | #include "koprefs.h" | 56 | #include "koprefs.h" |
57 | #include "kfiledialog.h" | 57 | #include "kfiledialog.h" |
58 | #include "koglobals.h" | 58 | #include "koglobals.h" |
59 | #include "kglobal.h" | 59 | #include "kglobal.h" |
60 | #include "ktoolbar.h" | 60 | #include "ktoolbar.h" |
61 | #include "klocale.h" | 61 | #include "klocale.h" |
62 | #include "kconfig.h" | 62 | #include "kconfig.h" |
63 | #include "externalapphandler.h" | 63 | #include "externalapphandler.h" |
64 | #include <kglobalsettings.h> | 64 | #include <kglobalsettings.h> |
65 | 65 | ||
66 | using namespace KCal; | 66 | using namespace KCal; |
67 | #ifndef _WIN32_ | 67 | #ifndef _WIN32_ |
68 | #include <unistd.h> | 68 | #include <unistd.h> |
69 | #else | 69 | #else |
70 | #ifdef _OL_IMPORT_ | 70 | #ifdef _OL_IMPORT_ |
71 | #include "koimportoldialog.h" | 71 | #include "koimportoldialog.h" |
72 | #endif | 72 | #endif |
73 | #endif | 73 | #endif |
74 | #include "mainwindow.h" | 74 | #include "mainwindow.h" |
75 | 75 | ||
76 | 76 | ||
77 | class KOex2phonePrefs : public QDialog | 77 | class KOex2phonePrefs : public QDialog |
78 | { | 78 | { |
79 | public: | 79 | public: |
80 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 80 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
81 | QDialog( parent, name, true ) | 81 | QDialog( parent, name, true ) |
82 | { | 82 | { |
83 | setCaption( i18n("Export to phone options") ); | 83 | setCaption( i18n("Export to phone options") ); |
84 | QVBoxLayout* lay = new QVBoxLayout( this ); | 84 | QVBoxLayout* lay = new QVBoxLayout( this ); |
85 | lay->setSpacing( 3 ); | 85 | lay->setSpacing( 3 ); |
86 | lay->setMargin( 3 ); | 86 | lay->setMargin( 3 ); |
87 | QLabel *lab; | 87 | QLabel *lab; |
88 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 88 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
89 | lab->setAlignment (AlignHCenter ); | 89 | lab->setAlignment (AlignHCenter ); |
90 | QHBox* temphb; | 90 | QHBox* temphb; |
91 | temphb = new QHBox( this ); | 91 | temphb = new QHBox( this ); |
92 | new QLabel( i18n("I/O device: "), temphb ); | 92 | new QLabel( i18n("I/O device: "), temphb ); |
93 | mPhoneDevice = new QLineEdit( temphb); | 93 | mPhoneDevice = new QLineEdit( temphb); |
94 | lay->addWidget( temphb ); | 94 | lay->addWidget( temphb ); |
95 | temphb = new QHBox( this ); | 95 | temphb = new QHBox( this ); |
96 | new QLabel( i18n("Connection: "), temphb ); | 96 | new QLabel( i18n("Connection: "), temphb ); |
97 | mPhoneConnection = new QLineEdit( temphb); | 97 | mPhoneConnection = new QLineEdit( temphb); |
98 | lay->addWidget( temphb ); | 98 | lay->addWidget( temphb ); |
99 | temphb = new QHBox( this ); | 99 | temphb = new QHBox( this ); |
100 | new QLabel( i18n("Model(opt.): "), temphb ); | 100 | new QLabel( i18n("Model(opt.): "), temphb ); |
101 | mPhoneModel = new QLineEdit( temphb); | 101 | mPhoneModel = new QLineEdit( temphb); |
102 | lay->addWidget( temphb ); | 102 | lay->addWidget( temphb ); |
103 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 103 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
104 | mWriteBackFuture->setChecked( true ); | 104 | mWriteBackFuture->setChecked( true ); |
105 | lay->addWidget( mWriteBackFuture ); | 105 | lay->addWidget( mWriteBackFuture ); |
106 | temphb = new QHBox( this ); | 106 | temphb = new QHBox( this ); |
107 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 107 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
108 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 108 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
109 | mWriteBackFutureWeeks->setValue( 8 ); | 109 | mWriteBackFutureWeeks->setValue( 8 ); |
110 | lay->addWidget( temphb ); | 110 | lay->addWidget( temphb ); |
111 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 111 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
112 | lab->setAlignment (AlignHCenter ); | 112 | lab->setAlignment (AlignHCenter ); |
113 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 113 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
114 | lay->addWidget( ok ); | 114 | lay->addWidget( ok ); |
115 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 115 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
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 | ||
126 | public: | 126 | public: |
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 | ||
132 | int globalFlagBlockStartup; | 132 | int globalFlagBlockStartup; |
133 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 133 | MainWindow::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 | } |
381 | MainWindow::~MainWindow() | 381 | MainWindow::~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 | ||
395 | void MainWindow::disableBR(bool b) | 395 | void 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 | } |
414 | bool MainWindow::beamReceiveEnabled() | 414 | bool 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 | ||
422 | void MainWindow::toggleBeamReceive() | 422 | void 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 | } |
440 | void MainWindow::showMaximized () | 440 | void 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 | } |
450 | void MainWindow::closeEvent( QCloseEvent* ce ) | 450 | void 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 | ||
484 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 484 | void 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 | ||
594 | QPixmap MainWindow::loadPixmap( QString name ) | 594 | QPixmap MainWindow::loadPixmap( QString name ) |
595 | { | 595 | { |
596 | return SmallIcon( name ); | 596 | return SmallIcon( name ); |
597 | 597 | ||
598 | } | 598 | } |
599 | void MainWindow::setUsesBigPixmaps ( bool b ) | 599 | void 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 | } |
605 | void MainWindow::initActions() | 605 | void 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 ); |
1141 | action->addTo( helpMenu ); | 1141 | action->addTo( helpMenu ); |
1142 | connect( action, SIGNAL( activated() ), | 1142 | connect( action, SIGNAL( activated() ), |
1143 | SLOT( usertrans() ) ); | 1143 | SLOT( usertrans() ) ); |
1144 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 1144 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
1145 | action->addTo( helpMenu ); | 1145 | action->addTo( helpMenu ); |
1146 | connect( action, SIGNAL( activated() ), | 1146 | connect( action, SIGNAL( activated() ), |
1147 | SLOT( faq() ) ); | 1147 | SLOT( faq() ) ); |
1148 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 1148 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
1149 | action->addTo( helpMenu ); | 1149 | action->addTo( helpMenu ); |
1150 | connect( action, SIGNAL( activated() ), | 1150 | connect( action, SIGNAL( activated() ), |
1151 | SLOT( licence() ) ); | 1151 | SLOT( licence() ) ); |
1152 | action = new QAction( "about", i18n("About..."), 0, this ); | 1152 | action = new QAction( "about", i18n("About..."), 0, this ); |
1153 | action->addTo( helpMenu ); | 1153 | action->addTo( helpMenu ); |
1154 | connect( action, SIGNAL( activated() ), | 1154 | connect( action, SIGNAL( activated() ), |
1155 | SLOT( about() ) ); | 1155 | SLOT( about() ) ); |
1156 | //menuBar->insertSeparator(); | 1156 | //menuBar->insertSeparator(); |
1157 | 1157 | ||
1158 | // ****************************************************** | 1158 | // ****************************************************** |
1159 | // menubar icons | 1159 | // menubar icons |
1160 | 1160 | ||
1161 | 1161 | ||
1162 | 1162 | ||
1163 | //menuBar->insertItem( iconToolBar ); | 1163 | //menuBar->insertItem( iconToolBar ); |
1164 | //xdays_action | 1164 | //xdays_action |
1165 | if (p-> mShowIconNewEvent) | 1165 | if (p-> mShowIconNewEvent) |
1166 | ne_action->addTo( iconToolBar ); | 1166 | ne_action->addTo( iconToolBar ); |
1167 | if (p->mShowIconNewTodo ) | 1167 | if (p->mShowIconNewTodo ) |
1168 | nt_action->addTo( iconToolBar ); | 1168 | nt_action->addTo( iconToolBar ); |
1169 | if (p-> mShowIconSearch) | 1169 | if (p-> mShowIconSearch) |
1170 | search_action->addTo( iconToolBar ); | 1170 | search_action->addTo( iconToolBar ); |
1171 | if (p-> mShowIconWhatsThis) | 1171 | if (p-> mShowIconWhatsThis) |
1172 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1172 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1173 | if (p-> mShowIconNext) | 1173 | if (p-> mShowIconNext) |
1174 | whatsnext_action->addTo( viewToolBar ); | 1174 | whatsnext_action->addTo( viewToolBar ); |
1175 | if (p-> mShowIconNextDays) | 1175 | if (p-> mShowIconNextDays) |
1176 | xdays_action->addTo( viewToolBar ); | 1176 | xdays_action->addTo( viewToolBar ); |
1177 | if (p-> mShowIconJournal) | 1177 | if (p-> mShowIconJournal) |
1178 | viewjournal_action->addTo( viewToolBar ); | 1178 | viewjournal_action->addTo( viewToolBar ); |
1179 | if (p-> mShowIconDay1) | 1179 | if (p-> mShowIconDay1) |
1180 | day1_action->addTo( viewToolBar ); | 1180 | day1_action->addTo( viewToolBar ); |
1181 | if (p-> mShowIconDay5) | 1181 | if (p-> mShowIconDay5) |
1182 | day5_action->addTo( viewToolBar ); | 1182 | day5_action->addTo( viewToolBar ); |
1183 | if (p-> mShowIconDay7) | 1183 | if (p-> mShowIconDay7) |
1184 | day7_action->addTo( viewToolBar ); | 1184 | day7_action->addTo( viewToolBar ); |
1185 | if (p-> mShowIconDay6) | 1185 | if (p-> mShowIconDay6) |
1186 | day6_action->addTo( viewToolBar ); | 1186 | day6_action->addTo( viewToolBar ); |
1187 | if (p-> mShowIconMonth) | 1187 | if (p-> mShowIconMonth) |
1188 | month_action->addTo( viewToolBar ); | 1188 | month_action->addTo( viewToolBar ); |
1189 | if (p-> mShowIconList) | 1189 | if (p-> mShowIconList) |
1190 | showlist_action->addTo( viewToolBar ); | 1190 | showlist_action->addTo( viewToolBar ); |
1191 | if (p-> mShowIconTodoview) | 1191 | if (p-> mShowIconTodoview) |
1192 | todoview_action->addTo( viewToolBar ); | 1192 | todoview_action->addTo( viewToolBar ); |
1193 | 1193 | ||
1194 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1194 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1195 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); | 1195 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); |
1196 | if (p-> mShowIconBackFast) { | 1196 | if (p-> mShowIconBackFast) { |
1197 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1197 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1198 | connect( action, SIGNAL( activated() ), | 1198 | connect( action, SIGNAL( activated() ), |
1199 | mView, SLOT( goPreviousMonth() ) ); | 1199 | mView, SLOT( goPreviousMonth() ) ); |
1200 | action->addTo( navigatorToolBar ); | 1200 | action->addTo( navigatorToolBar ); |
1201 | } | 1201 | } |
1202 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1202 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1203 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); | 1203 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); |
1204 | if (p-> mShowIconBack) { | 1204 | if (p-> mShowIconBack) { |
1205 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1205 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1206 | connect( action, SIGNAL( activated() ), | 1206 | connect( action, SIGNAL( activated() ), |
1207 | mView, SLOT( goPrevious() ) ); | 1207 | mView, SLOT( goPrevious() ) ); |
1208 | action->addTo( navigatorToolBar ); | 1208 | action->addTo( navigatorToolBar ); |
1209 | } | 1209 | } |
1210 | icon = loadPixmap( pathString + "today" ); | 1210 | icon = loadPixmap( pathString + "today" ); |
1211 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1211 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1212 | if (p-> mShowIconToday) | 1212 | if (p-> mShowIconToday) |
1213 | today_action->addTo( navigatorToolBar ); | 1213 | today_action->addTo( navigatorToolBar ); |
1214 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1214 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1215 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1215 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1216 | if (p-> mShowIconForward) { | 1216 | if (p-> mShowIconForward) { |
1217 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1217 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1218 | connect( action, SIGNAL( activated() ), | 1218 | connect( action, SIGNAL( activated() ), |
1219 | mView, SLOT( goNext() ) ); | 1219 | mView, SLOT( goNext() ) ); |
1220 | action->addTo( navigatorToolBar ); | 1220 | action->addTo( navigatorToolBar ); |
1221 | } | 1221 | } |
1222 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1222 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1223 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1223 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1224 | if (p-> mShowIconForwardFast) { | 1224 | if (p-> mShowIconForwardFast) { |
1225 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1225 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1226 | connect( action, SIGNAL( activated() ), | 1226 | connect( action, SIGNAL( activated() ), |
1227 | mView, SLOT( goNextMonth() ) ); | 1227 | mView, SLOT( goNextMonth() ) ); |
1228 | action->addTo( navigatorToolBar ); | 1228 | action->addTo( navigatorToolBar ); |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | 1231 | ||
1232 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); | 1232 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); |
1233 | 1233 | ||
1234 | 1234 | ||
1235 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); | 1235 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); |
1236 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); | 1236 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); |
1237 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); | 1237 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); |
1238 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); | 1238 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); |
1239 | 1239 | ||
1240 | if (p-> mShowIconNewEvent) | 1240 | if (p-> mShowIconNewEvent) |
1241 | configureToolBarMenu->setItemChecked( 10, true ); | 1241 | configureToolBarMenu->setItemChecked( 10, true ); |
1242 | if (p->mShowIconNewTodo ) | 1242 | if (p->mShowIconNewTodo ) |
1243 | configureToolBarMenu->setItemChecked( 20, true ); | 1243 | configureToolBarMenu->setItemChecked( 20, true ); |
1244 | if (p-> mShowIconSearch) | 1244 | if (p-> mShowIconSearch) |
1245 | configureToolBarMenu->setItemChecked( 120, true ); | 1245 | configureToolBarMenu->setItemChecked( 120, true ); |
1246 | if (p-> mShowIconList) | 1246 | if (p-> mShowIconList) |
1247 | configureToolBarMenu->setItemChecked( 30, true ); | 1247 | configureToolBarMenu->setItemChecked( 30, true ); |
1248 | if (p-> mShowIconDay1) | 1248 | if (p-> mShowIconDay1) |
1249 | configureToolBarMenu->setItemChecked( 40, true ); | 1249 | configureToolBarMenu->setItemChecked( 40, true ); |
1250 | if (p-> mShowIconDay5) | 1250 | if (p-> mShowIconDay5) |
1251 | configureToolBarMenu->setItemChecked( 50, true ); | 1251 | configureToolBarMenu->setItemChecked( 50, true ); |
1252 | if (p-> mShowIconDay6) | 1252 | if (p-> mShowIconDay6) |
1253 | configureToolBarMenu->setItemChecked( 75, true ); | 1253 | configureToolBarMenu->setItemChecked( 75, true ); |
1254 | if (p-> mShowIconDay7) | 1254 | if (p-> mShowIconDay7) |
1255 | configureToolBarMenu->setItemChecked( 60, true ); | 1255 | configureToolBarMenu->setItemChecked( 60, true ); |
1256 | if (p-> mShowIconMonth) | 1256 | if (p-> mShowIconMonth) |
1257 | configureToolBarMenu->setItemChecked( 70, true ); | 1257 | configureToolBarMenu->setItemChecked( 70, true ); |
1258 | if (p-> mShowIconTodoview) | 1258 | if (p-> mShowIconTodoview) |
1259 | configureToolBarMenu->setItemChecked( 80, true ); | 1259 | configureToolBarMenu->setItemChecked( 80, true ); |
1260 | if (p-> mShowIconBackFast) | 1260 | if (p-> mShowIconBackFast) |
1261 | configureToolBarMenu->setItemChecked( 200, true ); | 1261 | configureToolBarMenu->setItemChecked( 200, true ); |
1262 | if (p-> mShowIconBack) | 1262 | if (p-> mShowIconBack) |
1263 | configureToolBarMenu->setItemChecked( 210, true ); | 1263 | configureToolBarMenu->setItemChecked( 210, true ); |
1264 | if (p-> mShowIconToday) | 1264 | if (p-> mShowIconToday) |
1265 | configureToolBarMenu->setItemChecked( 130, true ); | 1265 | configureToolBarMenu->setItemChecked( 130, true ); |
1266 | if (p-> mShowIconForward) | 1266 | if (p-> mShowIconForward) |
1267 | configureToolBarMenu->setItemChecked( 220, true ); | 1267 | configureToolBarMenu->setItemChecked( 220, true ); |
1268 | if (p-> mShowIconForwardFast) | 1268 | if (p-> mShowIconForwardFast) |
1269 | configureToolBarMenu->setItemChecked( 230, true ); | 1269 | configureToolBarMenu->setItemChecked( 230, true ); |
1270 | if (p-> mShowIconNextDays) | 1270 | if (p-> mShowIconNextDays) |
1271 | configureToolBarMenu->setItemChecked( 100, true ); | 1271 | configureToolBarMenu->setItemChecked( 100, true ); |
1272 | if (p-> mShowIconNext) | 1272 | if (p-> mShowIconNext) |
1273 | configureToolBarMenu->setItemChecked( 110, true ); | 1273 | configureToolBarMenu->setItemChecked( 110, true ); |
1274 | if (p-> mShowIconJournal) | 1274 | if (p-> mShowIconJournal) |
1275 | configureToolBarMenu->setItemChecked( 90, true ); | 1275 | configureToolBarMenu->setItemChecked( 90, true ); |
1276 | if (p-> mShowIconWhatsThis) | 1276 | if (p-> mShowIconWhatsThis) |
1277 | configureToolBarMenu->setItemChecked( 300, true ); | 1277 | configureToolBarMenu->setItemChecked( 300, true ); |
1278 | if (p-> mShowIconWeekNum) | 1278 | if (p-> mShowIconWeekNum) |
1279 | configureToolBarMenu->setItemChecked( 400, true ); | 1279 | configureToolBarMenu->setItemChecked( 400, true ); |
1280 | if (!p-> mShowIconStretch) { | 1280 | if (!p-> mShowIconStretch) { |
1281 | QLabel* dummy = new QLabel( iconToolBar ); | 1281 | QLabel* dummy = new QLabel( iconToolBar ); |
1282 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1282 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1283 | dummy->setMinimumWidth( 0 ); | 1283 | dummy->setMinimumWidth( 0 ); |
1284 | iconToolBar->setStretchableWidget ( dummy ) ; | 1284 | iconToolBar->setStretchableWidget ( dummy ) ; |
1285 | } | 1285 | } |
1286 | else { | 1286 | else { |
1287 | iconToolBar->setHorizontalStretchable (true ); | 1287 | iconToolBar->setHorizontalStretchable (true ); |
1288 | viewToolBar->setHorizontalStretchable (true ); | 1288 | viewToolBar->setHorizontalStretchable (true ); |
1289 | navigatorToolBar->setHorizontalStretchable (true ); | 1289 | navigatorToolBar->setHorizontalStretchable (true ); |
1290 | iconToolBar->setVerticalStretchable (true ); | 1290 | iconToolBar->setVerticalStretchable (true ); |
1291 | viewToolBar->setVerticalStretchable (true ); | 1291 | viewToolBar->setVerticalStretchable (true ); |
1292 | navigatorToolBar->setVerticalStretchable (true ); | 1292 | navigatorToolBar->setVerticalStretchable (true ); |
1293 | configureToolBarMenu->setItemChecked( 5, true ); | 1293 | configureToolBarMenu->setItemChecked( 5, true ); |
1294 | } | 1294 | } |
1295 | if (p-> mShowIconFilter) | 1295 | if (p-> mShowIconFilter) |
1296 | configureToolBarMenu->setItemChecked( 7, true ); | 1296 | configureToolBarMenu->setItemChecked( 7, true ); |
1297 | if (p-> mShowIconOnetoolbar) | 1297 | if (p-> mShowIconOnetoolbar) |
1298 | configureToolBarMenu->setItemChecked( 6, true ); | 1298 | configureToolBarMenu->setItemChecked( 6, true ); |
1299 | 1299 | ||
1300 | 1300 | ||
1301 | if ( filterMenubar ) { | 1301 | if ( filterMenubar ) { |
1302 | filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); | 1302 | filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); |
1303 | connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); | 1303 | connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); |
1304 | } | 1304 | } |
1305 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1305 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1306 | configureAgenda( p->mHourSize ); | 1306 | configureAgenda( p->mHourSize ); |
1307 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1307 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | void MainWindow::exportToPhone( int mode ) | 1310 | void MainWindow::exportToPhone( int mode ) |
1311 | { | 1311 | { |
1312 | 1312 | ||
1313 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1313 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1314 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1314 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1315 | KOex2phonePrefs ex2phone; | 1315 | KOex2phonePrefs ex2phone; |
1316 | 1316 | ||
1317 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1317 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1318 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1318 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1319 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1319 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1320 | if ( mode == 1 ) | 1320 | if ( mode == 1 ) |
1321 | ex2phone.setCaption(i18n("Export complete calendar")); | 1321 | ex2phone.setCaption(i18n("Export complete calendar")); |
1322 | if ( mode == 2 ) | 1322 | if ( mode == 2 ) |
1323 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1323 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1324 | 1324 | ||
1325 | if ( !ex2phone.exec() ) { | 1325 | if ( !ex2phone.exec() ) { |
1326 | return; | 1326 | return; |
1327 | } | 1327 | } |
1328 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1328 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1329 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1329 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1330 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1330 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1331 | 1331 | ||
1332 | int inFuture = 0; | 1332 | int inFuture = 0; |
1333 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1333 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1334 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1334 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1335 | QPtrList<Incidence> delSel; | 1335 | QPtrList<Incidence> delSel; |
1336 | if ( mode == 1 ) | 1336 | if ( mode == 1 ) |
1337 | delSel = mCalendar->rawIncidences(); | 1337 | delSel = mCalendar->rawIncidences(); |
1338 | if ( mode == 2 ) | 1338 | if ( mode == 2 ) |
1339 | delSel = mCalendar->incidences(); | 1339 | delSel = mCalendar->incidences(); |
1340 | CalendarLocal* cal = new CalendarLocal(); | 1340 | CalendarLocal* cal = new CalendarLocal(); |
1341 | cal->setLocalTime(); | 1341 | cal->setLocalTime(); |
1342 | Incidence *incidence = delSel.first(); | 1342 | Incidence *incidence = delSel.first(); |
1343 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1343 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1344 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1344 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1345 | while ( incidence ) { | 1345 | while ( incidence ) { |
1346 | if ( incidence->typeID() != journalID ) { | 1346 | if ( incidence->typeID() != journalID ) { |
1347 | bool add = true; | 1347 | bool add = true; |
1348 | if ( inFuture ) { | 1348 | if ( inFuture ) { |
1349 | QDateTime dt; | 1349 | QDateTime dt; |
1350 | if ( incidence->typeID() == todoID ) { | 1350 | if ( incidence->typeID() == todoID ) { |
1351 | Todo * t = (Todo*)incidence; | 1351 | Todo * t = (Todo*)incidence; |
1352 | if ( t->hasDueDate() ) | 1352 | if ( t->hasDueDate() ) |
1353 | dt = t->dtDue(); | 1353 | dt = t->dtDue(); |
1354 | else | 1354 | else |
1355 | dt = cur.addSecs( 62 ); | 1355 | dt = cur.addSecs( 62 ); |
1356 | } | 1356 | } |
1357 | else { | 1357 | else { |
1358 | bool ok; | 1358 | bool ok; |
1359 | dt = incidence->getNextOccurence( cur, &ok ); | 1359 | dt = incidence->getNextOccurence( cur, &ok ); |
1360 | if ( !ok ) | 1360 | if ( !ok ) |
1361 | dt = cur.addSecs( -62 ); | 1361 | dt = cur.addSecs( -62 ); |
1362 | } | 1362 | } |
1363 | if ( dt < cur || dt > end ) { | 1363 | if ( dt < cur || dt > end ) { |
1364 | add = false; | 1364 | add = false; |
1365 | } | 1365 | } |
1366 | } | 1366 | } |
1367 | if ( add ) { | 1367 | if ( add ) { |
1368 | Incidence *in = incidence->clone(); | 1368 | Incidence *in = incidence->clone(); |
1369 | cal->addIncidence( in ); | 1369 | cal->addIncidence( in ); |
1370 | } | 1370 | } |
1371 | } | 1371 | } |
1372 | incidence = delSel.next(); | 1372 | incidence = delSel.next(); |
1373 | } | 1373 | } |
1374 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1374 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1375 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1375 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1376 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1376 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1377 | 1377 | ||
1378 | setCaption( i18n("Writing to phone...")); | 1378 | setCaption( i18n("Writing to phone...")); |
1379 | if ( PhoneFormat::writeToPhone( cal ) ) | 1379 | if ( PhoneFormat::writeToPhone( cal ) ) |
1380 | setCaption( i18n("Export to phone successful!")); | 1380 | setCaption( i18n("Export to phone successful!")); |
1381 | else | 1381 | else |
1382 | setCaption( i18n("Error exporting to phone!")); | 1382 | setCaption( i18n("Error exporting to phone!")); |
1383 | delete cal; | 1383 | delete cal; |
1384 | } | 1384 | } |
1385 | 1385 | ||
1386 | 1386 | ||
1387 | void MainWindow::setDefaultPreferences() | 1387 | void MainWindow::setDefaultPreferences() |
1388 | { | 1388 | { |
1389 | KOPrefs *p = KOPrefs::instance(); | 1389 | KOPrefs *p = KOPrefs::instance(); |
1390 | 1390 | ||
1391 | p->mCompactDialogs = true; | 1391 | p->mCompactDialogs = true; |
1392 | p->mConfirm = true; | 1392 | p->mConfirm = true; |
1393 | // p->mEnableQuickTodo = false; | 1393 | // p->mEnableQuickTodo = false; |
1394 | 1394 | ||
1395 | } | 1395 | } |
1396 | 1396 | ||
1397 | QString MainWindow::resourcePath() | 1397 | QString MainWindow::resourcePath() |
1398 | { | 1398 | { |
1399 | return KGlobal::iconLoader()->iconPath(); | 1399 | return KGlobal::iconLoader()->iconPath(); |
1400 | } | 1400 | } |
1401 | 1401 | ||
1402 | void MainWindow::displayText( QString text ,QString cap ) | 1402 | void MainWindow::displayText( QString text ,QString cap ) |
1403 | { | 1403 | { |
1404 | QDialog dia( this, "name", true ); ; | 1404 | QDialog dia( this, "name", true ); ; |
1405 | dia.setCaption( cap ); | 1405 | dia.setCaption( cap ); |
1406 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1406 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1407 | lay->setSpacing( 3 ); | 1407 | lay->setSpacing( 3 ); |
1408 | lay->setMargin( 3 ); | 1408 | lay->setMargin( 3 ); |
1409 | QTextBrowser tb ( &dia ); | 1409 | QTextBrowser tb ( &dia ); |
1410 | lay->addWidget( &tb ); | 1410 | lay->addWidget( &tb ); |
1411 | tb.setText( text ); | 1411 | tb.setText( text ); |
1412 | #ifdef DESKTOP_VERSION | 1412 | #ifdef DESKTOP_VERSION |
1413 | dia.resize( 640, 480); | 1413 | dia.resize( 640, 480); |
1414 | #else | 1414 | #else |
1415 | dia.showMaximized(); | 1415 | dia.showMaximized(); |
1416 | #endif | 1416 | #endif |
1417 | dia.exec(); | 1417 | dia.exec(); |
1418 | } | 1418 | } |
1419 | 1419 | ||
1420 | void MainWindow::features() | 1420 | void MainWindow::features() |
1421 | { | 1421 | { |
1422 | 1422 | ||
1423 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1423 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1424 | } | 1424 | } |
1425 | 1425 | ||
1426 | void MainWindow::usertrans() | 1426 | void MainWindow::usertrans() |
1427 | { | 1427 | { |
1428 | 1428 | ||
1429 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1429 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1430 | } | 1430 | } |
1431 | 1431 | ||
1432 | void MainWindow::storagehowto() | 1432 | void MainWindow::storagehowto() |
1433 | { | 1433 | { |
1434 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); | 1434 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); |
1435 | } | 1435 | } |
1436 | void MainWindow::timetrackinghowto() | 1436 | void MainWindow::timetrackinghowto() |
1437 | { | 1437 | { |
1438 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); | 1438 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); |
1439 | } | 1439 | } |
1440 | void MainWindow::kdesynchowto() | 1440 | void MainWindow::kdesynchowto() |
1441 | { | 1441 | { |
1442 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1442 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1443 | } | 1443 | } |
1444 | void MainWindow::multisynchowto() | 1444 | void MainWindow::multisynchowto() |
1445 | { | 1445 | { |
1446 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1446 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1447 | } | 1447 | } |
1448 | void MainWindow::synchowto() | 1448 | void MainWindow::synchowto() |
1449 | { | 1449 | { |
1450 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1450 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1451 | } | 1451 | } |
1452 | void MainWindow::faq() | 1452 | void MainWindow::faq() |
1453 | { | 1453 | { |
1454 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1454 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1455 | 1455 | ||
1456 | } | 1456 | } |
1457 | void MainWindow::whatsNew() | 1457 | void MainWindow::whatsNew() |
1458 | { | 1458 | { |
1459 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1459 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1460 | 1460 | ||
1461 | } | 1461 | } |
1462 | void MainWindow::licence() | 1462 | void MainWindow::licence() |
1463 | { | 1463 | { |
1464 | KApplication::showLicence(); | 1464 | KApplication::showLicence(); |
1465 | 1465 | ||
1466 | } | 1466 | } |
1467 | void MainWindow::about() | 1467 | void MainWindow::about() |
1468 | { | 1468 | { |
1469 | QString version; | 1469 | QString version; |
1470 | #include <../version> | 1470 | #include <../version> |
1471 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1471 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1472 | i18n("KOrganizer/Platform-independent\n") + | 1472 | i18n("KOrganizer/Platform-independent\n") + |
1473 | "(KO/Pi) " + version + " - " + | 1473 | "(KO/Pi) " + version + " - " + |
1474 | 1474 | ||
1475 | #ifdef DESKTOP_VERSION | 1475 | #ifdef DESKTOP_VERSION |
1476 | i18n("Desktop Edition\n") + | 1476 | i18n("Desktop Edition\n") + |
1477 | #else | 1477 | #else |
1478 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1478 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1479 | #endif | 1479 | #endif |
1480 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1480 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1481 | } | 1481 | } |
1482 | void MainWindow::keyBindings() | 1482 | void MainWindow::keyBindings() |
1483 | { | 1483 | { |
1484 | QString cap = i18n("KO/Pi Keys + Colors"); | 1484 | QString cap = i18n("KO/Pi Keys + Colors"); |
1485 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1485 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1486 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1486 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1487 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + | 1487 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + |
1488 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + | 1488 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + |
1489 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1489 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1490 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1490 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1491 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1491 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1492 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1492 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1493 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1493 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1494 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ | 1494 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ |
1495 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1495 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1496 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1496 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1497 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1497 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1498 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1498 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1499 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1499 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1500 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1500 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1501 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ | 1501 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ |
1502 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1502 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1503 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1503 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1504 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1504 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1505 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1505 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1506 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1506 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1507 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1507 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1508 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1508 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1509 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1509 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1510 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1510 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1511 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1511 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1512 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1512 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1513 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1513 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1514 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1514 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1515 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1515 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1516 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1516 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1517 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1517 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1518 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1518 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1519 | i18n("<p><h3>In list view:</h3></p>\n") + | 1519 | i18n("<p><h3>In list view:</h3></p>\n") + |
1520 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1520 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1521 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1521 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1522 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1522 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1523 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1523 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1524 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1524 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1525 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1525 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1526 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1526 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1527 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1527 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1528 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1528 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1529 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1529 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1530 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1530 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1531 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1531 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1532 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1532 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1533 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1533 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1534 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1534 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1535 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1535 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1536 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1536 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1537 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1537 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1538 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1538 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1539 | displayText( text, cap); | 1539 | displayText( text, cap); |
1540 | } | 1540 | } |
1541 | void MainWindow::aboutAutoSaving() | 1541 | void MainWindow::aboutAutoSaving() |
1542 | { | 1542 | { |
1543 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); | 1543 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); |
1544 | 1544 | ||
1545 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1545 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1546 | 1546 | ||
1547 | } | 1547 | } |
1548 | void MainWindow::aboutKnownBugs() | 1548 | void MainWindow::aboutKnownBugs() |
1549 | { | 1549 | { |
1550 | QMessageBox* msg; | 1550 | QMessageBox* msg; |
1551 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1551 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1552 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ | 1552 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ |
1553 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1553 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1554 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + | 1554 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + |
1555 | i18n("\nor report them in the bugtracker on\n") + | 1555 | i18n("\nor report them in the bugtracker on\n") + |
1556 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1556 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1557 | QMessageBox::NoIcon, | 1557 | QMessageBox::NoIcon, |
1558 | QMessageBox::Ok, | 1558 | QMessageBox::Ok, |
1559 | QMessageBox::NoButton, | 1559 | QMessageBox::NoButton, |
1560 | QMessageBox::NoButton); | 1560 | QMessageBox::NoButton); |
1561 | msg->exec(); | 1561 | msg->exec(); |
1562 | delete msg; | 1562 | delete msg; |
1563 | 1563 | ||
1564 | } | 1564 | } |
1565 | 1565 | ||
1566 | QString MainWindow::defaultFileName() | 1566 | QString MainWindow::defaultFileName() |
1567 | { | 1567 | { |
1568 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1568 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1569 | } | 1569 | } |
1570 | QString MainWindow::syncFileName() | 1570 | QString MainWindow::syncFileName() |
1571 | { | 1571 | { |
1572 | #ifdef DESKTOP_VERSION | 1572 | #ifdef DESKTOP_VERSION |
1573 | return locateLocal( "tmp", "synccalendar.ics" ); | 1573 | return locateLocal( "tmp", "synccalendar.ics" ); |
1574 | #else | 1574 | #else |
1575 | return QString( "/tmp/synccalendar.ics" ); | 1575 | return QString( "/tmp/synccalendar.ics" ); |
1576 | #endif | 1576 | #endif |
1577 | } | 1577 | } |
1578 | #include "koglobals.h" | 1578 | #include "koglobals.h" |
1579 | #include <kcalendarsystem.h> | 1579 | #include <kcalendarsystem.h> |
1580 | void MainWindow::updateWeek(QDate seda) | 1580 | void MainWindow::updateWeek(QDate seda) |
1581 | { | 1581 | { |
1582 | int weekNum = KGlobal::locale()->weekNum ( seda ); | 1582 | int weekNum = KGlobal::locale()->weekNum ( seda ); |
1583 | mWeekPixmap.fill( mWeekBgColor ); | 1583 | mWeekPixmap.fill( mWeekBgColor ); |
1584 | QPainter p ( &mWeekPixmap ); | 1584 | QPainter p ( &mWeekPixmap ); |
1585 | p.setFont( mWeekFont ); | 1585 | p.setFont( mWeekFont ); |
1586 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1586 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); |
1587 | p.end(); | 1587 | p.end(); |
1588 | QIconSet icon3 ( mWeekPixmap ); | 1588 | QIconSet icon3 ( mWeekPixmap ); |
1589 | mWeekAction->setIconSet ( icon3 ); | 1589 | mWeekAction->setIconSet ( icon3 ); |
1590 | 1590 | ||
1591 | } | 1591 | } |
1592 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1592 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1593 | { | 1593 | { |
1594 | updateWeek( selectedDates.first() ); | 1594 | updateWeek( selectedDates.first() ); |
1595 | } | 1595 | } |
1596 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1596 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1597 | { | 1597 | { |
1598 | 1598 | ||
1599 | if ( !incidence ) { | 1599 | if ( !incidence ) { |
1600 | enableIncidenceActions( false ); | 1600 | enableIncidenceActions( false ); |
1601 | 1601 | ||
1602 | mNewSubTodoAction->setEnabled( false ); | 1602 | mNewSubTodoAction->setEnabled( false ); |
1603 | setCaptionToDates(); | 1603 | setCaptionToDates(); |
1604 | return; | 1604 | return; |
1605 | 1605 | ||
1606 | } | 1606 | } |
1607 | 1607 | ||
1608 | //KGlobal::locale()->formatDateTime(nextA, true); | 1608 | //KGlobal::locale()->formatDateTime(nextA, true); |
1609 | QString startString = ""; | 1609 | QString startString = ""; |
1610 | if ( incidence->typeID() != todoID ) { | 1610 | if ( incidence->typeID() != todoID ) { |
1611 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1611 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1612 | if ( incidence->doesFloat() ) { | 1612 | if ( incidence->doesFloat() ) { |
1613 | startString += ": "+incidence->dtStartDateStr( true ); | 1613 | startString += ": "+incidence->dtStartDateStr( true ); |
1614 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1614 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1615 | 1615 | ||
1616 | } else { | 1616 | } else { |
1617 | startString = ": "+incidence->dtStartStr(true); | 1617 | startString = ": "+incidence->dtStartStr(true); |
1618 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1618 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1619 | 1619 | ||
1620 | } | 1620 | } |
1621 | 1621 | ||
1622 | } else { | 1622 | } else { |
1623 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1623 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1624 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1624 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1625 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1625 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1626 | 1626 | ||
1627 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1627 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1628 | bool ok; | 1628 | bool ok; |
1629 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1629 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1630 | if ( ok ) { | 1630 | if ( ok ) { |
1631 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1631 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1632 | startString += i18n(" (%1 y.)"). arg( years ); | 1632 | startString += i18n(" (%1 y.)"). arg( years ); |
1633 | } | 1633 | } |
1634 | } | 1634 | } |
1635 | else | 1635 | else |
1636 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1636 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1637 | } | 1637 | } |
1638 | 1638 | ||
1639 | } | 1639 | } |
1640 | else | 1640 | else |
1641 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1641 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1642 | if ( !incidence->location().isEmpty() ) | 1642 | if ( !incidence->location().isEmpty() ) |
1643 | startString += " (" +incidence->location()+")"; | 1643 | startString += " (" +incidence->location()+")"; |
1644 | setCaption( incidence->summary()+startString); | 1644 | setCaption( incidence->summary()+startString); |
1645 | 1645 | ||
1646 | enableIncidenceActions( true ); | 1646 | enableIncidenceActions( true ); |
1647 | 1647 | ||
1648 | if ( incidence->typeID() == eventID ) { | 1648 | if ( incidence->typeID() == eventID ) { |
1649 | mShowAction->setText( i18n("Show Event...") ); | 1649 | mShowAction->setText( i18n("Show Event...") ); |
1650 | mEditAction->setText( i18n("Edit Event...") ); | 1650 | mEditAction->setText( i18n("Edit Event...") ); |
1651 | mDeleteAction->setText( i18n("Delete Event...") ); | 1651 | mDeleteAction->setText( i18n("Delete Event...") ); |
1652 | 1652 | ||
1653 | mNewSubTodoAction->setEnabled( false ); | 1653 | mNewSubTodoAction->setEnabled( false ); |
1654 | } else if ( incidence->typeID() == todoID ) { | 1654 | } else if ( incidence->typeID() == todoID ) { |
1655 | mShowAction->setText( i18n("Show Todo...") ); | 1655 | mShowAction->setText( i18n("Show Todo...") ); |
1656 | mEditAction->setText( i18n("Edit Todo...") ); | 1656 | mEditAction->setText( i18n("Edit Todo...") ); |
1657 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1657 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1658 | 1658 | ||
1659 | mNewSubTodoAction->setEnabled( true ); | 1659 | mNewSubTodoAction->setEnabled( true ); |
1660 | } else { | 1660 | } else { |
1661 | mShowAction->setText( i18n("Show...") ); | 1661 | mShowAction->setText( i18n("Show...") ); |
1662 | mShowAction->setText( i18n("Edit...") ); | 1662 | mShowAction->setText( i18n("Edit...") ); |
1663 | mShowAction->setText( i18n("Delete...") ); | 1663 | mShowAction->setText( i18n("Delete...") ); |
1664 | 1664 | ||
1665 | mNewSubTodoAction->setEnabled( false ); | 1665 | mNewSubTodoAction->setEnabled( false ); |
1666 | } | 1666 | } |
1667 | } | 1667 | } |
1668 | 1668 | ||
1669 | void MainWindow::enableIncidenceActions( bool enabled ) | 1669 | void MainWindow::enableIncidenceActions( bool enabled ) |
1670 | { | 1670 | { |
1671 | mShowAction->setEnabled( enabled ); | 1671 | mShowAction->setEnabled( enabled ); |
1672 | mEditAction->setEnabled( enabled ); | 1672 | mEditAction->setEnabled( enabled ); |
1673 | mDeleteAction->setEnabled( enabled ); | 1673 | mDeleteAction->setEnabled( enabled ); |
1674 | 1674 | ||
1675 | mCloneAction->setEnabled( enabled ); | 1675 | mCloneAction->setEnabled( enabled ); |
1676 | mMoveAction->setEnabled( enabled ); | 1676 | mMoveAction->setEnabled( enabled ); |
1677 | mBeamAction->setEnabled( enabled ); | 1677 | mBeamAction->setEnabled( enabled ); |
1678 | mCancelAction->setEnabled( enabled ); | 1678 | mCancelAction->setEnabled( enabled ); |
1679 | } | 1679 | } |
1680 | 1680 | ||
1681 | void MainWindow::importOL() | 1681 | void MainWindow::importOL() |
1682 | { | 1682 | { |
1683 | #ifdef _OL_IMPORT_ | 1683 | #ifdef _OL_IMPORT_ |
1684 | mView->clearAllViews(); | 1684 | mView->clearAllViews(); |
1685 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1685 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1686 | id->exec(); | 1686 | id->exec(); |
1687 | delete id; | 1687 | delete id; |
1688 | mView->calendar()->checkAlarmForIncidence( 0, true ); | 1688 | mView->calendar()->checkAlarmForIncidence( 0, true ); |
1689 | mView->updateView(); | 1689 | mView->updateView(); |
1690 | #endif | 1690 | #endif |
1691 | } | 1691 | } |
1692 | void MainWindow::importBday() | 1692 | void MainWindow::importBday() |
1693 | { | 1693 | { |
1694 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1694 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1695 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1695 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1696 | i18n("Import!"), i18n("Cancel"), 0, | 1696 | i18n("Import!"), i18n("Cancel"), 0, |
1697 | 0, 1 ); | 1697 | 0, 1 ); |
1698 | if ( result == 0 ) { | 1698 | if ( result == 0 ) { |
1699 | mView->importBday(); | 1699 | mView->importBday(); |
1700 | 1700 | ||
1701 | } | 1701 | } |
1702 | 1702 | ||
1703 | 1703 | ||
1704 | } | 1704 | } |
1705 | void MainWindow::importQtopia() | 1705 | void MainWindow::importQtopia() |
1706 | { | 1706 | { |
1707 | //#ifndef DESKTOP_VERSION | 1707 | //#ifndef DESKTOP_VERSION |
1708 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); | 1708 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); |
1709 | #ifdef DESKTOP_VERSION | 1709 | #ifdef DESKTOP_VERSION |
1710 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1710 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
1711 | #endif | 1711 | #endif |
1712 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1712 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1713 | i18n("Import!"), i18n("Cancel"), 0, | 1713 | i18n("Import!"), i18n("Cancel"), 0, |
1714 | 0, 1 ); | 1714 | 0, 1 ); |
1715 | if ( result == 0 ) { | 1715 | if ( result == 0 ) { |
1716 | #ifndef DESKTOP_VERSION | 1716 | #ifndef DESKTOP_VERSION |
1717 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1717 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1718 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1718 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1719 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1719 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1720 | #else | 1720 | #else |
1721 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1721 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1722 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1722 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1723 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1723 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1724 | #endif | 1724 | #endif |
1725 | mView->importQtopia( categories, datebook, todolist ); | 1725 | mView->importQtopia( categories, datebook, todolist ); |
1726 | } | 1726 | } |
1727 | mView->calendar()->reInitAlarmSettings(); | 1727 | mView->calendar()->reInitAlarmSettings(); |
1728 | #if 0 | 1728 | #if 0 |
1729 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1729 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1730 | i18n("Not supported \non desktop!\n"), | 1730 | i18n("Not supported \non desktop!\n"), |
1731 | i18n("Ok"), i18n("Cancel"), 0, | 1731 | i18n("Ok"), i18n("Cancel"), 0, |
1732 | 0, 1 ); | 1732 | 0, 1 ); |
1733 | 1733 | ||
1734 | #endif | 1734 | #endif |
1735 | } | 1735 | } |
1736 | 1736 | ||
1737 | void MainWindow::saveOnClose() | 1737 | void MainWindow::saveOnClose() |
1738 | { | 1738 | { |
1739 | KOPrefs *p = KOPrefs::instance(); | 1739 | KOPrefs *p = KOPrefs::instance(); |
1740 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1740 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1741 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); | 1741 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); |
1742 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); | 1742 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); |
1743 | if ( filterToolBar ) { | 1743 | if ( filterToolBar ) { |
1744 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); | 1744 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); |
1745 | } | 1745 | } |
1746 | #ifdef DESKTOP_VERSION | 1746 | #ifdef DESKTOP_VERSION |
1747 | 1747 | ||
1748 | QPoint myP; | 1748 | QPoint myP; |
1749 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1749 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1750 | if ( p->mToolBarHor ) | 1750 | if ( p->mToolBarHor ) |
1751 | p->mToolBarUp = myP.y() > height()/2; | 1751 | p->mToolBarUp = myP.y() > height()/2; |
1752 | else | 1752 | else |
1753 | p->mToolBarUp = myP.x() > width()/2; | 1753 | p->mToolBarUp = myP.x() > width()/2; |
1754 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1754 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1755 | if ( p->mToolBarHorV ) | 1755 | if ( p->mToolBarHorV ) |
1756 | p->mToolBarUpV = myP.y() > height()/2; | 1756 | p->mToolBarUpV = myP.y() > height()/2; |
1757 | else | 1757 | else |
1758 | p->mToolBarUpV = myP.x() > width()/2 ; | 1758 | p->mToolBarUpV = myP.x() > width()/2 ; |
1759 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1759 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1760 | if ( p->mToolBarHorN ) | 1760 | if ( p->mToolBarHorN ) |
1761 | p->mToolBarUpN = myP.y() > height()/2; | 1761 | p->mToolBarUpN = myP.y() > height()/2; |
1762 | else | 1762 | else |
1763 | p->mToolBarUpN = myP.x() > width()/2 ; | 1763 | p->mToolBarUpN = myP.x() > width()/2 ; |
1764 | if ( filterToolBar ) { | 1764 | if ( filterToolBar ) { |
1765 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1765 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1766 | if ( p->mToolBarHorF ) | 1766 | if ( p->mToolBarHorF ) |
1767 | p->mToolBarUpF = myP.y() > height()/2; | 1767 | p->mToolBarUpF = myP.y() > height()/2; |
1768 | else | 1768 | else |
1769 | p->mToolBarUpF = myP.x() > width()/2 ; | 1769 | p->mToolBarUpF = myP.x() > width()/2 ; |
1770 | } | 1770 | } |
1771 | #else | 1771 | #else |
1772 | if ( p->mToolBarHor ) | 1772 | if ( p->mToolBarHor ) |
1773 | p->mToolBarUp = iconToolBar->y() > height()/2; | 1773 | p->mToolBarUp = iconToolBar->y() > height()/2; |
1774 | else | 1774 | else |
1775 | p->mToolBarUp = iconToolBar->x() > width()/2; | 1775 | p->mToolBarUp = iconToolBar->x() > width()/2; |
1776 | if ( p->mToolBarHorV ) | 1776 | if ( p->mToolBarHorV ) |
1777 | p->mToolBarUpV = viewToolBar->y() > height()/2; | 1777 | p->mToolBarUpV = viewToolBar->y() > height()/2; |
1778 | else | 1778 | else |
1779 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; | 1779 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; |
1780 | 1780 | ||
1781 | if ( p->mToolBarHorN ) | 1781 | if ( p->mToolBarHorN ) |
1782 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; | 1782 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; |
1783 | else | 1783 | else |
1784 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; | 1784 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; |
1785 | if ( filterToolBar ) { | 1785 | if ( filterToolBar ) { |
1786 | if ( p->mToolBarHorF ) | 1786 | if ( p->mToolBarHorF ) |
1787 | p->mToolBarUpF = filterToolBar->y() > height()/2; | 1787 | p->mToolBarUpF = filterToolBar->y() > height()/2; |
1788 | else | 1788 | else |
1789 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | 1789 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; |
1790 | } | 1790 | } |
1791 | #endif | 1791 | #endif |
1792 | 1792 | ||
1793 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1793 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1794 | save(); | 1794 | save(); |
1795 | mView->writeSettings(); | 1795 | mView->writeSettings(); |
1796 | } | 1796 | } |
1797 | void MainWindow::slotModifiedChanged( bool changed ) | 1797 | void MainWindow::slotModifiedChanged( bool changed ) |
1798 | { | 1798 | { |
1799 | if ( mBlockAtStartup ) | 1799 | if ( mBlockAtStartup ) |
1800 | return; | 1800 | return; |
1801 | 1801 | ||
1802 | int msec; | 1802 | int msec; |
1803 | // we store the changes after 1 minute, | 1803 | // we store the changes after 1 minute, |
1804 | // and for safety reasons after 10 minutes again | 1804 | // and for safety reasons after 10 minutes again |
1805 | if ( !mSyncManager->blockSave() ) | 1805 | if ( !mSyncManager->blockSave() ) |
1806 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1806 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1807 | else | 1807 | else |
1808 | msec = 1000 * 600; | 1808 | msec = 1000 * 600; |
1809 | mSaveTimer.start( msec, true ); // 1 minute | 1809 | mSaveTimer.start( msec, true ); // 1 minute |
1810 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1810 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1811 | mCalendarModifiedFlag = true; | 1811 | mCalendarModifiedFlag = true; |
1812 | } | 1812 | } |
1813 | void MainWindow::saveStopTimer() | 1813 | void MainWindow::saveStopTimer() |
1814 | { | 1814 | { |
1815 | mSaveTimer.stop(); | 1815 | mSaveTimer.stop(); |
1816 | } | 1816 | } |
1817 | void MainWindow::save() | 1817 | void MainWindow::save() |
1818 | { | 1818 | { |
1819 | if ( !mCalendarModifiedFlag ) { | 1819 | if ( !mCalendarModifiedFlag ) { |
1820 | qDebug("KO: Calendar not modified. Nothing saved."); | 1820 | qDebug("KO: Calendar not modified. Nothing saved."); |
1821 | return; | 1821 | return; |
1822 | } | 1822 | } |
1823 | if ( mSyncManager->blockSave() ) | 1823 | if ( mSyncManager->blockSave() ) |
1824 | return; | 1824 | return; |
1825 | mSyncManager->setBlockSave(true); | 1825 | mSyncManager->setBlockSave(true); |
1826 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1826 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1827 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ | 1827 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ |
1828 | QDate reference ( 2000,1,1); | 1828 | QDate reference ( 2000,1,1); |
1829 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1829 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1830 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { | 1830 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { |
1831 | setCaption(i18n("Creating backup ... please wait ..." )); | 1831 | setCaption(i18n("Creating backup ... please wait ..." )); |
1832 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); | 1832 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); |
1833 | // we need the file path, the backup dir and the number of bups as param | 1833 | // we need the file path, the backup dir and the number of bups as param |
1834 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 1834 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
1835 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 1835 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
1836 | bupDir = KGlobalSettings::backupDataDir(); | 1836 | bupDir = KGlobalSettings::backupDataDir(); |
1837 | int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1837 | int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1838 | if ( retval == 0 ) { | 1838 | if ( retval == 0 ) { |
1839 | qDebug("KO: Backup cancelled. Will try again tomorrow "); | 1839 | qDebug("KO: Backup cancelled. Will try again tomorrow "); |
1840 | // retval == 0 : backup skipped for today, try again tomorrow | 1840 | // retval == 0 : backup skipped for today, try again tomorrow |
1841 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; | 1841 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; |
1842 | } else if ( retval == 1 ){ | 1842 | } else if ( retval == 1 ){ |
1843 | qDebug("KO: Backup created."); | 1843 | qDebug("KO: Backup created."); |
1844 | // backup ok | 1844 | // backup ok |
1845 | KOPrefs::instance()->mLastBackupDate = daysTo; | 1845 | KOPrefs::instance()->mLastBackupDate = daysTo; |
1846 | 1846 | ||
1847 | } else if ( retval == 2 ){ | 1847 | } else if ( retval == 2 ){ |
1848 | qDebug("KO: Backup globally cancelled."); | 1848 | qDebug("KO: Backup globally cancelled."); |
1849 | // backup globally cancelled | 1849 | // backup globally cancelled |
1850 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 1850 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
1851 | } | 1851 | } |
1852 | // retval == 3: do nothing, try again later | 1852 | // retval == 3: do nothing, try again later |
1853 | } | 1853 | } |
1854 | ; // KPimGlobalPrefs::instance()->mLastBackupDate | 1854 | ; // KPimGlobalPrefs::instance()->mLastBackupDate |
1855 | } | 1855 | } |
1856 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1856 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1857 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1857 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1858 | qDebug("KO: Start saving data to file!"); | 1858 | qDebug("KO: Start saving data to file!"); |
1859 | mView->saveCalendar( defaultFileName() ); | 1859 | mView->saveCalendar( defaultFileName() ); |
1860 | mCalendarModifiedFlag = false; | 1860 | mCalendarModifiedFlag = false; |
1861 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1861 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1862 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1862 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1863 | QString savemes; | 1863 | QString savemes; |
1864 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1864 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1865 | setCaption(savemes); | 1865 | setCaption(savemes); |
1866 | } else | 1866 | } else |
1867 | setCaption(i18n("Saving cancelled!")); | 1867 | setCaption(i18n("Saving cancelled!")); |
1868 | mSyncManager->setBlockSave( false ); | 1868 | mSyncManager->setBlockSave( false ); |
1869 | } | 1869 | } |
1870 | 1870 | ||
1871 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1871 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1872 | { | 1872 | { |
1873 | if ( !e->isAutoRepeat() ) { | 1873 | if ( !e->isAutoRepeat() ) { |
1874 | mFlagKeyPressed = false; | 1874 | mFlagKeyPressed = false; |
1875 | } | 1875 | } |
1876 | } | 1876 | } |
1877 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1877 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1878 | { | 1878 | { |
1879 | qApp->processEvents(); | 1879 | qApp->processEvents(); |
1880 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1880 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1881 | e->ignore(); | 1881 | e->ignore(); |
1882 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1882 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1883 | return; | 1883 | return; |
1884 | } | 1884 | } |
1885 | if (! e->isAutoRepeat() ) | 1885 | if (! e->isAutoRepeat() ) |
1886 | mFlagKeyPressed = true; | 1886 | mFlagKeyPressed = true; |
1887 | KOPrefs *p = KOPrefs::instance(); | 1887 | KOPrefs *p = KOPrefs::instance(); |
1888 | bool showSelectedDates = false; | 1888 | bool showSelectedDates = false; |
1889 | int size; | 1889 | int size; |
1890 | int pro = 0; | 1890 | int pro = 0; |
1891 | //qDebug("MainWindow::keyPressEvent "); | 1891 | //qDebug("MainWindow::keyPressEvent "); |
1892 | switch ( e->key() ) { | 1892 | switch ( e->key() ) { |
1893 | case Qt::Key_Right: | 1893 | case Qt::Key_Right: |
1894 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1894 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1895 | mView->goNextMonth(); | 1895 | mView->goNextMonth(); |
1896 | else | 1896 | else |
1897 | mView->goNext(); | 1897 | mView->goNext(); |
1898 | showSelectedDates = true; | 1898 | showSelectedDates = true; |
1899 | break; | 1899 | break; |
1900 | case Qt::Key_Left: | 1900 | case Qt::Key_Left: |
1901 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1901 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1902 | mView->goPreviousMonth(); | 1902 | mView->goPreviousMonth(); |
1903 | else | 1903 | else |
1904 | mView->goPrevious(); | 1904 | mView->goPrevious(); |
1905 | showSelectedDates = true; | 1905 | showSelectedDates = true; |
1906 | break; | 1906 | break; |
1907 | case Qt::Key_Down: | 1907 | case Qt::Key_Down: |
1908 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1908 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1909 | break; | 1909 | break; |
1910 | case Qt::Key_Up: | 1910 | case Qt::Key_Up: |
1911 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1911 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1912 | break; | 1912 | break; |
1913 | case Qt::Key_K: | 1913 | case Qt::Key_K: |
1914 | mView->viewManager()->showMonthViewWeek(); | 1914 | mView->viewManager()->showMonthViewWeek(); |
1915 | break; | 1915 | break; |
1916 | case Qt::Key_I: | 1916 | case Qt::Key_I: |
1917 | mView->showIncidence(); | 1917 | mView->showIncidence(); |
1918 | break; | 1918 | break; |
1919 | case Qt::Key_Delete: | 1919 | case Qt::Key_Delete: |
1920 | case Qt::Key_Backspace: | 1920 | case Qt::Key_Backspace: |
1921 | mView->deleteIncidence(); | 1921 | mView->deleteIncidence(); |
1922 | break; | 1922 | break; |
1923 | case Qt::Key_D: | 1923 | case Qt::Key_D: |
1924 | mView->viewManager()->showDayView(); | 1924 | mView->viewManager()->showDayView(); |
1925 | showSelectedDates = true; | 1925 | showSelectedDates = true; |
1926 | break; | 1926 | break; |
1927 | case Qt::Key_O: | 1927 | case Qt::Key_O: |
1928 | mView->toggleFilerEnabled( ); | 1928 | mView->toggleFilerEnabled( ); |
1929 | break; | 1929 | break; |
1930 | case Qt::Key_0: | 1930 | case Qt::Key_0: |
1931 | case Qt::Key_1: | 1931 | case Qt::Key_1: |
1932 | case Qt::Key_2: | 1932 | case Qt::Key_2: |
1933 | case Qt::Key_3: | 1933 | case Qt::Key_3: |
1934 | case Qt::Key_4: | 1934 | case Qt::Key_4: |
1935 | case Qt::Key_5: | 1935 | case Qt::Key_5: |
1936 | case Qt::Key_6: | 1936 | case Qt::Key_6: |
1937 | case Qt::Key_7: | 1937 | case Qt::Key_7: |
1938 | case Qt::Key_8: | 1938 | case Qt::Key_8: |
1939 | case Qt::Key_9: | 1939 | case Qt::Key_9: |
1940 | pro = e->key()-48; | 1940 | pro = e->key()-48; |
1941 | if ( pro == 0 ) | 1941 | if ( pro == 0 ) |
1942 | pro = 10; | 1942 | pro = 10; |
1943 | if ( e->state() == Qt::ControlButton) | 1943 | if ( e->state() == Qt::ControlButton) |
1944 | pro += 10; | 1944 | pro += 10; |
1945 | break; | 1945 | break; |
1946 | case Qt::Key_M: | 1946 | case Qt::Key_M: |
1947 | mView->viewManager()->showMonthView(); | 1947 | mView->viewManager()->showMonthView(); |
1948 | showSelectedDates = true; | 1948 | showSelectedDates = true; |
1949 | break; | 1949 | break; |
1950 | case Qt::Key_Insert: | 1950 | case Qt::Key_Insert: |
1951 | mView->newEvent(); | 1951 | mView->newEvent(); |
1952 | break; | 1952 | break; |
1953 | case Qt::Key_S : | 1953 | case Qt::Key_S : |
1954 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1954 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1955 | mView->newSubTodo(); | 1955 | mView->newSubTodo(); |
1956 | else | 1956 | else |
1957 | mView->dialogManager()->showSearchDialog(); | 1957 | mView->dialogManager()->showSearchDialog(); |
1958 | break; | 1958 | break; |
1959 | case Qt::Key_Y : | 1959 | case Qt::Key_Y : |
1960 | case Qt::Key_Z : | 1960 | case Qt::Key_Z : |
1961 | mView->viewManager()->showWorkWeekView(); | 1961 | mView->viewManager()->showWorkWeekView(); |
1962 | showSelectedDates = true; | 1962 | showSelectedDates = true; |
1963 | break; | 1963 | break; |
1964 | case Qt::Key_U : | 1964 | case Qt::Key_U : |
1965 | mView->viewManager()->showWeekView(); | 1965 | mView->viewManager()->showWeekView(); |
1966 | showSelectedDates = true; | 1966 | showSelectedDates = true; |
1967 | break; | 1967 | break; |
1968 | case Qt::Key_H : | 1968 | case Qt::Key_H : |
1969 | keyBindings(); | 1969 | keyBindings(); |
1970 | break; | 1970 | break; |
1971 | case Qt::Key_W: | 1971 | case Qt::Key_W: |
1972 | mView->viewManager()->showWhatsNextView(); | 1972 | mView->viewManager()->showWhatsNextView(); |
1973 | break; | 1973 | break; |
1974 | case Qt::Key_L: | 1974 | case Qt::Key_L: |
1975 | mView->viewManager()->showListView(); | 1975 | mView->viewManager()->showListView(); |
1976 | break; | 1976 | break; |
1977 | case Qt::Key_N: | 1977 | case Qt::Key_N: |
1978 | mView->viewManager()->showNextView(); | 1978 | mView->viewManager()->showNextView(); |
1979 | break; | 1979 | break; |
1980 | case Qt::Key_V: | 1980 | case Qt::Key_V: |
1981 | mView->viewManager()->showTodoView(); | 1981 | mView->viewManager()->showTodoView(); |
1982 | break; | 1982 | break; |
1983 | case Qt::Key_C: | 1983 | case Qt::Key_C: |
1984 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1984 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1985 | break; | 1985 | break; |
1986 | case Qt::Key_P: | 1986 | case Qt::Key_P: |
1987 | mView->showDatePicker( ); | 1987 | mView->showDatePicker( ); |
1988 | break; | 1988 | break; |
1989 | case Qt::Key_F: | 1989 | case Qt::Key_F: |
1990 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1990 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1991 | mView->editFilters(); | 1991 | mView->editFilters(); |
1992 | else | 1992 | else |
1993 | mView->toggleFilter(); | 1993 | mView->toggleFilter(); |
1994 | break; | 1994 | break; |
1995 | case Qt::Key_X: | 1995 | case Qt::Key_X: |
1996 | if ( e->state() == Qt::ControlButton ) | 1996 | if ( e->state() == Qt::ControlButton ) |
1997 | mView->toggleDateNavigatorWidget(); | 1997 | mView->toggleDateNavigatorWidget(); |
1998 | else { | 1998 | else { |
1999 | mView->viewManager()->showNextXView(); | 1999 | mView->viewManager()->showNextXView(); |
2000 | showSelectedDates = true; | 2000 | showSelectedDates = true; |
2001 | } | 2001 | } |
2002 | break; | 2002 | break; |
2003 | case Qt::Key_Space: | 2003 | case Qt::Key_Space: |
2004 | mView->toggleExpand(); | 2004 | mView->toggleExpand(); |
2005 | break; | 2005 | break; |
2006 | case Qt::Key_A: | 2006 | case Qt::Key_A: |
2007 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) | 2007 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) |
2008 | mView->showNextAlarms(); | 2008 | mView->showNextAlarms(); |
2009 | else | 2009 | else |
2010 | mView->toggleAllDaySize(); | 2010 | mView->toggleAllDaySize(); |
2011 | break; | 2011 | break; |
2012 | case Qt::Key_T: | 2012 | case Qt::Key_T: |
2013 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2013 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2014 | mView->newTodo(); | 2014 | mView->newTodo(); |
2015 | else { | 2015 | else { |
2016 | mView->goToday(); | 2016 | mView->goToday(); |
2017 | showSelectedDates = true; | 2017 | showSelectedDates = true; |
2018 | } | 2018 | } |
2019 | break; | 2019 | break; |
2020 | case Qt::Key_J: | 2020 | case Qt::Key_J: |
2021 | mView->viewManager()->showJournalView(); | 2021 | mView->viewManager()->showJournalView(); |
2022 | break; | 2022 | break; |
2023 | case Qt::Key_B: | 2023 | case Qt::Key_B: |
2024 | mView->editIncidenceDescription();; | 2024 | mView->editIncidenceDescription();; |
2025 | break; | 2025 | break; |
2026 | // case Qt::Key_Return: | 2026 | // case Qt::Key_Return: |
2027 | case Qt::Key_E: | 2027 | case Qt::Key_E: |
2028 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2028 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2029 | mView->newEvent(); | 2029 | mView->newEvent(); |
2030 | else | 2030 | else |
2031 | mView->editIncidence(); | 2031 | mView->editIncidence(); |
2032 | break; | 2032 | break; |
2033 | case Qt::Key_Plus: | 2033 | case Qt::Key_Plus: |
2034 | size = p->mHourSize +2; | 2034 | size = p->mHourSize +2; |
2035 | if ( size <= 22 ) | 2035 | if ( size <= 22 ) |
2036 | configureAgenda( size ); | 2036 | configureAgenda( size ); |
2037 | break; | 2037 | break; |
2038 | case Qt::Key_Minus: | 2038 | case Qt::Key_Minus: |
2039 | size = p->mHourSize - 2; | 2039 | size = p->mHourSize - 2; |
2040 | if ( size >= 4 ) | 2040 | if ( size >= 4 ) |
2041 | configureAgenda( size ); | 2041 | configureAgenda( size ); |
2042 | break; | 2042 | break; |
2043 | 2043 | ||
2044 | 2044 | ||
2045 | default: | 2045 | default: |
2046 | e->ignore(); | 2046 | e->ignore(); |
2047 | } | 2047 | } |
2048 | if ( pro > 0 ) { | 2048 | if ( pro > 0 ) { |
2049 | mView->selectFilter( pro-1 ); | 2049 | mView->selectFilter( pro-1 ); |
2050 | } | 2050 | } |
2051 | if ( showSelectedDates ) { | 2051 | if ( showSelectedDates ) { |
2052 | ;// setCaptionToDates(); | 2052 | ;// setCaptionToDates(); |
2053 | } | 2053 | } |
2054 | 2054 | ||
2055 | } | 2055 | } |
2056 | void MainWindow::fillFilterMenuTB() | 2056 | void MainWindow::fillFilterMenuTB() |
2057 | { | 2057 | { |
2058 | selectFilterMenuTB->clear(); | 2058 | selectFilterMenuTB->clear(); |
2059 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); | 2059 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); |
2060 | selectFilterMenuTB->insertSeparator(); | 2060 | selectFilterMenuTB->insertSeparator(); |
2061 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); | 2061 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); |
2062 | 2062 | ||
2063 | selectFilterMenuTB->insertSeparator(); | 2063 | selectFilterMenuTB->insertSeparator(); |
2064 | QPtrList<CalFilter> fili = mView->filters(); | 2064 | QPtrList<CalFilter> fili = mView->filters(); |
2065 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2065 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2066 | CalFilter *filter = fili.first(); | 2066 | CalFilter *filter = fili.first(); |
2067 | int iii = 2; | 2067 | int iii = 2; |
2068 | bool checkitem = mView->filterView()->filtersEnabled(); | 2068 | bool checkitem = mView->filterView()->filtersEnabled(); |
2069 | while(filter) { | 2069 | while(filter) { |
2070 | selectFilterMenuTB->insertItem( filter->name(), iii ); | 2070 | selectFilterMenuTB->insertItem( filter->name(), iii ); |
2071 | if ( filter == curfilter) | 2071 | if ( filter == curfilter) |
2072 | selectFilterMenuTB->setItemChecked( iii, checkitem ); | 2072 | selectFilterMenuTB->setItemChecked( iii, checkitem ); |
2073 | filter = fili.next(); | 2073 | filter = fili.next(); |
2074 | ++iii; | 2074 | ++iii; |
2075 | } | 2075 | } |
2076 | if ( !checkitem ) | 2076 | if ( !checkitem ) |
2077 | selectFilterMenuTB->setItemChecked( 1, true ); | 2077 | selectFilterMenuTB->setItemChecked( 1, true ); |
2078 | 2078 | ||
2079 | int x = 0; | 2079 | int x = 0; |
2080 | int y = iconToolBar->height(); | 2080 | int y = iconToolBar->height(); |
2081 | int dX = 0; | 2081 | int dX = 0; |
2082 | int dY = 0; | 2082 | int dY = 0; |
2083 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2083 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
2084 | if ( iconToolBar->y() > height()/2 ) { | 2084 | if ( iconToolBar->y() > height()/2 ) { |
2085 | dY = selectFilterMenuTB->sizeHint().height()+8; | 2085 | dY = selectFilterMenuTB->sizeHint().height()+8; |
2086 | y = 0; | 2086 | y = 0; |
2087 | } | 2087 | } |
2088 | } else { | 2088 | } else { |
2089 | if ( iconToolBar->x() > width()/2 ) { // right side | 2089 | if ( iconToolBar->x() > width()/2 ) { // right side |
2090 | x=0; | 2090 | x=0; |
2091 | dX= selectFilterMenuTB->sizeHint().width()+8; | 2091 | dX= selectFilterMenuTB->sizeHint().width()+8; |
2092 | y = 0; | 2092 | y = 0; |
2093 | } else { | 2093 | } else { |
2094 | x= iconToolBar->width(); | 2094 | x= iconToolBar->width(); |
2095 | y = 0; | 2095 | y = 0; |
2096 | } | 2096 | } |
2097 | } | 2097 | } |
2098 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); | 2098 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); |
2099 | selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); | 2099 | selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); |
2100 | } | 2100 | } |
2101 | void MainWindow::fillFilterMenu() | 2101 | void MainWindow::fillFilterMenu() |
2102 | { | 2102 | { |
2103 | selectFilterMenu->clear(); | 2103 | selectFilterMenu->clear(); |
2104 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 2104 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
2105 | selectFilterMenu->insertSeparator(); | 2105 | selectFilterMenu->insertSeparator(); |
2106 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); | 2106 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); |
2107 | 2107 | ||
2108 | selectFilterMenu->insertSeparator(); | 2108 | selectFilterMenu->insertSeparator(); |
2109 | QPtrList<CalFilter> fili = mView->filters(); | 2109 | QPtrList<CalFilter> fili = mView->filters(); |
2110 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2110 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2111 | CalFilter *filter = fili.first(); | 2111 | CalFilter *filter = fili.first(); |
2112 | int iii = 2; | 2112 | int iii = 2; |
2113 | bool checkitem = mView->filterView()->filtersEnabled(); | 2113 | bool checkitem = mView->filterView()->filtersEnabled(); |
2114 | while(filter) { | 2114 | while(filter) { |
2115 | selectFilterMenu->insertItem( filter->name(), iii ); | 2115 | selectFilterMenu->insertItem( filter->name(), iii ); |
2116 | if ( filter == curfilter) | 2116 | if ( filter == curfilter) |
2117 | selectFilterMenu->setItemChecked( iii, checkitem ); | 2117 | selectFilterMenu->setItemChecked( iii, checkitem ); |
2118 | filter = fili.next(); | 2118 | filter = fili.next(); |
2119 | ++iii; | 2119 | ++iii; |
2120 | } | 2120 | } |
2121 | if ( !checkitem ) | 2121 | if ( !checkitem ) |
2122 | selectFilterMenu->setItemChecked( 1, true ); | 2122 | selectFilterMenu->setItemChecked( 1, true ); |
2123 | } | 2123 | } |
2124 | void MainWindow::fillFilterMenuPopup() | 2124 | void MainWindow::fillFilterMenuPopup() |
2125 | { | 2125 | { |
2126 | filterPopupMenu->clear(); | 2126 | filterPopupMenu->clear(); |
2127 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); | 2127 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); |
2128 | 2128 | ||
2129 | filterPopupMenu->insertSeparator(); | 2129 | filterPopupMenu->insertSeparator(); |
2130 | QPtrList<CalFilter> fili = mView->filters(); | 2130 | QPtrList<CalFilter> fili = mView->filters(); |
2131 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2131 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2132 | CalFilter *filter = fili.first(); | 2132 | CalFilter *filter = fili.first(); |
2133 | int iii = 1; | 2133 | int iii = 1; |
2134 | bool checkitem = mView->filterView()->filtersEnabled(); | 2134 | bool checkitem = mView->filterView()->filtersEnabled(); |
2135 | while(filter) { | 2135 | while(filter) { |
2136 | filterPopupMenu->insertItem( filter->name(), iii ); | 2136 | filterPopupMenu->insertItem( filter->name(), iii ); |
2137 | if ( filter == curfilter) | 2137 | if ( filter == curfilter) |
2138 | filterPopupMenu->setItemChecked( iii, checkitem ); | 2138 | filterPopupMenu->setItemChecked( iii, checkitem ); |
2139 | filter = fili.next(); | 2139 | filter = fili.next(); |
2140 | ++iii; | 2140 | ++iii; |
2141 | } | 2141 | } |
2142 | if ( !checkitem ) | 2142 | if ( !checkitem ) |
2143 | filterPopupMenu->setItemChecked( 0, true ); | 2143 | filterPopupMenu->setItemChecked( 0, true ); |
2144 | } | 2144 | } |
2145 | void MainWindow::selectFilter( int fil ) | 2145 | void MainWindow::selectFilter( int fil ) |
2146 | { | 2146 | { |
2147 | 2147 | ||
2148 | if ( fil == 0 ) { | 2148 | if ( fil == 0 ) { |
2149 | mView->editFilters( ); | 2149 | mView->editFilters( ); |
2150 | } else if ( fil == 1 ){ | 2150 | } else if ( fil == 1 ){ |
2151 | if ( mView->filterView()->filtersEnabled() ) | 2151 | if ( mView->filterView()->filtersEnabled() ) |
2152 | mView->toggleFilerEnabled( ); | 2152 | mView->toggleFilerEnabled( ); |
2153 | } else { | 2153 | } else { |
2154 | if ( !mView->filterView()->filtersEnabled() ) { | 2154 | if ( !mView->filterView()->filtersEnabled() ) { |
2155 | mView->filterView()->blockSignals( true ); | 2155 | mView->filterView()->blockSignals( true ); |
2156 | mView->toggleFilerEnabled( ); | 2156 | mView->toggleFilerEnabled( ); |
2157 | mView->filterView()->blockSignals( false ); | 2157 | mView->filterView()->blockSignals( false ); |
2158 | } | 2158 | } |
2159 | mView->selectFilter( fil-2 ); | 2159 | mView->selectFilter( fil-2 ); |
2160 | } | 2160 | } |
2161 | } | 2161 | } |
2162 | void MainWindow::updateFilterToolbar() | 2162 | void MainWindow::updateFilterToolbar() |
2163 | { | 2163 | { |
2164 | if ( filterMenubar ) { | 2164 | if ( filterMenubar ) { |
2165 | if ( !mView->filterView()->filtersEnabled() ) { | 2165 | if ( !mView->filterView()->filtersEnabled() ) { |
2166 | filterMenubar->changeItem( 0, i18n("No Filter") ); | 2166 | filterMenubar->changeItem( 0, i18n("No Filter") ); |
2167 | } else { | 2167 | } else { |
2168 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2168 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2169 | if ( curfilter ) { | 2169 | if ( curfilter ) { |
2170 | filterMenubar->changeItem( 0, curfilter->name() ); | 2170 | filterMenubar->changeItem( 0, curfilter->name() ); |
2171 | } | 2171 | } |
2172 | } | 2172 | } |
2173 | } | 2173 | } |
2174 | } | 2174 | } |
2175 | void MainWindow::selectFilterPopup( int fil ) | 2175 | void MainWindow::selectFilterPopup( int fil ) |
2176 | { | 2176 | { |
2177 | selectFilter( fil + 1 ); | 2177 | selectFilter( fil + 1 ); |
2178 | 2178 | ||
2179 | } | 2179 | } |
2180 | void MainWindow::configureToolBar( int item ) | 2180 | void MainWindow::configureToolBar( int item ) |
2181 | { | 2181 | { |
2182 | 2182 | ||
2183 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 2183 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
2184 | KOPrefs *p = KOPrefs::instance(); | 2184 | KOPrefs *p = KOPrefs::instance(); |
2185 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 2185 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
2186 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); | 2186 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); |
2187 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); | 2187 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); |
2188 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 2188 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
2189 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 2189 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
2190 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); | 2190 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); |
2191 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); | 2191 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); |
2192 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); | 2192 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); |
2193 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); | 2193 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); |
2194 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 2194 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
2195 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 2195 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
2196 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 2196 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
2197 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 2197 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
2198 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 2198 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
2199 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 2199 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
2200 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 2200 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
2201 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 2201 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
2202 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 2202 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
2203 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 2203 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
2204 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 2204 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
2205 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 2205 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
2206 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 2206 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
2207 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 2207 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
2208 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 2208 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
2209 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 2209 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
2210 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 2210 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
2211 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 2211 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
2212 | // initActions(); | 2212 | // initActions(); |
2213 | } | 2213 | } |
2214 | void MainWindow::setCaption ( const QString & c ) | 2214 | void MainWindow::setCaption ( const QString & c ) |
2215 | { | 2215 | { |
2216 | QString cap = c; | 2216 | QString cap = c; |
2217 | cap.replace( QRegExp("\n"), " " ); | 2217 | cap.replace( QRegExp("\n"), " " ); |
2218 | cap = cap.stripWhiteSpace(); | 2218 | cap = cap.stripWhiteSpace(); |
2219 | if ( cap.isEmpty() ) | 2219 | if ( cap.isEmpty() ) |
2220 | cap = "KO/Pi"; | 2220 | cap = "KO/Pi"; |
2221 | QWidget::setCaption( cap ); | 2221 | QWidget::setCaption( cap ); |
2222 | } | 2222 | } |
2223 | void MainWindow::setCaptionToDates() | 2223 | void MainWindow::setCaptionToDates() |
2224 | { | 2224 | { |
2225 | QString selDates; | 2225 | QString selDates; |
2226 | QDate date = mView->startDate(); | 2226 | QDate date = mView->startDate(); |
2227 | if ( ! date.isValid() ) { | 2227 | if ( ! date.isValid() ) { |
2228 | setCaption(""); | 2228 | setCaption(""); |
2229 | return; | 2229 | return; |
2230 | } | 2230 | } |
2231 | selDates = KGlobal::locale()->formatDate( date, true); | 2231 | selDates = KGlobal::locale()->formatDate( date, true); |
2232 | if (mView->startDate() < mView->endDate() ) | 2232 | if (mView->startDate() < mView->endDate() ) |
2233 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 2233 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
2234 | else { | 2234 | else { |
2235 | QString addString; | 2235 | QString addString; |
2236 | if ( date == QDateTime::currentDateTime().date() ) | 2236 | if ( date == QDateTime::currentDateTime().date() ) |
2237 | addString = i18n("Today"); | 2237 | addString = i18n("Today"); |
2238 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) | 2238 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
2239 | addString = i18n("Tomorrow"); | 2239 | addString = i18n("Tomorrow"); |
2240 | if ( !addString.isEmpty() ) | 2240 | if ( !addString.isEmpty() ) |
2241 | selDates = addString+", "+selDates ; | 2241 | selDates = addString+", "+selDates ; |
2242 | } | 2242 | } |
2243 | setCaption( i18n("Dates: ") + selDates ); | 2243 | setCaption( i18n("Dates: ") + selDates ); |
2244 | 2244 | ||
2245 | } | 2245 | } |
2246 | void MainWindow::showConfigureAgenda( ) | 2246 | void MainWindow::showConfigureAgenda( ) |
2247 | { | 2247 | { |
2248 | int iii; | 2248 | int iii; |
2249 | for ( iii = 1;iii<= 10 ;++iii ){ | 2249 | for ( iii = 1;iii<= 10 ;++iii ){ |
2250 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 2250 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
2251 | } | 2251 | } |
2252 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 2252 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
2253 | } | 2253 | } |
2254 | void MainWindow::configureAgenda( int item ) | 2254 | void MainWindow::configureAgenda( int item ) |
2255 | { | 2255 | { |
2256 | if ( KOPrefs::instance()->mHourSize == item ) | 2256 | if ( KOPrefs::instance()->mHourSize == item ) |
2257 | return; | 2257 | return; |
2258 | KOPrefs::instance()->mHourSize=item; | 2258 | KOPrefs::instance()->mHourSize=item; |
2259 | mView->viewManager()->agendaView()->updateConfig(); | 2259 | mView->viewManager()->agendaView()->updateConfig(); |
2260 | } | 2260 | } |
2261 | 2261 | ||
2262 | void MainWindow::saveCalendar() | 2262 | void MainWindow::saveCalendar() |
2263 | { | 2263 | { |
2264 | QString fn = KOPrefs::instance()->mLastSaveFile; | 2264 | QString fn = KOPrefs::instance()->mLastSaveFile; |
2265 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); | 2265 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); |
2266 | 2266 | ||
2267 | if ( fn == "" ) | 2267 | if ( fn == "" ) |
2268 | return; | 2268 | return; |
2269 | QFileInfo info; | 2269 | QFileInfo info; |
2270 | info.setFile( fn ); | 2270 | info.setFile( fn ); |
2271 | QString mes; | 2271 | QString mes; |
2272 | bool createbup = true; | 2272 | bool createbup = true; |
2273 | if ( info. exists() ) { | 2273 | if ( info. exists() ) { |
2274 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; | 2274 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; |
2275 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 2275 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
2276 | i18n("Overwrite!"), i18n("Cancel"), 0, | 2276 | i18n("Overwrite!"), i18n("Cancel"), 0, |
2277 | 0, 1 ); | 2277 | 0, 1 ); |
2278 | if ( result != 0 ) { | 2278 | if ( result != 0 ) { |
2279 | createbup = false; | 2279 | createbup = false; |
2280 | } | 2280 | } |
2281 | } | 2281 | } |
2282 | if ( createbup ) { | 2282 | if ( createbup ) { |
2283 | mView->saveCalendar( fn ); | 2283 | mView->saveCalendar( fn ); |
2284 | mes = i18n("KO/Pi:Saved %1").arg(fn); | 2284 | mes = i18n("KO/Pi:Saved %1").arg(fn); |
2285 | KOPrefs::instance()->mLastSaveFile = fn; | 2285 | KOPrefs::instance()->mLastSaveFile = fn; |
2286 | setCaption(mes); | 2286 | setCaption(mes); |
2287 | } | 2287 | } |
2288 | } | 2288 | } |
2289 | void MainWindow::loadCalendar() | 2289 | void MainWindow::loadCalendar() |
2290 | { | 2290 | { |
2291 | 2291 | ||
2292 | QString fn = KOPrefs::instance()->mLastLoadFile; | 2292 | QString fn = KOPrefs::instance()->mLastLoadFile; |
2293 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 2293 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
2294 | 2294 | ||
2295 | if ( fn == "" ) | 2295 | if ( fn == "" ) |
2296 | return; | 2296 | return; |
2297 | QFileInfo info; | 2297 | QFileInfo info; |
2298 | info.setFile( fn ); | 2298 | info.setFile( fn ); |
2299 | QString mess; | 2299 | QString mess; |
2300 | bool loadbup = true; | 2300 | bool loadbup = true; |
2301 | if ( info. exists() ) { | 2301 | if ( info. exists() ) { |
2302 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2302 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2303 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2303 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2304 | mess, | 2304 | mess, |
2305 | i18n("Load!"), i18n("Cancel"), 0, | 2305 | i18n("Load!"), i18n("Cancel"), 0, |
2306 | 0, 1 ); | 2306 | 0, 1 ); |
2307 | if ( result != 0 ) { | 2307 | if ( result != 0 ) { |
2308 | loadbup = false; | 2308 | loadbup = false; |
2309 | } | 2309 | } |
2310 | } else { | 2310 | } else { |
2311 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2311 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2312 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 2312 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
2313 | 0, 1 ); | 2313 | 0, 1 ); |
2314 | 2314 | ||
2315 | return; | 2315 | return; |
2316 | } | 2316 | } |
2317 | if ( loadbup ) { | 2317 | if ( loadbup ) { |
2318 | mView->openCalendar( fn ); | 2318 | mView->openCalendar( fn ); |
2319 | KOPrefs::instance()->mLastLoadFile = fn; | 2319 | KOPrefs::instance()->mLastLoadFile = fn; |
2320 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 2320 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
2321 | setCaption(mess); | 2321 | setCaption(mess); |
2322 | } | 2322 | } |
2323 | 2323 | ||
2324 | } | 2324 | } |
2325 | void MainWindow::quickImportIcal() | 2325 | void MainWindow::quickImportIcal() |
2326 | { | 2326 | { |
2327 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 2327 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
2328 | } | 2328 | } |
2329 | void MainWindow::importFile( QString fn, bool quick ) | 2329 | void MainWindow::importFile( QString fn, bool quick ) |
2330 | { | 2330 | { |
2331 | QFileInfo info; | 2331 | QFileInfo info; |
2332 | info.setFile( fn ); | 2332 | info.setFile( fn ); |
2333 | QString mess; | 2333 | QString mess; |
2334 | bool loadbup = true; | 2334 | bool loadbup = true; |
2335 | if ( !info. exists() ) { | 2335 | if ( !info. exists() ) { |
2336 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 2336 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
2337 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2337 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2338 | mess ); | 2338 | mess ); |
2339 | return; | 2339 | return; |
2340 | } | 2340 | } |
2341 | int result = 0; | 2341 | int result = 0; |
2342 | if ( !quick ) { | 2342 | if ( !quick ) { |
2343 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2343 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2344 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2344 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2345 | mess, | 2345 | mess, |
2346 | "Import", "Cancel", 0, | 2346 | "Import", "Cancel", 0, |
2347 | 0, 1 ); | 2347 | 0, 1 ); |
2348 | } | 2348 | } |
2349 | if ( result == 0 ) { | 2349 | if ( result == 0 ) { |
2350 | if ( mView->openCalendar( fn, true )) { | 2350 | if ( mView->openCalendar( fn, true )) { |
2351 | KOPrefs::instance()->mLastImportFile = fn; | 2351 | KOPrefs::instance()->mLastImportFile = fn; |
2352 | setCaption(i18n("Imported file successfully")); | 2352 | setCaption(i18n("Imported file successfully")); |
2353 | } else { | 2353 | } else { |
2354 | setCaption(i18n("Error importing file")); | 2354 | setCaption(i18n("Error importing file")); |
2355 | } | 2355 | } |
2356 | } | 2356 | } |
2357 | } | 2357 | } |
2358 | 2358 | ||
2359 | void MainWindow::importIcal() | 2359 | void MainWindow::importIcal() |
2360 | { | 2360 | { |
2361 | 2361 | ||
2362 | QString fn =KOPrefs::instance()->mLastImportFile; | 2362 | QString fn =KOPrefs::instance()->mLastImportFile; |
2363 | 2363 | ||
2364 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 2364 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
2365 | if ( fn == "" ) | 2365 | if ( fn == "" ) |
2366 | return; | 2366 | return; |
2367 | importFile( fn, true ); | 2367 | importFile( fn, true ); |
2368 | 2368 | ||
2369 | } | 2369 | } |
2370 | 2370 | ||
2371 | void MainWindow::exportVCalendar() | 2371 | void MainWindow::exportVCalendar() |
2372 | { | 2372 | { |
2373 | QString fn = KOPrefs::instance()->mLastVcalFile; | 2373 | QString fn = KOPrefs::instance()->mLastVcalFile; |
2374 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 2374 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
2375 | if ( fn == "" ) | 2375 | if ( fn == "" ) |
2376 | return; | 2376 | return; |
2377 | QFileInfo info; | 2377 | QFileInfo info; |
2378 | info.setFile( fn ); | 2378 | info.setFile( fn ); |
2379 | QString mes; | 2379 | QString mes; |
2380 | bool createbup = true; | 2380 | bool createbup = true; |
2381 | if ( info. exists() ) { | 2381 | if ( info. exists() ) { |
2382 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 2382 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
2383 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 2383 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
2384 | i18n("Overwrite!"), i18n("Cancel"), 0, | 2384 | i18n("Overwrite!"), i18n("Cancel"), 0, |
2385 | 0, 1 ); | 2385 | 0, 1 ); |
2386 | if ( result != 0 ) { | 2386 | if ( result != 0 ) { |
2387 | createbup = false; | 2387 | createbup = false; |
2388 | } | 2388 | } |
2389 | } | 2389 | } |
2390 | if ( createbup ) { | 2390 | if ( createbup ) { |
2391 | if ( mView->exportVCalendar( fn ) ) { | 2391 | if ( mView->exportVCalendar( fn ) ) { |
2392 | KOPrefs::instance()->mLastVcalFile = fn; | 2392 | KOPrefs::instance()->mLastVcalFile = fn; |
2393 | if ( fn.length() > 20 ) | 2393 | if ( fn.length() > 20 ) |
2394 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 2394 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
2395 | else | 2395 | else |
2396 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 2396 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
2397 | setCaption(mes); | 2397 | setCaption(mes); |
2398 | } | 2398 | } |
2399 | } | 2399 | } |
2400 | 2400 | ||
2401 | } | 2401 | } |
2402 | QString MainWindow::sentSyncFile() | 2402 | QString MainWindow::sentSyncFile() |
2403 | { | 2403 | { |
2404 | #ifdef DESKTOP_VERSION | 2404 | #ifdef DESKTOP_VERSION |
2405 | return locateLocal( "tmp", "copysynccal.ics" ); | 2405 | return locateLocal( "tmp", "copysynccal.ics" ); |
2406 | #else | 2406 | #else |
2407 | return QString( "/tmp/copysynccal.ics" ); | 2407 | return QString( "/tmp/copysynccal.ics" ); |
2408 | #endif | 2408 | #endif |
2409 | } | 2409 | } |
2410 | 2410 | ||
2411 | void MainWindow::syncFileRequest() | 2411 | void MainWindow::syncFileRequest() |
2412 | { | 2412 | { |
2413 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2413 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2414 | mSyncManager->slotSyncMenu( 999 ); | 2414 | mSyncManager->slotSyncMenu( 999 ); |
2415 | } | 2415 | } |
2416 | 2416 | ||
2417 | setCaption(i18n("Saving Data to temp file ..." )); | 2417 | setCaption(i18n("Saving Data to temp file ..." )); |
2418 | mView->saveCalendar( sentSyncFile() ); | 2418 | mView->saveCalendar( sentSyncFile() ); |
2419 | setCaption(i18n("Data saved to temp file!" )); | 2419 | setCaption(i18n("Data saved to temp file!" )); |
2420 | 2420 | ||
2421 | } | 2421 | } |
2422 | void MainWindow::getFile( bool success ) | 2422 | void MainWindow::getFile( bool success ) |
2423 | { | 2423 | { |
2424 | if ( ! success ) { | 2424 | if ( ! success ) { |
2425 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2425 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2426 | return; | 2426 | return; |
2427 | } | 2427 | } |
2428 | mView->openCalendar( sentSyncFile() ); | 2428 | mView->openCalendar( sentSyncFile() ); |
2429 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2429 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2430 | mSyncManager->slotSyncMenu( 999 ); | 2430 | mSyncManager->slotSyncMenu( 999 ); |
2431 | } | 2431 | } |
2432 | setCaption( i18n("Pi-Sync successful!") ); | 2432 | setCaption( i18n("Pi-Sync successful!") ); |
2433 | } | 2433 | } |
2434 | void MainWindow::printListView() | 2434 | void MainWindow::printListView() |
2435 | { | 2435 | { |
2436 | 2436 | ||
2437 | QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); | 2437 | QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); |
2438 | 2438 | ||
2439 | KMessageBox::information( this, message); | 2439 | KMessageBox::information( this, message); |
2440 | } | 2440 | } |
2441 | void MainWindow::printSel( ) | 2441 | void MainWindow::printSel( ) |
2442 | { | 2442 | { |
2443 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 2443 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
2444 | } | 2444 | } |
2445 | 2445 | ||
2446 | void MainWindow::printCal() | 2446 | void MainWindow::printCal() |
2447 | { | 2447 | { |
2448 | mView->print();//mCp->showDialog(); | 2448 | mView->print();//mCp->showDialog(); |
2449 | } | 2449 | } |
2450 | 2450 | ||
2451 | 2451 | ||
2452 | #include "libkdepim/kdatepicker.h" | 2452 | #include "libkdepim/kdatepicker.h" |
2453 | #include <kdatetbl.h> | 2453 | #include <kdatetbl.h> |
2454 | 2454 | ||
2455 | void MainWindow::weekAction() | 2455 | void MainWindow::weekAction() |
2456 | { | 2456 | { |
2457 | int month; | 2457 | int month; |
2458 | KPopupFrame* popup = new KPopupFrame(this); | 2458 | KPopupFrame* popup = new KPopupFrame(this); |
2459 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); | 2459 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); |
2460 | // ----- | 2460 | // ----- |
2461 | picker->resize(picker->sizeHint()); | 2461 | picker->resize(picker->sizeHint()); |
2462 | popup->setMainWidget(picker); | 2462 | popup->setMainWidget(picker); |
2463 | picker->setFocus(); | 2463 | picker->setFocus(); |
2464 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 2464 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
2465 | int x = 0; | 2465 | int x = 0; |
2466 | int y = iconToolBar->height(); | 2466 | int y = iconToolBar->height(); |
2467 | int dX = 0; | 2467 | int dX = 0; |
2468 | int dY = 0; | 2468 | int dY = 0; |
2469 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2469 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
2470 | if ( iconToolBar->y() > height()/2 ) { | 2470 | if ( iconToolBar->y() > height()/2 ) { |
2471 | dY = picker->sizeHint().height()+8; | 2471 | dY = picker->sizeHint().height()+8; |
2472 | y = 0; | 2472 | y = 0; |
2473 | } | 2473 | } |
2474 | } else { | 2474 | } else { |
2475 | if ( iconToolBar->x() > width()/2 ) { // right side | 2475 | if ( iconToolBar->x() > width()/2 ) { // right side |
2476 | x=0; | 2476 | x=0; |
2477 | dX= picker->sizeHint().width()+8; | 2477 | dX= picker->sizeHint().width()+8; |
2478 | y = 0; | 2478 | y = 0; |
2479 | } else { | 2479 | } else { |
2480 | x= iconToolBar->width(); | 2480 | x= iconToolBar->width(); |
2481 | y = 0; | 2481 | y = 0; |
2482 | } | 2482 | } |
2483 | } | 2483 | } |
2484 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); | 2484 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); |
2485 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) | 2485 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) |
2486 | { | 2486 | { |
2487 | month = picker->getResult(); | 2487 | month = picker->getResult(); |
2488 | emit selectWeek ( month ); | 2488 | emit selectWeek ( month ); |
2489 | //qDebug("weekSelected %d ", month); | 2489 | //qDebug("weekSelected %d ", month); |
2490 | } | 2490 | } |
2491 | delete popup; | 2491 | delete popup; |
2492 | } | 2492 | } |
2493 | 2493 | ||
2494 | void MainWindow::hideEvent ( QHideEvent * ) | 2494 | void MainWindow::hideEvent ( QHideEvent * ) |
2495 | { | 2495 | { |
2496 | QString message; | 2496 | QString message; |
2497 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); | 2497 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); |
2498 | if ( nextA.isValid() ) { | 2498 | if ( nextA.isValid() ) { |
2499 | QString sum = mCalendar->nextSummary(); | 2499 | QString sum = mCalendar->nextSummary(); |
2500 | 2500 | ||
2501 | message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); | 2501 | message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); |
2502 | setCaption( message ); | 2502 | setCaption( message ); |
2503 | } | 2503 | } |
2504 | } | 2504 | } |
2505 | 2505 | ||
2506 | void MainWindow::resizeEvent( QResizeEvent* e) | 2506 | void MainWindow::resizeEvent( QResizeEvent* e) |
2507 | { | 2507 | { |
2508 | #ifndef DESKTOP_VERSION | 2508 | #ifndef DESKTOP_VERSION |
2509 | if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { | 2509 | if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { |
2510 | if (QApplication::desktop()->width() > QApplication::desktop()->height() ) | 2510 | if (QApplication::desktop()->width() > QApplication::desktop()->height() ) |
2511 | filterToolBar->hide(); | 2511 | filterToolBar->hide(); |
2512 | else | 2512 | else |
2513 | filterToolBar->show(); | 2513 | filterToolBar->show(); |
2514 | } | 2514 | } |
2515 | #endif | 2515 | #endif |
2516 | QMainWindow::resizeEvent( e); | 2516 | QMainWindow::resizeEvent( e); |
2517 | } | 2517 | } |
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 | ||
47 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | 47 | SearchDialog::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 | ||
135 | SearchDialog::~SearchDialog() | 140 | SearchDialog::~SearchDialog() |
136 | { | 141 | { |
137 | 142 | ||
138 | } | 143 | } |
144 | void 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 | } | ||
139 | void SearchDialog::raiseAndSelect() | 156 | void 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 | } |
182 | void SearchDialog::setFocusToList() | 199 | void SearchDialog::setFocusToList() |
183 | { | 200 | { |
184 | listView->resetFocus(); | 201 | listView->resetFocus(); |
185 | } | 202 | } |
186 | void SearchDialog::accept() | 203 | void SearchDialog::accept() |
187 | { | 204 | { |
188 | doSearch(); | 205 | doSearch(); |
189 | } | 206 | } |
190 | void SearchDialog::updateList() | 207 | void 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 | } |
203 | void SearchDialog::searchTextChanged( const QString &_text ) | 220 | void 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 | ||
210 | void SearchDialog::doSearch() | 227 | void 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 | } |
248 | void SearchDialog::updateConfig() | 265 | void SearchDialog::updateConfig() |
249 | { | 266 | { |
250 | listView->updateConfig(); | 267 | listView->updateConfig(); |
251 | } | 268 | } |
252 | void SearchDialog::updateView() | 269 | void 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 | ||
275 | void SearchDialog::search(const QRegExp &re) | 292 | void 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 | ||
450 | void SearchDialog::keyPressEvent ( QKeyEvent *e) | 467 | void 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 | ||
36 | class KDateEdit; | 36 | class KDateEdit; |
37 | class QCheckBox; | 37 | class QCheckBox; |
38 | class QLineEdit; | 38 | class QLineEdit; |
39 | class KLineEdit; | 39 | class KLineEdit; |
40 | class QLabel; | 40 | class QLabel; |
41 | class CalendarView; | 41 | class CalendarView; |
42 | 42 | ||
43 | using namespace KCal; | 43 | using namespace KCal; |
44 | class SearchDialog : public QVBox | 44 | class 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 |