summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-16 22:08:18 (UTC)
committer zautrix <zautrix>2005-02-16 22:08:18 (UTC)
commit451b4de59893b5c0801a7bbb2f8cbe8e0266b324 (patch) (unidiff)
treece3f535541583d37cfe951ddd8d7474770d9c374
parentb2cf8e9a08082539e0a5578a98766e5990783f9a (diff)
downloadkdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.zip
kdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.tar.gz
kdepimpi-451b4de59893b5c0801a7bbb2f8cbe8e0266b324.tar.bz2
month view fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--korganizer/datenavigator.cpp15
-rw-r--r--korganizer/datenavigator.h3
-rw-r--r--korganizer/komonthview.cpp8
-rw-r--r--korganizer/komonthview.h3
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/koviewmanager.cpp62
-rw-r--r--korganizer/koviewmanager.h2
-rw-r--r--korganizer/mainwindow.cpp12
-rw-r--r--korganizer/navigatorbar.cpp26
-rw-r--r--korganizer/navigatorbar.h4
13 files changed, 124 insertions, 19 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index a3ea5ee..3d8edfc 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,38 +1,40 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.0.8 ************ 3********** VERSION 2.0.8 ************
4 4
5Fixed a problem in dependency info in the ipk files for the Zaurus. 5Fixed a problem in dependency info in the ipk files for the Zaurus.
6 6
7Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar.
8
7 9
8********** VERSION 2.0.7 ************ 10********** VERSION 2.0.7 ************
9 11
10Added global application font settings 12Added global application font settings
11(for all KDE-Pim/Pi apps) to the general settings. 13(for all KDE-Pim/Pi apps) to the general settings.
12 14
13Fixed a problem in OM/Pi when trying to login to some IMAP servers 15Fixed a problem in OM/Pi when trying to login to some IMAP servers
14(like the IMAP server of Apple: mail.mac.com ) 16(like the IMAP server of Apple: mail.mac.com )
15 17
16Added recurring todos to KO/Pi. 18Added recurring todos to KO/Pi.
17 19
18 20
19********** VERSION 2.0.6 ************ 21********** VERSION 2.0.6 ************
20 22
21Some bugfixes in the pi-sync mode. 23Some bugfixes in the pi-sync mode.
22Added German translation for pi-sync mode. 24Added German translation for pi-sync mode.
23 25
24KO/Pi: 26KO/Pi:
25Made the todolist using alternate background. 27Made the todolist using alternate background.
26 28
27Other minor fixes in KO/Pi. 29Other minor fixes in KO/Pi.
28 30
29 31
30********** VERSION 2.0.5 ************ 32********** VERSION 2.0.5 ************
31 33
32Bugfixes in KO/Pi. 34Bugfixes in KO/Pi.
33 35
34********** VERSION 2.0.4 ************ 36********** VERSION 2.0.4 ************
35 37
36KO/Pi: 38KO/Pi:
37Fixed problem loading translations for summary/location edit boxes in event/todo editor. 39Fixed problem loading translations for summary/location edit boxes in event/todo editor.
38 40
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 2d4cb74..5f1bee4 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1242,43 +1242,43 @@
1242{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, 1242{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" },
1243{ "T: %1","T: %1" }, 1243{ "T: %1","T: %1" },
1244{ "Start: ","Start: " }, 1244{ "Start: ","Start: " },
1245{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 1245{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
1246{ "Password for remote access:","Passwort für fernen Zugriff:" }, 1246{ "Password for remote access:","Passwort für fernen Zugriff:" },
1247{ "Remote IP address:","Ferne IP Adresse:" }, 1247{ "Remote IP address:","Ferne IP Adresse:" },
1248{ "Remote port number:","Ferne Port Nummer:" }, 1248{ "Remote port number:","Ferne Port Nummer:" },
1249{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 1249{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
1250{ "Remote from: ","Fern von: " }, 1250{ "Remote from: ","Fern von: " },
1251{ "Local from: ","Lokal von: " }, 1251{ "Local from: ","Lokal von: " },
1252{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, 1252{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" },
1253{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 1253{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
1254{ "Write back","Schreibe zurück" }, 1254{ "Write back","Schreibe zurück" },
1255{ "KO/Pi Synchronization","KO/Pi Synchronisation" }, 1255{ "KO/Pi Synchronization","KO/Pi Synchronisation" },
1256{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 1256{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
1257{ "Received sync request","Sync Anfrage erhalten" }, 1257{ "Received sync request","Sync Anfrage erhalten" },
1258{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, 1258{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." },
1259{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1259{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1260{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1260{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1261{ "Sending file...","Sende Datei..." }, 1261{ "Sending file...","Sende Datei..." },
1262{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1262{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1263{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1263{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1264{ "Received %1 bytes","%1 Bytes erhalten" }, 1264{ "Received %1 bytes","%1 Bytes erhalten" },
1265{ "Writing file to disk...","Speichere Datei..." }, 1265{ "Writing file to disk...","Speichere Datei..." },
1266{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1266{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1267{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1267{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1268{ "Synchronize!","Synchronisiere!" }, 1268{ "Synchronize!","Synchronisiere!" },
1269{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1269{ "High clock skew!","Großer Uhrzeitunterschied!" },
1270{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1270{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1271{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, 1271{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
1272{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1272{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1273{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1273{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1274{ "","" }, 1274{ "List week view","Listenwochenansicht" },
1275{ "","" }, 1275{ "List week","Listenwochenansicht" },
1276{ "","" }, 1276{ "","" },
1277{ "","" }, 1277{ "","" },
1278{ "","" }, 1278{ "","" },
1279{ "","" }, 1279{ "","" },
1280{ "","" }, 1280{ "","" },
1281{ "","" }, 1281{ "","" },
1282{ "","" }, 1282{ "","" },
1283{ "","" }, 1283{ "","" },
1284{ "","" }, \ No newline at end of file 1284{ "","" }, \ No newline at end of file
diff --git a/korganizer/datenavigator.cpp b/korganizer/datenavigator.cpp
index 8b7c993..b0eac51 100644
--- a/korganizer/datenavigator.cpp
+++ b/korganizer/datenavigator.cpp
@@ -54,64 +54,70 @@ void DateNavigator::slotMonthSelect( int m )
54 if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) 54 if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 )
55 selectMonthByDate( firstSelected ); 55 selectMonthByDate( firstSelected );
56 else 56 else
57 selectWeekByDay( weekDay, firstSelected ); 57 selectWeekByDay( weekDay, firstSelected );
58 58
59} 59}
60 60
61void DateNavigator::slotDaySelect( QDate d ) 61void DateNavigator::slotDaySelect( QDate d )
62{ 62{
63 QDate firstSelected = mSelectedDates.first(); 63 QDate firstSelected = mSelectedDates.first();
64 int weekDay = firstSelected.dayOfWeek(); 64 int weekDay = firstSelected.dayOfWeek();
65 //int diff = firstSelected.daysTo( d ) ; 65 //int diff = firstSelected.daysTo( d ) ;
66 firstSelected = firstSelected.addDays( firstSelected .daysTo( d ) ); 66 firstSelected = firstSelected.addDays( firstSelected .daysTo( d ) );
67 67
68 selectWeekByDay( weekDay, firstSelected ); 68 selectWeekByDay( weekDay, firstSelected );
69 69
70} 70}
71 71
72void DateNavigator::selectMonthByDate( const QDate & firstSelected ) 72void DateNavigator::selectMonthByDate( const QDate & firstSelected )
73{ 73{
74 74
75 int monthDay = firstSelected.day(); 75 int monthDay = firstSelected.day();
76 QDate date = firstSelected.addDays( 1-monthDay ); 76 QDate date = firstSelected.addDays( 1-monthDay );
77 selectDates( date , date.daysInMonth ()); 77 selectDates( date , date.daysInMonth ());
78 78
79} 79}
80void DateNavigator::selectMonth() 80void DateNavigator::selectMonth()
81{ 81{
82 82
83 QDate date =mSelectedDates.first(); 83 QDate date =mSelectedDates.first();
84 selectMonthByDate( date ); 84 selectMonthByDate( date );
85} 85}
86void DateNavigator::selectMonthFromMonthview()
87{
88
89 QDate date =mSelectedDates.first().addDays( 7 );
90 selectMonthByDate( date );
91}
86 92
87DateList DateNavigator::selectedDates() 93DateList DateNavigator::selectedDates()
88{ 94{
89 return mSelectedDates; 95 return mSelectedDates;
90} 96}
91 97
92int DateNavigator::datesCount() const 98int DateNavigator::datesCount() const
93{ 99{
94 return mSelectedDates.count(); 100 return mSelectedDates.count();
95} 101}
96 102
97void DateNavigator::selectDates( const DateList& dateList ) 103void DateNavigator::selectDates( const DateList& dateList )
98{ 104{
99 if (dateList.count() > 0) { 105 if (dateList.count() > 0) {
100 mSelectedDates = dateList; 106 mSelectedDates = dateList;
101 emitSelected(); 107 emitSelected();
102 } 108 }
103} 109}
104 110
105void DateNavigator::selectDate( const QDate &date ) 111void DateNavigator::selectDate( const QDate &date )
106{ 112{
107 QDate d = date; 113 QDate d = date;
108 114
109 if ( !d.isValid() ) { 115 if ( !d.isValid() ) {
110 d = QDate::currentDate(); 116 d = QDate::currentDate();
111 } 117 }
112 118
113 mSelectedDates.clear(); 119 mSelectedDates.clear();
114 mSelectedDates.append( d ); 120 mSelectedDates.append( d );
115 121
116 emitSelected(); 122 emitSelected();
117} 123}
@@ -229,64 +235,73 @@ void DateNavigator::selectPreviousYear()
229 int weekDay = firstSelected.dayOfWeek(); 235 int weekDay = firstSelected.dayOfWeek();
230 firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 ); 236 firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 );
231 237
232 selectWeekByDay( weekDay, firstSelected ); 238 selectWeekByDay( weekDay, firstSelected );
233} 239}
234 240
235void DateNavigator::selectPreviousMonth() 241void DateNavigator::selectPreviousMonth()
236{ 242{
237 QDate firstSelected = mSelectedDates.first(); 243 QDate firstSelected = mSelectedDates.first();
238 int weekDay = firstSelected.dayOfWeek(); 244 int weekDay = firstSelected.dayOfWeek();
239 firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 ); 245 firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 );
240 246
241 247
242 if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) 248 if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 )
243 selectMonthByDate( firstSelected ); 249 selectMonthByDate( firstSelected );
244 else 250 else
245 selectWeekByDay( weekDay, firstSelected ); 251 selectWeekByDay( weekDay, firstSelected );
246} 252}
247 253
248void DateNavigator::selectNextMonth() 254void DateNavigator::selectNextMonth()
249{ 255{
250 QDate firstSelected = mSelectedDates.first(); 256 QDate firstSelected = mSelectedDates.first();
251 int weekDay = firstSelected.dayOfWeek(); 257 int weekDay = firstSelected.dayOfWeek();
252 258
253 firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, 1 ); 259 firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, 1 );
254 260
255 if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) 261 if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 )
256 selectMonthByDate( firstSelected ); 262 selectMonthByDate( firstSelected );
257 else 263 else
258 selectWeekByDay( weekDay, firstSelected ); 264 selectWeekByDay( weekDay, firstSelected );
259 265
260} 266}
267void DateNavigator::selectPreviousWeek()
268{
269 selectDates( mSelectedDates.first().addDays( -7 ), datesCount() );
270}
271
272void DateNavigator::selectNextWeek()
273{
274 selectDates( mSelectedDates.first().addDays( 7 ), datesCount() );
275}
261 276
262void DateNavigator::selectNextYear() 277void DateNavigator::selectNextYear()
263{ 278{
264 QDate firstSelected = mSelectedDates.first(); 279 QDate firstSelected = mSelectedDates.first();
265 int weekDay = firstSelected.dayOfWeek(); 280 int weekDay = firstSelected.dayOfWeek();
266 firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, 1 ); 281 firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, 1 );
267 282
268 selectWeekByDay( weekDay, firstSelected ); 283 selectWeekByDay( weekDay, firstSelected );
269} 284}
270 285
271void DateNavigator::selectPrevious() 286void DateNavigator::selectPrevious()
272{ 287{
273 int offset = -7; 288 int offset = -7;
274 if ( datesCount() == 1 ) { 289 if ( datesCount() == 1 ) {
275 offset = -1; 290 offset = -1;
276 } 291 }
277 if ( mViewManager ) 292 if ( mViewManager )
278 if ( mViewManager->showsNextDays() ) 293 if ( mViewManager->showsNextDays() )
279 offset = -datesCount(); 294 offset = -datesCount();
280 selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); 295 selectDates( mSelectedDates.first().addDays( offset ), datesCount() );
281} 296}
282 297
283void DateNavigator::selectNext() 298void DateNavigator::selectNext()
284{ 299{
285 int offset = 7; 300 int offset = 7;
286 if ( datesCount() == 1 ) { 301 if ( datesCount() == 1 ) {
287 offset = 1; 302 offset = 1;
288 } 303 }
289 if ( mViewManager ) 304 if ( mViewManager )
290 if ( mViewManager->showsNextDays() ) 305 if ( mViewManager->showsNextDays() )
291 offset = datesCount(); 306 offset = datesCount();
292 selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); 307 selectDates( mSelectedDates.first().addDays( offset ), datesCount() );
diff --git a/korganizer/datenavigator.h b/korganizer/datenavigator.h
index 4265e84..9742d41 100644
--- a/korganizer/datenavigator.h
+++ b/korganizer/datenavigator.h
@@ -38,54 +38,57 @@ class DateNavigator : public QObject
38 Q_OBJECT 38 Q_OBJECT
39 public: 39 public:
40 DateNavigator( QObject *parent = 0, const char *name = 0 , KOViewManager * v = 0); 40 DateNavigator( QObject *parent = 0, const char *name = 0 , KOViewManager * v = 0);
41 ~DateNavigator(); 41 ~DateNavigator();
42 42
43 KCal::DateList selectedDates(); 43 KCal::DateList selectedDates();
44 44
45 int datesCount() const; 45 int datesCount() const;
46 46
47 public slots: 47 public slots:
48 void selectDates( const KCal::DateList & ); 48 void selectDates( const KCal::DateList & );
49 void selectDate( const QDate & ); 49 void selectDate( const QDate & );
50 50
51 void selectDates( int count ); 51 void selectDates( int count );
52 void selectDates( const QDate &, int count ); 52 void selectDates( const QDate &, int count );
53 53
54 void selectWeek(); 54 void selectWeek();
55 void selectWeek( int weeknum ); 55 void selectWeek( int weeknum );
56 void selectWeekFromMonthView( int weeknum ); 56 void selectWeekFromMonthView( int weeknum );
57 void selectWeek( const QDate & ); 57 void selectWeek( const QDate & );
58 58
59 void selectWorkWeek(); 59 void selectWorkWeek();
60 void selectWorkWeek( const QDate & ); 60 void selectWorkWeek( const QDate & );
61 61
62 void selectWeekByDay( int weekDay, const QDate & ); 62 void selectWeekByDay( int weekDay, const QDate & );
63 63
64 void selectToday(); 64 void selectToday();
65 void selectTodayMonth(); 65 void selectTodayMonth();
66 66
67 void selectPreviousYear(); 67 void selectPreviousYear();
68 void selectPreviousMonth(); 68 void selectPreviousMonth();
69 void selectNextMonth(); 69 void selectNextMonth();
70 void selectPreviousWeek();
71 void selectNextWeek();
70 void selectNextYear(); 72 void selectNextYear();
71 73
72 void selectMonth(); 74 void selectMonth();
75 void selectMonthFromMonthview();
73 void selectMonthByDate( const QDate & ); 76 void selectMonthByDate( const QDate & );
74 77
75 void selectPrevious(); 78 void selectPrevious();
76 void selectNext(); 79 void selectNext();
77 void slotMonthSelect( int ); 80 void slotMonthSelect( int );
78 void slotDaySelect( QDate d ); 81 void slotDaySelect( QDate d );
79 82
80 signals: 83 signals:
81 void datesSelected( const KCal::DateList & ); 84 void datesSelected( const KCal::DateList & );
82 85
83 protected: 86 protected:
84 void emitSelected(); 87 void emitSelected();
85 88
86 private: 89 private:
87 KOViewManager * mViewManager; 90 KOViewManager * mViewManager;
88 KCal::DateList mSelectedDates; 91 KCal::DateList mSelectedDates;
89}; 92};
90 93
91#endif 94#endif
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index d0380e3..f9bc1ca 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -920,77 +920,79 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
920 920
921 //mWeekLabels[mNumWeeks]->setText( i18n("W")); 921 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
922 922
923#if 0 923#if 0
924 if ( mShowWeekView ) 924 if ( mShowWeekView )
925 mWidStack->raiseWidget( mWeekView ); 925 mWidStack->raiseWidget( mWeekView );
926 else 926 else
927 mWidStack->raiseWidget( mMonthView ); 927 mWidStack->raiseWidget( mMonthView );
928#endif 928#endif
929 929
930 emit incidenceSelected( 0 ); 930 emit incidenceSelected( 0 );
931#ifndef DESKTOP_VERSION 931#ifndef DESKTOP_VERSION
932 resize( QApplication::desktop()->size() ); 932 resize( QApplication::desktop()->size() );
933#else 933#else
934 resize(640, 480 ); 934 resize(640, 480 );
935 updatePossible = true; 935 updatePossible = true;
936#endif 936#endif
937 computeLayout(); 937 computeLayout();
938 938
939 if ( mShowWeekView ) 939 if ( mShowWeekView )
940 mWidStack->raiseWidget( mWeekView ); 940 mWidStack->raiseWidget( mWeekView );
941 else 941 else
942 mWidStack->raiseWidget( mMonthView ); 942 mWidStack->raiseWidget( mMonthView );
943} 943}
944 944
945KOMonthView::~KOMonthView() 945KOMonthView::~KOMonthView()
946{ 946{
947 delete mContextMenu; 947 delete mContextMenu;
948} 948}
949 949
950void KOMonthView::selectInternalWeekNum ( int n ) 950void KOMonthView::selectInternalWeekNum ( int n )
951{ 951{
952 switchView(); 952 switchView();
953 emit selectWeekNum ( n ); 953 if ( !KOPrefs::instance()->mMonthViewWeek )
954 emit selectMonth ();
955 else
956 emit selectWeekNum ( n );
954} 957}
955 958
956int KOMonthView::currentWeek() 959int KOMonthView::currentWeek()
957{ 960{
958 if ( mShowWeekView ) 961 if ( mShowWeekView )
959 return mWeekLabelsW[0]->getWeekNum(); 962 return mWeekLabelsW[0]->getWeekNum();
960 return mWeekLabels[0]->getWeekNum(); 963 return mWeekLabels[0]->getWeekNum();
961} 964}
962void KOMonthView::switchView() 965void KOMonthView::switchView()
963{ 966{
964
965 if ( selectedCell( ) ) 967 if ( selectedCell( ) )
966 selectedCell()->deselect(); 968 selectedCell()->deselect();
967 mShowWeekView = !mShowWeekView; 969 mShowWeekView = !mShowWeekView;
968 KOPrefs::instance()->mMonthViewWeek = mShowWeekView; 970 KOPrefs::instance()->mMonthViewWeek = mShowWeekView;
969 if ( clPending ) { 971 if ( clPending ) {
970 computeLayout(); 972 computeLayout();
971 updateConfig(); 973 updateConfig();
972 } 974 }
973 if ( mShowWeekView ) 975 if ( mShowWeekView )
974 mWidStack->raiseWidget( mWeekView ); 976 mWidStack->raiseWidget( mWeekView );
975 else 977 else
976 mWidStack->raiseWidget( mMonthView ); 978 mWidStack->raiseWidget( mMonthView );
977 clPending = false; 979 clPending = false;
978} 980}
979 981
980int KOMonthView::maxDatesHint() 982int KOMonthView::maxDatesHint()
981{ 983{
982 return mNumCells; 984 return mNumCells;
983} 985}
984 986
985int KOMonthView::currentDateCount() 987int KOMonthView::currentDateCount()
986{ 988{
987 return mNumCells; 989 return mNumCells;
988} 990}
989 991
990QPtrList<Incidence> KOMonthView::selectedIncidences() 992QPtrList<Incidence> KOMonthView::selectedIncidences()
991{ 993{
992 QPtrList<Incidence> selected; 994 QPtrList<Incidence> selected;
993 995
994 if ( mSelectedCell ) { 996 if ( mSelectedCell ) {
995 Incidence *incidence = mSelectedCell->selectedIncidence(); 997 Incidence *incidence = mSelectedCell->selectedIncidence();
996 if ( incidence ) selected.append( incidence ); 998 if ( incidence ) selected.append( incidence );
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 03f9dc6..2f6f5dc 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -214,73 +214,74 @@ class KOMonthView: public KOEventView
214 virtual int maxDatesHint(); 214 virtual int maxDatesHint();
215 215
216 /** Returns number of currently shown dates. */ 216 /** Returns number of currently shown dates. */
217 virtual int currentDateCount(); 217 virtual int currentDateCount();
218 218
219 /** returns the currently selected events */ 219 /** returns the currently selected events */
220 virtual QPtrList<Incidence> selectedIncidences(); 220 virtual QPtrList<Incidence> selectedIncidences();
221 221
222 /** returns dates of the currently selected events */ 222 /** returns dates of the currently selected events */
223 virtual DateList selectedDates(); 223 virtual DateList selectedDates();
224 224
225 virtual void printPreview(CalPrinter *calPrinter, 225 virtual void printPreview(CalPrinter *calPrinter,
226 const QDate &, const QDate &); 226 const QDate &, const QDate &);
227 bool isMonthView() { return true; } 227 bool isMonthView() { return true; }
228 bool isUpdatePossible() { return updatePossible; } 228 bool isUpdatePossible() { return updatePossible; }
229 229
230 MonthViewCell * selectedCell(); 230 MonthViewCell * selectedCell();
231 bool skipResize; 231 bool skipResize;
232 NavigatorBar* navigatorBar() { return mNavigatorBar ;} 232 NavigatorBar* navigatorBar() { return mNavigatorBar ;}
233 public slots: 233 public slots:
234 virtual void updateView(); 234 virtual void updateView();
235 virtual void updateConfig(); 235 virtual void updateConfig();
236 virtual void showDates(const QDate &start, const QDate &end); 236 virtual void showDates(const QDate &start, const QDate &end);
237 virtual void showEvents(QPtrList<Event> eventList); 237 virtual void showEvents(QPtrList<Event> eventList);
238 238
239 void changeEventDisplay(Event *, int); 239 void changeEventDisplay(Event *, int);
240 240
241 void clearSelection(); 241 void clearSelection();
242 242
243 void showContextMenu( Incidence * ); 243 void showContextMenu( Incidence * );
244 244
245 void setSelectedCell( MonthViewCell * ); 245 void setSelectedCell( MonthViewCell * );
246 void switchView();
246 247
247 protected slots: 248 protected slots:
248 void selectInternalWeekNum ( int ); 249 void selectInternalWeekNum ( int );
249 void switchView();
250 void processSelectionChange(); 250 void processSelectionChange();
251 signals: 251 signals:
252 void nextMonth(); 252 void nextMonth();
253 void prevMonth(); 253 void prevMonth();
254 void selectWeekNum ( int ); 254 void selectWeekNum ( int );
255 void selectMonth ();
255 void showDaySignal( QDate ); 256 void showDaySignal( QDate );
256 protected: 257 protected:
257 void resizeEvent(QResizeEvent *); 258 void resizeEvent(QResizeEvent *);
258 void viewChanged(); 259 void viewChanged();
259 void updateDayLabels(); 260 void updateDayLabels();
260 261
261 private: 262 private:
262 NavigatorBar* mNavigatorBar; 263 NavigatorBar* mNavigatorBar;
263 int currentWeek(); 264 int currentWeek();
264 bool clPending; 265 bool clPending;
265 QWidgetStack * mWidStack; 266 QWidgetStack * mWidStack;
266 QWidget* mMonthView; 267 QWidget* mMonthView;
267 QWidget* mWeekView; 268 QWidget* mWeekView;
268 bool mShowWeekView; 269 bool mShowWeekView;
269 bool updatePossible; 270 bool updatePossible;
270 int mDaysPerWeek; 271 int mDaysPerWeek;
271 int mNumWeeks; 272 int mNumWeeks;
272 int mNumCells; 273 int mNumCells;
273 bool mWeekStartsMonday; 274 bool mWeekStartsMonday;
274 bool mShowSatSunComp; 275 bool mShowSatSunComp;
275 void computeLayout(); 276 void computeLayout();
276 void computeLayoutWeek(); 277 void computeLayoutWeek();
277 278
278 QPtrVector<MonthViewCell> mCells; 279 QPtrVector<MonthViewCell> mCells;
279 QPtrVector<QLabel> mDayLabels; 280 QPtrVector<QLabel> mDayLabels;
280 QPtrVector<KOWeekButton> mWeekLabels; 281 QPtrVector<KOWeekButton> mWeekLabels;
281 QPtrVector<MonthViewCell> mCellsW; 282 QPtrVector<MonthViewCell> mCellsW;
282 QPtrVector<QLabel> mDayLabelsW; 283 QPtrVector<QLabel> mDayLabelsW;
283 QPtrVector<KOWeekButton> mWeekLabelsW; 284 QPtrVector<KOWeekButton> mWeekLabelsW;
284 285
285 bool mShortDayLabelsM; 286 bool mShortDayLabelsM;
286 bool mShortDayLabelsW; 287 bool mShortDayLabelsW;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 7efb6a6..5efc247 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -46,64 +46,65 @@
46 46
47#include "koprefs.h" 47#include "koprefs.h"
48#include "mainwindow.h" 48#include "mainwindow.h"
49 49
50KOPrefs *KOPrefs::mInstance = 0; 50KOPrefs *KOPrefs::mInstance = 0;
51static KStaticDeleter<KOPrefs> insd; 51static KStaticDeleter<KOPrefs> insd;
52 52
53KOPrefs::KOPrefs() : 53KOPrefs::KOPrefs() :
54 KPimPrefs("korganizerrc") 54 KPimPrefs("korganizerrc")
55{ 55{
56 mCategoryColors.setAutoDelete(true); 56 mCategoryColors.setAutoDelete(true);
57 fillMailDefaults(); 57 fillMailDefaults();
58 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 58 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
59 QColor defaultHolidayColor = QColor(255,0,0); 59 QColor defaultHolidayColor = QColor(255,0,0);
60 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 60 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
61 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 61 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
62 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 62 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
63 QColor defaultTodoDueTodayColor = QColor(255,220,100); 63 QColor defaultTodoDueTodayColor = QColor(255,220,100);
64 QColor defaultTodoOverdueColor = QColor(255,153,125); 64 QColor defaultTodoOverdueColor = QColor(255,153,125);
65 65
66 66
67 KPrefs::setCurrentGroup("General"); 67 KPrefs::setCurrentGroup("General");
68 68
69 69
70 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 70 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
71 71
72 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 72 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
73 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 73 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
74 addItemBool("ShowIconSearch",&mShowIconSearch,true); 74 addItemBool("ShowIconSearch",&mShowIconSearch,true);
75 addItemBool("ShowIconList",&mShowIconList,true); 75 addItemBool("ShowIconList",&mShowIconList,true);
76 addItemBool("ShowIconDay1",&mShowIconDay1,true); 76 addItemBool("ShowIconDay1",&mShowIconDay1,true);
77 addItemBool("ShowIconDay5",&mShowIconDay5,true); 77 addItemBool("ShowIconDay5",&mShowIconDay5,true);
78 addItemBool("ShowIconDay6",&mShowIconDay6,true);
78 addItemBool("ShowIconDay7",&mShowIconDay7,true); 79 addItemBool("ShowIconDay7",&mShowIconDay7,true);
79 addItemBool("ShowIconMonth",&mShowIconMonth,true); 80 addItemBool("ShowIconMonth",&mShowIconMonth,true);
80 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 81 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
81 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 82 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
82 addItemBool("ShowIconBack",&mShowIconBack,true); 83 addItemBool("ShowIconBack",&mShowIconBack,true);
83 addItemBool("ShowIconToday",&mShowIconToday,true); 84 addItemBool("ShowIconToday",&mShowIconToday,true);
84 addItemBool("ShowIconForward",&mShowIconForward,true); 85 addItemBool("ShowIconForward",&mShowIconForward,true);
85 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 86 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
86 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 87 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
87 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 88 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
88 addItemBool("ShowIconNext",&mShowIconNext,true); 89 addItemBool("ShowIconNext",&mShowIconNext,true);
89 addItemBool("ShowIconJournal",&mShowIconJournal,true); 90 addItemBool("ShowIconJournal",&mShowIconJournal,true);
90 addItemBool("ShowIconStretch",&mShowIconStretch,true); 91 addItemBool("ShowIconStretch",&mShowIconStretch,true);
91 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 92 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
92 93
93 addItemBool("AskForQuit",&mAskForQuit,false); 94 addItemBool("AskForQuit",&mAskForQuit,false);
94 95
95#ifndef DESKTOP_VERSION 96#ifndef DESKTOP_VERSION
96 addItemBool("ShowFullMenu",&mShowFullMenu,false); 97 addItemBool("ShowFullMenu",&mShowFullMenu,false);
97#else 98#else
98 addItemBool("ShowFullMenu",&mShowFullMenu,true); 99 addItemBool("ShowFullMenu",&mShowFullMenu,true);
99#endif 100#endif
100 addItemBool("ToolBarHor",&mToolBarHor, true ); 101 addItemBool("ToolBarHor",&mToolBarHor, true );
101 addItemBool("ToolBarUp",&mToolBarUp, false ); 102 addItemBool("ToolBarUp",&mToolBarUp, false );
102 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 103 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
103 addItemInt("Whats Next Days",&mWhatsNextDays,3); 104 addItemInt("Whats Next Days",&mWhatsNextDays,3);
104 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 105 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
105 106
106 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 107 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
107 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 108 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
108 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 109 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
109 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 110 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index fa69d52..e300067 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -142,64 +142,65 @@ class KOPrefs : public KPimPrefs
142 142
143 int mDayBegins; 143 int mDayBegins;
144 int mHourSize; 144 int mHourSize;
145 int mAllDaySize; 145 int mAllDaySize;
146 bool mShowFullMenu; 146 bool mShowFullMenu;
147 bool mDailyRecur; 147 bool mDailyRecur;
148 bool mWeeklyRecur; 148 bool mWeeklyRecur;
149 bool mMonthDailyRecur; 149 bool mMonthDailyRecur;
150 bool mMonthWeeklyRecur; 150 bool mMonthWeeklyRecur;
151 bool mMonthShowIcons; 151 bool mMonthShowIcons;
152 bool mMonthShowShort; 152 bool mMonthShowShort;
153 bool mEnableToolTips; 153 bool mEnableToolTips;
154 bool mEnableMonthScroll; 154 bool mEnableMonthScroll;
155 bool mFullViewMonth; 155 bool mFullViewMonth;
156 bool mMonthViewUsesCategoryColor; 156 bool mMonthViewUsesCategoryColor;
157 bool mFullViewTodo; 157 bool mFullViewTodo;
158 bool mShowCompletedTodo; 158 bool mShowCompletedTodo;
159 bool mMarcusBainsEnabled; 159 bool mMarcusBainsEnabled;
160 int mNextXDays; 160 int mNextXDays;
161 int mWhatsNextDays; 161 int mWhatsNextDays;
162 int mWhatsNextPrios; 162 int mWhatsNextPrios;
163 bool mEnableQuickTodo; 163 bool mEnableQuickTodo;
164 164
165 bool mCompactDialogs; 165 bool mCompactDialogs;
166 bool mVerticalScreen; 166 bool mVerticalScreen;
167 167
168 bool mShowIconNewTodo; 168 bool mShowIconNewTodo;
169 bool mShowIconNewEvent; 169 bool mShowIconNewEvent;
170 bool mShowIconSearch; 170 bool mShowIconSearch;
171 bool mShowIconList; 171 bool mShowIconList;
172 bool mShowIconDay1; 172 bool mShowIconDay1;
173 bool mShowIconDay5; 173 bool mShowIconDay5;
174 bool mShowIconDay6;
174 bool mShowIconDay7; 175 bool mShowIconDay7;
175 bool mShowIconMonth; 176 bool mShowIconMonth;
176 bool mShowIconTodoview; 177 bool mShowIconTodoview;
177 bool mShowIconBackFast; 178 bool mShowIconBackFast;
178 bool mShowIconBack; 179 bool mShowIconBack;
179 bool mShowIconToday; 180 bool mShowIconToday;
180 bool mShowIconForward; 181 bool mShowIconForward;
181 bool mShowIconForwardFast; 182 bool mShowIconForwardFast;
182 bool mShowIconWhatsThis; 183 bool mShowIconWhatsThis;
183 bool mShowIconNextDays; 184 bool mShowIconNextDays;
184 bool mShowIconNext; 185 bool mShowIconNext;
185 bool mShowIconJournal; 186 bool mShowIconJournal;
186 187
187 bool mShowIconStretch; 188 bool mShowIconStretch;
188 189
189 bool mToolBarHor; 190 bool mToolBarHor;
190 bool mToolBarUp; 191 bool mToolBarUp;
191 bool mToolBarMiniIcons; 192 bool mToolBarMiniIcons;
192 193
193 bool mAskForQuit; 194 bool mAskForQuit;
194 bool mUsePassWd; 195 bool mUsePassWd;
195 bool mShowSyncEvents; 196 bool mShowSyncEvents;
196 bool mShowTodoInAgenda; 197 bool mShowTodoInAgenda;
197 bool mShowTimeInAgenda; 198 bool mShowTimeInAgenda;
198 bool mHideNonStartedTodos; 199 bool mHideNonStartedTodos;
199 200
200 int mLastSyncTime; 201 int mLastSyncTime;
201 void setCategoryColor(QString cat,const QColor & color); 202 void setCategoryColor(QString cat,const QColor & color);
202 QColor *categoryColor(QString cat); 203 QColor *categoryColor(QString cat);
203 204
204 QString mArchiveFile; 205 QString mArchiveFile;
205 QString mHtmlExportFile; 206 QString mHtmlExportFile;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index f8f6c1d..e22f096 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -59,65 +59,70 @@ int globalFlagBlockAgendaItemUpdate = 1;
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") showMonthView(); 91 else if (view == "Month") {
92 if ( KOPrefs::instance()->mMonthViewWeek )
93 showMonthView();
94 else
95 showMonthViewWeek();
96 }
92 else if (view == "List") showListView(); 97 else if (view == "List") showListView();
93 else if (view == "Journal") showJournalView(); 98 else if (view == "Journal") showJournalView();
94 else if (view == "TimeSpan") showTimeSpanView(); 99 else if (view == "TimeSpan") showTimeSpanView();
95 else if (view == "Todo") showTodoView(); 100 else if (view == "Todo") showTodoView();
96 else { 101 else {
97 config->setGroup( "Views" ); 102 config->setGroup( "Views" );
98 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
99 mCurrentAgendaView = dateCount; 104 mCurrentAgendaView = dateCount;
100 showAgendaView(); 105 showAgendaView();
101 mCurrentAgendaView = dateCount; 106 mCurrentAgendaView = dateCount;
102#ifdef DESKTOP_VERSION 107#ifdef DESKTOP_VERSION
103 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); 108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) );
104#endif 109#endif
105 } 110 }
106} 111}
107 112
108void KOViewManager::showDateView( int view, QDate date) 113void KOViewManager::showDateView( int view, QDate date)
109{ 114{
110 static int lastMode = 0; 115 static int lastMode = 0;
111 static int lastCount = 0; 116 static int lastCount = 0;
112 static bool lastNDMode = false; 117 static bool lastNDMode = false;
113 static QDate lastDate; 118 static QDate lastDate;
114 //qDebug("date %d %s", view, date.toString().latin1()); 119 //qDebug("date %d %s", view, date.toString().latin1());
115 120
116 if (view != 9) 121 if (view != 9)
117 lastMode = 0; 122 lastMode = 0;
118 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); 123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays );
119 bool savemFlagShowNextxDays = mFlagShowNextxDays; 124 bool savemFlagShowNextxDays = mFlagShowNextxDays;
120 mFlagShowNextxDays = false; 125 mFlagShowNextxDays = false;
121 if ( view == 3 ) { 126 if ( view == 3 ) {
122 //mCurrentAgendaView = 1 ; 127 //mCurrentAgendaView = 1 ;
123 lastDate = mMainView->dateNavigator()->selectedDates().first(); 128 lastDate = mMainView->dateNavigator()->selectedDates().first();
@@ -178,65 +183,66 @@ void KOViewManager::writeSettings(KConfig *config)
178 else view = "Agenda"; 183 else view = "Agenda";
179 184
180 config->writeEntry("Current View",view); 185 config->writeEntry("Current View",view);
181 186
182 if (mAgendaView) { 187 if (mAgendaView) {
183 mAgendaView->writeSettings(config); 188 mAgendaView->writeSettings(config);
184 } 189 }
185 if (mTimeSpanView) { 190 if (mTimeSpanView) {
186 mTimeSpanView->writeSettings(config); 191 mTimeSpanView->writeSettings(config);
187 } 192 }
188 if (mListView) { 193 if (mListView) {
189 mListView->writeSettings(config); 194 mListView->writeSettings(config);
190 } 195 }
191 if (mTodoView) { 196 if (mTodoView) {
192 mTodoView->saveLayout(config,"Todo View"); 197 mTodoView->saveLayout(config,"Todo View");
193 } 198 }
194} 199}
195 200
196void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 201void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
197{ 202{
198 203
199 //mFlagShowNextxDays = false; 204 //mFlagShowNextxDays = false;
200 //if(view == mCurrentView) return; 205 //if(view == mCurrentView) return;
201 if ( view == 0 ) { 206 if ( view == 0 ) {
202 view = mCurrentView; 207 view = mCurrentView;
203 if ( view == 0 ) 208 if ( view == 0 )
204 return; 209 return;
205 } 210 }
206 bool full = fullScreen; 211 bool full = fullScreen;
207 if(view == mCurrentView && view != mWhatsNextView ) { 212 if(view == mCurrentView && view != mWhatsNextView ) {
208 if ( mCurrentAgendaView < 0 ) 213 if ( mCurrentAgendaView < 0 )
209 return; 214 return;
210 full = mMainView->leftFrame()->isVisible(); 215 if ( view != mMonthView )
216 full = mMainView->leftFrame()->isVisible();
211 } else { 217 } else {
212 if ( view == mMonthView && mMonthView) 218 if ( view == mMonthView && mMonthView)
213 ;//mMonthView->skipResize = true ; 219 ;//mMonthView->skipResize = true ;
214 mCurrentView = view; 220 mCurrentView = view;
215 // bool full = fullScreen; 221 // bool full = fullScreen;
216 bool isFull = !mMainView->leftFrame()->isVisible(); 222 bool isFull = !mMainView->leftFrame()->isVisible();
217 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 223 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
218 full = true; 224 full = true;
219 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 225 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
220 full = false; 226 full = false;
221 } 227 }
222 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 228 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
223 //raiseCurrentView( full ); 229 //raiseCurrentView( full );
224 mMainView->processIncidenceSelection( 0 ); 230 mMainView->processIncidenceSelection( 0 );
225 //mMainView->updateView(); 231 //mMainView->updateView();
226 raiseCurrentView( full, true ); 232 raiseCurrentView( full, true );
227 mMainView->adaptNavigationUnits(); 233 mMainView->adaptNavigationUnits();
228} 234}
229 235
230void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 236void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
231{ 237{
232 mCurrentAgendaView = 0; 238 mCurrentAgendaView = 0;
233 if ( fullScreen ) { 239 if ( fullScreen ) {
234 mMainView->leftFrame()->hide(); 240 mMainView->leftFrame()->hide();
235 } else { 241 } else {
236 mMainView->leftFrame()->show(); 242 mMainView->leftFrame()->show();
237 } 243 }
238 emit signalFullScreen( !fullScreen ); 244 emit signalFullScreen( !fullScreen );
239 if ( callUpdateView ) 245 if ( callUpdateView )
240 mMainView->updateView(); 246 mMainView->updateView();
241 247
242 if ( globalFlagBlockAgenda == 5 ) { 248 if ( globalFlagBlockAgenda == 5 ) {
@@ -457,129 +463,163 @@ void KOViewManager::showWeekView()
457 463
458 464
459 mFlagShowNextxDays = false; 465 mFlagShowNextxDays = false;
460 globalFlagBlockAgenda = 1; 466 globalFlagBlockAgenda = 1;
461 globalFlagBlockLabel = 1; 467 globalFlagBlockLabel = 1;
462 if ( mCurrentAgendaView != 7 ) 468 if ( mCurrentAgendaView != 7 )
463 mCurrentAgendaView = -1; 469 mCurrentAgendaView = -1;
464 showAgendaView(); 470 showAgendaView();
465 qApp->processEvents(); 471 qApp->processEvents();
466 globalFlagBlockAgenda = 2; 472 globalFlagBlockAgenda = 2;
467 globalFlagBlockLabel = 0; 473 globalFlagBlockLabel = 0;
468 mMainView->dateNavigator()->selectWeek(); 474 mMainView->dateNavigator()->selectWeek();
469 mCurrentAgendaView = 7 ; 475 mCurrentAgendaView = 7 ;
470} 476}
471 477
472void KOViewManager::showNextXView() 478void KOViewManager::showNextXView()
473{ 479{
474 480
475 globalFlagBlockAgenda = 1; 481 globalFlagBlockAgenda = 1;
476 if ( mCurrentAgendaView != 3 ) 482 if ( mCurrentAgendaView != 3 )
477 mCurrentAgendaView = -1; 483 mCurrentAgendaView = -1;
478 showAgendaView(KOPrefs::instance()->mFullViewMonth); 484 showAgendaView(KOPrefs::instance()->mFullViewMonth);
479 globalFlagBlockAgenda = 2; 485 globalFlagBlockAgenda = 2;
480 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 486 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
481 KOPrefs::instance()->mNextXDays ); 487 KOPrefs::instance()->mNextXDays );
482 mFlagShowNextxDays = true; 488 mFlagShowNextxDays = true;
483 mCurrentAgendaView = 3 ; 489 mCurrentAgendaView = 3 ;
484} 490}
485bool KOViewManager::showsNextDays() 491bool KOViewManager::showsNextDays()
486{ 492{
487 return mFlagShowNextxDays; 493 return mFlagShowNextxDays;
488} 494}
489void KOViewManager::showMonthView() 495void KOViewManager::createMonthView()
490 { 496{
491 if (!mMonthView) { 497if (!mMonthView) {
492 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 498 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
493 499
494 addView(mMonthView); 500 addView(mMonthView);
495 // mMonthView->show(); 501 // mMonthView->show();
496 // SIGNALS/SLOTS FOR MONTH VIEW 502 // SIGNALS/SLOTS FOR MONTH VIEW
497 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 503 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
498 mMainView, SLOT(newEvent(QDateTime))); 504 mMainView, SLOT(newEvent(QDateTime)));
499 505
500 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 506 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
501 mMainView, SLOT(showIncidence(Incidence *))); 507 mMainView, SLOT(showIncidence(Incidence *)));
502 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 508 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
503 mMainView, SLOT(editIncidence(Incidence *))); 509 mMainView, SLOT(editIncidence(Incidence *)));
504 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 510 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
505 mMainView, SLOT(deleteIncidence(Incidence *))); 511 mMainView, SLOT(deleteIncidence(Incidence *)));
506 512
507 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 513 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
508 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 514 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
509 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 515 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
510 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 516 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
511 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 517 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
512 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 518 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
513 519
514 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 520 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
515 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 521 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
516 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 522 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
517 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 523 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
518 connect( mMonthView, SIGNAL( selectWeekNum( int ) ), 524 connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
519 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); 525 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) );
526 connect( mMonthView, SIGNAL( selectMonth() ),
527 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) );
520 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), 528 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
521 mMainView, SLOT ( showDay( QDate ) ) ); 529 mMainView, SLOT ( showDay( QDate ) ) );
522 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); 530 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
523 connect( mMonthView, SIGNAL(nextMonth() ), 531 connect( mMonthView, SIGNAL(nextMonth() ),
524 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); 532 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) );
525 connect( mMonthView, SIGNAL(prevMonth() ), 533 connect( mMonthView, SIGNAL(prevMonth() ),
526 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); 534 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) );
527 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), 535 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ),
528 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); 536 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) );
529 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), 537 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ),
530 mMainView->dateNavigator(), SLOT( selectNextYear() ) ); 538 mMainView->dateNavigator(), SLOT( selectNextYear() ) );
531 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), 539 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ),
532 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); 540 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) );
533 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), 541 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ),
534 mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); 542 mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
543 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ),
544 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) );
545 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ),
546 mMainView->dateNavigator(), SLOT( selectNextWeek() ) );
535 547
536 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 548 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
537 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); 549 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) );
538 550
539 551
540 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), 552 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ),
541 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); 553 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) );
542 554
543 } 555 }
556}
557void KOViewManager::showMonthViewWeek()
558{
559 createMonthView();
560 bool full = true;
561 if ( mCurrentView == mMonthView)
562 full = mMainView->leftFrame()->isVisible();
563 if ( !KOPrefs::instance()->mMonthViewWeek ) {
564 mMonthView->switchView();
565 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
566 full = false;
567 else
568 full = true;
569 }
570 mMainView->dateNavigator()->selectWeek();
571 showView(mMonthView, full );
572}
544 573
574void KOViewManager::showMonthView()
575 {
576
577 createMonthView();
545 globalFlagBlockAgenda = 1; 578 globalFlagBlockAgenda = 1;
546 //mFlagShowNextxDays = false; 579 //mFlagShowNextxDays = false;
547 // if(mMonthView == mCurrentView) return; 580 bool full = true;
548 if ( KOPrefs::instance()->mMonthViewWeek ) 581 if ( mCurrentView == mMonthView)
549 mMainView->dateNavigator()->selectWeek(); 582 full = mMainView->leftFrame()->isVisible();
550 else 583 // if(mMonthView == mCurrentView) return;
551 mMainView->dateNavigator()->selectMonth(); 584 if ( KOPrefs::instance()->mMonthViewWeek ) {
585 mMonthView->switchView();
586 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
587 full = false;
588 else
589 full = true;
590 }
591 mMainView->dateNavigator()->selectMonth();
552 592
553 showView(mMonthView, true ); 593 showView(mMonthView, full );
554 594
555} 595}
556 596
557void KOViewManager::showTodoView() 597void KOViewManager::showTodoView()
558{ 598{
559 //mFlagShowNextxDays = false; 599 //mFlagShowNextxDays = false;
560 if ( !mTodoView ) { 600 if ( !mTodoView ) {
561 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 601 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
562 "KOViewManager::TodoView" ); 602 "KOViewManager::TodoView" );
563 603
564 addView( mTodoView ); 604 addView( mTodoView );
565 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 605 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
566 606
567 // SIGNALS/SLOTS FOR TODO VIEW 607 // SIGNALS/SLOTS FOR TODO VIEW
568 connect( mTodoView, SIGNAL( newTodoSignal() ), 608 connect( mTodoView, SIGNAL( newTodoSignal() ),
569 mMainView, SLOT( newTodo() ) ); 609 mMainView, SLOT( newTodo() ) );
570 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 610 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
571 mMainView, SLOT( newSubTodo( Todo *) ) ); 611 mMainView, SLOT( newSubTodo( Todo *) ) );
572 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 612 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
573 mMainView, SLOT( showTodo( Todo * ) ) ); 613 mMainView, SLOT( showTodo( Todo * ) ) );
574 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 614 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
575 mMainView, SLOT( editTodo( Todo * ) ) ); 615 mMainView, SLOT( editTodo( Todo * ) ) );
576 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 616 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
577 mMainView, SLOT( deleteTodo( Todo * ) ) ); 617 mMainView, SLOT( deleteTodo( Todo * ) ) );
578 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 618 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
579 mMainView, SLOT( purgeCompleted() ) ); 619 mMainView, SLOT( purgeCompleted() ) );
580 620
581 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 621 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
582 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 622 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
583 623
584 connect( mMainView, SIGNAL( configChanged() ), mTodoView, 624 connect( mMainView, SIGNAL( configChanged() ), mTodoView,
585 SLOT( updateConfig() ) ); 625 SLOT( updateConfig() ) );
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 66ab138..8f0bf82 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -63,56 +63,58 @@ class KOViewManager : public QObject
63 void writeCurrentView(KConfig *); 63 void writeCurrentView(KConfig *);
64 64
65 KOrg::BaseView *currentView(); 65 KOrg::BaseView *currentView();
66 66
67 void setDocumentId( const QString & ); 67 void setDocumentId( const QString & );
68 68
69 void updateView( const QDate &start, const QDate &end ); 69 void updateView( const QDate &start, const QDate &end );
70 70
71 void raiseCurrentView( bool fullScreen = false , bool updateView = false); 71 void raiseCurrentView( bool fullScreen = false , bool updateView = false);
72 72
73 void addView(KOrg::BaseView *); 73 void addView(KOrg::BaseView *);
74 74
75 Incidence *currentSelection(); 75 Incidence *currentSelection();
76 QDate currentSelectionDate(); 76 QDate currentSelectionDate();
77 77
78 KOAgendaView *agendaView() const { return mAgendaView; } 78 KOAgendaView *agendaView() const { return mAgendaView; }
79 79
80 signals: 80 signals:
81 void printWNV(); 81 void printWNV();
82 void signalFullScreen( bool ); 82 void signalFullScreen( bool );
83 void signalAgendaView( bool ); 83 void signalAgendaView( bool );
84 public slots: 84 public slots:
85 void showDateView( int, QDate ); 85 void showDateView( int, QDate );
86 void updateView(); 86 void updateView();
87 void showWhatsNextView(); 87 void showWhatsNextView();
88 void showListView(); 88 void showListView();
89 void showAgendaView( bool fullScreen = false ); 89 void showAgendaView( bool fullScreen = false );
90 void showDayView(); 90 void showDayView();
91 void showWorkWeekView(); 91 void showWorkWeekView();
92 void showWeekView(); 92 void showWeekView();
93 void showNextXView(); 93 void showNextXView();
94 void showMonthView(); 94 void showMonthView();
95 void showMonthViewWeek();
95 void showTodoView(); 96 void showTodoView();
96 void showJournalView(); 97 void showJournalView();
97 void showTimeSpanView(); 98 void showTimeSpanView();
98 99
99 private: 100 private:
101 void createMonthView();
100 CalendarView *mMainView; 102 CalendarView *mMainView;
101 103
102 int mCurrentAgendaView; 104 int mCurrentAgendaView;
103 KOAgendaView *mAgendaView; 105 KOAgendaView *mAgendaView;
104 KOListView *mListView; 106 KOListView *mListView;
105 KOMonthView *mMonthView; 107 KOMonthView *mMonthView;
106 KOTodoView *mTodoView; 108 KOTodoView *mTodoView;
107 KOWhatsNextView *mWhatsNextView; 109 KOWhatsNextView *mWhatsNextView;
108 KOJournalView *mJournalView; 110 KOJournalView *mJournalView;
109 KOTimeSpanView *mTimeSpanView; 111 KOTimeSpanView *mTimeSpanView;
110 112
111 KOrg::BaseView *mCurrentView; // currently active event view 113 KOrg::BaseView *mCurrentView; // currently active event view
112 114
113 int mAgendaViewMode; 115 int mAgendaViewMode;
114 bool mFlagShowNextxDays; 116 bool mFlagShowNextxDays;
115 117
116}; 118};
117 119
118#endif 120#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index ab0e4d6..16031b8 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -684,64 +684,71 @@ void MainWindow::initActions()
684 mView->viewManager(), SLOT( showListView() ) ); 684 mView->viewManager(), SLOT( showListView() ) );
685 685
686 686
687 icon = loadPixmap( pathString + "day" ); 687 icon = loadPixmap( pathString + "day" );
688 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 688 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
689 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 689 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
690 day1_action->addTo( viewMenu ); 690 day1_action->addTo( viewMenu );
691 // action->addTo( toolBar ); 691 // action->addTo( toolBar );
692 connect( day1_action, SIGNAL( activated() ), 692 connect( day1_action, SIGNAL( activated() ),
693 mView->viewManager(), SLOT( showDayView() ) ); 693 mView->viewManager(), SLOT( showDayView() ) );
694 694
695 icon = loadPixmap( pathString + "workweek" ); 695 icon = loadPixmap( pathString + "workweek" );
696 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 696 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
697 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 697 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
698 day5_action->addTo( viewMenu ); 698 day5_action->addTo( viewMenu );
699 connect( day5_action, SIGNAL( activated() ), 699 connect( day5_action, SIGNAL( activated() ),
700 mView->viewManager(), SLOT( showWorkWeekView() ) ); 700 mView->viewManager(), SLOT( showWorkWeekView() ) );
701 701
702 icon = loadPixmap( pathString + "week" ); 702 icon = loadPixmap( pathString + "week" );
703 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 703 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
704 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 704 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
705 day7_action->addTo( viewMenu ); 705 day7_action->addTo( viewMenu );
706 connect( day7_action, SIGNAL( activated() ), 706 connect( day7_action, SIGNAL( activated() ),
707 mView->viewManager(), SLOT( showWeekView() ) ); 707 mView->viewManager(), SLOT( showWeekView() ) );
708 708
709 icon = loadPixmap( pathString + "month" ); 709 icon = loadPixmap( pathString + "month" );
710 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 710 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
711 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 711 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
712 month_action->addTo( viewMenu ); 712 month_action->addTo( viewMenu );
713 connect( month_action, SIGNAL( activated() ), 713 connect( month_action, SIGNAL( activated() ),
714 mView->viewManager(), SLOT( showMonthView() ) ); 714 mView->viewManager(), SLOT( showMonthView() ) );
715 715
716 icon = loadPixmap( pathString + "workweek2" );
717 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
718 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
719 day6_action->addTo( viewMenu );
720 connect( day6_action, SIGNAL( activated() ),
721 mView->viewManager(), SLOT( showMonthViewWeek() ) );
722
716 icon = loadPixmap( pathString + "todo" ); 723 icon = loadPixmap( pathString + "todo" );
717 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 724 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
718 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 725 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
719 todoview_action->addTo( viewMenu ); 726 todoview_action->addTo( viewMenu );
720 connect( todoview_action, SIGNAL( activated() ), 727 connect( todoview_action, SIGNAL( activated() ),
721 mView->viewManager(), SLOT( showTodoView() ) ); 728 mView->viewManager(), SLOT( showTodoView() ) );
722 729
723 icon = loadPixmap( pathString + "journal" ); 730 icon = loadPixmap( pathString + "journal" );
724 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 731 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
725 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 732 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
726 viewjournal_action->addTo( viewMenu ); 733 viewjournal_action->addTo( viewMenu );
727 connect( viewjournal_action, SIGNAL( activated() ), 734 connect( viewjournal_action, SIGNAL( activated() ),
728 mView->viewManager(), SLOT( showJournalView() ) ); 735 mView->viewManager(), SLOT( showJournalView() ) );
729 736
730 icon = loadPixmap( pathString + "xdays" ); 737 icon = loadPixmap( pathString + "xdays" );
731 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); 738 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 );
732 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 739 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
733 xdays_action->addTo( viewMenu ); 740 xdays_action->addTo( viewMenu );
734 connect( xdays_action, SIGNAL( activated() ), 741 connect( xdays_action, SIGNAL( activated() ),
735 mView->viewManager(), SLOT( showNextXView() ) ); 742 mView->viewManager(), SLOT( showNextXView() ) );
736 743
737 icon = loadPixmap( pathString + "whatsnext" ); 744 icon = loadPixmap( pathString + "whatsnext" );
738 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); 745 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 );
739 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 746 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
740 whatsnext_action->addTo( viewMenu ); 747 whatsnext_action->addTo( viewMenu );
741 connect( whatsnext_action, SIGNAL( activated() ), 748 connect( whatsnext_action, SIGNAL( activated() ),
742 mView->viewManager(), SLOT( showWhatsNextView() ) ); 749 mView->viewManager(), SLOT( showWhatsNextView() ) );
743 750
744#if 0 751#if 0
745 action = new QAction( "view_timespan", "Time Span", 0, this ); 752 action = new QAction( "view_timespan", "Time Span", 0, this );
746 action->addTo( viewMenu ); 753 action->addTo( viewMenu );
747 connect( action, SIGNAL( activated() ), 754 connect( action, SIGNAL( activated() ),
@@ -966,120 +973,124 @@ void MainWindow::initActions()
966 action->addTo( helpMenu ); 973 action->addTo( helpMenu );
967 connect( action, SIGNAL( activated() ), 974 connect( action, SIGNAL( activated() ),
968 SLOT( about() ) ); 975 SLOT( about() ) );
969 //menuBar->insertSeparator(); 976 //menuBar->insertSeparator();
970 977
971 // ****************************************************** 978 // ******************************************************
972 // menubar icons 979 // menubar icons
973 980
974 981
975 iconToolBar->setHorizontalStretchable (true ); 982 iconToolBar->setHorizontalStretchable (true );
976 //menuBar->insertItem( iconToolBar ); 983 //menuBar->insertItem( iconToolBar );
977 //xdays_action 984 //xdays_action
978 if (p-> mShowIconNewEvent) 985 if (p-> mShowIconNewEvent)
979 ne_action->addTo( iconToolBar ); 986 ne_action->addTo( iconToolBar );
980 if (p->mShowIconNewTodo ) 987 if (p->mShowIconNewTodo )
981 nt_action->addTo( iconToolBar ); 988 nt_action->addTo( iconToolBar );
982 if (p-> mShowIconSearch) 989 if (p-> mShowIconSearch)
983 search_action->addTo( iconToolBar ); 990 search_action->addTo( iconToolBar );
984 if (p-> mShowIconNext) 991 if (p-> mShowIconNext)
985 whatsnext_action->addTo( iconToolBar ); 992 whatsnext_action->addTo( iconToolBar );
986 if (p-> mShowIconNextDays) 993 if (p-> mShowIconNextDays)
987 xdays_action->addTo( iconToolBar ); 994 xdays_action->addTo( iconToolBar );
988 if (p-> mShowIconList) 995 if (p-> mShowIconList)
989 showlist_action->addTo( iconToolBar ); 996 showlist_action->addTo( iconToolBar );
990 if (p-> mShowIconDay1) 997 if (p-> mShowIconDay1)
991 day1_action->addTo( iconToolBar ); 998 day1_action->addTo( iconToolBar );
992 if (p-> mShowIconDay5) 999 if (p-> mShowIconDay5)
993 day5_action->addTo( iconToolBar ); 1000 day5_action->addTo( iconToolBar );
994 if (p-> mShowIconDay7) 1001 if (p-> mShowIconDay7)
995 day7_action->addTo( iconToolBar ); 1002 day7_action->addTo( iconToolBar );
996 if (p-> mShowIconMonth) 1003 if (p-> mShowIconMonth)
997 month_action->addTo( iconToolBar ); 1004 month_action->addTo( iconToolBar );
1005 if (p-> mShowIconDay6)
1006 day6_action->addTo( iconToolBar );
998 if (p-> mShowIconTodoview) 1007 if (p-> mShowIconTodoview)
999 todoview_action->addTo( iconToolBar ); 1008 todoview_action->addTo( iconToolBar );
1000 if (p-> mShowIconJournal) 1009 if (p-> mShowIconJournal)
1001 viewjournal_action->addTo( iconToolBar ); 1010 viewjournal_action->addTo( iconToolBar );
1002 icon = loadPixmap( pathString + "2leftarrowB" ); 1011 icon = loadPixmap( pathString + "2leftarrowB" );
1003 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 1012 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
1004 if (p-> mShowIconBackFast) { 1013 if (p-> mShowIconBackFast) {
1005 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1014 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1006 connect( action, SIGNAL( activated() ), 1015 connect( action, SIGNAL( activated() ),
1007 mView, SLOT( goPreviousMonth() ) ); 1016 mView, SLOT( goPreviousMonth() ) );
1008 action->addTo( iconToolBar ); 1017 action->addTo( iconToolBar );
1009 } 1018 }
1010 icon = loadPixmap( pathString + "1leftarrowB" ); 1019 icon = loadPixmap( pathString + "1leftarrowB" );
1011 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 1020 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
1012 if (p-> mShowIconBack) { 1021 if (p-> mShowIconBack) {
1013 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1022 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1014 connect( action, SIGNAL( activated() ), 1023 connect( action, SIGNAL( activated() ),
1015 mView, SLOT( goPrevious() ) ); 1024 mView, SLOT( goPrevious() ) );
1016 action->addTo( iconToolBar ); 1025 action->addTo( iconToolBar );
1017 } 1026 }
1018 icon = loadPixmap( pathString + "today" ); 1027 icon = loadPixmap( pathString + "today" );
1019 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1028 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1020 if (p-> mShowIconToday) 1029 if (p-> mShowIconToday)
1021 today_action->addTo( iconToolBar ); 1030 today_action->addTo( iconToolBar );
1022 icon = loadPixmap( pathString + "1rightarrowB" ); 1031 icon = loadPixmap( pathString + "1rightarrowB" );
1023 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1032 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1024 if (p-> mShowIconForward) { 1033 if (p-> mShowIconForward) {
1025 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1034 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1026 connect( action, SIGNAL( activated() ), 1035 connect( action, SIGNAL( activated() ),
1027 mView, SLOT( goNext() ) ); 1036 mView, SLOT( goNext() ) );
1028 action->addTo( iconToolBar ); 1037 action->addTo( iconToolBar );
1029 } 1038 }
1030 icon = loadPixmap( pathString + "2rightarrowB" ); 1039 icon = loadPixmap( pathString + "2rightarrowB" );
1031 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1040 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1032 if (p-> mShowIconForwardFast) { 1041 if (p-> mShowIconForwardFast) {
1033 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1042 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1034 connect( action, SIGNAL( activated() ), 1043 connect( action, SIGNAL( activated() ),
1035 mView, SLOT( goNextMonth() ) ); 1044 mView, SLOT( goNextMonth() ) );
1036 action->addTo( iconToolBar ); 1045 action->addTo( iconToolBar );
1037 } 1046 }
1038 1047
1039 1048
1040 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 1049 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
1041 1050
1042 if (p-> mShowIconNewEvent) 1051 if (p-> mShowIconNewEvent)
1043 configureToolBarMenu->setItemChecked( 10, true ); 1052 configureToolBarMenu->setItemChecked( 10, true );
1044 if (p->mShowIconNewTodo ) 1053 if (p->mShowIconNewTodo )
1045 configureToolBarMenu->setItemChecked( 20, true ); 1054 configureToolBarMenu->setItemChecked( 20, true );
1046 if (p-> mShowIconSearch) 1055 if (p-> mShowIconSearch)
1047 configureToolBarMenu->setItemChecked( 120, true ); 1056 configureToolBarMenu->setItemChecked( 120, true );
1048 if (p-> mShowIconList) 1057 if (p-> mShowIconList)
1049 configureToolBarMenu->setItemChecked( 30, true ); 1058 configureToolBarMenu->setItemChecked( 30, true );
1050 if (p-> mShowIconDay1) 1059 if (p-> mShowIconDay1)
1051 configureToolBarMenu->setItemChecked( 40, true ); 1060 configureToolBarMenu->setItemChecked( 40, true );
1052 if (p-> mShowIconDay5) 1061 if (p-> mShowIconDay5)
1053 configureToolBarMenu->setItemChecked( 50, true ); 1062 configureToolBarMenu->setItemChecked( 50, true );
1063 if (p-> mShowIconDay6)
1064 configureToolBarMenu->setItemChecked( 75, true );
1054 if (p-> mShowIconDay7) 1065 if (p-> mShowIconDay7)
1055 configureToolBarMenu->setItemChecked( 60, true ); 1066 configureToolBarMenu->setItemChecked( 60, true );
1056 if (p-> mShowIconMonth) 1067 if (p-> mShowIconMonth)
1057 configureToolBarMenu->setItemChecked( 70, true ); 1068 configureToolBarMenu->setItemChecked( 70, true );
1058 if (p-> mShowIconTodoview) 1069 if (p-> mShowIconTodoview)
1059 configureToolBarMenu->setItemChecked( 80, true ); 1070 configureToolBarMenu->setItemChecked( 80, true );
1060 if (p-> mShowIconBackFast) 1071 if (p-> mShowIconBackFast)
1061 configureToolBarMenu->setItemChecked( 200, true ); 1072 configureToolBarMenu->setItemChecked( 200, true );
1062 if (p-> mShowIconBack) 1073 if (p-> mShowIconBack)
1063 configureToolBarMenu->setItemChecked( 210, true ); 1074 configureToolBarMenu->setItemChecked( 210, true );
1064 if (p-> mShowIconToday) 1075 if (p-> mShowIconToday)
1065 configureToolBarMenu->setItemChecked( 130, true ); 1076 configureToolBarMenu->setItemChecked( 130, true );
1066 if (p-> mShowIconForward) 1077 if (p-> mShowIconForward)
1067 configureToolBarMenu->setItemChecked( 220, true ); 1078 configureToolBarMenu->setItemChecked( 220, true );
1068 if (p-> mShowIconForwardFast) 1079 if (p-> mShowIconForwardFast)
1069 configureToolBarMenu->setItemChecked( 230, true ); 1080 configureToolBarMenu->setItemChecked( 230, true );
1070 if (p-> mShowIconNextDays) 1081 if (p-> mShowIconNextDays)
1071 configureToolBarMenu->setItemChecked( 100, true ); 1082 configureToolBarMenu->setItemChecked( 100, true );
1072 if (p-> mShowIconNext) 1083 if (p-> mShowIconNext)
1073 configureToolBarMenu->setItemChecked( 110, true ); 1084 configureToolBarMenu->setItemChecked( 110, true );
1074 if (p-> mShowIconJournal) 1085 if (p-> mShowIconJournal)
1075 configureToolBarMenu->setItemChecked( 90, true ); 1086 configureToolBarMenu->setItemChecked( 90, true );
1076 if (p-> mShowIconWhatsThis) 1087 if (p-> mShowIconWhatsThis)
1077 configureToolBarMenu->setItemChecked( 300, true ); 1088 configureToolBarMenu->setItemChecked( 300, true );
1078 1089
1079 QLabel* dummy = new QLabel( iconToolBar ); 1090 QLabel* dummy = new QLabel( iconToolBar );
1080 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1091 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1081 if (!p-> mShowIconStretch) 1092 if (!p-> mShowIconStretch)
1082 iconToolBar->setStretchableWidget ( dummy ) ; 1093 iconToolBar->setStretchableWidget ( dummy ) ;
1083 else 1094 else
1084 configureToolBarMenu->setItemChecked( 5, true ); 1095 configureToolBarMenu->setItemChecked( 5, true );
1085 if (p-> mShowIconWhatsThis) 1096 if (p-> mShowIconWhatsThis)
@@ -1770,64 +1781,65 @@ void MainWindow::fillFilterMenu()
1770 while(filter) { 1781 while(filter) {
1771 selectFilterMenu->insertItem( filter->name(), iii ); 1782 selectFilterMenu->insertItem( filter->name(), iii );
1772 if ( filter == curfilter) 1783 if ( filter == curfilter)
1773 selectFilterMenu->setItemChecked( iii, true ); 1784 selectFilterMenu->setItemChecked( iii, true );
1774 if ( disable ) 1785 if ( disable )
1775 selectFilterMenu->setItemEnabled( iii, false ); 1786 selectFilterMenu->setItemEnabled( iii, false );
1776 filter = fili.next(); 1787 filter = fili.next();
1777 ++iii; 1788 ++iii;
1778 } 1789 }
1779} 1790}
1780void MainWindow::selectFilter( int fil ) 1791void MainWindow::selectFilter( int fil )
1781{ 1792{
1782 if ( fil == 0 ) { 1793 if ( fil == 0 ) {
1783 mView->editFilters( ); 1794 mView->editFilters( );
1784 } else if ( fil == 1 ){ 1795 } else if ( fil == 1 ){
1785 mView->toggleFilerEnabled( ); 1796 mView->toggleFilerEnabled( );
1786 } else { 1797 } else {
1787 mView->selectFilter( fil-2 ); 1798 mView->selectFilter( fil-2 );
1788 } 1799 }
1789} 1800}
1790void MainWindow::configureToolBar( int item ) 1801void MainWindow::configureToolBar( int item )
1791{ 1802{
1792 1803
1793 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 1804 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
1794 KOPrefs *p = KOPrefs::instance(); 1805 KOPrefs *p = KOPrefs::instance();
1795 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 1806 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
1796 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 1807 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
1797 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 1808 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
1798 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 1809 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
1799 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 1810 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
1800 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 1811 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
1801 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 1812 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
1813 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
1802 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 1814 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
1803 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 1815 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
1804 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 1816 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
1805 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 1817 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
1806 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 1818 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
1807 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 1819 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
1808 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 1820 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
1809 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 1821 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
1810 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 1822 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
1811 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 1823 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
1812 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 1824 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
1813 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 1825 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
1814 // initActions(); 1826 // initActions();
1815} 1827}
1816 1828
1817void MainWindow::setCaptionToDates() 1829void MainWindow::setCaptionToDates()
1818{ 1830{
1819 QString selDates; 1831 QString selDates;
1820 selDates = KGlobal::locale()->formatDate(mView->startDate(), true); 1832 selDates = KGlobal::locale()->formatDate(mView->startDate(), true);
1821 if (mView->startDate() < mView->endDate() ) 1833 if (mView->startDate() < mView->endDate() )
1822 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 1834 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
1823 else { 1835 else {
1824 QString addString; 1836 QString addString;
1825 if ( mView->startDate() == QDateTime::currentDateTime().date() ) 1837 if ( mView->startDate() == QDateTime::currentDateTime().date() )
1826 addString = i18n("Today"); 1838 addString = i18n("Today");
1827 else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) 1839 else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) )
1828 addString = i18n("Tomorrow"); 1840 addString = i18n("Tomorrow");
1829 if ( !addString.isEmpty() ) 1841 if ( !addString.isEmpty() )
1830 selDates = addString+", "+selDates ; 1842 selDates = addString+", "+selDates ;
1831 } 1843 }
1832 setCaption( i18n("Dates: ") + selDates ); 1844 setCaption( i18n("Dates: ") + selDates );
1833 1845
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index b591232..934e153 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -60,128 +60,150 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
60 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); 60 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised);
61 mCtrlFrame->setLineWidth(1); 61 mCtrlFrame->setLineWidth(1);
62 62
63 topLayout->addWidget( mCtrlFrame ); 63 topLayout->addWidget( mCtrlFrame );
64 64
65 QFont tfont = font(); 65 QFont tfont = font();
66 if ( QApplication::desktop()->width() >= 480 ) 66 if ( QApplication::desktop()->width() >= 480 )
67 tfont.setPointSize(tfont.pointSize()+2); 67 tfont.setPointSize(tfont.pointSize()+2);
68 tfont.setBold(true); 68 tfont.setBold(true);
69 69
70 bool isRTL = KOGlobals::self()->reverseLayout(); 70 bool isRTL = KOGlobals::self()->reverseLayout();
71#ifndef DESKTOP_VERSION 71#ifndef DESKTOP_VERSION
72 bool isDesktop = false; 72 bool isDesktop = false;
73#else 73#else
74 bool isDesktop = true; 74 bool isDesktop = true;
75#endif 75#endif
76 if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 ) 76 if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 )
77 isDesktop = true; 77 isDesktop = true;
78 // Create backward navigation buttons 78 // Create backward navigation buttons
79 mPrevYear = new QPushButton( mCtrlFrame ); 79 mPrevYear = new QPushButton( mCtrlFrame );
80 mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) ); 80 mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) );
81 QToolTip::add( mPrevYear, i18n("Previous Year") ); 81 QToolTip::add( mPrevYear, i18n("Previous Year") );
82 82
83 mPrevMonth = new QPushButton( mCtrlFrame ); 83 mPrevMonth = new QPushButton( mCtrlFrame );
84 mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); 84 mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
85 QToolTip::add( mPrevMonth, i18n("Previous Month") ); 85 QToolTip::add( mPrevMonth, i18n("Previous Month") );
86 86
87 // Create forward navigation buttons 87 // Create forward navigation buttons
88 mNextMonth = new QPushButton( mCtrlFrame ); 88 mNextMonth = new QPushButton( mCtrlFrame );
89 mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); 89 mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
90 QToolTip::add( mNextMonth, i18n("Next Month") ); 90 QToolTip::add( mNextMonth, i18n("Next Month") );
91 91
92 mPrevWeek = new QPushButton( mCtrlFrame );
93 mPrevWeek->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
94 QToolTip::add( mPrevWeek, i18n("Previous Week") );
95
96 // Create forward navigation buttons
97 mNextWeek = new QPushButton( mCtrlFrame );
98 mNextWeek->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
99 QToolTip::add( mNextWeek, i18n("Next Week") );
100
92 mNextYear = new QPushButton( mCtrlFrame ); 101 mNextYear = new QPushButton( mCtrlFrame );
93 mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); 102 mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") );
94 QToolTip::add( mNextYear, i18n("Next Year") ); 103 QToolTip::add( mNextYear, i18n("Next Year") );
95 mSelectMonth = new QPushButton( mCtrlFrame ); 104 mSelectMonth = new QPushButton( mCtrlFrame );
96 // Create month name label 105 // Create month name label
97 //selectMonth->setFont( tfont ); 106 //selectMonth->setFont( tfont );
98 // selectMonth->setAlignment( AlignCenter ); 107 // selectMonth->setAlignment( AlignCenter );
99 //mDateLabel = new QLabel( selectMonth ); 108 //mDateLabel = new QLabel( selectMonth );
100 //mDateLabel->setFont( tfont ); 109 //mDateLabel->setFont( tfont );
101 //mDateLabel->setAlignment( AlignCenter ); 110 //mDateLabel->setAlignment( AlignCenter );
102 if ( QString ( name ) == QString("useBigPixmaps") ) { 111 if ( QString ( name ) == QString("useBigPixmaps") ) {
103 mNextMonth->setFlat( true); 112 mNextMonth->setFlat( true);
113 mNextWeek->setFlat( true);
104 mNextYear->setFlat( true); 114 mNextYear->setFlat( true);
105 mSelectMonth->setFlat( true); 115 mSelectMonth->setFlat( true);
106 mPrevYear->setFlat( true); 116 mPrevYear->setFlat( true);
107 mPrevMonth->setFlat( true); 117 mPrevMonth->setFlat( true);
118 mPrevWeek->setFlat( true);
119 } else {
120 mPrevWeek->hide();
121 mNextWeek->hide();
108 } 122 }
109 mSelectMonth->setFont( tfont ); 123 mSelectMonth->setFont( tfont );
110 // Set minimum width to width of widest month name label 124 // Set minimum width to width of widest month name label
111 int i; 125 int i;
112 int maxwidth = 0; 126 int maxwidth = 0;
113 QFontMetrics fm ( mSelectMonth->font() ); 127 QFontMetrics fm ( mSelectMonth->font() );
114 int width = fm.width("September '00" ); 128 int width = fm.width("September '00" );
115// for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date); 129// for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date);
116// ++i ) { 130// ++i ) {
117// //int width = fm.width( KOGlobals::self()->calendarSystem()->monthName(i, 131// //int width = fm.width( KOGlobals::self()->calendarSystem()->monthName(i,
118// // KOGlobals::self()->calendarSystem()->year(date) ) + " 2000" ); 132// // KOGlobals::self()->calendarSystem()->year(date) ) + " 2000" );
119// int width = fm.width("September 2000" ); 133// int width = fm.width("September 2000" );
120// if ( width > maxwidth ) maxwidth = width; 134// if ( width > maxwidth ) maxwidth = width;
121// } 135// }
122 maxwidth = width+2; 136 maxwidth = width+2;
123 int size = fm.height()+2; 137 int size = fm.height()+2;
124 if ( QApplication::desktop()->width() >= 480 ) { 138 if ( QApplication::desktop()->width() >= 480 ) {
125 size += 6; 139 size += 6;
126 maxwidth+= 6; 140 maxwidth+= 6;
127 } 141 }
128 142
129 mSelectMonth->setFixedWidth( maxwidth ); 143 mSelectMonth->setFixedWidth( maxwidth );
130 mSelectMonth->setFixedHeight( size ); 144 mSelectMonth->setFixedHeight( size );
131 mPrevYear->setFixedHeight( size ); 145 mPrevYear->setFixedHeight( size );
132 mPrevMonth->setFixedHeight( size ); 146 mPrevMonth->setFixedHeight( size );
133 mNextMonth->setFixedHeight( size ); 147 mPrevWeek->setFixedHeight( size );
148 mNextMonth->setFixedHeight( size );
149 mNextWeek->setFixedHeight( size );
134 mNextYear->setFixedHeight ( size ); 150 mNextYear->setFixedHeight ( size );
135 // set up control frame layout 151 // set up control frame layout
136 QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); 152 QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 );
137 ctrlLayout->addWidget( mPrevYear, 3 ); 153 ctrlLayout->addWidget( mPrevYear, 3 );
138 ctrlLayout->addWidget( mPrevMonth, 3 ); 154 ctrlLayout->addWidget( mPrevMonth, 3 );
155 ctrlLayout->addWidget( mPrevWeek, 3 );
139 //ctrlLayout->addStretch( 1 ); 156 //ctrlLayout->addStretch( 1 );
140 // ctrlLayout->addSpacing( 1 ); 157 // ctrlLayout->addSpacing( 1 );
141 // ctrlLayout->addWidget( mDateLabel ); 158 // ctrlLayout->addWidget( mDateLabel );
142 ctrlLayout->addWidget( mSelectMonth ); 159 ctrlLayout->addWidget( mSelectMonth );
143 // ctrlLayout->addSpacing( 1 ); 160 // ctrlLayout->addSpacing( 1 );
144 // ctrlLayout->addStretch( 1 ); 161 // ctrlLayout->addStretch( 1 );
162 ctrlLayout->addWidget( mNextWeek, 3 );
145 ctrlLayout->addWidget( mNextMonth, 3 ); 163 ctrlLayout->addWidget( mNextMonth, 3 );
146 ctrlLayout->addWidget( mNextYear, 3 ); 164 ctrlLayout->addWidget( mNextYear, 3 );
147 165
148 connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); 166 connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) );
149 connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); 167 connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) );
150 connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); 168 connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) );
169 connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) );
170 connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) );
151 connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); 171 connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) );
152 connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); 172 connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) );
153 mPrevYear->setFocusPolicy(NoFocus); 173 mPrevYear->setFocusPolicy(NoFocus);
154 mPrevMonth->setFocusPolicy(NoFocus); 174 mPrevMonth->setFocusPolicy(NoFocus);
155 mNextMonth->setFocusPolicy(NoFocus); 175 mNextMonth->setFocusPolicy(NoFocus);
176 mPrevWeek->setFocusPolicy(NoFocus);
177 mNextWeek->setFocusPolicy(NoFocus);
156 mNextYear->setFocusPolicy(NoFocus); 178 mNextYear->setFocusPolicy(NoFocus);
157 mSelectMonth->setFocusPolicy(NoFocus); 179 mSelectMonth->setFocusPolicy(NoFocus);
158 setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); 180 setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) );
159 181
160} 182}
161 183
162NavigatorBar::~NavigatorBar() 184NavigatorBar::~NavigatorBar()
163{ 185{
164} 186}
165 187
166void NavigatorBar::selectMonth() 188void NavigatorBar::selectMonth()
167{ 189{
168 190
169 int month; 191 int month;
170 KPopupFrame* popup = new KPopupFrame(this); 192 KPopupFrame* popup = new KPopupFrame(this);
171 KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup); 193 KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup);
172 // ----- 194 // -----
173 picker->resize(picker->sizeHint()); 195 picker->resize(picker->sizeHint());
174 popup->setMainWidget(picker); 196 popup->setMainWidget(picker);
175 picker->setFocus(); 197 picker->setFocus();
176 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 198 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
177 if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height())))) 199 if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height()))))
178 { 200 {
179 month = picker->getResult(); 201 month = picker->getResult();
180 emit monthSelected ( month ); 202 emit monthSelected ( month );
181 } else { 203 } else {
182 KNotifyClient::beep(); 204 KNotifyClient::beep();
183 } 205 }
184 delete popup; 206 delete popup;
185} 207}
186void NavigatorBar::selectDates( const KCal::DateList &dateList ) 208void NavigatorBar::selectDates( const KCal::DateList &dateList )
187{ 209{
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 93240a6..803c817 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -17,49 +17,53 @@
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef NAVIGATORBAR_H 24#ifndef NAVIGATORBAR_H
25#define NAVIGATORBAR_H 25#define NAVIGATORBAR_H
26 26
27#include <libkcal/incidencebase.h> 27#include <libkcal/incidencebase.h>
28 28
29#include <qwidget.h> 29#include <qwidget.h>
30 30
31class QPushButton; 31class QPushButton;
32class QFrame; 32class QFrame;
33class QLabel; 33class QLabel;
34 34
35class NavigatorBar: public QWidget 35class NavigatorBar: public QWidget
36{ 36{
37 Q_OBJECT 37 Q_OBJECT
38 public: 38 public:
39 NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 ); 39 NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 );
40 ~NavigatorBar(); 40 ~NavigatorBar();
41 41
42 public slots: 42 public slots:
43 void selectDates( const KCal::DateList & ); 43 void selectDates( const KCal::DateList & );
44 void selectMonth(); 44 void selectMonth();
45 45
46 signals: 46 signals:
47 void goNextMonth(); 47 void goNextMonth();
48 void goPrevMonth(); 48 void goPrevMonth();
49 void goNextWeek();
50 void goPrevWeek();
49 void goNextYear(); 51 void goNextYear();
50 void goPrevYear(); 52 void goPrevYear();
51 void monthSelected( int ); 53 void monthSelected( int );
52 54
53 private: 55 private:
54 QFrame *mCtrlFrame; 56 QFrame *mCtrlFrame;
55 57
56 QPushButton *mPrevYear; 58 QPushButton *mPrevYear;
57 QPushButton *mPrevMonth; 59 QPushButton *mPrevMonth;
58 QPushButton *mNextMonth; 60 QPushButton *mNextMonth;
61 QPushButton *mPrevWeek;
62 QPushButton *mNextWeek;
59 QPushButton *mNextYear; 63 QPushButton *mNextYear;
60 QPushButton *mSelectMonth; 64 QPushButton *mSelectMonth;
61 65
62 //QLabel *mDateLabel; 66 //QLabel *mDateLabel;
63}; 67};
64 68
65#endif 69#endif