-rw-r--r-- | korganizer/mainwindow.cpp | 500 |
1 files changed, 258 insertions, 242 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 6c0aa9b..4b00062 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -12,7 +12,8 @@ | |||
12 | #include <qfileinfo.h> | 12 | #include <qfileinfo.h> |
13 | #include <qlabel.h> | 13 | #include <qlabel.h> |
14 | #include <qwmatrix.h> | 14 | #include <qmap.h> |
15 | #include <qtextbrowser.h> | 15 | #include <qwmatrix.h> |
16 | #include <qtextstream.h> | 16 | #include <qtextbrowser.h> |
17 | #include <qtextstream.h> | ||
17 | #ifndef DESKTOP_VERSION | 18 | #ifndef DESKTOP_VERSION |
18 | #include <qpe/global.h> | 19 | #include <qpe/global.h> |
@@ -21,6 +22,6 @@ | |||
21 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
22 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
23 | #include <qtopia/alarmserver.h> | 24 | #include <qtopia/alarmserver.h> |
24 | #include <qtopia/qcopenvelope_qws.h> | 25 | #include <qtopia/qcopenvelope_qws.h> |
25 | #else | 26 | #else |
26 | #include <qmenubar.h> | 27 | #include <qmenubar.h> |
@@ -52,5 +53,7 @@ | |||
52 | #include "kconfig.h" | 53 | #include "kconfig.h" |
53 | #include "simplealarmclient.h" | 54 | #include "simplealarmclient.h" |
54 | using namespace KCal; | 55 | #include "externalapphandler.h" |
56 | |||
57 | using namespace KCal; | ||
55 | #ifndef _WIN32_ | 58 | #ifndef _WIN32_ |
56 | #include <unistd.h> | 59 | #include <unistd.h> |
@@ -67,9 +70,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
67 | #ifdef DESKTOP_VERSION | 70 | #ifdef DESKTOP_VERSION |
68 | setFont( QFont("Arial"), 14 ); | 71 | setFont( QFont("Arial"), 14 ); |
69 | #endif | 72 | #endif |
70 | 73 | ||
71 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 74 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
72 | QString confFile = locateLocal("config","korganizerrc"); | 75 | QString confFile = locateLocal("config","korganizerrc"); |
73 | QFileInfo finf ( confFile ); | 76 | QFileInfo finf ( confFile ); |
74 | bool showWarning = !finf.exists(); | 77 | bool showWarning = !finf.exists(); |
75 | setIcon(SmallIcon( "ko24" ) ); | 78 | setIcon(SmallIcon( "ko24" ) ); |
@@ -81,5 +84,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
81 | // if ( p->mHourSize == 4 ) | 84 | // if ( p->mHourSize == 4 ) |
82 | // p->mHourSize = 6; | 85 | // p->mHourSize = 6; |
83 | // } | 86 | // } |
84 | if ( p->mHourSize > 18 ) | 87 | if ( p->mHourSize > 18 ) |
85 | p->mHourSize = 18; | 88 | p->mHourSize = 18; |
@@ -103,6 +106,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
103 | addToolBar (iconToolBar , tbd ); | 106 | addToolBar (iconToolBar , tbd ); |
104 | mBlockSaveFlag = false; | 107 | mBlockSaveFlag = false; |
105 | mCalendarModifiedFlag = false; | 108 | mCalendarModifiedFlag = false; |
106 | 109 | ||
107 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 110 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
108 | splash->setAlignment ( AlignCenter ); | 111 | splash->setAlignment ( AlignCenter ); |
@@ -117,7 +120,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
117 | mView->hide(); | 120 | mView->hide(); |
118 | //mView->resize(splash->size() ); | 121 | //mView->resize(splash->size() ); |
119 | initActions(); | 122 | initActions(); |
120 | #ifndef DESKTOP_VERSION | 123 | #ifndef DESKTOP_VERSION |
121 | iconToolBar->show(); | 124 | iconToolBar->show(); |
122 | qApp->processEvents(); | 125 | qApp->processEvents(); |
123 | #endif | 126 | #endif |
@@ -134,5 +137,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
134 | //mView->resize( splash->size() ); | 137 | //mView->resize( splash->size() ); |
135 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 138 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
136 | mView->readSettings(); | 139 | mView->readSettings(); |
137 | bool oldOpened = false; | 140 | bool oldOpened = false; |
138 | bool newFile = false; | 141 | bool newFile = false; |
@@ -149,10 +152,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
149 | } else { | 152 | } else { |
150 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 153 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
151 | finfo.setFile( oldFile ); | 154 | finfo.setFile( oldFile ); |
152 | if (finfo.exists() ) { | 155 | if (finfo.exists() ) { |
153 | KMessageBox::information( this, message); | 156 | KMessageBox::information( this, message); |
154 | mView->openCalendar( oldFile ); | 157 | mView->openCalendar( oldFile ); |
155 | qApp->processEvents(); | 158 | qApp->processEvents(); |
156 | } | 159 | } |
157 | } | 160 | } |
158 | mView->saveCalendar( defaultFileName() ); | 161 | mView->saveCalendar( defaultFileName() ); |
@@ -176,5 +179,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
176 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 179 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
177 | SLOT( slotModifiedChanged( bool ) ) ); | 180 | SLOT( slotModifiedChanged( bool ) ) ); |
178 | 181 | ||
179 | 182 | ||
180 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 183 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
@@ -185,34 +188,37 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
185 | globalFlagBlockStartup = 0; | 188 | globalFlagBlockStartup = 0; |
186 | mView->show(); | 189 | mView->show(); |
187 | delete splash; | 190 | delete splash; |
188 | if ( newFile ) | 191 | if ( newFile ) |
189 | mView->updateConfig(); | 192 | mView->updateConfig(); |
190 | // qApp->processEvents(); | 193 | // qApp->processEvents(); |
191 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 194 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
192 | fillSyncMenu(); | 195 | fillSyncMenu(); |
193 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 196 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
194 | if ( showWarning ) { | 197 | if ( showWarning ) { |
195 | KMessageBox::information( this, | 198 | KMessageBox::information( this, |
196 | "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"); | 199 | "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"); |
197 | qApp->processEvents(); | 200 | qApp->processEvents(); |
198 | mView->dialogManager()->showSyncOptions(); | 201 | mView->dialogManager()->showSyncOptions(); |
199 | } | 202 | } |
203 | |||
204 | //US listen for result adressed from Ka/Pi | ||
205 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | ||
200 | } | 206 | } |
201 | MainWindow::~MainWindow() | 207 | MainWindow::~MainWindow() |
202 | { | 208 | { |
203 | //qDebug("MainWindow::~MainWindow() "); | 209 | //qDebug("MainWindow::~MainWindow() "); |
204 | //save toolbar location | 210 | //save toolbar location |
205 | 211 | ||
206 | delete mCalendar; | 212 | delete mCalendar; |
207 | delete KOPrefs::instance(); | 213 | delete KOPrefs::instance(); |
208 | delete KIncidenceFormatter::instance(); | 214 | delete KIncidenceFormatter::instance(); |
209 | 215 | ||
210 | 216 | ||
211 | } | 217 | } |
212 | void MainWindow::closeEvent( QCloseEvent* ce ) | 218 | void MainWindow::closeEvent( QCloseEvent* ce ) |
213 | { | 219 | { |
214 | 220 | ||
215 | 221 | ||
216 | 222 | ||
217 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 223 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
218 | saveOnClose(); | 224 | saveOnClose(); |
@@ -224,5 +230,5 @@ void MainWindow::closeEvent( QCloseEvent* ce ) | |||
224 | switch( QMessageBox::information( this, "KO/Pi", | 230 | switch( QMessageBox::information( this, "KO/Pi", |
225 | i18n("Do you really want\nto close KO/Pi?"), | 231 | i18n("Do you really want\nto close KO/Pi?"), |
226 | i18n("Close"), i18n("No"), | 232 | i18n("Close"), i18n("No"), |
227 | 0, 0 ) ) { | 233 | 0, 0 ) ) { |
228 | case 0: | 234 | case 0: |
@@ -231,8 +237,8 @@ void MainWindow::closeEvent( QCloseEvent* ce ) | |||
231 | break; | 237 | break; |
232 | case 1: | 238 | case 1: |
233 | ce->ignore(); | 239 | ce->ignore(); |
234 | break; | 240 | break; |
235 | case 2: | 241 | case 2: |
236 | 242 | ||
237 | default: | 243 | default: |
238 | break; | 244 | break; |
@@ -249,16 +255,26 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
249 | //qDebug("message "); | 255 | //qDebug("message "); |
250 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 256 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
257 | |||
258 | if ( cmsg == "-writeFile" ) { | ||
259 | // I made from the "-writeFile" an "-writeAlarm" | ||
260 | mView->viewManager()->showWhatsNextView(); | ||
261 | mCalendar->checkAlarmForIncidence( 0, true); | ||
262 | showMaximized(); | ||
263 | raise(); | ||
264 | return; | ||
265 | } | ||
266 | |||
251 | if ( cmsg == "-writeFile" ) { | 267 | if ( cmsg == "-writeFile" ) { |
252 | // I made from the "-writeFile" an "-writeAlarm" | 268 | // I made from the "-writeFile" an "-writeAlarm" |
253 | mView->viewManager()->showWhatsNextView(); | 269 | mView->viewManager()->showWhatsNextView(); |
254 | mCalendar->checkAlarmForIncidence( 0, true); | 270 | mCalendar->checkAlarmForIncidence( 0, true); |
255 | showMaximized(); | 271 | showMaximized(); |
256 | raise(); | 272 | raise(); |
257 | return; | 273 | return; |
258 | 274 | ||
259 | } | 275 | } |
260 | if ( cmsg == "-writeFileSilent" ) { | 276 | if ( cmsg == "-writeFileSilent" ) { |
261 | // I made from the "-writeFile" an "-writeAlarm" | 277 | // I made from the "-writeFile" an "-writeAlarm" |
262 | // mView->viewManager()->showWhatsNextView(); | 278 | // mView->viewManager()->showWhatsNextView(); |
263 | mCalendar->checkAlarmForIncidence( 0, true); | 279 | mCalendar->checkAlarmForIncidence( 0, true); |
264 | //showMaximized(); | 280 | //showMaximized(); |
@@ -269,5 +285,5 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
269 | if ( cmsg == "-newCountdown" ) { | 285 | if ( cmsg == "-newCountdown" ) { |
270 | qDebug("newCountdown "); | 286 | qDebug("newCountdown "); |
271 | 287 | ||
272 | } | 288 | } |
273 | QString msg ; | 289 | QString msg ; |
@@ -288,6 +304,6 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
288 | if ( msg == "-newTodo" ) { | 304 | if ( msg == "-newTodo" ) { |
289 | mView->newTodo(); | 305 | mView->newTodo(); |
290 | 306 | ||
291 | } | 307 | } |
292 | if ( msg == "-showWN" ) { | 308 | if ( msg == "-showWN" ) { |
293 | mView->viewManager()->showWhatsNextView(); | 309 | mView->viewManager()->showWhatsNextView(); |
@@ -324,9 +340,9 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
324 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 340 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
325 | mView->viewManager()->showWhatsNextView(); | 341 | mView->viewManager()->showWhatsNextView(); |
326 | } | 342 | } |
327 | else if ( msg == "-showNextXView" ) { | 343 | else if ( msg == "-showNextXView" ) { |
328 | mView->viewManager()->showNextXView(); | 344 | mView->viewManager()->showNextXView(); |
329 | } | 345 | } |
330 | 346 | ||
331 | 347 | ||
332 | } | 348 | } |
@@ -352,5 +368,5 @@ void MainWindow::initActions() | |||
352 | QPopupMenu *importMenu = new QPopupMenu( this ); | 368 | QPopupMenu *importMenu = new QPopupMenu( this ); |
353 | selectFilterMenu = new QPopupMenu( this ); | 369 | selectFilterMenu = new QPopupMenu( this ); |
354 | selectFilterMenu->setCheckable( true ); | 370 | selectFilterMenu->setCheckable( true ); |
355 | syncMenu = new QPopupMenu( this ); | 371 | syncMenu = new QPopupMenu( this ); |
356 | configureAgendaMenu = new QPopupMenu( this ); | 372 | configureAgendaMenu = new QPopupMenu( this ); |
@@ -364,9 +380,9 @@ void MainWindow::initActions() | |||
364 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 380 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
365 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 381 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
366 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 382 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
367 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 383 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
368 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 384 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
369 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 385 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
370 | } else { | 386 | } else { |
371 | QPEMenuBar *menuBar1; | 387 | QPEMenuBar *menuBar1; |
372 | menuBar1 = new QPEMenuBar( iconToolBar ); | 388 | menuBar1 = new QPEMenuBar( iconToolBar ); |
@@ -377,9 +393,9 @@ void MainWindow::initActions() | |||
377 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 393 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
378 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 394 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
379 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 395 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
380 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 396 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
381 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 397 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
382 | menuBar->insertItem( i18n("Help"), helpMenu ); | 398 | menuBar->insertItem( i18n("Help"), helpMenu ); |
383 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 399 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
384 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 400 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
385 | } | 401 | } |
@@ -394,24 +410,24 @@ void MainWindow::initActions() | |||
394 | configureToolBarMenu->setCheckable( true ); | 410 | configureToolBarMenu->setCheckable( true ); |
395 | 411 | ||
396 | QString pathString = ""; | 412 | QString pathString = ""; |
397 | if ( !p->mToolBarMiniIcons ) { | 413 | if ( !p->mToolBarMiniIcons ) { |
398 | if ( QApplication::desktop()->width() < 480 ) | 414 | if ( QApplication::desktop()->width() < 480 ) |
399 | pathString += "icons16/"; | 415 | pathString += "icons16/"; |
400 | } else | 416 | } else |
401 | pathString += "iconsmini/"; | 417 | pathString += "iconsmini/"; |
402 | configureAgendaMenu->setCheckable( true ); | 418 | configureAgendaMenu->setCheckable( true ); |
403 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); | 419 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); |
404 | configureAgendaMenu->insertSeparator(); | 420 | configureAgendaMenu->insertSeparator(); |
405 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); | 421 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); |
406 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); | 422 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); |
407 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); | 423 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); |
408 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); | 424 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); |
409 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); | 425 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); |
410 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); | 426 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); |
411 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); | 427 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); |
412 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); | 428 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); |
413 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 429 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
414 | 430 | ||
415 | icon = loadPixmap( pathString + "configure" ); | 431 | icon = loadPixmap( pathString + "configure" ); |
416 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 432 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
417 | action->addTo( actionMenu ); | 433 | action->addTo( actionMenu ); |
@@ -419,7 +435,7 @@ void MainWindow::initActions() | |||
419 | mView, SLOT( edit_options() ) ); | 435 | mView, SLOT( edit_options() ) ); |
420 | actionMenu->insertSeparator(); | 436 | actionMenu->insertSeparator(); |
421 | icon = loadPixmap( pathString + "newevent" ); | 437 | icon = loadPixmap( pathString + "newevent" ); |
422 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 438 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
423 | configureToolBarMenu->insertSeparator(); | 439 | configureToolBarMenu->insertSeparator(); |
424 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 440 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
425 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 441 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
@@ -427,21 +443,21 @@ void MainWindow::initActions() | |||
427 | connect( ne_action, SIGNAL( activated() ), | 443 | connect( ne_action, SIGNAL( activated() ), |
428 | mView, SLOT( newEvent() ) ); | 444 | mView, SLOT( newEvent() ) ); |
429 | icon = loadPixmap( pathString + "newtodo" ); | 445 | icon = loadPixmap( pathString + "newtodo" ); |
430 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 446 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
431 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 447 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
432 | nt_action->addTo( actionMenu ); | 448 | nt_action->addTo( actionMenu ); |
433 | connect( nt_action, SIGNAL( activated() ), | 449 | connect( nt_action, SIGNAL( activated() ), |
434 | mView, SLOT( newTodo() ) ); | 450 | mView, SLOT( newTodo() ) ); |
435 | icon = loadPixmap( pathString + "navi" ); | 451 | icon = loadPixmap( pathString + "navi" ); |
436 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 452 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
437 | action->addTo( viewMenu ); | 453 | action->addTo( viewMenu ); |
438 | connect( action, SIGNAL( activated() ), | 454 | connect( action, SIGNAL( activated() ), |
439 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 455 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
440 | icon = loadPixmap( pathString + "filter" ); | 456 | icon = loadPixmap( pathString + "filter" ); |
441 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 457 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
442 | action->addTo( viewMenu ); | 458 | action->addTo( viewMenu ); |
443 | connect( action, SIGNAL( activated() ), | 459 | connect( action, SIGNAL( activated() ), |
444 | mView, SLOT( toggleFilter() ) ); | 460 | mView, SLOT( toggleFilter() ) ); |
445 | 461 | ||
446 | 462 | ||
447 | viewMenu->insertSeparator(); | 463 | viewMenu->insertSeparator(); |
@@ -453,6 +469,6 @@ void MainWindow::initActions() | |||
453 | action->addTo( iconToolBar ); | 469 | action->addTo( iconToolBar ); |
454 | viewMenu->insertSeparator(); | 470 | viewMenu->insertSeparator(); |
455 | icon = loadPixmap( pathString + "list" ); | 471 | icon = loadPixmap( pathString + "list" ); |
456 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 472 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
457 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 473 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
458 | showlist_action->addTo( viewMenu ); | 474 | showlist_action->addTo( viewMenu ); |
@@ -461,6 +477,6 @@ void MainWindow::initActions() | |||
461 | 477 | ||
462 | 478 | ||
463 | icon = loadPixmap( pathString + "day" ); | 479 | icon = loadPixmap( pathString + "day" ); |
464 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 480 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
465 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 481 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
466 | day1_action->addTo( viewMenu ); | 482 | day1_action->addTo( viewMenu ); |
@@ -469,6 +485,6 @@ void MainWindow::initActions() | |||
469 | mView->viewManager(), SLOT( showDayView() ) ); | 485 | mView->viewManager(), SLOT( showDayView() ) ); |
470 | 486 | ||
471 | icon = loadPixmap( pathString + "workweek" ); | 487 | icon = loadPixmap( pathString + "workweek" ); |
472 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 488 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
473 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 489 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
474 | day5_action->addTo( viewMenu ); | 490 | day5_action->addTo( viewMenu ); |
@@ -477,5 +493,5 @@ void MainWindow::initActions() | |||
477 | 493 | ||
478 | icon = loadPixmap( pathString + "week" ); | 494 | icon = loadPixmap( pathString + "week" ); |
479 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 495 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
480 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 496 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
481 | day7_action->addTo( viewMenu ); | 497 | day7_action->addTo( viewMenu ); |
@@ -483,6 +499,6 @@ void MainWindow::initActions() | |||
483 | mView->viewManager(), SLOT( showWeekView() ) ); | 499 | mView->viewManager(), SLOT( showWeekView() ) ); |
484 | 500 | ||
485 | icon = loadPixmap( pathString + "month" ); | 501 | icon = loadPixmap( pathString + "month" ); |
486 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 502 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
487 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 503 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
488 | month_action->addTo( viewMenu ); | 504 | month_action->addTo( viewMenu ); |
@@ -490,6 +506,6 @@ void MainWindow::initActions() | |||
490 | mView->viewManager(), SLOT( showMonthView() ) ); | 506 | mView->viewManager(), SLOT( showMonthView() ) ); |
491 | 507 | ||
492 | icon = loadPixmap( pathString + "todo" ); | 508 | icon = loadPixmap( pathString + "todo" ); |
493 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 509 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
494 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 510 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
495 | todoview_action->addTo( viewMenu ); | 511 | todoview_action->addTo( viewMenu ); |
@@ -497,6 +513,6 @@ void MainWindow::initActions() | |||
497 | mView->viewManager(), SLOT( showTodoView() ) ); | 513 | mView->viewManager(), SLOT( showTodoView() ) ); |
498 | 514 | ||
499 | icon = loadPixmap( pathString + "journal" ); | 515 | icon = loadPixmap( pathString + "journal" ); |
500 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 516 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
501 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 517 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
502 | viewjournal_action->addTo( viewMenu ); | 518 | viewjournal_action->addTo( viewMenu ); |
@@ -504,6 +520,6 @@ void MainWindow::initActions() | |||
504 | mView->viewManager(), SLOT( showJournalView() ) ); | 520 | mView->viewManager(), SLOT( showJournalView() ) ); |
505 | 521 | ||
506 | icon = loadPixmap( pathString + "xdays" ); | 522 | icon = loadPixmap( pathString + "xdays" ); |
507 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 523 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
508 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 524 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
509 | xdays_action->addTo( viewMenu ); | 525 | xdays_action->addTo( viewMenu ); |
@@ -511,11 +527,11 @@ void MainWindow::initActions() | |||
511 | mView->viewManager(), SLOT( showNextXView() ) ); | 527 | mView->viewManager(), SLOT( showNextXView() ) ); |
512 | 528 | ||
513 | icon = loadPixmap( pathString + "whatsnext" ); | 529 | icon = loadPixmap( pathString + "whatsnext" ); |
514 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 530 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
515 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 531 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
516 | whatsnext_action->addTo( viewMenu ); | 532 | whatsnext_action->addTo( viewMenu ); |
517 | connect( whatsnext_action, SIGNAL( activated() ), | 533 | connect( whatsnext_action, SIGNAL( activated() ), |
518 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 534 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
519 | 535 | ||
520 | #if 0 | 536 | #if 0 |
521 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 537 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
@@ -555,13 +571,13 @@ void MainWindow::initActions() | |||
555 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 571 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
556 | 572 | ||
557 | icon = loadPixmap( pathString + "search" ); | 573 | icon = loadPixmap( pathString + "search" ); |
558 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 574 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
559 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 575 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
560 | search_action->addTo( actionMenu ); | 576 | search_action->addTo( actionMenu ); |
561 | connect( search_action, SIGNAL( activated() ), | 577 | connect( search_action, SIGNAL( activated() ), |
562 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 578 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
563 | 579 | ||
564 | icon = loadPixmap( pathString + "today" ); | 580 | icon = loadPixmap( pathString + "today" ); |
565 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 581 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
566 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 582 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
567 | today_action->addTo( actionMenu ); | 583 | today_action->addTo( actionMenu ); |
@@ -571,6 +587,6 @@ void MainWindow::initActions() | |||
571 | if ( KOPrefs::instance()->mShowFullMenu ) { | 587 | if ( KOPrefs::instance()->mShowFullMenu ) { |
572 | actionMenu->insertSeparator(); | 588 | actionMenu->insertSeparator(); |
573 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 589 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
574 | 590 | ||
575 | } | 591 | } |
576 | // actionMenu->insertSeparator(); | 592 | // actionMenu->insertSeparator(); |
@@ -630,5 +646,5 @@ void MainWindow::initActions() | |||
630 | action->addTo( importMenu ); | 646 | action->addTo( importMenu ); |
631 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 647 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
632 | 648 | ||
633 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 649 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
634 | this ); | 650 | this ); |
@@ -636,12 +652,12 @@ void MainWindow::initActions() | |||
636 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 652 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
637 | #else | 653 | #else |
638 | importMenu->insertSeparator(); | 654 | importMenu->insertSeparator(); |
639 | icon = loadPixmap( pathString + "print" ); | 655 | icon = loadPixmap( pathString + "print" ); |
640 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 656 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
641 | action->addTo( importMenu ); | 657 | action->addTo( importMenu ); |
642 | connect( action, SIGNAL( activated() ), | 658 | connect( action, SIGNAL( activated() ), |
643 | this, SLOT( printCal() ) ); | 659 | this, SLOT( printCal() ) ); |
644 | 660 | ||
645 | icon = loadPixmap( pathString + "print" ); | 661 | icon = loadPixmap( pathString + "print" ); |
646 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 662 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
647 | action->addTo( importMenu ); | 663 | action->addTo( importMenu ); |
@@ -658,32 +674,32 @@ void MainWindow::initActions() | |||
658 | action->addTo( importMenu ); | 674 | action->addTo( importMenu ); |
659 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 675 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
660 | 676 | ||
661 | //menuBar->insertItem( "Configure",configureMenu ); | 677 | //menuBar->insertItem( "Configure",configureMenu ); |
662 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 678 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
663 | icon = loadPixmap( "korganizer/korganizer" ); | 679 | icon = loadPixmap( "korganizer/korganizer" ); |
664 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 680 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
665 | action->addTo( helpMenu ); | 681 | action->addTo( helpMenu ); |
666 | connect( action, SIGNAL( activated() ), | 682 | connect( action, SIGNAL( activated() ), |
667 | SLOT( keyBindings() ) ); | 683 | SLOT( keyBindings() ) ); |
668 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 684 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
669 | action->addTo( helpMenu ); | 685 | action->addTo( helpMenu ); |
670 | connect( action, SIGNAL( activated() ), | 686 | connect( action, SIGNAL( activated() ), |
671 | SLOT( features() ) ); | 687 | SLOT( features() ) ); |
672 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 688 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
673 | action->addTo( helpMenu ); | 689 | action->addTo( helpMenu ); |
674 | connect( action, SIGNAL( activated() ), | 690 | connect( action, SIGNAL( activated() ), |
675 | SLOT( aboutAutoSaving() ) ); | 691 | SLOT( aboutAutoSaving() ) ); |
676 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 692 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
677 | action->addTo( helpMenu ); | 693 | action->addTo( helpMenu ); |
678 | connect( action, SIGNAL( activated() ), | 694 | connect( action, SIGNAL( activated() ), |
679 | SLOT( aboutKnownBugs() ) ); | 695 | SLOT( aboutKnownBugs() ) ); |
680 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 696 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
681 | action->addTo( helpMenu ); | 697 | action->addTo( helpMenu ); |
682 | connect( action, SIGNAL( activated() ), | 698 | connect( action, SIGNAL( activated() ), |
683 | SLOT( usertrans() ) ); | 699 | SLOT( usertrans() ) ); |
684 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 700 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
685 | action->addTo( helpMenu ); | 701 | action->addTo( helpMenu ); |
686 | connect( action, SIGNAL( activated() ), | 702 | connect( action, SIGNAL( activated() ), |
687 | SLOT( synchowto() ) ); | 703 | SLOT( synchowto() ) ); |
688 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 704 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
689 | action->addTo( helpMenu ); | 705 | action->addTo( helpMenu ); |
@@ -693,6 +709,6 @@ void MainWindow::initActions() | |||
693 | action->addTo( helpMenu ); | 709 | action->addTo( helpMenu ); |
694 | connect( action, SIGNAL( activated() ), | 710 | connect( action, SIGNAL( activated() ), |
695 | SLOT( faq() ) ); | 711 | SLOT( faq() ) ); |
696 | 712 | ||
697 | 713 | ||
698 | action = new QAction( "about", i18n("About..."), 0, this ); | 714 | action = new QAction( "about", i18n("About..."), 0, this ); |
@@ -707,8 +723,8 @@ void MainWindow::initActions() | |||
707 | 723 | ||
708 | // ****************************************************** | 724 | // ****************************************************** |
709 | // menubar icons | 725 | // menubar icons |
710 | 726 | ||
711 | 727 | ||
712 | iconToolBar->setHorizontalStretchable (true ); | 728 | iconToolBar->setHorizontalStretchable (true ); |
713 | //menuBar->insertItem( iconToolBar ); | 729 | //menuBar->insertItem( iconToolBar ); |
714 | //xdays_action | 730 | //xdays_action |
@@ -738,5 +754,5 @@ void MainWindow::initActions() | |||
738 | viewjournal_action->addTo( iconToolBar ); | 754 | viewjournal_action->addTo( iconToolBar ); |
739 | icon = loadPixmap( pathString + "2leftarrowB" ); | 755 | icon = loadPixmap( pathString + "2leftarrowB" ); |
740 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 756 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
741 | if (p-> mShowIconBackFast) { | 757 | if (p-> mShowIconBackFast) { |
742 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 758 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
@@ -746,5 +762,5 @@ void MainWindow::initActions() | |||
746 | } | 762 | } |
747 | icon = loadPixmap( pathString + "1leftarrowB" ); | 763 | icon = loadPixmap( pathString + "1leftarrowB" ); |
748 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 764 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
749 | if (p-> mShowIconBack) { | 765 | if (p-> mShowIconBack) { |
750 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 766 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
@@ -753,8 +769,8 @@ void MainWindow::initActions() | |||
753 | action->addTo( iconToolBar ); | 769 | action->addTo( iconToolBar ); |
754 | } | 770 | } |
755 | if (p-> mShowIconToday) | 771 | if (p-> mShowIconToday) |
756 | today_action->addTo( iconToolBar ); | 772 | today_action->addTo( iconToolBar ); |
757 | icon = loadPixmap( pathString + "1rightarrowB" ); | 773 | icon = loadPixmap( pathString + "1rightarrowB" ); |
758 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 774 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
759 | if (p-> mShowIconForward) { | 775 | if (p-> mShowIconForward) { |
760 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 776 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
@@ -764,5 +780,5 @@ void MainWindow::initActions() | |||
764 | } | 780 | } |
765 | icon = loadPixmap( pathString + "2rightarrowB" ); | 781 | icon = loadPixmap( pathString + "2rightarrowB" ); |
766 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 782 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
767 | if (p-> mShowIconForwardFast) { | 783 | if (p-> mShowIconForwardFast) { |
768 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 784 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
@@ -771,7 +787,7 @@ void MainWindow::initActions() | |||
771 | action->addTo( iconToolBar ); | 787 | action->addTo( iconToolBar ); |
772 | } | 788 | } |
773 | 789 | ||
774 | 790 | ||
775 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 791 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
776 | 792 | ||
777 | if (p-> mShowIconNewEvent) | 793 | if (p-> mShowIconNewEvent) |
@@ -795,8 +811,8 @@ void MainWindow::initActions() | |||
795 | if (p-> mShowIconBackFast) | 811 | if (p-> mShowIconBackFast) |
796 | configureToolBarMenu->setItemChecked( 200, true ); | 812 | configureToolBarMenu->setItemChecked( 200, true ); |
797 | if (p-> mShowIconBack) | 813 | if (p-> mShowIconBack) |
798 | configureToolBarMenu->setItemChecked( 210, true ); | 814 | configureToolBarMenu->setItemChecked( 210, true ); |
799 | if (p-> mShowIconToday) | 815 | if (p-> mShowIconToday) |
800 | configureToolBarMenu->setItemChecked( 130, true ); | 816 | configureToolBarMenu->setItemChecked( 130, true ); |
801 | if (p-> mShowIconForward) | 817 | if (p-> mShowIconForward) |
802 | configureToolBarMenu->setItemChecked( 220, true ); | 818 | configureToolBarMenu->setItemChecked( 220, true ); |
@@ -820,5 +836,5 @@ void MainWindow::initActions() | |||
820 | if (p-> mShowIconWhatsThis) | 836 | if (p-> mShowIconWhatsThis) |
821 | QWhatsThis::whatsThisButton ( iconToolBar ); | 837 | QWhatsThis::whatsThisButton ( iconToolBar ); |
822 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 838 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
823 | configureAgenda( p->mHourSize ); | 839 | configureAgenda( p->mHourSize ); |
824 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 840 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
@@ -851,5 +867,5 @@ void MainWindow::fillSyncMenu() | |||
851 | config.writeEntry("ExternSyncProfiles","Sharp_DTM"); | 867 | config.writeEntry("ExternSyncProfiles","Sharp_DTM"); |
852 | config.sync(); | 868 | config.sync(); |
853 | delete temp; | 869 | delete temp; |
854 | } | 870 | } |
855 | KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); | 871 | KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); |
@@ -867,12 +883,12 @@ void MainWindow::fillSyncMenu() | |||
867 | } | 883 | } |
868 | mView->setupExternSyncProfiles(); | 884 | mView->setupExternSyncProfiles(); |
869 | } | 885 | } |
870 | 886 | ||
871 | int MainWindow::ringSync() | 887 | int MainWindow::ringSync() |
872 | { | 888 | { |
873 | int syncedProfiles = 0; | 889 | int syncedProfiles = 0; |
874 | int i; | 890 | int i; |
875 | QTime timer; | 891 | QTime timer; |
876 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 892 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
877 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 893 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; |
878 | KSyncProfile* temp = new KSyncProfile (); | 894 | KSyncProfile* temp = new KSyncProfile (); |
@@ -895,5 +911,5 @@ int MainWindow::ringSync() | |||
895 | } else { | 911 | } else { |
896 | if ( temp->getIsLocalFileSync() ) { | 912 | if ( temp->getIsLocalFileSync() ) { |
897 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) | 913 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) |
898 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 914 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
899 | } else { | 915 | } else { |
@@ -905,5 +921,5 @@ int MainWindow::ringSync() | |||
905 | } else | 921 | } else |
906 | syncRemote( temp, false ); | 922 | syncRemote( temp, false ); |
907 | 923 | ||
908 | } | 924 | } |
909 | } | 925 | } |
@@ -916,5 +932,5 @@ int MainWindow::ringSync() | |||
916 | #endif | 932 | #endif |
917 | } | 933 | } |
918 | 934 | ||
919 | } | 935 | } |
920 | 936 | ||
@@ -922,5 +938,5 @@ int MainWindow::ringSync() | |||
922 | delete temp; | 938 | delete temp; |
923 | return syncedProfiles; | 939 | return syncedProfiles; |
924 | } | 940 | } |
925 | 941 | ||
926 | void MainWindow::multiSync( bool askforPrefs ) | 942 | void MainWindow::multiSync( bool askforPrefs ) |
@@ -928,9 +944,9 @@ void MainWindow::multiSync( bool askforPrefs ) | |||
928 | if (mBlockSaveFlag) | 944 | if (mBlockSaveFlag) |
929 | return; | 945 | return; |
930 | mBlockSaveFlag = true; | 946 | mBlockSaveFlag = true; |
931 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 947 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
932 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), | 948 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), |
933 | question, | 949 | question, |
934 | i18n("Yes"), i18n("No"), | 950 | i18n("Yes"), i18n("No"), |
935 | 0, 0 ) != 0 ) { | 951 | 0, 0 ) != 0 ) { |
936 | mBlockSaveFlag = false; | 952 | mBlockSaveFlag = false; |
@@ -951,5 +967,5 @@ void MainWindow::multiSync( bool askforPrefs ) | |||
951 | mBlockSaveFlag = false; | 967 | mBlockSaveFlag = false; |
952 | if ( num ) | 968 | if ( num ) |
953 | save(); | 969 | save(); |
954 | if ( num ) | 970 | if ( num ) |
955 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); | 971 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); |
@@ -966,9 +982,9 @@ void MainWindow::slotSyncMenu( int action ) | |||
966 | 982 | ||
967 | return; | 983 | return; |
968 | } | 984 | } |
969 | if ( action == 1 ) { | 985 | if ( action == 1 ) { |
970 | multiSync( true ); | 986 | multiSync( true ); |
971 | return; | 987 | return; |
972 | } | 988 | } |
973 | 989 | ||
974 | if (mBlockSaveFlag) | 990 | if (mBlockSaveFlag) |
@@ -978,5 +994,5 @@ void MainWindow::slotSyncMenu( int action ) | |||
978 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); | 994 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); |
979 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); | 995 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); |
980 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 996 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
981 | KSyncProfile* temp = new KSyncProfile (); | 997 | KSyncProfile* temp = new KSyncProfile (); |
982 | temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); | 998 | temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); |
@@ -998,5 +1014,5 @@ void MainWindow::slotSyncMenu( int action ) | |||
998 | } else if ( action >= 1003 ) { | 1014 | } else if ( action >= 1003 ) { |
999 | if ( temp->getIsLocalFileSync() ) { | 1015 | if ( temp->getIsLocalFileSync() ) { |
1000 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) | 1016 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) |
1001 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 1017 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
1002 | } else { | 1018 | } else { |
@@ -1036,5 +1052,5 @@ void MainWindow::displayText( QString text ,QString cap ) | |||
1036 | lay->setMargin( 3 ); | 1052 | lay->setMargin( 3 ); |
1037 | QTextBrowser tb ( &dia ); | 1053 | QTextBrowser tb ( &dia ); |
1038 | lay->addWidget( &tb ); | 1054 | lay->addWidget( &tb ); |
1039 | tb.setText( text ); | 1055 | tb.setText( text ); |
1040 | #ifdef DESKTOP_VERSION | 1056 | #ifdef DESKTOP_VERSION |
@@ -1048,13 +1064,13 @@ void MainWindow::displayFile( QString fn, QString cap ) | |||
1048 | { | 1064 | { |
1049 | QString fileName = resourcePath() + fn; | 1065 | QString fileName = resourcePath() + fn; |
1050 | QString text; | 1066 | QString text; |
1051 | QFile file( fileName ); | 1067 | QFile file( fileName ); |
1052 | if (!file.open( IO_ReadOnly ) ) { | 1068 | if (!file.open( IO_ReadOnly ) ) { |
1053 | return ; | 1069 | return ; |
1054 | 1070 | ||
1055 | } | 1071 | } |
1056 | QTextStream ts( &file ); | 1072 | QTextStream ts( &file ); |
1057 | text = ts.read(); | 1073 | text = ts.read(); |
1058 | file.close(); | 1074 | file.close(); |
1059 | displayText( text, cap); | 1075 | displayText( text, cap); |
1060 | } | 1076 | } |
@@ -1079,5 +1095,5 @@ void MainWindow::synchowto() | |||
1079 | { | 1095 | { |
1080 | #if 0 | 1096 | #if 0 |
1081 | QPtrList<Incidence> er = mCalendar->rawIncidences(); | 1097 | QPtrList<Incidence> er = mCalendar->rawIncidences(); |
1082 | Incidence* inR = er.first(); | 1098 | Incidence* inR = er.first(); |
1083 | VCalFormat vf; | 1099 | VCalFormat vf; |
@@ -1093,5 +1109,5 @@ void MainWindow::synchowto() | |||
1093 | #endif | 1109 | #endif |
1094 | displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); | 1110 | displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); |
1095 | } | 1111 | } |
1096 | void MainWindow::faq() | 1112 | void MainWindow::faq() |
1097 | { | 1113 | { |
@@ -1116,5 +1132,5 @@ void MainWindow::about() | |||
1116 | i18n("KOrganizer/Platform-independent\n") + | 1132 | i18n("KOrganizer/Platform-independent\n") + |
1117 | "(KO/Pi) " + version + " - " + | 1133 | "(KO/Pi) " + version + " - " + |
1118 | 1134 | ||
1119 | #ifdef DESKTOP_VERSION | 1135 | #ifdef DESKTOP_VERSION |
1120 | i18n("Desktop Edition\n") + | 1136 | i18n("Desktop Edition\n") + |
@@ -1176,5 +1192,5 @@ void MainWindow::keyBindings() | |||
1176 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1192 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1177 | displayText( text, cap); | 1193 | displayText( text, cap); |
1178 | 1194 | ||
1179 | } | 1195 | } |
1180 | void MainWindow::aboutAutoSaving() | 1196 | void MainWindow::aboutAutoSaving() |
@@ -1188,6 +1204,6 @@ void MainWindow::aboutAutoSaving() | |||
1188 | msg->exec(); | 1204 | msg->exec(); |
1189 | delete msg; | 1205 | delete msg; |
1190 | 1206 | ||
1191 | 1207 | ||
1192 | } | 1208 | } |
1193 | void MainWindow::aboutKnownBugs() | 1209 | void MainWindow::aboutKnownBugs() |
@@ -1206,5 +1222,5 @@ void MainWindow::aboutKnownBugs() | |||
1206 | msg->exec(); | 1222 | msg->exec(); |
1207 | delete msg; | 1223 | delete msg; |
1208 | 1224 | ||
1209 | } | 1225 | } |
1210 | 1226 | ||
@@ -1218,41 +1234,41 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1218 | if ( !incidence ) { | 1234 | if ( !incidence ) { |
1219 | enableIncidenceActions( false ); | 1235 | enableIncidenceActions( false ); |
1220 | 1236 | ||
1221 | mNewSubTodoAction->setEnabled( false ); | 1237 | mNewSubTodoAction->setEnabled( false ); |
1222 | setCaptionToDates(); | 1238 | setCaptionToDates(); |
1223 | return; | 1239 | return; |
1224 | 1240 | ||
1225 | } | 1241 | } |
1226 | 1242 | ||
1227 | //KGlobal::locale()->formatDateTime(nextA, true); | 1243 | //KGlobal::locale()->formatDateTime(nextA, true); |
1228 | QString startString = ""; | 1244 | QString startString = ""; |
1229 | if ( incidence->type() != "Todo" ) { | 1245 | if ( incidence->type() != "Todo" ) { |
1230 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1246 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1231 | if ( incidence->doesFloat() ) { | 1247 | if ( incidence->doesFloat() ) { |
1232 | startString += ": "+incidence->dtStartDateStr( true ); | 1248 | startString += ": "+incidence->dtStartDateStr( true ); |
1233 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1249 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1234 | 1250 | ||
1235 | } else { | 1251 | } else { |
1236 | startString = ": "+incidence->dtStartStr(true); | 1252 | startString = ": "+incidence->dtStartStr(true); |
1237 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1253 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1238 | 1254 | ||
1239 | } | 1255 | } |
1240 | 1256 | ||
1241 | } else { | 1257 | } else { |
1242 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1258 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1243 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1259 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1244 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1260 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1245 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1261 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1246 | } | 1262 | } |
1247 | 1263 | ||
1248 | } | 1264 | } |
1249 | else | 1265 | else |
1250 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1266 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1251 | if ( !incidence->location().isEmpty() ) | 1267 | if ( !incidence->location().isEmpty() ) |
1252 | startString += " (" +incidence->location()+")"; | 1268 | startString += " (" +incidence->location()+")"; |
1253 | setCaption( incidence->summary()+startString); | 1269 | setCaption( incidence->summary()+startString); |
1254 | 1270 | ||
1255 | enableIncidenceActions( true ); | 1271 | enableIncidenceActions( true ); |
1256 | 1272 | ||
1257 | if ( incidence->type() == "Event" ) { | 1273 | if ( incidence->type() == "Event" ) { |
1258 | mShowAction->setText( i18n("Show Event...") ); | 1274 | mShowAction->setText( i18n("Show Event...") ); |
@@ -1293,5 +1309,5 @@ void MainWindow::importOL() | |||
1293 | } | 1309 | } |
1294 | void MainWindow::importBday() | 1310 | void MainWindow::importBday() |
1295 | { | 1311 | { |
1296 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1312 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1297 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1313 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
@@ -1300,7 +1316,7 @@ void MainWindow::importBday() | |||
1300 | if ( result == 0 ) { | 1316 | if ( result == 0 ) { |
1301 | mView->importBday(); | 1317 | mView->importBday(); |
1302 | 1318 | ||
1303 | } | 1319 | } |
1304 | 1320 | ||
1305 | 1321 | ||
1306 | } | 1322 | } |
@@ -1324,7 +1340,7 @@ void MainWindow::importQtopia() | |||
1324 | 0, 1 ); | 1340 | 0, 1 ); |
1325 | 1341 | ||
1326 | #endif | 1342 | #endif |
1327 | } | 1343 | } |
1328 | 1344 | ||
1329 | void MainWindow::saveOnClose() | 1345 | void MainWindow::saveOnClose() |
1330 | { | 1346 | { |
@@ -1342,5 +1358,5 @@ void MainWindow::slotModifiedChanged( bool changed ) | |||
1342 | return; | 1358 | return; |
1343 | int msec; | 1359 | int msec; |
1344 | // we store the changes after 1 minute, | 1360 | // we store the changes after 1 minute, |
1345 | // and for safety reasons after 10 minutes again | 1361 | // and for safety reasons after 10 minutes again |
1346 | if ( !mBlockSaveFlag ) | 1362 | if ( !mBlockSaveFlag ) |
@@ -1355,5 +1371,5 @@ void MainWindow::slotModifiedChanged( bool changed ) | |||
1355 | void MainWindow::save() | 1371 | void MainWindow::save() |
1356 | { | 1372 | { |
1357 | if ( mBlockSaveFlag ) | 1373 | if ( mBlockSaveFlag ) |
1358 | return; | 1374 | return; |
1359 | bool store = mBlockSaveFlag; | 1375 | bool store = mBlockSaveFlag; |
@@ -1371,12 +1387,12 @@ void MainWindow::save() | |||
1371 | QString savemes; | 1387 | QString savemes; |
1372 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1388 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1373 | setCaption(savemes); | 1389 | setCaption(savemes); |
1374 | } else | 1390 | } else |
1375 | setCaption(i18n("Saving cancelled!")); | 1391 | setCaption(i18n("Saving cancelled!")); |
1376 | mCalendarModifiedFlag = false; | 1392 | mCalendarModifiedFlag = false; |
1377 | mBlockSaveFlag = store; | 1393 | mBlockSaveFlag = store; |
1378 | } | 1394 | } |
1379 | 1395 | ||
1380 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1396 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1381 | { | 1397 | { |
1382 | if ( !e->isAutoRepeat() ) { | 1398 | if ( !e->isAutoRepeat() ) { |
@@ -1384,5 +1400,5 @@ void MainWindow::keyReleaseEvent ( QKeyEvent * e) | |||
1384 | } | 1400 | } |
1385 | } | 1401 | } |
1386 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1402 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1387 | { | 1403 | { |
1388 | qApp->processEvents(); | 1404 | qApp->processEvents(); |
@@ -1419,5 +1435,5 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1419 | case Qt::Key_Up: | 1435 | case Qt::Key_Up: |
1420 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1436 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1421 | break; | 1437 | break; |
1422 | case Qt::Key_I: | 1438 | case Qt::Key_I: |
1423 | mView->showIncidence(); | 1439 | mView->showIncidence(); |
@@ -1441,5 +1457,5 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1441 | case Qt::Key_5: | 1457 | case Qt::Key_5: |
1442 | case Qt::Key_6: | 1458 | case Qt::Key_6: |
1443 | case Qt::Key_7: | 1459 | case Qt::Key_7: |
1444 | case Qt::Key_8: | 1460 | case Qt::Key_8: |
1445 | case Qt::Key_9: | 1461 | case Qt::Key_9: |
@@ -1460,5 +1476,5 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1460 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1476 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1461 | mView->newSubTodo(); | 1477 | mView->newSubTodo(); |
1462 | else | 1478 | else |
1463 | mView->dialogManager()->showSearchDialog(); | 1479 | mView->dialogManager()->showSearchDialog(); |
1464 | break; | 1480 | break; |
@@ -1477,36 +1493,36 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1477 | case Qt::Key_W: | 1493 | case Qt::Key_W: |
1478 | mView->viewManager()->showWhatsNextView(); | 1494 | mView->viewManager()->showWhatsNextView(); |
1479 | break; | 1495 | break; |
1480 | case Qt::Key_L: | 1496 | case Qt::Key_L: |
1481 | mView->viewManager()->showListView(); | 1497 | mView->viewManager()->showListView(); |
1482 | break; | 1498 | break; |
1483 | case Qt::Key_N: | 1499 | case Qt::Key_N: |
1484 | mView->viewManager()->showNextXView(); | 1500 | mView->viewManager()->showNextXView(); |
1485 | showSelectedDates = true; | 1501 | showSelectedDates = true; |
1486 | break; | 1502 | break; |
1487 | case Qt::Key_V: | 1503 | case Qt::Key_V: |
1488 | mView->viewManager()->showTodoView(); | 1504 | mView->viewManager()->showTodoView(); |
1489 | break; | 1505 | break; |
1490 | case Qt::Key_C: | 1506 | case Qt::Key_C: |
1491 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1507 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1492 | break; | 1508 | break; |
1493 | case Qt::Key_P: | 1509 | case Qt::Key_P: |
1494 | mView->showDatePicker( ); | 1510 | mView->showDatePicker( ); |
1495 | break; | 1511 | break; |
1496 | case Qt::Key_F: | 1512 | case Qt::Key_F: |
1497 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1513 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1498 | mView->editFilters(); | 1514 | mView->editFilters(); |
1499 | else | 1515 | else |
1500 | mView->toggleFilter(); | 1516 | mView->toggleFilter(); |
1501 | break; | 1517 | break; |
1502 | case Qt::Key_X: | 1518 | case Qt::Key_X: |
1503 | mView->toggleDateNavigatorWidget(); | 1519 | mView->toggleDateNavigatorWidget(); |
1504 | break; | 1520 | break; |
1505 | case Qt::Key_Space: | 1521 | case Qt::Key_Space: |
1506 | mView->toggleExpand(); | 1522 | mView->toggleExpand(); |
1507 | break; | 1523 | break; |
1508 | case Qt::Key_A: | 1524 | case Qt::Key_A: |
1509 | mView->toggleAllDaySize(); | 1525 | mView->toggleAllDaySize(); |
1510 | break; | 1526 | break; |
1511 | case Qt::Key_T: | 1527 | case Qt::Key_T: |
1512 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1528 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
@@ -1523,6 +1539,6 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1523 | mView->editIncidenceDescription();; | 1539 | mView->editIncidenceDescription();; |
1524 | break; | 1540 | break; |
1525 | // case Qt::Key_Return: | 1541 | // case Qt::Key_Return: |
1526 | case Qt::Key_E: | 1542 | case Qt::Key_E: |
1527 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1543 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1528 | mView->newEvent(); | 1544 | mView->newEvent(); |
@@ -1540,5 +1556,5 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1540 | configureAgenda( size ); | 1556 | configureAgenda( size ); |
1541 | break; | 1557 | break; |
1542 | 1558 | ||
1543 | 1559 | ||
1544 | default: | 1560 | default: |
@@ -1565,5 +1581,5 @@ void MainWindow::fillFilterMenu() | |||
1565 | disable = true; | 1581 | disable = true; |
1566 | } | 1582 | } |
1567 | selectFilterMenu->insertSeparator(); | 1583 | selectFilterMenu->insertSeparator(); |
1568 | QPtrList<CalFilter> fili = mView->filters(); | 1584 | QPtrList<CalFilter> fili = mView->filters(); |
1569 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1585 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
@@ -1605,5 +1621,5 @@ void MainWindow::configureToolBar( int item ) | |||
1605 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1621 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1606 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1622 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1607 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1623 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1608 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 1624 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1609 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 1625 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
@@ -1611,5 +1627,5 @@ void MainWindow::configureToolBar( int item ) | |||
1611 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 1627 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1612 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 1628 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1613 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 1629 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1614 | // initActions(); | 1630 | // initActions(); |
1615 | } | 1631 | } |
@@ -1622,9 +1638,9 @@ void MainWindow::setCaptionToDates() | |||
1622 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1638 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1623 | setCaption( i18n("Dates: ") + selDates ); | 1639 | setCaption( i18n("Dates: ") + selDates ); |
1624 | 1640 | ||
1625 | } | 1641 | } |
1626 | // parameter item == 0: reinit | 1642 | // parameter item == 0: reinit |
1627 | void MainWindow::configureAgenda( int item ) | 1643 | void MainWindow::configureAgenda( int item ) |
1628 | { | 1644 | { |
1629 | 1645 | ||
1630 | KOPrefs *p = KOPrefs::instance(); | 1646 | KOPrefs *p = KOPrefs::instance(); |
@@ -1650,5 +1666,5 @@ void MainWindow::configureAgenda( int item ) | |||
1650 | 1666 | ||
1651 | void MainWindow::saveCalendar() | 1667 | void MainWindow::saveCalendar() |
1652 | { | 1668 | { |
1653 | QString fn = KOPrefs::instance()->mLastSaveFile; | 1669 | QString fn = KOPrefs::instance()->mLastSaveFile; |
1654 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); | 1670 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); |
@@ -1660,5 +1676,5 @@ void MainWindow::saveCalendar() | |||
1660 | QString mes; | 1676 | QString mes; |
1661 | bool createbup = true; | 1677 | bool createbup = true; |
1662 | if ( info. exists() ) { | 1678 | if ( info. exists() ) { |
1663 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; | 1679 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; |
1664 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1680 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
@@ -1670,5 +1686,5 @@ void MainWindow::saveCalendar() | |||
1670 | } | 1686 | } |
1671 | if ( createbup ) { | 1687 | if ( createbup ) { |
1672 | mView->saveCalendar( fn ); | 1688 | mView->saveCalendar( fn ); |
1673 | mes = i18n("KO/Pi:Saved %1").arg(fn); | 1689 | mes = i18n("KO/Pi:Saved %1").arg(fn); |
1674 | KOPrefs::instance()->mLastSaveFile = fn; | 1690 | KOPrefs::instance()->mLastSaveFile = fn; |
@@ -1678,8 +1694,8 @@ void MainWindow::saveCalendar() | |||
1678 | void MainWindow::loadCalendar() | 1694 | void MainWindow::loadCalendar() |
1679 | { | 1695 | { |
1680 | 1696 | ||
1681 | QString fn = KOPrefs::instance()->mLastLoadFile; | 1697 | QString fn = KOPrefs::instance()->mLastLoadFile; |
1682 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 1698 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
1683 | 1699 | ||
1684 | if ( fn == "" ) | 1700 | if ( fn == "" ) |
1685 | return; | 1701 | return; |
@@ -1727,7 +1743,7 @@ void MainWindow::importFile( QString fn, bool quick ) | |||
1727 | mess ); | 1743 | mess ); |
1728 | return; | 1744 | return; |
1729 | } | 1745 | } |
1730 | int result = 0; | 1746 | int result = 0; |
1731 | if ( !quick ) { | 1747 | if ( !quick ) { |
1732 | 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 )); | 1748 | 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 )); |
1733 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1749 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
@@ -1748,5 +1764,5 @@ void MainWindow::importFile( QString fn, bool quick ) | |||
1748 | void MainWindow::importIcal() | 1764 | void MainWindow::importIcal() |
1749 | { | 1765 | { |
1750 | 1766 | ||
1751 | QString fn =KOPrefs::instance()->mLastImportFile; | 1767 | QString fn =KOPrefs::instance()->mLastImportFile; |
1752 | 1768 | ||
@@ -1755,5 +1771,5 @@ void MainWindow::importIcal() | |||
1755 | return; | 1771 | return; |
1756 | importFile( fn, true ); | 1772 | importFile( fn, true ); |
1757 | 1773 | ||
1758 | } | 1774 | } |
1759 | 1775 | ||
@@ -1768,5 +1784,5 @@ void MainWindow::exportVCalendar() | |||
1768 | QString mes; | 1784 | QString mes; |
1769 | bool createbup = true; | 1785 | bool createbup = true; |
1770 | if ( info. exists() ) { | 1786 | if ( info. exists() ) { |
1771 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 1787 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
1772 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1788 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
@@ -1778,6 +1794,6 @@ void MainWindow::exportVCalendar() | |||
1778 | } | 1794 | } |
1779 | if ( createbup ) { | 1795 | if ( createbup ) { |
1780 | if ( mView->exportVCalendar( fn ) ) { | 1796 | if ( mView->exportVCalendar( fn ) ) { |
1781 | KOPrefs::instance()->mLastVcalFile = fn; | 1797 | KOPrefs::instance()->mLastVcalFile = fn; |
1782 | if ( fn.length() > 20 ) | 1798 | if ( fn.length() > 20 ) |
1783 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 1799 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
@@ -1789,18 +1805,18 @@ void MainWindow::exportVCalendar() | |||
1789 | 1805 | ||
1790 | } | 1806 | } |
1791 | #include <qpushbutton.h> | 1807 | #include <qpushbutton.h> |
1792 | QString MainWindow::getPassword( ) | 1808 | QString MainWindow::getPassword( ) |
1793 | { | 1809 | { |
1794 | QString retfile = ""; | 1810 | QString retfile = ""; |
1795 | QDialog dia ( this, "input-dialog", true ); | 1811 | QDialog dia ( this, "input-dialog", true ); |
1796 | QLineEdit lab ( &dia ); | 1812 | QLineEdit lab ( &dia ); |
1797 | lab.setEchoMode( QLineEdit::Password ); | 1813 | lab.setEchoMode( QLineEdit::Password ); |
1798 | QVBoxLayout lay( &dia ); | 1814 | QVBoxLayout lay( &dia ); |
1799 | lay.setMargin(7); | 1815 | lay.setMargin(7); |
1800 | lay.setSpacing(7); | 1816 | lay.setSpacing(7); |
1801 | lay.addWidget( &lab); | 1817 | lay.addWidget( &lab); |
1802 | dia.setFixedSize( 230,50 ); | 1818 | dia.setFixedSize( 230,50 ); |
1803 | dia.setCaption( i18n("Enter password") ); | 1819 | dia.setCaption( i18n("Enter password") ); |
1804 | QPushButton pb ( "OK", &dia); | 1820 | QPushButton pb ( "OK", &dia); |
1805 | lay.addWidget( &pb ); | 1821 | lay.addWidget( &pb ); |
1806 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); | 1822 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); |
@@ -1845,7 +1861,7 @@ bool MainWindow::syncWithFile( QString fn , bool quick ) | |||
1845 | mess ); | 1861 | mess ); |
1846 | return ret; | 1862 | return ret; |
1847 | } | 1863 | } |
1848 | int result = 0; | 1864 | int result = 0; |
1849 | if ( !quick ) { | 1865 | if ( !quick ) { |
1850 | mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1866 | mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1851 | result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1867 | result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
@@ -1853,9 +1869,9 @@ bool MainWindow::syncWithFile( QString fn , bool quick ) | |||
1853 | i18n("Sync"), i18n("Cancel"), 0, | 1869 | i18n("Sync"), i18n("Cancel"), 0, |
1854 | 0, 1 ); | 1870 | 0, 1 ); |
1855 | if ( result ) | 1871 | if ( result ) |
1856 | return false; | 1872 | return false; |
1857 | } | 1873 | } |
1858 | if ( KOPrefs::instance()->mAskForPreferences ) | 1874 | if ( KOPrefs::instance()->mAskForPreferences ) |
1859 | mView->edit_sync_options(); | 1875 | mView->edit_sync_options(); |
1860 | if ( result == 0 ) { | 1876 | if ( result == 0 ) { |
1861 | //qDebug("Now sycing ... "); | 1877 | //qDebug("Now sycing ... "); |
@@ -1888,5 +1904,5 @@ void MainWindow::confSync() | |||
1888 | fillSyncMenu(); | 1904 | fillSyncMenu(); |
1889 | //mView->writeSettings(); | 1905 | //mView->writeSettings(); |
1890 | 1906 | ||
1891 | 1907 | ||
1892 | } | 1908 | } |
@@ -1898,5 +1914,5 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) | |||
1898 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), | 1914 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), |
1899 | question, | 1915 | question, |
1900 | i18n("Yes"), i18n("No"), | 1916 | i18n("Yes"), i18n("No"), |
1901 | 0, 0 ) != 0 ) | 1917 | 0, 0 ) != 0 ) |
1902 | return; | 1918 | return; |
@@ -1908,7 +1924,7 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) | |||
1908 | command = command.left( fi )+ pwd + command.mid( fi+5 ); | 1924 | command = command.left( fi )+ pwd + command.mid( fi+5 ); |
1909 | 1925 | ||
1910 | } | 1926 | } |
1911 | int maxlen = 30; | 1927 | int maxlen = 30; |
1912 | if ( QApplication::desktop()->width() > 320 ) | 1928 | if ( QApplication::desktop()->width() > 320 ) |
1913 | maxlen += 25; | 1929 | maxlen += 25; |
1914 | setCaption ( i18n( "Copy remote file to local machine..." ) ); | 1930 | setCaption ( i18n( "Copy remote file to local machine..." ) ); |
@@ -1929,5 +1945,5 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) | |||
1929 | question, | 1945 | question, |
1930 | i18n("Okay!")) ; | 1946 | i18n("Okay!")) ; |
1931 | setCaption ("KO/Pi"); | 1947 | setCaption ("KO/Pi"); |
1932 | return; | 1948 | return; |
1933 | } | 1949 | } |
@@ -1940,5 +1956,5 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) | |||
1940 | // e->setReadOnly( true ); | 1956 | // e->setReadOnly( true ); |
1941 | if ( KOPrefs::instance()->mWriteBackFile ) { | 1957 | if ( KOPrefs::instance()->mWriteBackFile ) { |
1942 | command = prof->getPostSyncCommand(); | 1958 | command = prof->getPostSyncCommand(); |
1943 | setCaption ( i18n( "Writing back file ..." ) ); | 1959 | setCaption ( i18n( "Writing back file ..." ) ); |
1944 | result = system ( command ); | 1960 | result = system ( command ); |
@@ -1955,7 +1971,7 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) | |||
1955 | } | 1971 | } |
1956 | void MainWindow::syncSSH() | 1972 | void MainWindow::syncSSH() |
1957 | { | 1973 | { |
1958 | // not used anymore | 1974 | // not used anymore |
1959 | QTime timer; | 1975 | QTime timer; |
1960 | timer.start(); | 1976 | timer.start(); |
1961 | //qDebug("MainWindow::syncssh() "); | 1977 | //qDebug("MainWindow::syncssh() "); |
@@ -1972,5 +1988,5 @@ void MainWindow::syncSSH() | |||
1972 | i18n("User: " ) + remoteUser +"\n" ; | 1988 | i18n("User: " ) + remoteUser +"\n" ; |
1973 | int maxlen = 30; | 1989 | int maxlen = 30; |
1974 | if ( QApplication::desktop()->width() > 320 ) | 1990 | if ( QApplication::desktop()->width() > 320 ) |
1975 | maxlen += 25; | 1991 | maxlen += 25; |
1976 | if ( remoteFile.length() > maxlen ) | 1992 | if ( remoteFile.length() > maxlen ) |
@@ -1982,8 +1998,8 @@ void MainWindow::syncSSH() | |||
1982 | else | 1998 | else |
1983 | question += i18n("Local temp file:\n " ) + localFile +"\n"; | 1999 | question += i18n("Local temp file:\n " ) + localFile +"\n"; |
1984 | 2000 | ||
1985 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), | 2001 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), |
1986 | question, | 2002 | question, |
1987 | i18n("Yes"), i18n("No"), | 2003 | i18n("Yes"), i18n("No"), |
1988 | 0, 0 ) != 0 ) | 2004 | 0, 0 ) != 0 ) |
1989 | return; | 2005 | return; |
@@ -2011,5 +2027,5 @@ void MainWindow::syncSSH() | |||
2011 | question, | 2027 | question, |
2012 | i18n("Okay!")) ; | 2028 | i18n("Okay!")) ; |
2013 | setCaption ("KO/Pi"); | 2029 | setCaption ("KO/Pi"); |
2014 | return; | 2030 | return; |
2015 | } | 2031 | } |
@@ -2024,5 +2040,5 @@ void MainWindow::syncSSH() | |||
2024 | // e->setReadOnly( true ); | 2040 | // e->setReadOnly( true ); |
2025 | if ( KOPrefs::instance()->mWriteBackFile ) { | 2041 | if ( KOPrefs::instance()->mWriteBackFile ) { |
2026 | command = "scp " + localFile +" " +remoteUser + "@" + remoteIP +":" + remoteFile ; | 2042 | command = "scp " + localFile +" " +remoteUser + "@" + remoteIP +":" + remoteFile ; |
2027 | setCaption ( i18n( "Writing back file ..." ) ); | 2043 | setCaption ( i18n( "Writing back file ..." ) ); |
2028 | result = system ( command ); | 2044 | result = system ( command ); |
@@ -2037,5 +2053,5 @@ void MainWindow::syncSSH() | |||
2037 | question, | 2053 | question, |
2038 | i18n("Okay!")) ; | 2054 | i18n("Okay!")) ; |
2039 | setCaption ("KO/Pi"); | 2055 | setCaption ("KO/Pi"); |
2040 | return; | 2056 | return; |
2041 | } else { | 2057 | } else { |
@@ -2052,5 +2068,5 @@ void MainWindow::syncSSH() | |||
2052 | qDebug("MainWindow::merging) "); | 2068 | qDebug("MainWindow::merging) "); |
2053 | mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 ); | 2069 | mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 ); |
2054 | while ( mBlockSaveFlag ) | 2070 | while ( mBlockSaveFlag ) |
2055 | qApp->processEvents(); | 2071 | qApp->processEvents(); |
2056 | save(); | 2072 | save(); |
@@ -2067,5 +2083,5 @@ void MainWindow::syncSharp() | |||
2067 | mView->syncSharp(); | 2083 | mView->syncSharp(); |
2068 | slotModifiedChanged( true ); | 2084 | slotModifiedChanged( true ); |
2069 | 2085 | ||
2070 | } | 2086 | } |
2071 | void MainWindow::syncPhone() | 2087 | void MainWindow::syncPhone() |
@@ -2075,5 +2091,5 @@ void MainWindow::syncPhone() | |||
2075 | mView->syncPhone(); | 2091 | mView->syncPhone(); |
2076 | slotModifiedChanged( true ); | 2092 | slotModifiedChanged( true ); |
2077 | 2093 | ||
2078 | } | 2094 | } |
2079 | 2095 | ||