summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-26 23:07:01 (UTC)
committer zautrix <zautrix>2005-03-26 23:07:01 (UTC)
commit9963563126c91d721406f24a49548b1d8f3dc415 (patch) (unidiff)
tree925a37684d46d8e89e9f5cbfb647d5b625a50c00
parent46b94158f6b115e175516a8432ec5b71f1403834 (diff)
downloadkdepimpi-9963563126c91d721406f24a49548b1d8f3dc415.zip
kdepimpi-9963563126c91d721406f24a49548b1d8f3dc415.tar.gz
kdepimpi-9963563126c91d721406f24a49548b1d8f3dc415.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp33
-rw-r--r--korganizer/mainwindow.cpp13
2 files changed, 24 insertions, 22 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index b5de4a1..e80b3fc 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -13,442 +13,443 @@
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 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <qwidgetstack.h> 26#include <qwidgetstack.h>
27 27
28#include <kconfig.h> 28#include <kconfig.h>
29#include <kglobal.h> 29#include <kglobal.h>
30#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#else 32#else
33#include <qapplication.h> 33#include <qapplication.h>
34#endif 34#endif
35#include <qdatetime.h> 35#include <qdatetime.h>
36#include "calendarview.h" 36#include "calendarview.h"
37#include "datenavigator.h" 37#include "datenavigator.h"
38#include "kotodoview.h" 38#include "kotodoview.h"
39#include "koagendaview.h" 39#include "koagendaview.h"
40#include "kodialogmanager.h" 40#include "kodialogmanager.h"
41#include "komonthview.h" 41#include "komonthview.h"
42#include "kolistview.h" 42#include "kolistview.h"
43#include "kowhatsnextview.h" 43#include "kowhatsnextview.h"
44#include "kojournalview.h" 44#include "kojournalview.h"
45#include "kotimespanview.h" 45#include "kotimespanview.h"
46#include "koprefs.h" 46#include "koprefs.h"
47#include "navigatorbar.h" 47#include "navigatorbar.h"
48#include "kdatenavigator.h" 48#include "kdatenavigator.h"
49 49
50#include "koviewmanager.h" 50#include "koviewmanager.h"
51//extern bool externFlagMonthviewBlockPainting; 51//extern bool externFlagMonthviewBlockPainting;
52 52
53//bool globalFlagBlockPainting = false; 53//bool globalFlagBlockPainting = false;
54int globalFlagBlockAgenda = 0; 54int globalFlagBlockAgenda = 0;
55int globalFlagBlockLabel = 0; 55int globalFlagBlockLabel = 0;
56int globalFlagBlockAgendaItemPaint = 1; 56int globalFlagBlockAgendaItemPaint = 1;
57int globalFlagBlockAgendaItemUpdate = 1; 57int globalFlagBlockAgendaItemUpdate = 1;
58 58
59 59
60KOViewManager::KOViewManager( CalendarView *mainView ) : 60KOViewManager::KOViewManager( CalendarView *mainView ) :
61 QObject(), mMainView( mainView ) 61 QObject(), mMainView( mainView )
62{ 62{
63 mCurrentView = 0; 63 mCurrentView = 0;
64 64
65 mWhatsNextView = 0; 65 mWhatsNextView = 0;
66 mTodoView = 0; 66 mTodoView = 0;
67 mAgendaView = 0; 67 mAgendaView = 0;
68 mMonthView = 0; 68 mMonthView = 0;
69 mListView = 0; 69 mListView = 0;
70 mJournalView = 0; 70 mJournalView = 0;
71 mTimeSpanView = 0; 71 mTimeSpanView = 0;
72 mCurrentAgendaView = 0 ; 72 mCurrentAgendaView = 0 ;
73 mFlagShowNextxDays = false; 73 mFlagShowNextxDays = false;
74} 74}
75 75
76KOViewManager::~KOViewManager() 76KOViewManager::~KOViewManager()
77{ 77{
78} 78}
79 79
80 80
81KOrg::BaseView *KOViewManager::currentView() 81KOrg::BaseView *KOViewManager::currentView()
82{ 82{
83 return mCurrentView; 83 return mCurrentView;
84} 84}
85 85
86void KOViewManager::readSettings(KConfig *config) 86void KOViewManager::readSettings(KConfig *config)
87{ 87{
88 config->setGroup("General"); 88 config->setGroup("General");
89 QString view = config->readEntry("Current View"); 89 QString view = config->readEntry("Current View");
90 if (view == "WhatsNext") showWhatsNextView(); 90 if (view == "WhatsNext") showWhatsNextView();
91 else if (view == "Month") { 91 else if (view == "Month") {
92 if ( !KOPrefs::instance()->mMonthViewWeek ) 92 if ( !KOPrefs::instance()->mMonthViewWeek )
93 showMonthView(); 93 showMonthView();
94 else 94 else
95 showMonthViewWeek(); 95 showMonthViewWeek();
96 } 96 }
97 else if (view == "List") showListView(); 97 else if (view == "List") showListView();
98 else if (view == "Journal") showJournalView(); 98 else if (view == "Journal") showJournalView();
99 else if (view == "TimeSpan") showTimeSpanView(); 99 else if (view == "TimeSpan") showTimeSpanView();
100 else if (view == "Todo") showTodoView(); 100 else if (view == "Todo") showTodoView();
101 else { 101 else {
102 config->setGroup( "Views" ); 102 config->setGroup( "Views" );
103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
104 mCurrentAgendaView = dateCount; 104 mCurrentAgendaView = dateCount;
105 showAgendaView(); 105 showAgendaView();
106 mCurrentAgendaView = dateCount; 106 mCurrentAgendaView = dateCount;
107#ifdef DESKTOP_VERSION 107#ifdef DESKTOP_VERSION
108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); 108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) );
109#endif 109#endif
110 } 110 }
111} 111}
112 112
113void KOViewManager::showDateView( int view, QDate date) 113void KOViewManager::showDateView( int view, QDate date)
114{ 114{
115 static int lastMode = 0; 115 static int lastMode = 0;
116 static int lastCount = 0; 116 static int lastCount = 0;
117 static bool lastNDMode = false; 117 static bool lastNDMode = false;
118 static QDate lastDate; 118 static QDate lastDate;
119 //qDebug("date %d %s", view, date.toString().latin1()); 119 //qDebug("date %d %s", view, date.toString().latin1());
120 120
121 if (view != 9) 121 if (view != 9)
122 lastMode = 0; 122 lastMode = 0;
123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); 123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays );
124 bool savemFlagShowNextxDays = mFlagShowNextxDays; 124 bool savemFlagShowNextxDays = mFlagShowNextxDays;
125 mFlagShowNextxDays = false; 125 mFlagShowNextxDays = false;
126 if ( view == 3 ) { 126 if ( view == 3 ) {
127 //mCurrentAgendaView = 1 ; 127 //mCurrentAgendaView = 1 ;
128 lastDate = mMainView->dateNavigator()->selectedDates().first(); 128 lastDate = mMainView->dateNavigator()->selectedDates().first();
129 lastCount = mMainView->dateNavigator()->selectedDates().count(); 129 lastCount = mMainView->dateNavigator()->selectedDates().count();
130 lastNDMode = savemFlagShowNextxDays; 130 lastNDMode = savemFlagShowNextxDays;
131 mMainView->dateNavigator()->selectDate( date ); 131 mMainView->dateNavigator()->selectDate( date );
132 lastMode = 1; 132 lastMode = 1;
133 mCurrentAgendaView = 1 ; 133 mCurrentAgendaView = 1 ;
134 } else if (view == 4 ) { 134 } else if (view == 4 ) {
135 mCurrentAgendaView = 7 ; 135 mCurrentAgendaView = 7 ;
136 mMainView->dateNavigator()->selectDates( date, 7 ); 136 mMainView->dateNavigator()->selectDates( date, 7 );
137 } else if (view == 5 ) { 137 } else if (view == 5 ) {
138 mCurrentAgendaView = 14 ; 138 mCurrentAgendaView = 14 ;
139 mMainView->dateNavigator()->selectDates( date, 14); 139 mMainView->dateNavigator()->selectDates( date, 14);
140 } else if (view == 6 ) { 140 } else if (view == 6 ) {
141 //mMainView->dateNavigator()->selectDates( date, 7 ); 141 //mMainView->dateNavigator()->selectDates( date, 7 );
142 showMonthView(); 142 showMonthView();
143 } else if (view == 7 ) { 143 } else if (view == 7 ) {
144 mMainView->dateNavigator()->selectDate( date ); 144 mMainView->dateNavigator()->selectDate( date );
145 showJournalView(); 145 showJournalView();
146 } else if (view == 8 ) { 146 } else if (view == 8 ) {
147 globalFlagBlockAgenda = 1; 147 globalFlagBlockAgenda = 1;
148 if ( mCurrentAgendaView != 3 ) 148 if ( mCurrentAgendaView != 3 )
149 mCurrentAgendaView = -1; 149 mCurrentAgendaView = -1;
150 showAgendaView(KOPrefs::instance()->mFullViewMonth); 150 showAgendaView(KOPrefs::instance()->mFullViewMonth);
151 globalFlagBlockAgenda = 2; 151 globalFlagBlockAgenda = 2;
152 mMainView->dateNavigator()->selectDates( date , 152 mMainView->dateNavigator()->selectDates( date ,
153 KOPrefs::instance()->mNextXDays ); 153 KOPrefs::instance()->mNextXDays );
154 mFlagShowNextxDays = true; 154 mFlagShowNextxDays = true;
155 mCurrentAgendaView = 3 ; 155 mCurrentAgendaView = 3 ;
156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) 156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode )
157 if ( lastMode ) { 157 if ( lastMode ) {
158 mCurrentAgendaView = lastCount ; 158 mCurrentAgendaView = lastCount ;
159 mMainView->dateNavigator()->selectDates( lastDate, lastCount); 159 mMainView->dateNavigator()->selectDates( lastDate, lastCount);
160 mFlagShowNextxDays = lastNDMode; 160 mFlagShowNextxDays = lastNDMode;
161 if ( mFlagShowNextxDays ) { 161 if ( mFlagShowNextxDays ) {
162 mCurrentAgendaView = 3 ; 162 mCurrentAgendaView = 3 ;
163 } 163 }
164 } else 164 } else
165 showWeekView(); 165 showWeekView();
166 } else if (view == 10) { 166 } else if (view == 10) {
167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); 167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() );
168 } 168 }
169} 169}
170 170
171 171
172 172
173void KOViewManager::writeSettings(KConfig *config) 173void KOViewManager::writeSettings(KConfig *config)
174{ 174{
175 config->setGroup("General"); 175 config->setGroup("General");
176 176
177 QString view; 177 QString view;
178 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 178 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
179 else if (mCurrentView == mMonthView) view = "Month"; 179 else if (mCurrentView == mMonthView) view = "Month";
180 else if (mCurrentView == mListView) view = "List"; 180 else if (mCurrentView == mListView) view = "List";
181 else if (mCurrentView == mJournalView) view = "Journal"; 181 else if (mCurrentView == mJournalView) view = "Journal";
182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
183 else if (mCurrentView == mTodoView) view = "Todo"; 183 else if (mCurrentView == mTodoView) view = "Todo";
184 else view = "Agenda"; 184 else view = "Agenda";
185 185
186 config->writeEntry("Current View",view); 186 config->writeEntry("Current View",view);
187 187
188 if (mAgendaView) { 188 if (mAgendaView) {
189 mAgendaView->writeSettings(config); 189 mAgendaView->writeSettings(config);
190 } 190 }
191 if (mTimeSpanView) { 191 if (mTimeSpanView) {
192 mTimeSpanView->writeSettings(config); 192 mTimeSpanView->writeSettings(config);
193 } 193 }
194 if (mListView) { 194 if (mListView) {
195 mListView->writeSettings(config); 195 mListView->writeSettings(config);
196 } 196 }
197 if (mTodoView) { 197 if (mTodoView) {
198 mTodoView->saveLayout(config,"Todo View"); 198 mTodoView->saveLayout(config,"Todo View");
199 } 199 }
200} 200}
201void KOViewManager::showNextView() 201void KOViewManager::showNextView()
202{ 202{
203 if (mCurrentView == mWhatsNextView) goto NEXT_X; 203 if (mCurrentView == mWhatsNextView) goto NEXT_X;
204 204
205 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto LIST; 205 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL;
206 206
207 if (mCurrentView == mListView ) goto DAY_1; 207 if (mCurrentView == mJournalView ) goto DAY_1;
208 208
209 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; 209 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5;
210 210
211 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; 211 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7;
212 212
213 if (mCurrentView == mAgendaView ) goto DAY_6; 213 if (mCurrentView == mAgendaView ) goto DAY_6;
214 214
215 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; 215 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH;
216 216
217 if (mCurrentView == mMonthView ) goto TODO; 217 if (mCurrentView == mMonthView ) goto LIST;
218
219 if (mCurrentView == mListView ) goto TODO;
220
221 // if (mCurrentView == mTodoView ) goto LIST;
218 222
219 if (mCurrentView == mTodoView ) goto JOURNAL;
220 223
221 NEXT: 224 NEXT:
222 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} 225 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
223 NEXT_X: 226 NEXT_X:
224 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} 227 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
225 LIST: 228 JOURNAL:
226 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} 229 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
227 DAY_1: 230 DAY_1:
228 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} 231 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
229 DAY_5: 232 DAY_5:
230 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} 233 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
231 DAY_7: 234 DAY_7:
232 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} 235 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
233 DAY_6: 236 DAY_6:
234 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} 237 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
235 MONTH: 238 MONTH:
236 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} 239 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
240 LIST:
241 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
237 TODO: 242 TODO:
238 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} 243 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
239 JOURNAL:
240 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
241
242
243 244
244 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} 245 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
245 246
246 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} 247 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
247
248 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
249 248
250 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} 249 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
251 250
251 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
252
252 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} 253 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
253 254
254 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} 255 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
255 256
256 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} 257 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
257 258
258 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} 259 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
259 260
260 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} 261 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
261 262
262 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} 263 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
263 264
264 265
265 266
266} 267}
267void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 268void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
268{ 269{
269 270
270 //mFlagShowNextxDays = false; 271 //mFlagShowNextxDays = false;
271 //if(view == mCurrentView) return; 272 //if(view == mCurrentView) return;
272 if ( view == 0 ) { 273 if ( view == 0 ) {
273 view = mCurrentView; 274 view = mCurrentView;
274 if ( view == 0 ) 275 if ( view == 0 )
275 return; 276 return;
276 } 277 }
277 bool callupdate = !(view == mCurrentView); 278 bool callupdate = !(view == mCurrentView);
278 bool full = fullScreen; 279 bool full = fullScreen;
279 if(view == mCurrentView && view != mWhatsNextView ) { 280 if(view == mCurrentView && view != mWhatsNextView ) {
280 if ( mCurrentAgendaView < 0 ) 281 if ( mCurrentAgendaView < 0 )
281 return; 282 return;
282 if ( view != mMonthView ) 283 if ( view != mMonthView )
283 full = mMainView->leftFrame()->isVisible(); 284 full = mMainView->leftFrame()->isVisible();
284 } else { 285 } else {
285 if ( view == mMonthView && mMonthView) 286 if ( view == mMonthView && mMonthView)
286 ;//mMonthView->skipResize = true ; 287 ;//mMonthView->skipResize = true ;
287 mCurrentView = view; 288 mCurrentView = view;
288 // bool full = fullScreen; 289 // bool full = fullScreen;
289 bool isFull = !mMainView->leftFrame()->isVisible(); 290 bool isFull = !mMainView->leftFrame()->isVisible();
290 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 291 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
291 full = true; 292 full = true;
292 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 293 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
293 full = false; 294 full = false;
294 } 295 }
295 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 296 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
296 //raiseCurrentView( full ); 297 //raiseCurrentView( full );
297 mMainView->processIncidenceSelection( 0 ); 298 mMainView->processIncidenceSelection( 0 );
298 //mMainView->updateView(); 299 //mMainView->updateView();
299 raiseCurrentView( full, callupdate ); 300 raiseCurrentView( full, callupdate );
300 mMainView->adaptNavigationUnits(); 301 mMainView->adaptNavigationUnits();
301} 302}
302 303
303void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 304void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
304{ 305{
305 mCurrentAgendaView = 0; 306 mCurrentAgendaView = 0;
306 if ( fullScreen ) { 307 if ( fullScreen ) {
307 mMainView->leftFrame()->hide(); 308 mMainView->leftFrame()->hide();
308 } else { 309 } else {
309 mMainView->leftFrame()->show(); 310 mMainView->leftFrame()->show();
310 } 311 }
311 //if ( mCurrentView == mMonthView ) qApp->processEvents(); 312 //if ( mCurrentView == mMonthView ) qApp->processEvents();
312 emit signalFullScreen( !fullScreen ); 313 emit signalFullScreen( !fullScreen );
313 if ( callUpdateView ) 314 if ( callUpdateView )
314 mMainView->updateView(); 315 mMainView->updateView();
315 316
316 if ( globalFlagBlockAgenda == 5 ) { 317 if ( globalFlagBlockAgenda == 5 ) {
317 globalFlagBlockAgenda = 4; 318 globalFlagBlockAgenda = 4;
318 globalFlagBlockAgendaItemPaint = 1; 319 globalFlagBlockAgendaItemPaint = 1;
319 } 320 }
320 mMainView->viewStack()->raiseWidget(mCurrentView); 321 mMainView->viewStack()->raiseWidget(mCurrentView);
321 if ( globalFlagBlockAgenda == 4 ) { 322 if ( globalFlagBlockAgenda == 4 ) {
322 if ( mCurrentView == mAgendaView ) { 323 if ( mCurrentView == mAgendaView ) {
323 //globalFlagBlockAgenda =1 ; 324 //globalFlagBlockAgenda =1 ;
324 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 325 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
325 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); 326 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins );
326 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 327 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
327 mAgendaView->setStartHour( QTime::currentTime ().hour() ); 328 mAgendaView->setStartHour( QTime::currentTime ().hour() );
328 qApp->processEvents(); 329 qApp->processEvents();
329 //qDebug("qApp->processEvents() "); 330 //qDebug("qApp->processEvents() ");
330 globalFlagBlockAgenda = 0; 331 globalFlagBlockAgenda = 0;
331 mAgendaView->repaintAgenda(); 332 mAgendaView->repaintAgenda();
332 333
333 } 334 }
334 globalFlagBlockAgenda = 0; 335 globalFlagBlockAgenda = 0;
335 } 336 }
336 emit signalAgendaView( mCurrentView == mAgendaView ); 337 emit signalAgendaView( mCurrentView == mAgendaView );
337 //qDebug("raiseCurrentView ende "); 338 //qDebug("raiseCurrentView ende ");
338 339
339} 340}
340 341
341void KOViewManager::updateView() 342void KOViewManager::updateView()
342{ 343{
343 // qDebug("KOViewManager::updateView() "); 344 // qDebug("KOViewManager::updateView() ");
344 // if we are updating mTodoView, we get endless recursion 345 // if we are updating mTodoView, we get endless recursion
345 if ( mTodoView == mCurrentView ) 346 if ( mTodoView == mCurrentView )
346 return; 347 return;
347 if ( mCurrentView ) mCurrentView->updateView(); 348 if ( mCurrentView ) mCurrentView->updateView();
348 349
349} 350}
350 351
351void KOViewManager::updateView(const QDate &start, const QDate &end) 352void KOViewManager::updateView(const QDate &start, const QDate &end)
352{ 353{
353 // kdDebug() << "KOViewManager::updateView()" << endl; 354 // kdDebug() << "KOViewManager::updateView()" << endl;
354 355
355 if (mCurrentView) mCurrentView->showDates(start, end); 356 if (mCurrentView) mCurrentView->showDates(start, end);
356 357
357 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); 358 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView();
358} 359}
359 360
360 361
361void KOViewManager::updateWNview() 362void KOViewManager::updateWNview()
362{ 363{
363 if ( mCurrentView == mWhatsNextView && mWhatsNextView ) 364 if ( mCurrentView == mWhatsNextView && mWhatsNextView )
364 mWhatsNextView->updateView(); 365 mWhatsNextView->updateView();
365 366
366} 367}
367void KOViewManager::showWhatsNextView() 368void KOViewManager::showWhatsNextView()
368{ 369{
369 if (!mWhatsNextView) { 370 if (!mWhatsNextView) {
370 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), 371 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(),
371 "KOViewManager::WhatsNextView"); 372 "KOViewManager::WhatsNextView");
372 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); 373 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog());
373 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); 374 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig()));
374 addView(mWhatsNextView); 375 addView(mWhatsNextView);
375 connect(this, SIGNAL( printWNV() ), 376 connect(this, SIGNAL( printWNV() ),
376 mWhatsNextView, SLOT( printMe() ) ); 377 mWhatsNextView, SLOT( printMe() ) );
377 } 378 }
378 globalFlagBlockAgenda = 1; 379 globalFlagBlockAgenda = 1;
379 showView(mWhatsNextView, true ); 380 showView(mWhatsNextView, true );
380 //mWhatsNextView->updateView(); 381 //mWhatsNextView->updateView();
381 382
382} 383}
383 384
384void KOViewManager::showListView() 385void KOViewManager::showListView()
385{ 386{
386 if (!mListView) { 387 if (!mListView) {
387 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); 388 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
388 addView(mListView); 389 addView(mListView);
389 390
390 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), 391 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)),
391 mMainView, SLOT(showIncidence(Incidence *))); 392 mMainView, SLOT(showIncidence(Incidence *)));
392 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), 393 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)),
393 mMainView, SLOT(editIncidence(Incidence *))); 394 mMainView, SLOT(editIncidence(Incidence *)));
394 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), 395 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)),
395 mMainView, SLOT(deleteIncidence(Incidence *))); 396 mMainView, SLOT(deleteIncidence(Incidence *)));
396 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), 397 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ),
397 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 398 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
398 connect( mListView, SIGNAL( signalNewEvent() ), 399 connect( mListView, SIGNAL( signalNewEvent() ),
399 mMainView, SLOT( newEvent() ) ); 400 mMainView, SLOT( newEvent() ) );
400 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); 401 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
401 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 402 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
402 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 403 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
403 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 404 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
404 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 405 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
405 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 406 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
406 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 407 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
407 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 408 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
408 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 409 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
409 } 410 }
410 // bool temp = mFlagShowNextxDays; 411 // bool temp = mFlagShowNextxDays;
411 //globalFlagBlockPainting = true; 412 //globalFlagBlockPainting = true;
412 globalFlagBlockAgenda = 1; 413 globalFlagBlockAgenda = 1;
413 if ( KOPrefs::instance()->mListViewMonthTimespan ) { 414 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
414 mMainView->setBlockShowDates( true ); 415 mMainView->setBlockShowDates( true );
415 mMainView->dateNavigator()->selectMonth(); 416 mMainView->dateNavigator()->selectMonth();
416 mMainView->setBlockShowDates( false ); 417 mMainView->setBlockShowDates( false );
417 } 418 }
418 showView(mListView, KOPrefs::instance()->mFullViewTodo); 419 showView(mListView, KOPrefs::instance()->mFullViewTodo);
419 //mFlagShowNextxDays = temp; 420 //mFlagShowNextxDays = temp;
420} 421}
421 422
422void KOViewManager::showAgendaView( bool fullScreen ) 423void KOViewManager::showAgendaView( bool fullScreen )
423{ 424{
424 425
425 mMainView->dialogManager()->hideSearchDialog(); 426 mMainView->dialogManager()->hideSearchDialog();
426 // qDebug("KOViewManager::showAgendaView "); 427 // qDebug("KOViewManager::showAgendaView ");
427 bool full; 428 bool full;
428 full = fullScreen; 429 full = fullScreen;
429 if (!mAgendaView) { 430 if (!mAgendaView) {
430 full = false; 431 full = false;
431 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); 432 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
432 addView(mAgendaView); 433 addView(mAgendaView);
433#ifndef DESKTOP_VERSION 434#ifndef DESKTOP_VERSION
434 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); 435 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
435#endif 436#endif
436 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), 437 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
437 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); 438 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
438 439
439 // SIGNALS/SLOTS FOR DAY/WEEK VIEW 440 // SIGNALS/SLOTS FOR DAY/WEEK VIEW
440 441
441 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); 442 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
442 443
443 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), 444 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
444 mMainView, SLOT(newTodoDateTime(QDateTime,bool))); 445 mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
445 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), 446 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
446 mMainView, SLOT(newEvent(QDateTime))); 447 mMainView, SLOT(newEvent(QDateTime)));
447 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), 448 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
448 mMainView, SLOT(newEvent(QDateTime,QDateTime))); 449 mMainView, SLOT(newEvent(QDateTime,QDateTime)));
449 connect(mAgendaView,SIGNAL(newEventSignal(QDate)), 450 connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
450 mMainView, SLOT(newEvent(QDate))); 451 mMainView, SLOT(newEvent(QDate)));
451 452
452 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), 453 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
453 mMainView, SLOT(editIncidence(Incidence *))); 454 mMainView, SLOT(editIncidence(Incidence *)));
454 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), 455 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index b947cac..24055af 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -820,400 +820,401 @@ void MainWindow::initActions()
820 connect( search_action, SIGNAL( activated() ), 820 connect( search_action, SIGNAL( activated() ),
821 mView->dialogManager(), SLOT( showSearchDialog() ) ); 821 mView->dialogManager(), SLOT( showSearchDialog() ) );
822 822
823 823
824 824
825 if ( KOPrefs::instance()->mShowFullMenu ) { 825 if ( KOPrefs::instance()->mShowFullMenu ) {
826 actionMenu->insertSeparator(); 826 actionMenu->insertSeparator();
827 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 827 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
828 828
829 } 829 }
830 // actionMenu->insertSeparator(); 830 // actionMenu->insertSeparator();
831 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 831 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
832 this ); 832 this );
833 action->addTo( importMenu_X ); 833 action->addTo( importMenu_X );
834 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 834 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
835 action = new QAction( "import_quick", i18n("Import last file"), 0, 835 action = new QAction( "import_quick", i18n("Import last file"), 0,
836 this ); 836 this );
837 action->addTo( importMenu_X ); 837 action->addTo( importMenu_X );
838 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 838 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
839 importMenu_X->insertSeparator(); 839 importMenu_X->insertSeparator();
840 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 840 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
841 this ); 841 this );
842 action->addTo( importMenu_X ); 842 action->addTo( importMenu_X );
843 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 843 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
844 //#ifndef DESKTOP_VERSION 844 //#ifndef DESKTOP_VERSION
845 importMenu_X->insertSeparator(); 845 importMenu_X->insertSeparator();
846 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 846 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
847 this ); 847 this );
848 action->addTo( importMenu_X ); 848 action->addTo( importMenu_X );
849 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 849 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
850 //#else 850 //#else
851#ifdef _OL_IMPORT_ 851#ifdef _OL_IMPORT_
852 importMenu_X->insertSeparator(); 852 importMenu_X->insertSeparator();
853 action = new QAction( "import_ol", i18n("Import from OL"), 0, 853 action = new QAction( "import_ol", i18n("Import from OL"), 0,
854 this ); 854 this );
855 action->addTo( importMenu_X ); 855 action->addTo( importMenu_X );
856 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 856 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
857#endif 857#endif
858 //#endif 858 //#endif
859 859
860 //importMenu->insertSeparator(); 860 //importMenu->insertSeparator();
861 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 861 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
862 this ); 862 this );
863 action->addTo( importMenu ); 863 action->addTo( importMenu );
864 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 864 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
865 865
866 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 866 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
867 this ); 867 this );
868 action->addTo( importMenu ); 868 action->addTo( importMenu );
869 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 869 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
870 importMenu->insertSeparator(); 870 importMenu->insertSeparator();
871 importMenu->insertItem( i18n("Import"), importMenu_X ); 871 importMenu->insertItem( i18n("Import"), importMenu_X );
872 //importMenu->insertSeparator(); 872 //importMenu->insertSeparator();
873 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 873 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
874 this ); 874 this );
875 action->addTo( exportMenu_X ); 875 action->addTo( exportMenu_X );
876 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 876 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
877 877
878 878
879 //LR 879 //LR
880 QPopupMenu *ex2phone = new QPopupMenu( this ); 880 QPopupMenu *ex2phone = new QPopupMenu( this );
881 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 881 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
882 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 882 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
883 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 883 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
884 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 884 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
885 885
886 importMenu->insertItem( i18n("Export"), exportMenu_X ); 886 importMenu->insertItem( i18n("Export"), exportMenu_X );
887#ifndef DESKTOP_VERSION 887#ifndef DESKTOP_VERSION
888 //importMenu->insertSeparator(); 888 //importMenu->insertSeparator();
889 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 889 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
890 this ); 890 this );
891 brAction->addTo( beamMenu_X ); 891 brAction->addTo( beamMenu_X );
892 brAction->setToggleAction (true ) ; 892 brAction->setToggleAction (true ) ;
893 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 893 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
894 894
895 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 895 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
896 this ); 896 this );
897 action->addTo( beamMenu_X ); 897 action->addTo( beamMenu_X );
898 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 898 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
899 899
900 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 900 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
901 this ); 901 this );
902 action->addTo( beamMenu_X ); 902 action->addTo( beamMenu_X );
903 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 903 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
904 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 904 importMenu->insertItem( i18n("Beam"), beamMenu_X );
905#else 905#else
906 //importMenu->insertSeparator(); 906 //importMenu->insertSeparator();
907 icon = loadPixmap( pathString + "print" ); 907 icon = loadPixmap( pathString + "print" );
908 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 908 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
909 action->addTo( beamMenu_X ); 909 action->addTo( beamMenu_X );
910 connect( action, SIGNAL( activated() ), 910 connect( action, SIGNAL( activated() ),
911 this, SLOT( printCal() ) ); 911 this, SLOT( printCal() ) );
912 912
913 icon = loadPixmap( pathString + "print" ); 913 icon = loadPixmap( pathString + "print" );
914 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 914 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
915 action->addTo( beamMenu_X ); 915 action->addTo( beamMenu_X );
916 connect( action, SIGNAL( activated() ), 916 connect( action, SIGNAL( activated() ),
917 this, SLOT( printSel() ) ); 917 this, SLOT( printSel() ) );
918 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 918 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
919 action->addTo( beamMenu_X ); 919 action->addTo( beamMenu_X );
920 connect( action, SIGNAL( activated() ), 920 connect( action, SIGNAL( activated() ),
921 mView->viewManager(), SIGNAL( printWNV() ) ); 921 mView->viewManager(), SIGNAL( printWNV() ) );
922 importMenu->insertItem( i18n("Print"), beamMenu_X ); 922 importMenu->insertItem( i18n("Print"), beamMenu_X );
923#endif 923#endif
924 importMenu->insertSeparator(); 924 importMenu->insertSeparator();
925 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 925 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
926 this ); 926 this );
927 action->addTo( importMenu ); 927 action->addTo( importMenu );
928 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 928 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
929 importMenu->insertSeparator(); 929 importMenu->insertSeparator();
930 action = new QAction( "beam all", i18n("Save"), 0, 930 action = new QAction( "beam all", i18n("Save"), 0,
931 this ); 931 this );
932 action->addTo( importMenu ); 932 action->addTo( importMenu );
933 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 933 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
934 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 934 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
935 this ); 935 this );
936 action->addTo( importMenu ); 936 action->addTo( importMenu );
937 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 937 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
938 938
939 //menuBar->insertItem( "Configure",configureMenu ); 939 //menuBar->insertItem( "Configure",configureMenu );
940 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 940 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
941 icon = loadPixmap( "korganizer/korganizer" ); 941 icon = loadPixmap( "korganizer/korganizer" );
942 942
943 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 943 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
944 action->addTo( helpMenu ); 944 action->addTo( helpMenu );
945 connect( action, SIGNAL( activated() ), 945 connect( action, SIGNAL( activated() ),
946 SLOT( whatsNew() ) ); 946 SLOT( whatsNew() ) );
947 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 947 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
948 action->addTo( helpMenu ); 948 action->addTo( helpMenu );
949 connect( action, SIGNAL( activated() ), 949 connect( action, SIGNAL( activated() ),
950 SLOT( features() ) ); 950 SLOT( features() ) );
951 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 951 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
952 action->addTo( helpMenu ); 952 action->addTo( helpMenu );
953 connect( action, SIGNAL( activated() ), 953 connect( action, SIGNAL( activated() ),
954 SLOT( keyBindings() ) ); 954 SLOT( keyBindings() ) );
955 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 955 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
956 action->addTo( helpMenu ); 956 action->addTo( helpMenu );
957 connect( action, SIGNAL( activated() ), 957 connect( action, SIGNAL( activated() ),
958 SLOT( synchowto() ) ); 958 SLOT( synchowto() ) );
959 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 959 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
960 action->addTo( helpMenu ); 960 action->addTo( helpMenu );
961 connect( action, SIGNAL( activated() ), 961 connect( action, SIGNAL( activated() ),
962 SLOT( kdesynchowto() ) ); 962 SLOT( kdesynchowto() ) );
963 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 963 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
964 action->addTo( helpMenu ); 964 action->addTo( helpMenu );
965 connect( action, SIGNAL( activated() ), 965 connect( action, SIGNAL( activated() ),
966 SLOT( multisynchowto() ) ); 966 SLOT( multisynchowto() ) );
967 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 967 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
968 action->addTo( helpMenu ); 968 action->addTo( helpMenu );
969 connect( action, SIGNAL( activated() ), 969 connect( action, SIGNAL( activated() ),
970 SLOT( aboutAutoSaving() ) ); 970 SLOT( aboutAutoSaving() ) );
971 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 971 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
972 action->addTo( helpMenu ); 972 action->addTo( helpMenu );
973 connect( action, SIGNAL( activated() ), 973 connect( action, SIGNAL( activated() ),
974 SLOT( aboutKnownBugs() ) ); 974 SLOT( aboutKnownBugs() ) );
975 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 975 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
976 action->addTo( helpMenu ); 976 action->addTo( helpMenu );
977 connect( action, SIGNAL( activated() ), 977 connect( action, SIGNAL( activated() ),
978 SLOT( usertrans() ) ); 978 SLOT( usertrans() ) );
979 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 979 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
980 action->addTo( helpMenu ); 980 action->addTo( helpMenu );
981 connect( action, SIGNAL( activated() ), 981 connect( action, SIGNAL( activated() ),
982 SLOT( faq() ) ); 982 SLOT( faq() ) );
983 action = new QAction( "licence", i18n("Licence..."), 0, this ); 983 action = new QAction( "licence", i18n("Licence..."), 0, this );
984 action->addTo( helpMenu ); 984 action->addTo( helpMenu );
985 connect( action, SIGNAL( activated() ), 985 connect( action, SIGNAL( activated() ),
986 SLOT( licence() ) ); 986 SLOT( licence() ) );
987 action = new QAction( "about", i18n("About..."), 0, this ); 987 action = new QAction( "about", i18n("About..."), 0, this );
988 action->addTo( helpMenu ); 988 action->addTo( helpMenu );
989 connect( action, SIGNAL( activated() ), 989 connect( action, SIGNAL( activated() ),
990 SLOT( about() ) ); 990 SLOT( about() ) );
991 //menuBar->insertSeparator(); 991 //menuBar->insertSeparator();
992 992
993 // ****************************************************** 993 // ******************************************************
994 // menubar icons 994 // menubar icons
995 995
996 996
997 iconToolBar->setHorizontalStretchable (true ); 997 iconToolBar->setHorizontalStretchable (true );
998 //menuBar->insertItem( iconToolBar ); 998 //menuBar->insertItem( iconToolBar );
999 //xdays_action 999 //xdays_action
1000 if (p-> mShowIconNewEvent) 1000 if (p-> mShowIconNewEvent)
1001 ne_action->addTo( iconToolBar ); 1001 ne_action->addTo( iconToolBar );
1002 if (p->mShowIconNewTodo ) 1002 if (p->mShowIconNewTodo )
1003 nt_action->addTo( iconToolBar ); 1003 nt_action->addTo( iconToolBar );
1004 if (p-> mShowIconSearch) 1004 if (p-> mShowIconSearch)
1005 search_action->addTo( iconToolBar ); 1005 search_action->addTo( iconToolBar );
1006 if (p-> mShowIconWhatsThis) 1006 if (p-> mShowIconWhatsThis)
1007 QWhatsThis::whatsThisButton ( iconToolBar ); 1007 QWhatsThis::whatsThisButton ( iconToolBar );
1008 if (p-> mShowIconNext) 1008 if (p-> mShowIconNext)
1009 whatsnext_action->addTo( iconToolBar ); 1009 whatsnext_action->addTo( iconToolBar );
1010 if (p-> mShowIconNextDays) 1010 if (p-> mShowIconNextDays)
1011 xdays_action->addTo( iconToolBar ); 1011 xdays_action->addTo( iconToolBar );
1012 if (p-> mShowIconList) 1012 if (p-> mShowIconJournal)
1013 showlist_action->addTo( iconToolBar ); 1013 viewjournal_action->addTo( iconToolBar );
1014 if (p-> mShowIconDay1) 1014 if (p-> mShowIconDay1)
1015 day1_action->addTo( iconToolBar ); 1015 day1_action->addTo( iconToolBar );
1016 if (p-> mShowIconDay5) 1016 if (p-> mShowIconDay5)
1017 day5_action->addTo( iconToolBar ); 1017 day5_action->addTo( iconToolBar );
1018 if (p-> mShowIconDay7) 1018 if (p-> mShowIconDay7)
1019 day7_action->addTo( iconToolBar ); 1019 day7_action->addTo( iconToolBar );
1020 if (p-> mShowIconDay6) 1020 if (p-> mShowIconDay6)
1021 day6_action->addTo( iconToolBar ); 1021 day6_action->addTo( iconToolBar );
1022 if (p-> mShowIconMonth) 1022 if (p-> mShowIconMonth)
1023 month_action->addTo( iconToolBar ); 1023 month_action->addTo( iconToolBar );
1024 if (p-> mShowIconList)
1025 showlist_action->addTo( iconToolBar );
1024 if (p-> mShowIconTodoview) 1026 if (p-> mShowIconTodoview)
1025 todoview_action->addTo( iconToolBar ); 1027 todoview_action->addTo( iconToolBar );
1026 if (p-> mShowIconJournal) 1028
1027 viewjournal_action->addTo( iconToolBar );
1028 icon = loadPixmap( pathString + "2leftarrowB" ); 1029 icon = loadPixmap( pathString + "2leftarrowB" );
1029 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 1030 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
1030 if (p-> mShowIconBackFast) { 1031 if (p-> mShowIconBackFast) {
1031 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1032 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1032 connect( action, SIGNAL( activated() ), 1033 connect( action, SIGNAL( activated() ),
1033 mView, SLOT( goPreviousMonth() ) ); 1034 mView, SLOT( goPreviousMonth() ) );
1034 action->addTo( iconToolBar ); 1035 action->addTo( iconToolBar );
1035 } 1036 }
1036 icon = loadPixmap( pathString + "1leftarrowB" ); 1037 icon = loadPixmap( pathString + "1leftarrowB" );
1037 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 1038 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
1038 if (p-> mShowIconBack) { 1039 if (p-> mShowIconBack) {
1039 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1040 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1040 connect( action, SIGNAL( activated() ), 1041 connect( action, SIGNAL( activated() ),
1041 mView, SLOT( goPrevious() ) ); 1042 mView, SLOT( goPrevious() ) );
1042 action->addTo( iconToolBar ); 1043 action->addTo( iconToolBar );
1043 } 1044 }
1044 icon = loadPixmap( pathString + "today" ); 1045 icon = loadPixmap( pathString + "today" );
1045 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1046 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1046 if (p-> mShowIconToday) 1047 if (p-> mShowIconToday)
1047 today_action->addTo( iconToolBar ); 1048 today_action->addTo( iconToolBar );
1048 icon = loadPixmap( pathString + "1rightarrowB" ); 1049 icon = loadPixmap( pathString + "1rightarrowB" );
1049 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1050 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1050 if (p-> mShowIconForward) { 1051 if (p-> mShowIconForward) {
1051 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1052 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1052 connect( action, SIGNAL( activated() ), 1053 connect( action, SIGNAL( activated() ),
1053 mView, SLOT( goNext() ) ); 1054 mView, SLOT( goNext() ) );
1054 action->addTo( iconToolBar ); 1055 action->addTo( iconToolBar );
1055 } 1056 }
1056 icon = loadPixmap( pathString + "2rightarrowB" ); 1057 icon = loadPixmap( pathString + "2rightarrowB" );
1057 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1058 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1058 if (p-> mShowIconForwardFast) { 1059 if (p-> mShowIconForwardFast) {
1059 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1060 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1060 connect( action, SIGNAL( activated() ), 1061 connect( action, SIGNAL( activated() ),
1061 mView, SLOT( goNextMonth() ) ); 1062 mView, SLOT( goNextMonth() ) );
1062 action->addTo( iconToolBar ); 1063 action->addTo( iconToolBar );
1063 } 1064 }
1064 1065
1065 1066
1066 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 1067 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
1067 1068
1068 if (p-> mShowIconNewEvent) 1069 if (p-> mShowIconNewEvent)
1069 configureToolBarMenu->setItemChecked( 10, true ); 1070 configureToolBarMenu->setItemChecked( 10, true );
1070 if (p->mShowIconNewTodo ) 1071 if (p->mShowIconNewTodo )
1071 configureToolBarMenu->setItemChecked( 20, true ); 1072 configureToolBarMenu->setItemChecked( 20, true );
1072 if (p-> mShowIconSearch) 1073 if (p-> mShowIconSearch)
1073 configureToolBarMenu->setItemChecked( 120, true ); 1074 configureToolBarMenu->setItemChecked( 120, true );
1074 if (p-> mShowIconList) 1075 if (p-> mShowIconList)
1075 configureToolBarMenu->setItemChecked( 30, true ); 1076 configureToolBarMenu->setItemChecked( 30, true );
1076 if (p-> mShowIconDay1) 1077 if (p-> mShowIconDay1)
1077 configureToolBarMenu->setItemChecked( 40, true ); 1078 configureToolBarMenu->setItemChecked( 40, true );
1078 if (p-> mShowIconDay5) 1079 if (p-> mShowIconDay5)
1079 configureToolBarMenu->setItemChecked( 50, true ); 1080 configureToolBarMenu->setItemChecked( 50, true );
1080 if (p-> mShowIconDay6) 1081 if (p-> mShowIconDay6)
1081 configureToolBarMenu->setItemChecked( 75, true ); 1082 configureToolBarMenu->setItemChecked( 75, true );
1082 if (p-> mShowIconDay7) 1083 if (p-> mShowIconDay7)
1083 configureToolBarMenu->setItemChecked( 60, true ); 1084 configureToolBarMenu->setItemChecked( 60, true );
1084 if (p-> mShowIconMonth) 1085 if (p-> mShowIconMonth)
1085 configureToolBarMenu->setItemChecked( 70, true ); 1086 configureToolBarMenu->setItemChecked( 70, true );
1086 if (p-> mShowIconTodoview) 1087 if (p-> mShowIconTodoview)
1087 configureToolBarMenu->setItemChecked( 80, true ); 1088 configureToolBarMenu->setItemChecked( 80, true );
1088 if (p-> mShowIconBackFast) 1089 if (p-> mShowIconBackFast)
1089 configureToolBarMenu->setItemChecked( 200, true ); 1090 configureToolBarMenu->setItemChecked( 200, true );
1090 if (p-> mShowIconBack) 1091 if (p-> mShowIconBack)
1091 configureToolBarMenu->setItemChecked( 210, true ); 1092 configureToolBarMenu->setItemChecked( 210, true );
1092 if (p-> mShowIconToday) 1093 if (p-> mShowIconToday)
1093 configureToolBarMenu->setItemChecked( 130, true ); 1094 configureToolBarMenu->setItemChecked( 130, true );
1094 if (p-> mShowIconForward) 1095 if (p-> mShowIconForward)
1095 configureToolBarMenu->setItemChecked( 220, true ); 1096 configureToolBarMenu->setItemChecked( 220, true );
1096 if (p-> mShowIconForwardFast) 1097 if (p-> mShowIconForwardFast)
1097 configureToolBarMenu->setItemChecked( 230, true ); 1098 configureToolBarMenu->setItemChecked( 230, true );
1098 if (p-> mShowIconNextDays) 1099 if (p-> mShowIconNextDays)
1099 configureToolBarMenu->setItemChecked( 100, true ); 1100 configureToolBarMenu->setItemChecked( 100, true );
1100 if (p-> mShowIconNext) 1101 if (p-> mShowIconNext)
1101 configureToolBarMenu->setItemChecked( 110, true ); 1102 configureToolBarMenu->setItemChecked( 110, true );
1102 if (p-> mShowIconJournal) 1103 if (p-> mShowIconJournal)
1103 configureToolBarMenu->setItemChecked( 90, true ); 1104 configureToolBarMenu->setItemChecked( 90, true );
1104 if (p-> mShowIconWhatsThis) 1105 if (p-> mShowIconWhatsThis)
1105 configureToolBarMenu->setItemChecked( 300, true ); 1106 configureToolBarMenu->setItemChecked( 300, true );
1106 if (p-> mShowIconWeekNum) 1107 if (p-> mShowIconWeekNum)
1107 configureToolBarMenu->setItemChecked( 400, true ); 1108 configureToolBarMenu->setItemChecked( 400, true );
1108 QLabel* dummy = new QLabel( iconToolBar ); 1109 QLabel* dummy = new QLabel( iconToolBar );
1109 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1110 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1110 if (!p-> mShowIconStretch) 1111 if (!p-> mShowIconStretch)
1111 iconToolBar->setStretchableWidget ( dummy ) ; 1112 iconToolBar->setStretchableWidget ( dummy ) ;
1112 else 1113 else
1113 configureToolBarMenu->setItemChecked( 5, true ); 1114 configureToolBarMenu->setItemChecked( 5, true );
1114 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1115 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1115 configureAgenda( p->mHourSize ); 1116 configureAgenda( p->mHourSize );
1116 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1117 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1117} 1118}
1118 1119
1119void MainWindow::exportToPhone( int mode ) 1120void MainWindow::exportToPhone( int mode )
1120{ 1121{
1121 1122
1122 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1123 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1123 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1124 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1124 KOex2phonePrefs ex2phone; 1125 KOex2phonePrefs ex2phone;
1125 1126
1126 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1127 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1127 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1128 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1128 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1129 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1129 if ( mode == 1 ) 1130 if ( mode == 1 )
1130 ex2phone.setCaption(i18n("Export complete calendar")); 1131 ex2phone.setCaption(i18n("Export complete calendar"));
1131 if ( mode == 2 ) 1132 if ( mode == 2 )
1132 ex2phone.setCaption(i18n("Export filtered calendar")); 1133 ex2phone.setCaption(i18n("Export filtered calendar"));
1133 1134
1134 if ( !ex2phone.exec() ) { 1135 if ( !ex2phone.exec() ) {
1135 return; 1136 return;
1136 } 1137 }
1137 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1138 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1138 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1139 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1139 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1140 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1140 1141
1141 int inFuture = 0; 1142 int inFuture = 0;
1142 if ( ex2phone.mWriteBackFuture->isChecked() ) 1143 if ( ex2phone.mWriteBackFuture->isChecked() )
1143 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1144 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1144 QPtrList<Incidence> delSel; 1145 QPtrList<Incidence> delSel;
1145 if ( mode == 1 ) 1146 if ( mode == 1 )
1146 delSel = mCalendar->rawIncidences(); 1147 delSel = mCalendar->rawIncidences();
1147 if ( mode == 2 ) 1148 if ( mode == 2 )
1148 delSel = mCalendar->incidences(); 1149 delSel = mCalendar->incidences();
1149 CalendarLocal* cal = new CalendarLocal(); 1150 CalendarLocal* cal = new CalendarLocal();
1150 cal->setLocalTime(); 1151 cal->setLocalTime();
1151 Incidence *incidence = delSel.first(); 1152 Incidence *incidence = delSel.first();
1152 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1153 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1153 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1154 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1154 while ( incidence ) { 1155 while ( incidence ) {
1155 if ( incidence->type() != "Journal" ) { 1156 if ( incidence->type() != "Journal" ) {
1156 bool add = true; 1157 bool add = true;
1157 if ( inFuture ) { 1158 if ( inFuture ) {
1158 QDateTime dt; 1159 QDateTime dt;
1159 if ( incidence->type() == "Todo" ) { 1160 if ( incidence->type() == "Todo" ) {
1160 Todo * t = (Todo*)incidence; 1161 Todo * t = (Todo*)incidence;
1161 if ( t->hasDueDate() ) 1162 if ( t->hasDueDate() )
1162 dt = t->dtDue(); 1163 dt = t->dtDue();
1163 else 1164 else
1164 dt = cur.addSecs( 62 ); 1165 dt = cur.addSecs( 62 );
1165 } 1166 }
1166 else { 1167 else {
1167 bool ok; 1168 bool ok;
1168 dt = incidence->getNextOccurence( cur, &ok ); 1169 dt = incidence->getNextOccurence( cur, &ok );
1169 if ( !ok ) 1170 if ( !ok )
1170 dt = cur.addSecs( -62 ); 1171 dt = cur.addSecs( -62 );
1171 } 1172 }
1172 if ( dt < cur || dt > end ) { 1173 if ( dt < cur || dt > end ) {
1173 add = false; 1174 add = false;
1174 } 1175 }
1175 } 1176 }
1176 if ( add ) { 1177 if ( add ) {
1177 Incidence *in = incidence->clone(); 1178 Incidence *in = incidence->clone();
1178 cal->addIncidence( in ); 1179 cal->addIncidence( in );
1179 } 1180 }
1180 } 1181 }
1181 incidence = delSel.next(); 1182 incidence = delSel.next();
1182 } 1183 }
1183 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1184 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1184 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1185 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1185 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1186 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1186 1187
1187 setCaption( i18n("Writing to phone...")); 1188 setCaption( i18n("Writing to phone..."));
1188 if ( PhoneFormat::writeToPhone( cal ) ) 1189 if ( PhoneFormat::writeToPhone( cal ) )
1189 setCaption( i18n("Export to phone successful!")); 1190 setCaption( i18n("Export to phone successful!"));
1190 else 1191 else
1191 setCaption( i18n("Error exporting to phone!")); 1192 setCaption( i18n("Error exporting to phone!"));
1192 delete cal; 1193 delete cal;
1193} 1194}
1194 1195
1195 1196
1196void MainWindow::setDefaultPreferences() 1197void MainWindow::setDefaultPreferences()
1197{ 1198{
1198 KOPrefs *p = KOPrefs::instance(); 1199 KOPrefs *p = KOPrefs::instance();
1199 1200
1200 p->mCompactDialogs = true; 1201 p->mCompactDialogs = true;
1201 p->mConfirm = true; 1202 p->mConfirm = true;
1202 // p->mEnableQuickTodo = false; 1203 // p->mEnableQuickTodo = false;
1203 1204
1204} 1205}
1205 1206
1206QString MainWindow::resourcePath() 1207QString MainWindow::resourcePath()
1207{ 1208{
1208 return KGlobal::iconLoader()->iconPath(); 1209 return KGlobal::iconLoader()->iconPath();
1209} 1210}
1210 1211
1211void MainWindow::displayText( QString text ,QString cap ) 1212void MainWindow::displayText( QString text ,QString cap )
1212{ 1213{
1213 QDialog dia( this, "name", true ); ; 1214 QDialog dia( this, "name", true ); ;
1214 dia.setCaption( cap ); 1215 dia.setCaption( cap );
1215 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1216 QVBoxLayout* lay = new QVBoxLayout( &dia );
1216 lay->setSpacing( 3 ); 1217 lay->setSpacing( 3 );
1217 lay->setMargin( 3 ); 1218 lay->setMargin( 3 );
1218 QTextBrowser tb ( &dia ); 1219 QTextBrowser tb ( &dia );
1219 lay->addWidget( &tb ); 1220 lay->addWidget( &tb );