summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-28 11:59:41 (UTC)
committer zautrix <zautrix>2005-03-28 11:59:41 (UTC)
commit314908d5d9139af7711c6e425260363bb014afce (patch) (unidiff)
tree8b4a72042d6f2e158c64b6b1cbfb7ef002d2fd61 /korganizer
parent9ff0641f33e63cc88e96d0066dba43b4699ca489 (diff)
downloadkdepimpi-314908d5d9139af7711c6e425260363bb014afce.zip
kdepimpi-314908d5d9139af7711c6e425260363bb014afce.tar.gz
kdepimpi-314908d5d9139af7711c6e425260363bb014afce.tar.bz2
toolbar fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/mainwindow.cpp70
3 files changed, 42 insertions, 30 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 2168094..1e68a44 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,221 +1,222 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kglobalsettings.h> 39#include <kglobalsettings.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <klocale.h> 41#include <klocale.h>
42#include <kdebug.h> 42#include <kdebug.h>
43#include <kemailsettings.h> 43#include <kemailsettings.h>
44#include <kstaticdeleter.h> 44#include <kstaticdeleter.h>
45#include <libkdepim/kpimglobalprefs.h> 45#include <libkdepim/kpimglobalprefs.h>
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("ShowIconDay6",&mShowIconDay6,true);
79 addItemBool("ShowIconDay7",&mShowIconDay7,true); 79 addItemBool("ShowIconDay7",&mShowIconDay7,true);
80 addItemBool("ShowIconMonth",&mShowIconMonth,true); 80 addItemBool("ShowIconMonth",&mShowIconMonth,true);
81 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 81 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
82 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 82 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
83 addItemBool("ShowIconBack",&mShowIconBack,true); 83 addItemBool("ShowIconBack",&mShowIconBack,true);
84 addItemBool("ShowIconToday",&mShowIconToday,true); 84 addItemBool("ShowIconToday",&mShowIconToday,true);
85 addItemBool("ShowIconForward",&mShowIconForward,true); 85 addItemBool("ShowIconForward",&mShowIconForward,true);
86 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 86 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
87 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 87 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
88 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); 88 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true);
89 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 89 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
90 addItemBool("ShowIconNext",&mShowIconNext,true); 90 addItemBool("ShowIconNext",&mShowIconNext,true);
91 addItemBool("ShowIconJournal",&mShowIconJournal,true); 91 addItemBool("ShowIconJournal",&mShowIconJournal,true);
92 addItemBool("ShowIconStretch",&mShowIconStretch,true); 92 addItemBool("ShowIconStretch",&mShowIconStretch,true);
93 addItemBool("ShowIconFilter",&mShowIconFilter,false); 93 addItemBool("ShowIconFilter",&mShowIconFilter,false);
94 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true);
94 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 95 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
95 96
96 addItemBool("AskForQuit",&mAskForQuit,false); 97 addItemBool("AskForQuit",&mAskForQuit,false);
97 98
98#ifndef DESKTOP_VERSION 99#ifndef DESKTOP_VERSION
99 addItemBool("ShowFullMenu",&mShowFullMenu,false); 100 addItemBool("ShowFullMenu",&mShowFullMenu,false);
100#else 101#else
101 addItemBool("ShowFullMenu",&mShowFullMenu,true); 102 addItemBool("ShowFullMenu",&mShowFullMenu,true);
102#endif 103#endif
103 addItemBool("ToolBarHor",&mToolBarHor, true ); 104 addItemBool("ToolBarHor",&mToolBarHor, true );
104 addItemBool("ToolBarUp",&mToolBarUp, false ); 105 addItemBool("ToolBarUp",&mToolBarUp, false );
105 addItemBool("ToolBarHorV",&mToolBarHorV, true ); 106 addItemBool("ToolBarHorV",&mToolBarHorV, true );
106 addItemBool("ToolBarUpV",&mToolBarUpV, false ); 107 addItemBool("ToolBarUpV",&mToolBarUpV, false );
107 addItemBool("ToolBarHorN",&mToolBarHorN, true ); 108 addItemBool("ToolBarHorN",&mToolBarHorN, true );
108 addItemBool("ToolBarUpN",&mToolBarUpN, false ); 109 addItemBool("ToolBarUpN",&mToolBarUpN, false );
109 addItemBool("ToolBarHorF",&mToolBarHorF, true ); 110 addItemBool("ToolBarHorF",&mToolBarHorF, true );
110 addItemBool("ToolBarUpF",&mToolBarUpF, false ); 111 addItemBool("ToolBarUpF",&mToolBarUpF, false );
111 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 112 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
112 addItemInt("Whats Next Days",&mWhatsNextDays,3); 113 addItemInt("Whats Next Days",&mWhatsNextDays,3);
113 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 114 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
114 115
115 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 116 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
116 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 117 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
117 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 118 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
118 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 119 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
119 addItemInt("AllDay Size",&mAllDaySize,28); 120 addItemInt("AllDay Size",&mAllDaySize,28);
120 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 121 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
121 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 122 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
122 123
123 addItemStringList("LocationDefaults",&mLocationDefaults ); 124 addItemStringList("LocationDefaults",&mLocationDefaults );
124 addItemStringList("EventSummary User",&mEventSummaryUser); 125 addItemStringList("EventSummary User",&mEventSummaryUser);
125 addItemStringList("TodoSummary User",&mTodoSummaryUser); 126 addItemStringList("TodoSummary User",&mTodoSummaryUser);
126 127
127 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 128 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
128 addItemBool("Enable Project View",&mEnableProjectView,false); 129 addItemBool("Enable Project View",&mEnableProjectView,false);
129 addItemBool("Auto Save",&mAutoSave,false); 130 addItemBool("Auto Save",&mAutoSave,false);
130 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 131 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
131 addItemBool("Confirm Deletes",&mConfirm,true); 132 addItemBool("Confirm Deletes",&mConfirm,true);
132 addItemString("Archive File",&mArchiveFile); 133 addItemString("Archive File",&mArchiveFile);
133 addItemString("Html Export File",&mHtmlExportFile, 134 addItemString("Html Export File",&mHtmlExportFile,
134 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 135 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
135 addItemBool("Html With Save",&mHtmlWithSave,false); 136 addItemBool("Html With Save",&mHtmlWithSave,false);
136 137
137 KPrefs::setCurrentGroup("Personal Settings"); 138 KPrefs::setCurrentGroup("Personal Settings");
138 139
139 addItemInt("Mail Client",&mMailClient,MailClientKMail); 140 addItemInt("Mail Client",&mMailClient,MailClientKMail);
140 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 141 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
141 addItemBool("Bcc",&mBcc,false); 142 addItemBool("Bcc",&mBcc,false);
142 143
143 KPrefs::setCurrentGroup("Time & Date"); 144 KPrefs::setCurrentGroup("Time & Date");
144 145
145 146
146 addItemInt("Default Start Time",&mStartTime,10); 147 addItemInt("Default Start Time",&mStartTime,10);
147 addItemInt("Default Duration",&mDefaultDuration,2); 148 addItemInt("Default Duration",&mDefaultDuration,2);
148 addItemInt("Default Alarm Time",&mAlarmTime,3); 149 addItemInt("Default Alarm Time",&mAlarmTime,3);
149 KPrefs::setCurrentGroup("AlarmSettings"); 150 KPrefs::setCurrentGroup("AlarmSettings");
150 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 151 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
151 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 152 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
152 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 153 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
153 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 154 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
154 155
155 156
156 KPrefs::setCurrentGroup("Calendar"); 157 KPrefs::setCurrentGroup("Calendar");
157 158
158 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 159 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
159 160
160 KPrefs::setCurrentGroup("Fonts"); 161 KPrefs::setCurrentGroup("Fonts");
161 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 162 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
162 addItemFont("TimeBar Font",&mTimeBarFont,KGlobalSettings::generalFont() ); 163 addItemFont("TimeBar Font",&mTimeBarFont,KGlobalSettings::generalFont() );
163 addItemFont("MonthView Font",&mMonthViewFont,KGlobalSettings::generalFont()); 164 addItemFont("MonthView Font",&mMonthViewFont,KGlobalSettings::generalFont());
164 addItemFont("AgendaView Font",&mAgendaViewFont,KGlobalSettings::generalFont()); 165 addItemFont("AgendaView Font",&mAgendaViewFont,KGlobalSettings::generalFont());
165 addItemFont("MarcusBains Font",&mMarcusBainsFont,KGlobalSettings::generalFont()); 166 addItemFont("MarcusBains Font",&mMarcusBainsFont,KGlobalSettings::generalFont());
166 addItemFont("TimeLabels Font",&mTimeLabelsFont,KGlobalSettings::generalFont()); 167 addItemFont("TimeLabels Font",&mTimeLabelsFont,KGlobalSettings::generalFont());
167 addItemFont("TodoView Font",&mTodoViewFont,KGlobalSettings::generalFont()); 168 addItemFont("TodoView Font",&mTodoViewFont,KGlobalSettings::generalFont());
168 addItemFont("ListView Font",&mListViewFont,KGlobalSettings::generalFont()); 169 addItemFont("ListView Font",&mListViewFont,KGlobalSettings::generalFont());
169 addItemFont("DateNavigator Font",&mDateNavigatorFont,KGlobalSettings::generalFont()); 170 addItemFont("DateNavigator Font",&mDateNavigatorFont,KGlobalSettings::generalFont());
170 addItemFont("EditBox Font",&mEditBoxFont,KGlobalSettings::generalFont()); 171 addItemFont("EditBox Font",&mEditBoxFont,KGlobalSettings::generalFont());
171 addItemFont("JournalView Font",&mJornalViewFont,KGlobalSettings::generalFont()); 172 addItemFont("JournalView Font",&mJornalViewFont,KGlobalSettings::generalFont());
172 addItemFont("WhatsNextView Font",&mWhatsNextFont,KGlobalSettings::generalFont()); 173 addItemFont("WhatsNextView Font",&mWhatsNextFont,KGlobalSettings::generalFont());
173 addItemFont("EventView Font",&mEventViewFont,KGlobalSettings::generalFont()); 174 addItemFont("EventView Font",&mEventViewFont,KGlobalSettings::generalFont());
174 175
175 KPrefs::setCurrentGroup("RemoteSyncing"); 176 KPrefs::setCurrentGroup("RemoteSyncing");
176 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 177 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
177 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 178 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
178 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 179 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
179 addItemInt("LastSyncTime",&mLastSyncTime,0); 180 addItemInt("LastSyncTime",&mLastSyncTime,0);
180 181
181#ifdef _WIN32_ 182#ifdef _WIN32_
182 QString hdp= locateLocal("data","korganizer")+"\\\\"; 183 QString hdp= locateLocal("data","korganizer")+"\\\\";
183#else 184#else
184 QString hdp= locateLocal("data","korganizer")+"/"; 185 QString hdp= locateLocal("data","korganizer")+"/";
185#endif 186#endif
186 187
187 KPrefs::setCurrentGroup("LoadSaveFileNames"); 188 KPrefs::setCurrentGroup("LoadSaveFileNames");
188 189
189 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 190 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
190 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 191 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
191 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 192 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
192 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 193 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
193 194
194 195
195 KPrefs::setCurrentGroup("Locale"); 196 KPrefs::setCurrentGroup("Locale");
196 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 197 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
197 198
198 199
199 KPrefs::setCurrentGroup("Colors"); 200 KPrefs::setCurrentGroup("Colors");
200 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 201 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
201 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 202 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
202 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 203 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
203 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); 204 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
204 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 205 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
205 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 206 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
206 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 207 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
207 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 208 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
208 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 209 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
209 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 210 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
210 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 211 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
211 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 212 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
212 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 213 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
213 addItemBool("MonthViewWeek",&mMonthViewWeek,false); 214 addItemBool("MonthViewWeek",&mMonthViewWeek,false);
214 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 215 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
215 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 216 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
216 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 217 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
217 addItemBool("UseAppColors",&mUseAppColors,false); 218 addItemBool("UseAppColors",&mUseAppColors,false);
218 219
219 220
220 221
221 KPrefs::setCurrentGroup("Views"); 222 KPrefs::setCurrentGroup("Views");
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 8dfdf69..fbce6ea 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -61,240 +61,241 @@ class KOPrefs : public KPimPrefs
61 61
62 protected: 62 protected:
63 void setTimeZoneIdDefault(); 63 void setTimeZoneIdDefault();
64 64
65 /** Fill empty mail fields with default values. */ 65 /** Fill empty mail fields with default values. */
66 void fillMailDefaults(); 66 void fillMailDefaults();
67 67
68 private: 68 private:
69 /** Constructor disabled for public. Use instance() to create a KOPrefs 69 /** Constructor disabled for public. Use instance() to create a KOPrefs
70 object. */ 70 object. */
71 KOPrefs(); 71 KOPrefs();
72 72
73 static KOPrefs *mInstance; 73 static KOPrefs *mInstance;
74 QStringList getDefaultList(); 74 QStringList getDefaultList();
75 QStringList getLocationDefaultList(); 75 QStringList getLocationDefaultList();
76 public: 76 public:
77 // preferences data 77 // preferences data
78 KConfig* getConfig(); 78 KConfig* getConfig();
79 void setFullName(const QString &); 79 void setFullName(const QString &);
80 QString fullName(); 80 QString fullName();
81 void setEmail(const QString &); 81 void setEmail(const QString &);
82 QString email(); 82 QString email();
83 83
84 QString mAdditional; 84 QString mAdditional;
85 85
86 bool mEmailControlCenter; 86 bool mEmailControlCenter;
87 87
88 bool mBcc; 88 bool mBcc;
89 bool mAutoSave; 89 bool mAutoSave;
90 int mAutoSaveInterval; 90 int mAutoSaveInterval;
91 bool mConfirm; 91 bool mConfirm;
92 92
93 bool mEnableGroupScheduling; 93 bool mEnableGroupScheduling;
94 bool mEnableProjectView; 94 bool mEnableProjectView;
95 95
96 int mDefaultFormat; 96 int mDefaultFormat;
97 int mMailClient; 97 int mMailClient;
98 98
99 int mStartTime; 99 int mStartTime;
100 int mDefaultDuration; 100 int mDefaultDuration;
101 int mAlarmTime; 101 int mAlarmTime;
102 102
103 int mWorkingHoursStart; 103 int mWorkingHoursStart;
104 int mWorkingHoursEnd; 104 int mWorkingHoursEnd;
105 bool mExcludeHolidays; 105 bool mExcludeHolidays;
106 bool mExcludeSaturdays; 106 bool mExcludeSaturdays;
107 bool mMarcusBainsShowSeconds; 107 bool mMarcusBainsShowSeconds;
108 108
109 QFont mTimeBarFont; 109 QFont mTimeBarFont;
110 QFont mMonthViewFont; 110 QFont mMonthViewFont;
111 QFont mAgendaViewFont; 111 QFont mAgendaViewFont;
112 QFont mMarcusBainsFont; 112 QFont mMarcusBainsFont;
113 QFont mTimeLabelsFont; 113 QFont mTimeLabelsFont;
114 QFont mTodoViewFont; 114 QFont mTodoViewFont;
115 QFont mListViewFont; 115 QFont mListViewFont;
116 QFont mDateNavigatorFont; 116 QFont mDateNavigatorFont;
117 QFont mEditBoxFont; 117 QFont mEditBoxFont;
118 QFont mJornalViewFont; 118 QFont mJornalViewFont;
119 QFont mWhatsNextFont; 119 QFont mWhatsNextFont;
120 QFont mEventViewFont; 120 QFont mEventViewFont;
121 121
122 122
123 123
124 124
125 QColor mHolidayColor; 125 QColor mHolidayColor;
126 QColor mHighlightColor; 126 QColor mHighlightColor;
127 QColor mEventColor; 127 QColor mEventColor;
128 QColor mTodoDoneColor; 128 QColor mTodoDoneColor;
129 QColor mAgendaBgColor; 129 QColor mAgendaBgColor;
130 QColor mWorkingHoursColor; 130 QColor mWorkingHoursColor;
131 QColor mTodoDueTodayColor; 131 QColor mTodoDueTodayColor;
132 QColor mTodoOverdueColor; 132 QColor mTodoOverdueColor;
133 QColor mMonthViewEvenColor; 133 QColor mMonthViewEvenColor;
134 QColor mMonthViewOddColor; 134 QColor mMonthViewOddColor;
135 QColor mMonthViewHolidayColor; 135 QColor mMonthViewHolidayColor;
136 bool mMonthViewUsesDayColors; 136 bool mMonthViewUsesDayColors;
137 bool mMonthViewSatSunTog; 137 bool mMonthViewSatSunTog;
138 bool mMonthViewWeek; 138 bool mMonthViewWeek;
139 QColor mAppColor1; 139 QColor mAppColor1;
140 QColor mAppColor2; 140 QColor mAppColor2;
141 bool mUseAppColors; 141 bool mUseAppColors;
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 mShowIconDay6;
175 bool mShowIconDay7; 175 bool mShowIconDay7;
176 bool mShowIconMonth; 176 bool mShowIconMonth;
177 bool mShowIconTodoview; 177 bool mShowIconTodoview;
178 bool mShowIconBackFast; 178 bool mShowIconBackFast;
179 bool mShowIconBack; 179 bool mShowIconBack;
180 bool mShowIconToday; 180 bool mShowIconToday;
181 bool mShowIconForward; 181 bool mShowIconForward;
182 bool mShowIconForwardFast; 182 bool mShowIconForwardFast;
183 bool mShowIconWhatsThis; 183 bool mShowIconWhatsThis;
184 bool mShowIconWeekNum; 184 bool mShowIconWeekNum;
185 bool mShowIconNextDays; 185 bool mShowIconNextDays;
186 bool mShowIconNext; 186 bool mShowIconNext;
187 bool mShowIconJournal; 187 bool mShowIconJournal;
188 bool mShowIconFilter; 188 bool mShowIconFilter;
189 bool mShowIconOnetoolbar;
189 190
190 bool mShowIconStretch; 191 bool mShowIconStretch;
191 192
192 bool mToolBarHor; 193 bool mToolBarHor;
193 bool mToolBarUp; 194 bool mToolBarUp;
194 bool mToolBarHorV; 195 bool mToolBarHorV;
195 bool mToolBarUpV; 196 bool mToolBarUpV;
196 bool mToolBarHorN; 197 bool mToolBarHorN;
197 bool mToolBarUpN; 198 bool mToolBarUpN;
198 bool mToolBarHorF; 199 bool mToolBarHorF;
199 bool mToolBarUpF; 200 bool mToolBarUpF;
200 bool mToolBarMiniIcons; 201 bool mToolBarMiniIcons;
201 202
202 bool mAskForQuit; 203 bool mAskForQuit;
203 bool mUsePassWd; 204 bool mUsePassWd;
204 bool mShowSyncEvents; 205 bool mShowSyncEvents;
205 bool mShowTodoInAgenda; 206 bool mShowTodoInAgenda;
206 bool mShowTimeInAgenda; 207 bool mShowTimeInAgenda;
207 bool mHideNonStartedTodos; 208 bool mHideNonStartedTodos;
208 209
209 int mLastSyncTime; 210 int mLastSyncTime;
210 void setCategoryColor(QString cat,const QColor & color); 211 void setCategoryColor(QString cat,const QColor & color);
211 QColor *categoryColor(QString cat); 212 QColor *categoryColor(QString cat);
212 213
213 QString mArchiveFile; 214 QString mArchiveFile;
214 QString mHtmlExportFile; 215 QString mHtmlExportFile;
215 bool mHtmlWithSave; 216 bool mHtmlWithSave;
216 217
217 QStringList mSelectedPlugins; 218 QStringList mSelectedPlugins;
218 219
219 QString mLastImportFile; 220 QString mLastImportFile;
220 QString mLastVcalFile; 221 QString mLastVcalFile;
221 QString mLastSaveFile; 222 QString mLastSaveFile;
222 QString mLastLoadFile; 223 QString mLastLoadFile;
223 224
224 225
225 QString mDefaultAlarmFile; 226 QString mDefaultAlarmFile;
226 int mIMIPScheduler; 227 int mIMIPScheduler;
227 int mIMIPSend; 228 int mIMIPSend;
228 QStringList mAdditionalMails; 229 QStringList mAdditionalMails;
229 int mIMIPAutoRefresh; 230 int mIMIPAutoRefresh;
230 int mIMIPAutoInsertReply; 231 int mIMIPAutoInsertReply;
231 int mIMIPAutoInsertRequest; 232 int mIMIPAutoInsertRequest;
232 int mIMIPAutoFreeBusy; 233 int mIMIPAutoFreeBusy;
233 int mIMIPAutoFreeBusyReply; 234 int mIMIPAutoFreeBusyReply;
234 235
235 QStringList mTodoTemplates; 236 QStringList mTodoTemplates;
236 QStringList mEventTemplates; 237 QStringList mEventTemplates;
237 238
238 int mDestination; 239 int mDestination;
239 240
240 241
241 bool mEditOnDoubleClick; 242 bool mEditOnDoubleClick;
242 bool mViewChangeHoldFullscreen; 243 bool mViewChangeHoldFullscreen;
243 bool mViewChangeHoldNonFullscreen; 244 bool mViewChangeHoldNonFullscreen;
244 bool mCenterOnCurrentTime; 245 bool mCenterOnCurrentTime;
245 bool mSetTimeToDayStartAt; 246 bool mSetTimeToDayStartAt;
246 bool mHighlightCurrentDay; 247 bool mHighlightCurrentDay;
247 bool mUseHighlightLightColor; 248 bool mUseHighlightLightColor;
248 bool mListViewMonthTimespan; 249 bool mListViewMonthTimespan;
249 bool mWNViewShowsParents; 250 bool mWNViewShowsParents;
250 bool mWNViewShowsPast; 251 bool mWNViewShowsPast;
251 bool mWNViewShowLocation; 252 bool mWNViewShowLocation;
252 bool mTodoViewShowsPercentage; 253 bool mTodoViewShowsPercentage;
253 bool mTodoViewUsesCatColors; 254 bool mTodoViewUsesCatColors;
254 bool mMonthViewUsesBigFont; 255 bool mMonthViewUsesBigFont;
255 bool mTodoViewUsesSmallFont; 256 bool mTodoViewUsesSmallFont;
256 bool mTodoViewUsesForegroundColor; 257 bool mTodoViewUsesForegroundColor;
257 bool mMonthViewUsesForegroundColor; 258 bool mMonthViewUsesForegroundColor;
258 259
259 bool mHightlightDateTimeEdit; 260 bool mHightlightDateTimeEdit;
260 bool mShortDateInViewer; 261 bool mShortDateInViewer;
261 262
262 bool mShowDateNavigator; 263 bool mShowDateNavigator;
263 264
264 QStringList mLocationDefaults; 265 QStringList mLocationDefaults;
265 QStringList mEventSummaryUser; 266 QStringList mEventSummaryUser;
266 QStringList mTodoSummaryUser; 267 QStringList mTodoSummaryUser;
267 268
268 bool mUseInternalAlarmNotification; 269 bool mUseInternalAlarmNotification;
269 int mAlarmPlayBeeps; 270 int mAlarmPlayBeeps;
270 int mAlarmSuspendTime; 271 int mAlarmSuspendTime;
271 int mAlarmSuspendCount; 272 int mAlarmSuspendCount;
272 int mAlarmBeepInterval; 273 int mAlarmBeepInterval;
273 int mOldLanguage; 274 int mOldLanguage;
274 int mOldLoadedLanguage; 275 int mOldLoadedLanguage;
275 276
276 277
277 QString mActiveSyncPort; 278 QString mActiveSyncPort;
278 QString mActiveSyncIP; 279 QString mActiveSyncIP;
279 280
280 // settings for eventviewer 281 // settings for eventviewer
281 bool mEVshowDetails; 282 bool mEVshowDetails;
282 bool mEVshowCreated; 283 bool mEVshowCreated;
283 bool mEVshowChanged; 284 bool mEVshowChanged;
284 bool mWTshowDetails; 285 bool mWTshowDetails;
285 bool mWTshowCreated; 286 bool mWTshowCreated;
286 bool mWTshowChanged; 287 bool mWTshowChanged;
287 288
288 private: 289 private:
289 QDict<QColor> mCategoryColors; 290 QDict<QColor> mCategoryColors;
290 QColor mDefaultCategoryColor; 291 QColor mDefaultCategoryColor;
291 292
292 QFont mDefaultTimeBarFont; 293 QFont mDefaultTimeBarFont;
293 QFont mDefaultViewFont; 294 QFont mDefaultViewFont;
294 QFont mDefaultMonthViewFont; 295 QFont mDefaultMonthViewFont;
295 296
296 QString mName; 297 QString mName;
297 QString mEmail; 298 QString mEmail;
298}; 299};
299 300
300#endif 301#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c6ae868..a4e0834 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -69,286 +69,289 @@ using namespace KCal;
69#else 69#else
70#ifdef _OL_IMPORT_ 70#ifdef _OL_IMPORT_
71#include "koimportoldialog.h" 71#include "koimportoldialog.h"
72#endif 72#endif
73#endif 73#endif
74#include "mainwindow.h" 74#include "mainwindow.h"
75 75
76 76
77class KOex2phonePrefs : public QDialog 77class KOex2phonePrefs : public QDialog
78{ 78{
79 public: 79 public:
80 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 80 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
81 QDialog( parent, name, true ) 81 QDialog( parent, name, true )
82 { 82 {
83 setCaption( i18n("Export to phone options") ); 83 setCaption( i18n("Export to phone options") );
84 QVBoxLayout* lay = new QVBoxLayout( this ); 84 QVBoxLayout* lay = new QVBoxLayout( this );
85 lay->setSpacing( 3 ); 85 lay->setSpacing( 3 );
86 lay->setMargin( 3 ); 86 lay->setMargin( 3 );
87 QLabel *lab; 87 QLabel *lab;
88 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 88 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
89 lab->setAlignment (AlignHCenter ); 89 lab->setAlignment (AlignHCenter );
90 QHBox* temphb; 90 QHBox* temphb;
91 temphb = new QHBox( this ); 91 temphb = new QHBox( this );
92 new QLabel( i18n("I/O device: "), temphb ); 92 new QLabel( i18n("I/O device: "), temphb );
93 mPhoneDevice = new QLineEdit( temphb); 93 mPhoneDevice = new QLineEdit( temphb);
94 lay->addWidget( temphb ); 94 lay->addWidget( temphb );
95 temphb = new QHBox( this ); 95 temphb = new QHBox( this );
96 new QLabel( i18n("Connection: "), temphb ); 96 new QLabel( i18n("Connection: "), temphb );
97 mPhoneConnection = new QLineEdit( temphb); 97 mPhoneConnection = new QLineEdit( temphb);
98 lay->addWidget( temphb ); 98 lay->addWidget( temphb );
99 temphb = new QHBox( this ); 99 temphb = new QHBox( this );
100 new QLabel( i18n("Model(opt.): "), temphb ); 100 new QLabel( i18n("Model(opt.): "), temphb );
101 mPhoneModel = new QLineEdit( temphb); 101 mPhoneModel = new QLineEdit( temphb);
102 lay->addWidget( temphb ); 102 lay->addWidget( temphb );
103 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 103 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
104 mWriteBackFuture->setChecked( true ); 104 mWriteBackFuture->setChecked( true );
105 lay->addWidget( mWriteBackFuture ); 105 lay->addWidget( mWriteBackFuture );
106 temphb = new QHBox( this ); 106 temphb = new QHBox( this );
107 new QLabel( i18n("Max. weeks in future: ") , temphb ); 107 new QLabel( i18n("Max. weeks in future: ") , temphb );
108 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 108 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
109 mWriteBackFutureWeeks->setValue( 8 ); 109 mWriteBackFutureWeeks->setValue( 8 );
110 lay->addWidget( temphb ); 110 lay->addWidget( temphb );
111 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 111 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
112 lab->setAlignment (AlignHCenter ); 112 lab->setAlignment (AlignHCenter );
113 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 113 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
114 lay->addWidget( ok ); 114 lay->addWidget( ok );
115 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 115 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
116 lay->addWidget( cancel ); 116 lay->addWidget( cancel );
117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
119 resize( 220, 240 ); 119 resize( 220, 240 );
120 qApp->processEvents(); 120 qApp->processEvents();
121 int dw = QApplication::desktop()->width(); 121 int dw = QApplication::desktop()->width();
122 int dh = QApplication::desktop()->height(); 122 int dh = QApplication::desktop()->height();
123 move( (dw-width())/2, (dh - height() )/2 ); 123 move( (dw-width())/2, (dh - height() )/2 );
124 } 124 }
125 125
126public: 126public:
127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
128 QCheckBox* mWriteBackFuture; 128 QCheckBox* mWriteBackFuture;
129 QSpinBox* mWriteBackFutureWeeks; 129 QSpinBox* mWriteBackFutureWeeks;
130}; 130};
131 131
132int globalFlagBlockStartup; 132int globalFlagBlockStartup;
133MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : 133MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
134 QMainWindow( parent, name ) 134 QMainWindow( parent, name )
135{ 135{
136 136
137 mClosed = false; 137 mClosed = false;
138 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 138 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
139 QString confFile = locateLocal("config","korganizerrc"); 139 QString confFile = locateLocal("config","korganizerrc");
140 QFileInfo finf ( confFile ); 140 QFileInfo finf ( confFile );
141 bool showWarning = !finf.exists(); 141 bool showWarning = !finf.exists();
142 setIcon(SmallIcon( "ko24" ) ); 142 setIcon(SmallIcon( "ko24" ) );
143 mBlockAtStartup = true; 143 mBlockAtStartup = true;
144 mFlagKeyPressed = false; 144 mFlagKeyPressed = false;
145 setCaption("KO/Pi"); 145 setCaption("KO/Pi");
146 KOPrefs *p = KOPrefs::instance(); 146 KOPrefs *p = KOPrefs::instance();
147 KPimGlobalPrefs::instance()->setGlobalConfig(); 147 KPimGlobalPrefs::instance()->setGlobalConfig();
148 if ( p->mHourSize > 22 ) 148 if ( p->mHourSize > 22 )
149 p->mHourSize = 22; 149 p->mHourSize = 22;
150 QMainWindow::ToolBarDock tbd; 150 QMainWindow::ToolBarDock tbd;
151 if ( p->mToolBarHor ) { 151 if ( p->mToolBarHor ) {
152 if ( p->mToolBarUp ) 152 if ( p->mToolBarUp )
153 tbd = Bottom; 153 tbd = Bottom;
154 else 154 else
155 tbd = Top; 155 tbd = Top;
156 } 156 }
157 else { 157 else {
158 if ( p->mToolBarUp ) 158 if ( p->mToolBarUp )
159 tbd = Right; 159 tbd = Right;
160 else 160 else
161 tbd = Left; 161 tbd = Left;
162 } 162 }
163 if ( KOPrefs::instance()->mUseAppColors ) 163 if ( KOPrefs::instance()->mUseAppColors )
164 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 164 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
165 globalFlagBlockStartup = 1; 165 globalFlagBlockStartup = 1;
166 iconToolBar = new QPEToolBar( this ); 166 iconToolBar = new QPEToolBar( this );
167 addToolBar (iconToolBar , tbd ); 167 addToolBar (iconToolBar , tbd );
168 168
169 if ( KOPrefs::instance()->mShowIconFilter ) { 169 if ( KOPrefs::instance()->mShowIconFilter ) {
170 if ( p->mToolBarHorF ) { 170 if ( p->mToolBarHorF ) {
171 if ( p->mToolBarUpF ) 171 if ( p->mToolBarUpF )
172 tbd = Bottom; 172 tbd = Bottom;
173 else 173 else
174 tbd = Top; 174 tbd = Top;
175 } 175 }
176 else { 176 else {
177 if ( p->mToolBarUpF ) 177 if ( p->mToolBarUpF )
178 tbd = Right; 178 tbd = Right;
179 else 179 else
180 tbd = Left; 180 tbd = Left;
181 } 181 }
182 filterToolBar = new QPEToolBar ( this ); 182 filterToolBar = new QPEToolBar ( this );
183 filterMenubar = new QPEMenuBar( filterToolBar ); 183 filterMenubar = new QPEMenuBar( filterToolBar );
184 QFontMetrics fm ( filterMenubar->font() ); 184 QFontMetrics fm ( filterMenubar->font() );
185 185
186 filterPopupMenu = new QPopupMenu( this ); 186 filterPopupMenu = new QPopupMenu( this );
187 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 187 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
188 filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) ); 188 filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) );
189 addToolBar (filterToolBar , tbd ); 189 addToolBar (filterToolBar , tbd );
190 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 190 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
191 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 191 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
192 } else { 192 } else {
193 filterToolBar = 0; 193 filterToolBar = 0;
194 filterMenubar = 0; 194 filterMenubar = 0;
195 filterPopupMenu = 0; 195 filterPopupMenu = 0;
196 } 196 }
197 197 if ( p->mShowIconOnetoolbar ) {
198 if ( p->mToolBarHorV ) { 198 viewToolBar = iconToolBar ;
199 if ( p->mToolBarUpV ) 199 navigatorToolBar = iconToolBar ;
200 tbd = Bottom; 200 } else {
201 else 201 if ( p->mToolBarHorV ) {
202 tbd = Top; 202 if ( p->mToolBarUpV )
203 } 203 tbd = Bottom;
204 else { 204 else
205 if ( p->mToolBarUpV ) 205 tbd = Top;
206 tbd = Right; 206 }
207 else 207 else {
208 tbd = Left; 208 if ( p->mToolBarUpV )
209 } 209 tbd = Right;
210 viewToolBar = new QPEToolBar( this ); 210 else
211 addToolBar (viewToolBar , tbd ); 211 tbd = Left;
212 if ( p->mToolBarHorN ) { 212 }
213 if ( p->mToolBarUpN ) 213 viewToolBar = new QPEToolBar( this );
214 tbd = Bottom; 214 addToolBar (viewToolBar , tbd );
215 else 215 if ( p->mToolBarHorN ) {
216 tbd = Top; 216 if ( p->mToolBarUpN )
217 } 217 tbd = Bottom;
218 else { 218 else
219 if ( p->mToolBarUpN ) 219 tbd = Top;
220 tbd = Right; 220 }
221 else 221 else {
222 tbd = Left; 222 if ( p->mToolBarUpN )
223 tbd = Right;
224 else
225 tbd = Left;
226 }
227 navigatorToolBar = new QPEToolBar( this );
228 addToolBar (navigatorToolBar , tbd );
223 } 229 }
224 navigatorToolBar = new QPEToolBar( this );
225 addToolBar (navigatorToolBar , tbd );
226
227 230
228 231
229 232
230 mCalendarModifiedFlag = false; 233 mCalendarModifiedFlag = false;
231 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 234 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
232 splash->setAlignment ( AlignCenter ); 235 splash->setAlignment ( AlignCenter );
233 setCentralWidget( splash ); 236 setCentralWidget( splash );
234#ifndef DESKTOP_VERSION 237#ifndef DESKTOP_VERSION
235 showMaximized(); 238 showMaximized();
236#endif 239#endif
237 240
238 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 241 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
239 setDefaultPreferences(); 242 setDefaultPreferences();
240 mCalendar = new CalendarLocal(); 243 mCalendar = new CalendarLocal();
241 mView = new CalendarView( mCalendar, this,"mCalendar " ); 244 mView = new CalendarView( mCalendar, this,"mCalendar " );
242 mView->hide(); 245 mView->hide();
243 //mView->resize(splash->size() ); 246 //mView->resize(splash->size() );
244 initActions(); 247 initActions();
245 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 248 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
246 mSyncManager->setBlockSave(false); 249 mSyncManager->setBlockSave(false);
247 mView->setSyncManager(mSyncManager); 250 mView->setSyncManager(mSyncManager);
248#ifndef DESKTOP_VERSION 251#ifndef DESKTOP_VERSION
249 iconToolBar->show(); 252 iconToolBar->show();
250 qApp->processEvents(); 253 qApp->processEvents();
251#endif 254#endif
252 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 255 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
253 int vh = height() ; 256 int vh = height() ;
254 int vw = width(); 257 int vw = width();
255 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 258 //qDebug("Toolbar hei %d ",iconToolBar->height() );
256 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 259 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
257 vh -= iconToolBar->height(); 260 vh -= iconToolBar->height();
258 } else { 261 } else {
259 vw -= iconToolBar->height(); 262 vw -= iconToolBar->height();
260 } 263 }
261 //mView->setMaximumSize( splash->size() ); 264 //mView->setMaximumSize( splash->size() );
262 //mView->resize( splash->size() ); 265 //mView->resize( splash->size() );
263 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 266 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
264 mView->readSettings(); 267 mView->readSettings();
265 bool newFile = false; 268 bool newFile = false;
266 if( !QFile::exists( defaultFileName() ) ) { 269 if( !QFile::exists( defaultFileName() ) ) {
267 QFileInfo finfo ( defaultFileName() ); 270 QFileInfo finfo ( defaultFileName() );
268 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 271 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
269 qDebug("oldfile %s ", oldFile.latin1()); 272 qDebug("oldfile %s ", oldFile.latin1());
270 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; 273 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n";
271 finfo.setFile( oldFile ); 274 finfo.setFile( oldFile );
272 if (finfo.exists() ) { 275 if (finfo.exists() ) {
273 KMessageBox::information( this, message); 276 KMessageBox::information( this, message);
274 mView->openCalendar( oldFile ); 277 mView->openCalendar( oldFile );
275 qApp->processEvents(); 278 qApp->processEvents();
276 } else { 279 } else {
277 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 280 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
278 finfo.setFile( oldFile ); 281 finfo.setFile( oldFile );
279 if (finfo.exists() ) { 282 if (finfo.exists() ) {
280 KMessageBox::information( this, message); 283 KMessageBox::information( this, message);
281 mView->openCalendar( oldFile ); 284 mView->openCalendar( oldFile );
282 qApp->processEvents(); 285 qApp->processEvents();
283 } 286 }
284 } 287 }
285 mView->saveCalendar( defaultFileName() ); 288 mView->saveCalendar( defaultFileName() );
286 newFile = true; 289 newFile = true;
287 } 290 }
288 291
289 QTime neededSaveTime = QDateTime::currentDateTime().time(); 292 QTime neededSaveTime = QDateTime::currentDateTime().time();
290 mView->openCalendar( defaultFileName() ); 293 mView->openCalendar( defaultFileName() );
291 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 294 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
292 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 295 qDebug("KO: Calendar loading time: %d ms",msNeeded );
293 296
294 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 297 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
295 KOPrefs::instance()->setAllDefaults(); 298 KOPrefs::instance()->setAllDefaults();
296 int count = mView->addCategories(); 299 int count = mView->addCategories();
297 } 300 }
298 processIncidenceSelection( 0 ); 301 processIncidenceSelection( 0 );
299 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 302 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
300 SLOT( processIncidenceSelection( Incidence * ) ) ); 303 SLOT( processIncidenceSelection( Incidence * ) ) );
301 connect( mView, SIGNAL( modifiedChanged( bool ) ), 304 connect( mView, SIGNAL( modifiedChanged( bool ) ),
302 SLOT( slotModifiedChanged( bool ) ) ); 305 SLOT( slotModifiedChanged( bool ) ) );
303 306
304 307
305 connect( mView, SIGNAL( tempDisableBR(bool) ), 308 connect( mView, SIGNAL( tempDisableBR(bool) ),
306 SLOT( disableBR(bool) ) ); 309 SLOT( disableBR(bool) ) );
307 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 310 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
308 mView->setModified( false ); 311 mView->setModified( false );
309 mBlockAtStartup = false; 312 mBlockAtStartup = false;
310 mView->setModified( false ); 313 mView->setModified( false );
311 setCentralWidget( mView ); 314 setCentralWidget( mView );
312 globalFlagBlockStartup = 0; 315 globalFlagBlockStartup = 0;
313 mView->show(); 316 mView->show();
314 delete splash; 317 delete splash;
315 if ( newFile ) 318 if ( newFile )
316 mView->updateConfig(); 319 mView->updateConfig();
317 // qApp->processEvents(); 320 // qApp->processEvents();
318 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 321 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
319 //fillSyncMenu(); 322 //fillSyncMenu();
320 323
321 324
322 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 325 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
323 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 326 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
324 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 327 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
325 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 328 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
326 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 329 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
327 mSyncManager->setDefaultFileName( sentSyncFile()); 330 mSyncManager->setDefaultFileName( sentSyncFile());
328 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 331 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
329 mSyncManager->fillSyncMenu(); 332 mSyncManager->fillSyncMenu();
330 333
331 334
332 335
333 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 336 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
334 if ( showWarning ) { 337 if ( showWarning ) {
335 KMessageBox::information( this, 338 KMessageBox::information( this,
336 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 339 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
337 qApp->processEvents(); 340 qApp->processEvents();
338 mView->dialogManager()->showSyncOptions(); 341 mView->dialogManager()->showSyncOptions();
339 } 342 }
340 343
341 //US listen for result adressed from Ka/Pi 344 //US listen for result adressed from Ka/Pi
342#ifndef DESKTOP_VERSION 345#ifndef DESKTOP_VERSION
343 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 346 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
344#endif 347#endif
345#ifndef DESKTOP_VERSION 348#ifndef DESKTOP_VERSION
346 infrared = 0; 349 infrared = 0;
347#endif 350#endif
348 updateWeek( mView->startDate() ); 351 updateWeek( mView->startDate() );
349 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 352 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
350 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 353 SLOT( updateWeekNum( const KCal::DateList & ) ) );
351 mBRdisabled = false; 354 mBRdisabled = false;
352 //toggleBeamReceive(); 355 //toggleBeamReceive();
353} 356}
354MainWindow::~MainWindow() 357MainWindow::~MainWindow()
@@ -568,256 +571,257 @@ QPixmap MainWindow::loadPixmap( QString name )
568{ 571{
569 return SmallIcon( name ); 572 return SmallIcon( name );
570 573
571} 574}
572void MainWindow::initActions() 575void MainWindow::initActions()
573{ 576{
574 //KOPrefs::instance()->mShowFullMenu 577 //KOPrefs::instance()->mShowFullMenu
575 iconToolBar->clear(); 578 iconToolBar->clear();
576 KOPrefs *p = KOPrefs::instance(); 579 KOPrefs *p = KOPrefs::instance();
577 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 580 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
578 581
579 QPopupMenu *viewMenu = new QPopupMenu( this ); 582 QPopupMenu *viewMenu = new QPopupMenu( this );
580 QPopupMenu *actionMenu = new QPopupMenu( this ); 583 QPopupMenu *actionMenu = new QPopupMenu( this );
581 QPopupMenu *importMenu = new QPopupMenu( this ); 584 QPopupMenu *importMenu = new QPopupMenu( this );
582 QPopupMenu *importMenu_X = new QPopupMenu( this ); 585 QPopupMenu *importMenu_X = new QPopupMenu( this );
583 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 586 QPopupMenu *exportMenu_X = new QPopupMenu( this );
584 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 587 QPopupMenu *beamMenu_X = new QPopupMenu( this );
585 selectFilterMenu = new QPopupMenu( this ); 588 selectFilterMenu = new QPopupMenu( this );
586 selectFilterMenu->setCheckable( true ); 589 selectFilterMenu->setCheckable( true );
587 syncMenu = new QPopupMenu( this ); 590 syncMenu = new QPopupMenu( this );
588 configureAgendaMenu = new QPopupMenu( this ); 591 configureAgendaMenu = new QPopupMenu( this );
589 configureToolBarMenu = new QPopupMenu( this ); 592 configureToolBarMenu = new QPopupMenu( this );
590 QPopupMenu *helpMenu = new QPopupMenu( this ); 593 QPopupMenu *helpMenu = new QPopupMenu( this );
591 QIconSet icon; 594 QIconSet icon;
592 int pixWid = 22, pixHei = 22; 595 int pixWid = 22, pixHei = 22;
593 QString pathString = ""; 596 QString pathString = "";
594 if ( !p->mToolBarMiniIcons ) { 597 if ( !p->mToolBarMiniIcons ) {
595 if ( QApplication::desktop()->width() < 480 ) { 598 if ( QApplication::desktop()->width() < 480 ) {
596 pathString += "icons16/"; 599 pathString += "icons16/";
597 pixWid = 18; pixHei = 16; 600 pixWid = 18; pixHei = 16;
598 } 601 }
599 } else { 602 } else {
600 pathString += "iconsmini/"; 603 pathString += "iconsmini/";
601 pixWid = 18; pixHei = 16; 604 pixWid = 18; pixHei = 16;
602 } 605 }
603 if ( KOPrefs::instance()->mShowFullMenu ) { 606 if ( KOPrefs::instance()->mShowFullMenu ) {
604 QMenuBar *menuBar1; 607 QMenuBar *menuBar1;
605 menuBar1 = menuBar(); 608 menuBar1 = menuBar();
606 menuBar1->insertItem( i18n("File"), importMenu ); 609 menuBar1->insertItem( i18n("File"), importMenu );
607 menuBar1->insertItem( i18n("View"), viewMenu ); 610 menuBar1->insertItem( i18n("View"), viewMenu );
608 menuBar1->insertItem( i18n("Actions"), actionMenu ); 611 menuBar1->insertItem( i18n("Actions"), actionMenu );
609#ifdef DESKTOP_VERSION 612#ifdef DESKTOP_VERSION
610 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 613 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
611 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 614 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
612#else 615#else
613 menuBar1->insertItem( i18n("Sync"), syncMenu ); 616 menuBar1->insertItem( i18n("Sync"), syncMenu );
614 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 617 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
615#endif 618#endif
616 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 619 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
617 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 620 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
618 menuBar1->insertItem( i18n("Help"), helpMenu ); 621 menuBar1->insertItem( i18n("Help"), helpMenu );
619 } else { 622 } else {
620 QPEMenuBar *menuBar1; 623 QPEMenuBar *menuBar1;
621 menuBar1 = new QPEMenuBar( iconToolBar ); 624 menuBar1 = new QPEMenuBar( iconToolBar );
622 QPopupMenu *menuBar = new QPopupMenu( this ); 625 QPopupMenu *menuBar = new QPopupMenu( this );
623 icon = loadPixmap( pathString + "z_menu" ); 626 icon = loadPixmap( pathString + "z_menu" );
624 menuBar1->insertItem( icon.pixmap(), menuBar); 627 menuBar1->insertItem( icon.pixmap(), menuBar);
625 //menuBar1->insertItem( i18n("ME"), menuBar); 628 //menuBar1->insertItem( i18n("ME"), menuBar);
626 menuBar->insertItem( i18n("File"), importMenu ); 629 menuBar->insertItem( i18n("File"), importMenu );
627 menuBar->insertItem( i18n("View"), viewMenu ); 630 menuBar->insertItem( i18n("View"), viewMenu );
628 menuBar->insertItem( i18n("Actions"), actionMenu ); 631 menuBar->insertItem( i18n("Actions"), actionMenu );
629 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 632 menuBar->insertItem( i18n("Synchronize"), syncMenu );
630 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 633 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
631 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 634 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
632 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 635 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
633 menuBar->insertItem( i18n("Help"), helpMenu ); 636 menuBar->insertItem( i18n("Help"), helpMenu );
634 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 637 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
635 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 638 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
636 } 639 }
637 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 640 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
638 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 641 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
639 mWeekBgColor = iconToolBar->backgroundColor(); 642 mWeekBgColor = iconToolBar->backgroundColor();
640 mWeekPixmap.resize( pixWid , pixHei ); 643 mWeekPixmap.resize( pixWid , pixHei );
641 mWeekPixmap.fill( mWeekBgColor ); 644 mWeekPixmap.fill( mWeekBgColor );
642 icon = mWeekPixmap; 645 icon = mWeekPixmap;
643 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 646 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
644 if ( p-> mShowIconWeekNum ) 647 if ( p-> mShowIconWeekNum )
645 mWeekAction->addTo( iconToolBar ); 648 mWeekAction->addTo( iconToolBar );
646 mWeekFont = font(); 649 mWeekFont = font();
647 650
648 int fontPoint = mWeekFont.pointSize(); 651 int fontPoint = mWeekFont.pointSize();
649 QFontMetrics f( mWeekFont ); 652 QFontMetrics f( mWeekFont );
650 int fontWid = f.width( "30" ); 653 int fontWid = f.width( "30" );
651 while ( fontWid > pixWid ) { 654 while ( fontWid > pixWid ) {
652 --fontPoint; 655 --fontPoint;
653 mWeekFont.setPointSize( fontPoint ); 656 mWeekFont.setPointSize( fontPoint );
654 QFontMetrics f( mWeekFont ); 657 QFontMetrics f( mWeekFont );
655 fontWid = f.width( "30" ); 658 fontWid = f.width( "30" );
656 //qDebug("dec-- "); 659 //qDebug("dec-- ");
657 } 660 }
658 661
659 connect( mWeekAction, SIGNAL( activated() ), 662 connect( mWeekAction, SIGNAL( activated() ),
660 this, SLOT( weekAction() ) ); 663 this, SLOT( weekAction() ) );
661 664
662 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 665 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
663 666
664 //#endif 667 //#endif
665 // ****************** 668 // ******************
666 QAction *action; 669 QAction *action;
667 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 670 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
668 configureToolBarMenu->setCheckable( true ); 671 configureToolBarMenu->setCheckable( true );
669 672
670 673
671 configureAgendaMenu->setCheckable( true ); 674 configureAgendaMenu->setCheckable( true );
672 int iii ; 675 int iii ;
673 for ( iii = 1;iii<= 10 ;++iii ){ 676 for ( iii = 1;iii<= 10 ;++iii ){
674 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 677 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
675 } 678 }
676 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 679 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
677 680
678 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 681 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
679 this, SLOT( showConfigureAgenda( ) ) ); 682 this, SLOT( showConfigureAgenda( ) ) );
680 683
681 icon = loadPixmap( pathString + "configure" ); 684 icon = loadPixmap( pathString + "configure" );
682 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); 685 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this );
683 action->addTo( actionMenu ); 686 action->addTo( actionMenu );
684 connect( action, SIGNAL( activated() ), 687 connect( action, SIGNAL( activated() ),
685 mView, SLOT( edit_options() ) ); 688 mView, SLOT( edit_options() ) );
686 actionMenu->insertSeparator(); 689 actionMenu->insertSeparator();
687 690
688 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 691 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
689 action->addTo( actionMenu ); 692 action->addTo( actionMenu );
690 connect( action, SIGNAL( activated() ), 693 connect( action, SIGNAL( activated() ),
691 mView, SLOT( undo_delete() ) ); 694 mView, SLOT( undo_delete() ) );
692 actionMenu->insertSeparator(); 695 actionMenu->insertSeparator();
693 696
694 icon = loadPixmap( pathString + "newevent" ); 697 icon = loadPixmap( pathString + "newevent" );
695 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 698 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
699 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
696 configureToolBarMenu->insertSeparator(); 700 configureToolBarMenu->insertSeparator();
697 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 701 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
698 configureToolBarMenu->insertSeparator(); 702 configureToolBarMenu->insertSeparator();
699 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 703 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
700 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 704 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
701 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 705 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
702 ne_action->addTo( actionMenu ); 706 ne_action->addTo( actionMenu );
703 connect( ne_action, SIGNAL( activated() ), 707 connect( ne_action, SIGNAL( activated() ),
704 mView, SLOT( newEvent() ) ); 708 mView, SLOT( newEvent() ) );
705 icon = loadPixmap( pathString + "newtodo" ); 709 icon = loadPixmap( pathString + "newtodo" );
706 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 710 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
707 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 711 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
708 nt_action->addTo( actionMenu ); 712 nt_action->addTo( actionMenu );
709 connect( nt_action, SIGNAL( activated() ), 713 connect( nt_action, SIGNAL( activated() ),
710 mView, SLOT( newTodo() ) ); 714 mView, SLOT( newTodo() ) );
711 715
712 icon = loadPixmap( pathString + "today" ); 716 icon = loadPixmap( pathString + "today" );
713 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 717 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
714 today_action->addTo( viewMenu ); 718 today_action->addTo( viewMenu );
715 connect( today_action, SIGNAL( activated() ), 719 connect( today_action, SIGNAL( activated() ),
716 mView, SLOT( goToday() ) ); 720 mView, SLOT( goToday() ) );
717 viewMenu->insertSeparator(); 721 viewMenu->insertSeparator();
718 722
719 icon = loadPixmap( pathString + "navi" ); 723 icon = loadPixmap( pathString + "navi" );
720 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 724 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
721 action->addTo( viewMenu ); 725 action->addTo( viewMenu );
722 connect( action, SIGNAL( activated() ), 726 connect( action, SIGNAL( activated() ),
723 mView, SLOT( toggleDateNavigatorWidget() ) ); 727 mView, SLOT( toggleDateNavigatorWidget() ) );
724 mToggleNav = action ; 728 mToggleNav = action ;
725 icon = loadPixmap( pathString + "filter" ); 729 icon = loadPixmap( pathString + "filter" );
726 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 730 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
727 action->addTo( viewMenu ); 731 action->addTo( viewMenu );
728 connect( action, SIGNAL( activated() ), 732 connect( action, SIGNAL( activated() ),
729 mView, SLOT( toggleFilter() ) ); 733 mView, SLOT( toggleFilter() ) );
730 mToggleFilter = action; 734 mToggleFilter = action;
731 icon = loadPixmap( pathString + "allday" ); 735 icon = loadPixmap( pathString + "allday" );
732 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 736 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
733 action->addTo( viewMenu ); 737 action->addTo( viewMenu );
734 connect( action, SIGNAL( activated() ), 738 connect( action, SIGNAL( activated() ),
735 mView, SLOT( toggleAllDaySize() ) ); 739 mView, SLOT( toggleAllDaySize() ) );
736 mToggleAllday = action; 740 mToggleAllday = action;
737 741
738 742
739 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 743 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
740 mToggleNav, SLOT( setEnabled ( bool ) ) ); 744 mToggleNav, SLOT( setEnabled ( bool ) ) );
741 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 745 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
742 mToggleFilter, SLOT( setEnabled ( bool ) ) ); 746 mToggleFilter, SLOT( setEnabled ( bool ) ) );
743 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 747 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
744 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 748 mToggleAllday, SLOT( setEnabled ( bool ) ) );
745 749
746 viewMenu->insertSeparator(); 750 viewMenu->insertSeparator();
747 icon = loadPixmap( pathString + "picker" ); 751 icon = loadPixmap( pathString + "picker" );
748 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 752 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
749 action->addTo( viewMenu ); 753 action->addTo( viewMenu );
750 connect( action, SIGNAL( activated() ), 754 connect( action, SIGNAL( activated() ),
751 mView, SLOT( showDatePicker() ) ); 755 mView, SLOT( showDatePicker() ) );
752 action->addTo( iconToolBar ); 756 action->addTo( iconToolBar );
753 viewMenu->insertSeparator(); 757 viewMenu->insertSeparator();
754 758
755 759
756 icon = loadPixmap( pathString + "whatsnext" ); 760 icon = loadPixmap( pathString + "whatsnext" );
757 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 761 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
758 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 762 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
759 whatsnext_action->addTo( viewMenu ); 763 whatsnext_action->addTo( viewMenu );
760 connect( whatsnext_action, SIGNAL( activated() ), 764 connect( whatsnext_action, SIGNAL( activated() ),
761 mView->viewManager(), SLOT( showWhatsNextView() ) ); 765 mView->viewManager(), SLOT( showWhatsNextView() ) );
762 766
763 icon = loadPixmap( pathString + "xdays" ); 767 icon = loadPixmap( pathString + "xdays" );
764 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 768 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
765 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 769 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
766 xdays_action->addTo( viewMenu ); 770 xdays_action->addTo( viewMenu );
767 connect( xdays_action, SIGNAL( activated() ), 771 connect( xdays_action, SIGNAL( activated() ),
768 mView->viewManager(), SLOT( showNextXView() ) ); 772 mView->viewManager(), SLOT( showNextXView() ) );
769 773
770 774
771 icon = loadPixmap( pathString + "journal" ); 775 icon = loadPixmap( pathString + "journal" );
772 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 776 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
773 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 777 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
774 viewjournal_action->addTo( viewMenu ); 778 viewjournal_action->addTo( viewMenu );
775 connect( viewjournal_action, SIGNAL( activated() ), 779 connect( viewjournal_action, SIGNAL( activated() ),
776 mView->viewManager(), SLOT( showJournalView() ) ); 780 mView->viewManager(), SLOT( showJournalView() ) );
777 781
778 782
779 icon = loadPixmap( pathString + "day" ); 783 icon = loadPixmap( pathString + "day" );
780 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 784 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
781 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 785 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
782 day1_action->addTo( viewMenu ); 786 day1_action->addTo( viewMenu );
783 // action->addTo( toolBar ); 787 // action->addTo( toolBar );
784 connect( day1_action, SIGNAL( activated() ), 788 connect( day1_action, SIGNAL( activated() ),
785 mView->viewManager(), SLOT( showDayView() ) ); 789 mView->viewManager(), SLOT( showDayView() ) );
786 790
787 icon = loadPixmap( pathString + "workweek" ); 791 icon = loadPixmap( pathString + "workweek" );
788 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 792 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
789 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 793 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
790 day5_action->addTo( viewMenu ); 794 day5_action->addTo( viewMenu );
791 connect( day5_action, SIGNAL( activated() ), 795 connect( day5_action, SIGNAL( activated() ),
792 mView->viewManager(), SLOT( showWorkWeekView() ) ); 796 mView->viewManager(), SLOT( showWorkWeekView() ) );
793 797
794 icon = loadPixmap( pathString + "week" ); 798 icon = loadPixmap( pathString + "week" );
795 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 799 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
796 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 800 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
797 day7_action->addTo( viewMenu ); 801 day7_action->addTo( viewMenu );
798 connect( day7_action, SIGNAL( activated() ), 802 connect( day7_action, SIGNAL( activated() ),
799 mView->viewManager(), SLOT( showWeekView() ) ); 803 mView->viewManager(), SLOT( showWeekView() ) );
800 804
801 icon = loadPixmap( pathString + "workweek2" ); 805 icon = loadPixmap( pathString + "workweek2" );
802 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 806 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
803 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 807 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
804 day6_action->addTo( viewMenu ); 808 day6_action->addTo( viewMenu );
805 connect( day6_action, SIGNAL( activated() ), 809 connect( day6_action, SIGNAL( activated() ),
806 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 810 mView->viewManager(), SLOT( showMonthViewWeek() ) );
807 811
808 icon = loadPixmap( pathString + "month" ); 812 icon = loadPixmap( pathString + "month" );
809 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 813 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
810 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 814 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
811 month_action->addTo( viewMenu ); 815 month_action->addTo( viewMenu );
812 connect( month_action, SIGNAL( activated() ), 816 connect( month_action, SIGNAL( activated() ),
813 mView->viewManager(), SLOT( showMonthView() ) ); 817 mView->viewManager(), SLOT( showMonthView() ) );
814 818
815 icon = loadPixmap( pathString + "list" ); 819 icon = loadPixmap( pathString + "list" );
816 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 820 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
817 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 821 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
818 showlist_action->addTo( viewMenu ); 822 showlist_action->addTo( viewMenu );
819 connect( showlist_action, SIGNAL( activated() ), 823 connect( showlist_action, SIGNAL( activated() ),
820 mView->viewManager(), SLOT( showListView() ) ); 824 mView->viewManager(), SLOT( showListView() ) );
821 825
822 icon = loadPixmap( pathString + "todo" ); 826 icon = loadPixmap( pathString + "todo" );
823 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 827 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
@@ -1068,256 +1072,258 @@ void MainWindow::initActions()
1068 //menuBar->insertItem( iconToolBar ); 1072 //menuBar->insertItem( iconToolBar );
1069 //xdays_action 1073 //xdays_action
1070 if (p-> mShowIconNewEvent) 1074 if (p-> mShowIconNewEvent)
1071 ne_action->addTo( iconToolBar ); 1075 ne_action->addTo( iconToolBar );
1072 if (p->mShowIconNewTodo ) 1076 if (p->mShowIconNewTodo )
1073 nt_action->addTo( iconToolBar ); 1077 nt_action->addTo( iconToolBar );
1074 if (p-> mShowIconSearch) 1078 if (p-> mShowIconSearch)
1075 search_action->addTo( iconToolBar ); 1079 search_action->addTo( iconToolBar );
1076 if (p-> mShowIconWhatsThis) 1080 if (p-> mShowIconWhatsThis)
1077 QWhatsThis::whatsThisButton ( iconToolBar ); 1081 QWhatsThis::whatsThisButton ( iconToolBar );
1078 if (p-> mShowIconNext) 1082 if (p-> mShowIconNext)
1079 whatsnext_action->addTo( viewToolBar ); 1083 whatsnext_action->addTo( viewToolBar );
1080 if (p-> mShowIconNextDays) 1084 if (p-> mShowIconNextDays)
1081 xdays_action->addTo( viewToolBar ); 1085 xdays_action->addTo( viewToolBar );
1082 if (p-> mShowIconJournal) 1086 if (p-> mShowIconJournal)
1083 viewjournal_action->addTo( viewToolBar ); 1087 viewjournal_action->addTo( viewToolBar );
1084 if (p-> mShowIconDay1) 1088 if (p-> mShowIconDay1)
1085 day1_action->addTo( viewToolBar ); 1089 day1_action->addTo( viewToolBar );
1086 if (p-> mShowIconDay5) 1090 if (p-> mShowIconDay5)
1087 day5_action->addTo( viewToolBar ); 1091 day5_action->addTo( viewToolBar );
1088 if (p-> mShowIconDay7) 1092 if (p-> mShowIconDay7)
1089 day7_action->addTo( viewToolBar ); 1093 day7_action->addTo( viewToolBar );
1090 if (p-> mShowIconDay6) 1094 if (p-> mShowIconDay6)
1091 day6_action->addTo( viewToolBar ); 1095 day6_action->addTo( viewToolBar );
1092 if (p-> mShowIconMonth) 1096 if (p-> mShowIconMonth)
1093 month_action->addTo( viewToolBar ); 1097 month_action->addTo( viewToolBar );
1094 if (p-> mShowIconList) 1098 if (p-> mShowIconList)
1095 showlist_action->addTo( viewToolBar ); 1099 showlist_action->addTo( viewToolBar );
1096 if (p-> mShowIconTodoview) 1100 if (p-> mShowIconTodoview)
1097 todoview_action->addTo( viewToolBar ); 1101 todoview_action->addTo( viewToolBar );
1098 1102
1099 icon = loadPixmap( pathString + "2leftarrowB" ); 1103 icon = loadPixmap( pathString + "2leftarrowB" );
1100 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); 1104 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200);
1101 if (p-> mShowIconBackFast) { 1105 if (p-> mShowIconBackFast) {
1102 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1106 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1103 connect( action, SIGNAL( activated() ), 1107 connect( action, SIGNAL( activated() ),
1104 mView, SLOT( goPreviousMonth() ) ); 1108 mView, SLOT( goPreviousMonth() ) );
1105 action->addTo( navigatorToolBar ); 1109 action->addTo( navigatorToolBar );
1106 } 1110 }
1107 icon = loadPixmap( pathString + "1leftarrowB" ); 1111 icon = loadPixmap( pathString + "1leftarrowB" );
1108 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); 1112 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210);
1109 if (p-> mShowIconBack) { 1113 if (p-> mShowIconBack) {
1110 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1114 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1111 connect( action, SIGNAL( activated() ), 1115 connect( action, SIGNAL( activated() ),
1112 mView, SLOT( goPrevious() ) ); 1116 mView, SLOT( goPrevious() ) );
1113 action->addTo( navigatorToolBar ); 1117 action->addTo( navigatorToolBar );
1114 } 1118 }
1115 icon = loadPixmap( pathString + "today" ); 1119 icon = loadPixmap( pathString + "today" );
1116 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1120 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1117 if (p-> mShowIconToday) 1121 if (p-> mShowIconToday)
1118 today_action->addTo( navigatorToolBar ); 1122 today_action->addTo( navigatorToolBar );
1119 icon = loadPixmap( pathString + "1rightarrowB" ); 1123 icon = loadPixmap( pathString + "1rightarrowB" );
1120 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1124 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1121 if (p-> mShowIconForward) { 1125 if (p-> mShowIconForward) {
1122 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1126 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1123 connect( action, SIGNAL( activated() ), 1127 connect( action, SIGNAL( activated() ),
1124 mView, SLOT( goNext() ) ); 1128 mView, SLOT( goNext() ) );
1125 action->addTo( navigatorToolBar ); 1129 action->addTo( navigatorToolBar );
1126 } 1130 }
1127 icon = loadPixmap( pathString + "2rightarrowB" ); 1131 icon = loadPixmap( pathString + "2rightarrowB" );
1128 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1132 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1129 if (p-> mShowIconForwardFast) { 1133 if (p-> mShowIconForwardFast) {
1130 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1134 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1131 connect( action, SIGNAL( activated() ), 1135 connect( action, SIGNAL( activated() ),
1132 mView, SLOT( goNextMonth() ) ); 1136 mView, SLOT( goNextMonth() ) );
1133 action->addTo( navigatorToolBar ); 1137 action->addTo( navigatorToolBar );
1134 } 1138 }
1135 1139
1136 1140
1137 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); 1141 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6);
1138 1142
1139 if (p-> mShowIconNewEvent) 1143 if (p-> mShowIconNewEvent)
1140 configureToolBarMenu->setItemChecked( 10, true ); 1144 configureToolBarMenu->setItemChecked( 10, true );
1141 if (p->mShowIconNewTodo ) 1145 if (p->mShowIconNewTodo )
1142 configureToolBarMenu->setItemChecked( 20, true ); 1146 configureToolBarMenu->setItemChecked( 20, true );
1143 if (p-> mShowIconSearch) 1147 if (p-> mShowIconSearch)
1144 configureToolBarMenu->setItemChecked( 120, true ); 1148 configureToolBarMenu->setItemChecked( 120, true );
1145 if (p-> mShowIconList) 1149 if (p-> mShowIconList)
1146 configureToolBarMenu->setItemChecked( 30, true ); 1150 configureToolBarMenu->setItemChecked( 30, true );
1147 if (p-> mShowIconDay1) 1151 if (p-> mShowIconDay1)
1148 configureToolBarMenu->setItemChecked( 40, true ); 1152 configureToolBarMenu->setItemChecked( 40, true );
1149 if (p-> mShowIconDay5) 1153 if (p-> mShowIconDay5)
1150 configureToolBarMenu->setItemChecked( 50, true ); 1154 configureToolBarMenu->setItemChecked( 50, true );
1151 if (p-> mShowIconDay6) 1155 if (p-> mShowIconDay6)
1152 configureToolBarMenu->setItemChecked( 75, true ); 1156 configureToolBarMenu->setItemChecked( 75, true );
1153 if (p-> mShowIconDay7) 1157 if (p-> mShowIconDay7)
1154 configureToolBarMenu->setItemChecked( 60, true ); 1158 configureToolBarMenu->setItemChecked( 60, true );
1155 if (p-> mShowIconMonth) 1159 if (p-> mShowIconMonth)
1156 configureToolBarMenu->setItemChecked( 70, true ); 1160 configureToolBarMenu->setItemChecked( 70, true );
1157 if (p-> mShowIconTodoview) 1161 if (p-> mShowIconTodoview)
1158 configureToolBarMenu->setItemChecked( 80, true ); 1162 configureToolBarMenu->setItemChecked( 80, true );
1159 if (p-> mShowIconBackFast) 1163 if (p-> mShowIconBackFast)
1160 configureToolBarMenu->setItemChecked( 200, true ); 1164 configureToolBarMenu->setItemChecked( 200, true );
1161 if (p-> mShowIconBack) 1165 if (p-> mShowIconBack)
1162 configureToolBarMenu->setItemChecked( 210, true ); 1166 configureToolBarMenu->setItemChecked( 210, true );
1163 if (p-> mShowIconToday) 1167 if (p-> mShowIconToday)
1164 configureToolBarMenu->setItemChecked( 130, true ); 1168 configureToolBarMenu->setItemChecked( 130, true );
1165 if (p-> mShowIconForward) 1169 if (p-> mShowIconForward)
1166 configureToolBarMenu->setItemChecked( 220, true ); 1170 configureToolBarMenu->setItemChecked( 220, true );
1167 if (p-> mShowIconForwardFast) 1171 if (p-> mShowIconForwardFast)
1168 configureToolBarMenu->setItemChecked( 230, true ); 1172 configureToolBarMenu->setItemChecked( 230, true );
1169 if (p-> mShowIconNextDays) 1173 if (p-> mShowIconNextDays)
1170 configureToolBarMenu->setItemChecked( 100, true ); 1174 configureToolBarMenu->setItemChecked( 100, true );
1171 if (p-> mShowIconNext) 1175 if (p-> mShowIconNext)
1172 configureToolBarMenu->setItemChecked( 110, true ); 1176 configureToolBarMenu->setItemChecked( 110, true );
1173 if (p-> mShowIconJournal) 1177 if (p-> mShowIconJournal)
1174 configureToolBarMenu->setItemChecked( 90, true ); 1178 configureToolBarMenu->setItemChecked( 90, true );
1175 if (p-> mShowIconWhatsThis) 1179 if (p-> mShowIconWhatsThis)
1176 configureToolBarMenu->setItemChecked( 300, true ); 1180 configureToolBarMenu->setItemChecked( 300, true );
1177 if (p-> mShowIconWeekNum) 1181 if (p-> mShowIconWeekNum)
1178 configureToolBarMenu->setItemChecked( 400, true ); 1182 configureToolBarMenu->setItemChecked( 400, true );
1179 if (!p-> mShowIconStretch) { 1183 if (!p-> mShowIconStretch) {
1180 QLabel* dummy = new QLabel( iconToolBar ); 1184 QLabel* dummy = new QLabel( iconToolBar );
1181 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1185 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1182 dummy->setMinimumWidth( 0 ); 1186 dummy->setMinimumWidth( 0 );
1183 iconToolBar->setStretchableWidget ( dummy ) ; 1187 iconToolBar->setStretchableWidget ( dummy ) ;
1184 } 1188 }
1185 else { 1189 else {
1186 iconToolBar->setHorizontalStretchable (true ); 1190 iconToolBar->setHorizontalStretchable (true );
1187 viewToolBar->setHorizontalStretchable (true ); 1191 viewToolBar->setHorizontalStretchable (true );
1188 navigatorToolBar->setHorizontalStretchable (true ); 1192 navigatorToolBar->setHorizontalStretchable (true );
1189 iconToolBar->setVerticalStretchable (true ); 1193 iconToolBar->setVerticalStretchable (true );
1190 viewToolBar->setVerticalStretchable (true ); 1194 viewToolBar->setVerticalStretchable (true );
1191 navigatorToolBar->setVerticalStretchable (true ); 1195 navigatorToolBar->setVerticalStretchable (true );
1192 configureToolBarMenu->setItemChecked( 5, true ); 1196 configureToolBarMenu->setItemChecked( 5, true );
1193 } 1197 }
1194 if (p-> mShowIconFilter) 1198 if (p-> mShowIconFilter)
1195 configureToolBarMenu->setItemChecked( 7, true ); 1199 configureToolBarMenu->setItemChecked( 7, true );
1200 if (p-> mShowIconOnetoolbar)
1201 configureToolBarMenu->setItemChecked( 6, true );
1196 1202
1197 1203
1198 if ( filterMenubar ) 1204 if ( filterMenubar )
1199 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); 1205 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) );
1200 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1206 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1201 configureAgenda( p->mHourSize ); 1207 configureAgenda( p->mHourSize );
1202 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1208 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1203} 1209}
1204 1210
1205void MainWindow::exportToPhone( int mode ) 1211void MainWindow::exportToPhone( int mode )
1206{ 1212{
1207 1213
1208 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1214 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1209 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1215 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1210 KOex2phonePrefs ex2phone; 1216 KOex2phonePrefs ex2phone;
1211 1217
1212 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1218 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1213 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1219 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1214 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1220 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1215 if ( mode == 1 ) 1221 if ( mode == 1 )
1216 ex2phone.setCaption(i18n("Export complete calendar")); 1222 ex2phone.setCaption(i18n("Export complete calendar"));
1217 if ( mode == 2 ) 1223 if ( mode == 2 )
1218 ex2phone.setCaption(i18n("Export filtered calendar")); 1224 ex2phone.setCaption(i18n("Export filtered calendar"));
1219 1225
1220 if ( !ex2phone.exec() ) { 1226 if ( !ex2phone.exec() ) {
1221 return; 1227 return;
1222 } 1228 }
1223 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1229 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1224 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1230 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1225 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1231 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1226 1232
1227 int inFuture = 0; 1233 int inFuture = 0;
1228 if ( ex2phone.mWriteBackFuture->isChecked() ) 1234 if ( ex2phone.mWriteBackFuture->isChecked() )
1229 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1235 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1230 QPtrList<Incidence> delSel; 1236 QPtrList<Incidence> delSel;
1231 if ( mode == 1 ) 1237 if ( mode == 1 )
1232 delSel = mCalendar->rawIncidences(); 1238 delSel = mCalendar->rawIncidences();
1233 if ( mode == 2 ) 1239 if ( mode == 2 )
1234 delSel = mCalendar->incidences(); 1240 delSel = mCalendar->incidences();
1235 CalendarLocal* cal = new CalendarLocal(); 1241 CalendarLocal* cal = new CalendarLocal();
1236 cal->setLocalTime(); 1242 cal->setLocalTime();
1237 Incidence *incidence = delSel.first(); 1243 Incidence *incidence = delSel.first();
1238 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1244 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1239 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1245 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1240 while ( incidence ) { 1246 while ( incidence ) {
1241 if ( incidence->type() != "Journal" ) { 1247 if ( incidence->type() != "Journal" ) {
1242 bool add = true; 1248 bool add = true;
1243 if ( inFuture ) { 1249 if ( inFuture ) {
1244 QDateTime dt; 1250 QDateTime dt;
1245 if ( incidence->type() == "Todo" ) { 1251 if ( incidence->type() == "Todo" ) {
1246 Todo * t = (Todo*)incidence; 1252 Todo * t = (Todo*)incidence;
1247 if ( t->hasDueDate() ) 1253 if ( t->hasDueDate() )
1248 dt = t->dtDue(); 1254 dt = t->dtDue();
1249 else 1255 else
1250 dt = cur.addSecs( 62 ); 1256 dt = cur.addSecs( 62 );
1251 } 1257 }
1252 else { 1258 else {
1253 bool ok; 1259 bool ok;
1254 dt = incidence->getNextOccurence( cur, &ok ); 1260 dt = incidence->getNextOccurence( cur, &ok );
1255 if ( !ok ) 1261 if ( !ok )
1256 dt = cur.addSecs( -62 ); 1262 dt = cur.addSecs( -62 );
1257 } 1263 }
1258 if ( dt < cur || dt > end ) { 1264 if ( dt < cur || dt > end ) {
1259 add = false; 1265 add = false;
1260 } 1266 }
1261 } 1267 }
1262 if ( add ) { 1268 if ( add ) {
1263 Incidence *in = incidence->clone(); 1269 Incidence *in = incidence->clone();
1264 cal->addIncidence( in ); 1270 cal->addIncidence( in );
1265 } 1271 }
1266 } 1272 }
1267 incidence = delSel.next(); 1273 incidence = delSel.next();
1268 } 1274 }
1269 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1275 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1270 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1276 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1271 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1277 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1272 1278
1273 setCaption( i18n("Writing to phone...")); 1279 setCaption( i18n("Writing to phone..."));
1274 if ( PhoneFormat::writeToPhone( cal ) ) 1280 if ( PhoneFormat::writeToPhone( cal ) )
1275 setCaption( i18n("Export to phone successful!")); 1281 setCaption( i18n("Export to phone successful!"));
1276 else 1282 else
1277 setCaption( i18n("Error exporting to phone!")); 1283 setCaption( i18n("Error exporting to phone!"));
1278 delete cal; 1284 delete cal;
1279} 1285}
1280 1286
1281 1287
1282void MainWindow::setDefaultPreferences() 1288void MainWindow::setDefaultPreferences()
1283{ 1289{
1284 KOPrefs *p = KOPrefs::instance(); 1290 KOPrefs *p = KOPrefs::instance();
1285 1291
1286 p->mCompactDialogs = true; 1292 p->mCompactDialogs = true;
1287 p->mConfirm = true; 1293 p->mConfirm = true;
1288 // p->mEnableQuickTodo = false; 1294 // p->mEnableQuickTodo = false;
1289 1295
1290} 1296}
1291 1297
1292QString MainWindow::resourcePath() 1298QString MainWindow::resourcePath()
1293{ 1299{
1294 return KGlobal::iconLoader()->iconPath(); 1300 return KGlobal::iconLoader()->iconPath();
1295} 1301}
1296 1302
1297void MainWindow::displayText( QString text ,QString cap ) 1303void MainWindow::displayText( QString text ,QString cap )
1298{ 1304{
1299 QDialog dia( this, "name", true ); ; 1305 QDialog dia( this, "name", true ); ;
1300 dia.setCaption( cap ); 1306 dia.setCaption( cap );
1301 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1307 QVBoxLayout* lay = new QVBoxLayout( &dia );
1302 lay->setSpacing( 3 ); 1308 lay->setSpacing( 3 );
1303 lay->setMargin( 3 ); 1309 lay->setMargin( 3 );
1304 QTextBrowser tb ( &dia ); 1310 QTextBrowser tb ( &dia );
1305 lay->addWidget( &tb ); 1311 lay->addWidget( &tb );
1306 tb.setText( text ); 1312 tb.setText( text );
1307#ifdef DESKTOP_VERSION 1313#ifdef DESKTOP_VERSION
1308 dia.resize( 640, 480); 1314 dia.resize( 640, 480);
1309#else 1315#else
1310 dia.showMaximized(); 1316 dia.showMaximized();
1311#endif 1317#endif
1312 dia.exec(); 1318 dia.exec();
1313} 1319}
1314 1320
1315void MainWindow::features() 1321void MainWindow::features()
1316{ 1322{
1317 1323
1318 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1324 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1319} 1325}
1320 1326
1321void MainWindow::usertrans() 1327void MainWindow::usertrans()
1322{ 1328{
1323 1329
@@ -1829,285 +1835,289 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
1829 showSelectedDates = true; 1835 showSelectedDates = true;
1830 } 1836 }
1831 break; 1837 break;
1832 case Qt::Key_V: 1838 case Qt::Key_V:
1833 mView->viewManager()->showTodoView(); 1839 mView->viewManager()->showTodoView();
1834 break; 1840 break;
1835 case Qt::Key_C: 1841 case Qt::Key_C:
1836 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1842 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1837 break; 1843 break;
1838 case Qt::Key_P: 1844 case Qt::Key_P:
1839 mView->showDatePicker( ); 1845 mView->showDatePicker( );
1840 break; 1846 break;
1841 case Qt::Key_F: 1847 case Qt::Key_F:
1842 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1848 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1843 mView->editFilters(); 1849 mView->editFilters();
1844 else 1850 else
1845 mView->toggleFilter(); 1851 mView->toggleFilter();
1846 break; 1852 break;
1847 case Qt::Key_X: 1853 case Qt::Key_X:
1848 mView->toggleDateNavigatorWidget(); 1854 mView->toggleDateNavigatorWidget();
1849 break; 1855 break;
1850 case Qt::Key_Space: 1856 case Qt::Key_Space:
1851 mView->toggleExpand(); 1857 mView->toggleExpand();
1852 break; 1858 break;
1853 case Qt::Key_A: 1859 case Qt::Key_A:
1854 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 1860 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
1855 mView->showNextAlarms(); 1861 mView->showNextAlarms();
1856 else 1862 else
1857 mView->toggleAllDaySize(); 1863 mView->toggleAllDaySize();
1858 break; 1864 break;
1859 case Qt::Key_T: 1865 case Qt::Key_T:
1860 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1866 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1861 mView->newTodo(); 1867 mView->newTodo();
1862 else { 1868 else {
1863 mView->goToday(); 1869 mView->goToday();
1864 showSelectedDates = true; 1870 showSelectedDates = true;
1865 } 1871 }
1866 break; 1872 break;
1867 case Qt::Key_J: 1873 case Qt::Key_J:
1868 mView->viewManager()->showJournalView(); 1874 mView->viewManager()->showJournalView();
1869 break; 1875 break;
1870 case Qt::Key_B: 1876 case Qt::Key_B:
1871 mView->editIncidenceDescription();; 1877 mView->editIncidenceDescription();;
1872 break; 1878 break;
1873 // case Qt::Key_Return: 1879 // case Qt::Key_Return:
1874 case Qt::Key_E: 1880 case Qt::Key_E:
1875 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1881 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1876 mView->newEvent(); 1882 mView->newEvent();
1877 else 1883 else
1878 mView->editIncidence(); 1884 mView->editIncidence();
1879 break; 1885 break;
1880 case Qt::Key_Plus: 1886 case Qt::Key_Plus:
1881 size = p->mHourSize +2; 1887 size = p->mHourSize +2;
1882 if ( size <= 22 ) 1888 if ( size <= 22 )
1883 configureAgenda( size ); 1889 configureAgenda( size );
1884 break; 1890 break;
1885 case Qt::Key_Minus: 1891 case Qt::Key_Minus:
1886 size = p->mHourSize - 2; 1892 size = p->mHourSize - 2;
1887 if ( size >= 4 ) 1893 if ( size >= 4 )
1888 configureAgenda( size ); 1894 configureAgenda( size );
1889 break; 1895 break;
1890 1896
1891 1897
1892 default: 1898 default:
1893 e->ignore(); 1899 e->ignore();
1894 } 1900 }
1895 if ( pro > 0 ) { 1901 if ( pro > 0 ) {
1896 mView->selectFilter( pro-1 ); 1902 mView->selectFilter( pro-1 );
1897 } 1903 }
1898 if ( showSelectedDates ) { 1904 if ( showSelectedDates ) {
1899 ;// setCaptionToDates(); 1905 ;// setCaptionToDates();
1900 } 1906 }
1901 1907
1902} 1908}
1903 1909
1904void MainWindow::fillFilterMenu() 1910void MainWindow::fillFilterMenu()
1905{ 1911{
1906 selectFilterMenu->clear(); 1912 selectFilterMenu->clear();
1907 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 1913 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
1908 selectFilterMenu->insertSeparator(); 1914 selectFilterMenu->insertSeparator();
1909 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 1915 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
1910 1916
1911 selectFilterMenu->insertSeparator(); 1917 selectFilterMenu->insertSeparator();
1912 QPtrList<CalFilter> fili = mView->filters(); 1918 QPtrList<CalFilter> fili = mView->filters();
1913 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1919 CalFilter *curfilter = mView->filterView()->selectedFilter();
1914 CalFilter *filter = fili.first(); 1920 CalFilter *filter = fili.first();
1915 int iii = 2; 1921 int iii = 2;
1916 bool checkitem = mView->filterView()->filtersEnabled(); 1922 bool checkitem = mView->filterView()->filtersEnabled();
1917 while(filter) { 1923 while(filter) {
1918 selectFilterMenu->insertItem( filter->name(), iii ); 1924 selectFilterMenu->insertItem( filter->name(), iii );
1919 if ( filter == curfilter) 1925 if ( filter == curfilter)
1920 selectFilterMenu->setItemChecked( iii, checkitem ); 1926 selectFilterMenu->setItemChecked( iii, checkitem );
1921 filter = fili.next(); 1927 filter = fili.next();
1922 ++iii; 1928 ++iii;
1923 } 1929 }
1924 if ( !checkitem ) 1930 if ( !checkitem )
1925 selectFilterMenu->setItemChecked( 1, true ); 1931 selectFilterMenu->setItemChecked( 1, true );
1926} 1932}
1927void MainWindow::fillFilterMenuPopup() 1933void MainWindow::fillFilterMenuPopup()
1928{ 1934{
1929 filterPopupMenu->clear(); 1935 filterPopupMenu->clear();
1930 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 1936 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
1931 1937
1932 filterPopupMenu->insertSeparator(); 1938 filterPopupMenu->insertSeparator();
1933 QPtrList<CalFilter> fili = mView->filters(); 1939 QPtrList<CalFilter> fili = mView->filters();
1934 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1940 CalFilter *curfilter = mView->filterView()->selectedFilter();
1935 CalFilter *filter = fili.first(); 1941 CalFilter *filter = fili.first();
1936 int iii = 1; 1942 int iii = 1;
1937 bool checkitem = mView->filterView()->filtersEnabled(); 1943 bool checkitem = mView->filterView()->filtersEnabled();
1938 while(filter) { 1944 while(filter) {
1939 filterPopupMenu->insertItem( filter->name(), iii ); 1945 filterPopupMenu->insertItem( filter->name(), iii );
1940 if ( filter == curfilter) 1946 if ( filter == curfilter)
1941 filterPopupMenu->setItemChecked( iii, checkitem ); 1947 filterPopupMenu->setItemChecked( iii, checkitem );
1942 filter = fili.next(); 1948 filter = fili.next();
1943 ++iii; 1949 ++iii;
1944 } 1950 }
1945 if ( !checkitem ) 1951 if ( !checkitem )
1946 filterPopupMenu->setItemChecked( 0, true ); 1952 filterPopupMenu->setItemChecked( 0, true );
1947} 1953}
1948void MainWindow::selectFilter( int fil ) 1954void MainWindow::selectFilter( int fil )
1949{ 1955{
1950 1956
1951 if ( fil == 0 ) { 1957 if ( fil == 0 ) {
1952 mView->editFilters( ); 1958 mView->editFilters( );
1953 } else if ( fil == 1 ){ 1959 } else if ( fil == 1 ){
1954 if ( mView->filterView()->filtersEnabled() ) 1960 if ( mView->filterView()->filtersEnabled() )
1955 mView->toggleFilerEnabled( ); 1961 mView->toggleFilerEnabled( );
1956 } else { 1962 } else {
1957 if ( !mView->filterView()->filtersEnabled() ) 1963 if ( !mView->filterView()->filtersEnabled() ) {
1964 mView->filterView()->blockSignals( true );
1958 mView->toggleFilerEnabled( ); 1965 mView->toggleFilerEnabled( );
1966 mView->filterView()->blockSignals( false );
1967 }
1959 mView->selectFilter( fil-2 ); 1968 mView->selectFilter( fil-2 );
1960 } 1969 }
1961} 1970}
1962void MainWindow::updateFilterToolbar() 1971void MainWindow::updateFilterToolbar()
1963{ 1972{
1964 if ( filterMenubar ) { 1973 if ( filterMenubar ) {
1965 if ( !mView->filterView()->filtersEnabled() ) { 1974 if ( !mView->filterView()->filtersEnabled() ) {
1966 filterMenubar->changeItem( 0, i18n("No Filter") ); 1975 filterMenubar->changeItem( 0, i18n("No Filter") );
1967 } else { 1976 } else {
1968 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1977 CalFilter *curfilter = mView->filterView()->selectedFilter();
1969 if ( curfilter ) { 1978 if ( curfilter ) {
1970 filterMenubar->changeItem( 0, curfilter->name() ); 1979 filterMenubar->changeItem( 0, curfilter->name() );
1971 } 1980 }
1972 } 1981 }
1973 } 1982 }
1974} 1983}
1975void MainWindow::selectFilterPopup( int fil ) 1984void MainWindow::selectFilterPopup( int fil )
1976{ 1985{
1977 selectFilter( fil + 1 ); 1986 selectFilter( fil + 1 );
1978 1987
1979} 1988}
1980void MainWindow::configureToolBar( int item ) 1989void MainWindow::configureToolBar( int item )
1981{ 1990{
1982 1991
1983 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 1992 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
1984 KOPrefs *p = KOPrefs::instance(); 1993 KOPrefs *p = KOPrefs::instance();
1985 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 1994 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
1995 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
1986 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 1996 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
1987 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 1997 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
1988 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 1998 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
1989 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 1999 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
1990 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2000 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
1991 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2001 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
1992 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2002 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
1993 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2003 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
1994 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2004 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
1995 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2005 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
1996 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2006 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
1997 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2007 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
1998 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2008 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
1999 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2009 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2000 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2010 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2001 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2011 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2002 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2012 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2003 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2013 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2004 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2014 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2005 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2015 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2006 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2016 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2007 // initActions(); 2017 // initActions();
2008} 2018}
2009void MainWindow::setCaption ( const QString & c ) 2019void MainWindow::setCaption ( const QString & c )
2010{ 2020{
2011 QString cap = c; 2021 QString cap = c;
2012 cap.replace( QRegExp("\n"), " " ); 2022 cap.replace( QRegExp("\n"), " " );
2013 cap = cap.stripWhiteSpace(); 2023 cap = cap.stripWhiteSpace();
2014 if ( cap.isEmpty() ) 2024 if ( cap.isEmpty() )
2015 cap = "KO/Pi"; 2025 cap = "KO/Pi";
2016 QWidget::setCaption( cap ); 2026 QWidget::setCaption( cap );
2017} 2027}
2018void MainWindow::setCaptionToDates() 2028void MainWindow::setCaptionToDates()
2019{ 2029{
2020 QString selDates; 2030 QString selDates;
2021 QDate date = mView->startDate(); 2031 QDate date = mView->startDate();
2022 if ( ! date.isValid() ) { 2032 if ( ! date.isValid() ) {
2023 setCaption(""); 2033 setCaption("");
2024 return; 2034 return;
2025 } 2035 }
2026 selDates = KGlobal::locale()->formatDate( date, true); 2036 selDates = KGlobal::locale()->formatDate( date, true);
2027 if (mView->startDate() < mView->endDate() ) 2037 if (mView->startDate() < mView->endDate() )
2028 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2038 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2029 else { 2039 else {
2030 QString addString; 2040 QString addString;
2031 if ( date == QDateTime::currentDateTime().date() ) 2041 if ( date == QDateTime::currentDateTime().date() )
2032 addString = i18n("Today"); 2042 addString = i18n("Today");
2033 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2043 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
2034 addString = i18n("Tomorrow"); 2044 addString = i18n("Tomorrow");
2035 if ( !addString.isEmpty() ) 2045 if ( !addString.isEmpty() )
2036 selDates = addString+", "+selDates ; 2046 selDates = addString+", "+selDates ;
2037 } 2047 }
2038 setCaption( i18n("Dates: ") + selDates ); 2048 setCaption( i18n("Dates: ") + selDates );
2039 2049
2040} 2050}
2041void MainWindow::showConfigureAgenda( ) 2051void MainWindow::showConfigureAgenda( )
2042{ 2052{
2043 int iii; 2053 int iii;
2044 for ( iii = 1;iii<= 10 ;++iii ){ 2054 for ( iii = 1;iii<= 10 ;++iii ){
2045 configureAgendaMenu->setItemChecked( (iii+1)*2, false ); 2055 configureAgendaMenu->setItemChecked( (iii+1)*2, false );
2046 } 2056 }
2047 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2057 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2048} 2058}
2049void MainWindow::configureAgenda( int item ) 2059void MainWindow::configureAgenda( int item )
2050{ 2060{
2051 if ( KOPrefs::instance()->mHourSize == item ) 2061 if ( KOPrefs::instance()->mHourSize == item )
2052 return; 2062 return;
2053 KOPrefs::instance()->mHourSize=item; 2063 KOPrefs::instance()->mHourSize=item;
2054 mView->viewManager()->agendaView()->updateConfig(); 2064 mView->viewManager()->agendaView()->updateConfig();
2055} 2065}
2056 2066
2057void MainWindow::saveCalendar() 2067void MainWindow::saveCalendar()
2058{ 2068{
2059 QString fn = KOPrefs::instance()->mLastSaveFile; 2069 QString fn = KOPrefs::instance()->mLastSaveFile;
2060 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); 2070 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this );
2061 2071
2062 if ( fn == "" ) 2072 if ( fn == "" )
2063 return; 2073 return;
2064 QFileInfo info; 2074 QFileInfo info;
2065 info.setFile( fn ); 2075 info.setFile( fn );
2066 QString mes; 2076 QString mes;
2067 bool createbup = true; 2077 bool createbup = true;
2068 if ( info. exists() ) { 2078 if ( info. exists() ) {
2069 mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; 2079 mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ;
2070 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2080 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2071 i18n("Overwrite!"), i18n("Cancel"), 0, 2081 i18n("Overwrite!"), i18n("Cancel"), 0,
2072 0, 1 ); 2082 0, 1 );
2073 if ( result != 0 ) { 2083 if ( result != 0 ) {
2074 createbup = false; 2084 createbup = false;
2075 } 2085 }
2076 } 2086 }
2077 if ( createbup ) { 2087 if ( createbup ) {
2078 mView->saveCalendar( fn ); 2088 mView->saveCalendar( fn );
2079 mes = i18n("KO/Pi:Saved %1").arg(fn); 2089 mes = i18n("KO/Pi:Saved %1").arg(fn);
2080 KOPrefs::instance()->mLastSaveFile = fn; 2090 KOPrefs::instance()->mLastSaveFile = fn;
2081 setCaption(mes); 2091 setCaption(mes);
2082 } 2092 }
2083} 2093}
2084void MainWindow::loadCalendar() 2094void MainWindow::loadCalendar()
2085{ 2095{
2086 2096
2087 QString fn = KOPrefs::instance()->mLastLoadFile; 2097 QString fn = KOPrefs::instance()->mLastLoadFile;
2088 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 2098 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
2089 2099
2090 if ( fn == "" ) 2100 if ( fn == "" )
2091 return; 2101 return;
2092 QFileInfo info; 2102 QFileInfo info;
2093 info.setFile( fn ); 2103 info.setFile( fn );
2094 QString mess; 2104 QString mess;
2095 bool loadbup = true; 2105 bool loadbup = true;
2096 if ( info. exists() ) { 2106 if ( info. exists() ) {
2097 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2107 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2098 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 2108 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
2099 mess, 2109 mess,
2100 i18n("Load!"), i18n("Cancel"), 0, 2110 i18n("Load!"), i18n("Cancel"), 0,
2101 0, 1 ); 2111 0, 1 );
2102 if ( result != 0 ) { 2112 if ( result != 0 ) {
2103 loadbup = false; 2113 loadbup = false;
2104 } 2114 }
2105 } else { 2115 } else {
2106 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2116 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2107 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 2117 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
2108 0, 1 ); 2118 0, 1 );
2109 2119
2110 return; 2120 return;
2111 } 2121 }
2112 if ( loadbup ) { 2122 if ( loadbup ) {
2113 mView->openCalendar( fn ); 2123 mView->openCalendar( fn );