summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp11
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/kolistview.cpp3
-rw-r--r--korganizer/kotodoview.cpp4
-rw-r--r--korganizer/mainwindow.cpp171
-rw-r--r--korganizer/mainwindow.h1
6 files changed, 114 insertions, 77 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index d0de233..c0f3be7 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -23,192 +23,193 @@
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
24 GNU General Public License for more details. 24 GNU General Public License for more details.
25 25
26 You should have received a copy of the GNU General Public License 26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software 27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include <stdlib.h> 31#include <stdlib.h>
32 32
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qradiobutton.h> 34#include <qradiobutton.h>
35#include <qbuttongroup.h> 35#include <qbuttongroup.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qclipboard.h> 37#include <qclipboard.h>
38#include <qcursor.h> 38#include <qcursor.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qprogressbar.h> 40#include <qprogressbar.h>
41#include <qmultilineedit.h> 41#include <qmultilineedit.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qwidgetstack.h> 43#include <qwidgetstack.h>
44#include <qptrlist.h> 44#include <qptrlist.h>
45#include <qregexp.h> 45#include <qregexp.h>
46#include <qgroupbox.h> 46#include <qgroupbox.h>
47#include <qfile.h> 47#include <qfile.h>
48#include <qdir.h> 48#include <qdir.h>
49#ifndef KORG_NOSPLITTER 49#ifndef KORG_NOSPLITTER
50#include <qsplitter.h> 50#include <qsplitter.h>
51#endif 51#endif
52 52
53#include <kglobal.h> 53#include <kglobal.h>
54#include <kdebug.h> 54#include <kdebug.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kfiledialog.h> 56#include <kfiledialog.h>
57#include <kmessagebox.h> 57#include <kmessagebox.h>
58#include <knotifyclient.h> 58#include <knotifyclient.h>
59#include <kconfig.h> 59#include <kconfig.h>
60 60
61#include <libkdepim/ksyncprefsdialog.h> 61#include <libkdepim/ksyncprefsdialog.h>
62#include <krun.h> 62#include <krun.h>
63#include <kdirwatch.h> 63#include <kdirwatch.h>
64#include <libkdepim/kdatepicker.h> 64#include <libkdepim/kdatepicker.h>
65#include <libkdepim/ksyncprofile.h> 65#include <libkdepim/ksyncprofile.h>
66#include <libkdepim/kpimglobalprefs.h> 66#include <libkdepim/kpimglobalprefs.h>
67 67
68#include <libkcal/vcaldrag.h> 68#include <libkcal/vcaldrag.h>
69#include <libkcal/icaldrag.h> 69#include <libkcal/icaldrag.h>
70#include <libkcal/icalformat.h> 70#include <libkcal/icalformat.h>
71#include <libkcal/vcalformat.h> 71#include <libkcal/vcalformat.h>
72#include <libkcal/scheduler.h> 72#include <libkcal/scheduler.h>
73#include <libkcal/calendarlocal.h> 73#include <libkcal/calendarlocal.h>
74#include <libkcal/journal.h> 74#include <libkcal/journal.h>
75#include <libkcal/calfilter.h> 75#include <libkcal/calfilter.h>
76#include <libkcal/attendee.h> 76#include <libkcal/attendee.h>
77#include <libkcal/dndfactory.h> 77#include <libkcal/dndfactory.h>
78#include <libkcal/freebusy.h> 78#include <libkcal/freebusy.h>
79#include <libkcal/filestorage.h> 79#include <libkcal/filestorage.h>
80#include <libkcal/calendarresources.h> 80#include <libkcal/calendarresources.h>
81#include <libkcal/qtopiaformat.h> 81#include <libkcal/qtopiaformat.h>
82#include "../kalarmd/alarmdialog.h" 82#include "../kalarmd/alarmdialog.h"
83 83
84#ifndef DESKTOP_VERSION 84#ifndef DESKTOP_VERSION
85#include <libkcal/sharpformat.h> 85#include <libkcal/sharpformat.h>
86#include <externalapphandler.h> 86#include <externalapphandler.h>
87#endif 87#endif
88#include <libkcal/phoneformat.h> 88#include <libkcal/phoneformat.h>
89#ifndef KORG_NOMAIL 89#ifndef KORG_NOMAIL
90#include "komailclient.h" 90#include "komailclient.h"
91#endif 91#endif
92#ifndef KORG_NOPRINTER 92#ifndef KORG_NOPRINTER
93#include "calprinter.h" 93#include "calprinter.h"
94#endif 94#endif
95#ifndef KORG_NOPLUGINS 95#ifndef KORG_NOPLUGINS
96#include "kocore.h" 96#include "kocore.h"
97#endif 97#endif
98#include "koeventeditor.h" 98#include "koeventeditor.h"
99#include "kotodoeditor.h" 99#include "kotodoeditor.h"
100#include "koprefs.h" 100#include "koprefs.h"
101#include "koeventviewerdialog.h" 101#include "koeventviewerdialog.h"
102#include "publishdialog.h" 102#include "publishdialog.h"
103#include "kofilterview.h" 103#include "kofilterview.h"
104#include "koglobals.h" 104#include "koglobals.h"
105#include "koviewmanager.h" 105#include "koviewmanager.h"
106#include "koagendaview.h" 106#include "koagendaview.h"
107#include "kodialogmanager.h" 107#include "kodialogmanager.h"
108#include "outgoingdialog.h" 108#include "outgoingdialog.h"
109#include "incomingdialog.h" 109#include "incomingdialog.h"
110#include "datenavigatorcontainer.h" 110#include "datenavigatorcontainer.h"
111#include "statusdialog.h" 111#include "statusdialog.h"
112#include "kdatenavigator.h" 112#include "kdatenavigator.h"
113#include "kotodoview.h" 113#include "kotodoview.h"
114#include "datenavigator.h" 114#include "datenavigator.h"
115#include "resourceview.h" 115#include "resourceview.h"
116#include "navigatorbar.h" 116#include "navigatorbar.h"
117#include "searchdialog.h" 117#include "searchdialog.h"
118#include "mainwindow.h" 118#include "mainwindow.h"
119#include "categoryeditdialog.h"
119 120
120#include "calendarview.h" 121#include "calendarview.h"
121#ifndef DESKTOP_VERSION 122#ifndef DESKTOP_VERSION
122#include <qtopia/alarmserver.h> 123#include <qtopia/alarmserver.h>
123#endif 124#endif
124#ifndef _WIN32_ 125#ifndef _WIN32_
125#include <stdlib.h> 126#include <stdlib.h>
126#include <stdio.h> 127#include <stdio.h>
127#include <unistd.h> 128#include <unistd.h>
128#else 129#else
129#include <qprocess.h> 130#include <qprocess.h>
130#endif 131#endif
131 132
132#ifdef DESKTOP_VERSION 133#ifdef DESKTOP_VERSION
133#include <kabc/stdaddressbook.h> 134#include <kabc/stdaddressbook.h>
134#endif 135#endif
135using namespace KOrg; 136using namespace KOrg;
136using namespace KCal; 137using namespace KCal;
137extern int globalFlagBlockAgenda; 138extern int globalFlagBlockAgenda;
138extern int globalFlagBlockStartup; 139extern int globalFlagBlockStartup;
139 140
140 141
141MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) 142MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent)
142 143
143{ 144{
144 mAlarms = alarms; 145 mAlarms = alarms;
145 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) ); 146 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) );
146 QString mText = "<table width=\"100%\">\n"; 147 QString mText = "<table width=\"100%\">\n";
147 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 148 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
148#ifdef DESKTOP_VERSION 149#ifdef DESKTOP_VERSION
149 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 150 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
150#else 151#else
151 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>"; 152 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>";
152#endif 153#endif
153 // mText += "<img src=\""; 154 // mText += "<img src=\"";
154 // mText += ipath; 155 // mText += ipath;
155 // mText += "\">"; 156 // mText += "\">";
156 //mEventDate = QDate::currentDate(); 157 //mEventDate = QDate::currentDate();
157#ifdef DESKTOP_VERSION 158#ifdef DESKTOP_VERSION
158 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>"; 159 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>";
159#else 160#else
160 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>"; 161 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>";
161#endif 162#endif
162 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 163 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
163 164
164 Incidence * inc = getNextInc( start ); 165 Incidence * inc = getNextInc( start );
165 int time = 0; 166 int time = 0;
166 //mText += "<table>"; 167 //mText += "<table>";
167 while ( inc ) { 168 while ( inc ) {
168 QDateTime dt ; 169 QDateTime dt ;
169 QString tempText = "<a "; 170 QString tempText = "<a ";
170 bool ok; 171 bool ok;
171 dt = inc->getNextOccurence( start, &ok ); 172 dt = inc->getNextOccurence( start, &ok );
172 if ( !ok ) continue; 173 if ( !ok ) continue;
173 if ( inc->typeID() == eventID ) { 174 if ( inc->typeID() == eventID ) {
174 tempText += "href=\"event:"; 175 tempText += "href=\"event:";
175 } else if ( inc->typeID() == todoID ) { 176 } else if ( inc->typeID() == todoID ) {
176 tempText += "href=\"todo:"; 177 tempText += "href=\"todo:";
177 } 178 }
178 tempText += inc->uid() + "\">"; 179 tempText += inc->uid() + "\">";
179 if ( inc->typeID() == todoID ) 180 if ( inc->typeID() == todoID )
180 tempText += i18n("Todo: "); 181 tempText += i18n("Todo: ");
181 if ( inc->summary().length() > 0 ) 182 if ( inc->summary().length() > 0 )
182 tempText += inc->summary(); 183 tempText += inc->summary();
183 else 184 else
184 tempText += i18n("-no summary-"); 185 tempText += i18n("-no summary-");
185 QString timestr; 186 QString timestr;
186 if (!inc->doesFloat()) 187 if (!inc->doesFloat())
187 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": "; 188 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": ";
188 else 189 else
189 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 190 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
190 if ( dt.date() < QDate::currentDate() && time == 0 ) { 191 if ( dt.date() < QDate::currentDate() && time == 0 ) {
191 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 192 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
192 mText += "<table>"; 193 mText += "<table>";
193 time = 1; 194 time = 1;
194 } 195 }
195 if ( dt.date() == QDate::currentDate() && time <= 1 ) { 196 if ( dt.date() == QDate::currentDate() && time <= 1 ) {
196 if ( time > 0 ) 197 if ( time > 0 )
197 mText +="</table>"; 198 mText +="</table>";
198 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>"; 199 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>";
199 mText += "<table>"; 200 mText += "<table>";
200 time = 2; 201 time = 2;
201 202
202 } 203 }
203 if ( dt.date() > QDate::currentDate() && time <= 2 ) { 204 if ( dt.date() > QDate::currentDate() && time <= 2 ) {
204 if ( time > 0 ) 205 if ( time > 0 )
205 mText +="</table>"; 206 mText +="</table>";
206 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>"; 207 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>";
207 mText += "<table>"; 208 mText += "<table>";
208 time = 3; 209 time = 3;
209 } 210 }
210 mText +="<tr><td><b>"; 211 mText +="<tr><td><b>";
211 mText += timestr; 212 mText += timestr;
212 mText += "</b></td><td>"; 213 mText += "</b></td><td>";
213 mText += tempText; 214 mText += tempText;
214 mText += "</td></tr>\n"; 215 mText += "</td></tr>\n";
@@ -220,201 +221,201 @@ MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Inciden
220 221
221MissedAlarmTextBrowser::~MissedAlarmTextBrowser() 222MissedAlarmTextBrowser::~MissedAlarmTextBrowser()
222{ 223{
223 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() "); 224 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() ");
224} 225}
225Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start ) 226Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start )
226{ 227{
227 QDateTime dt ; 228 QDateTime dt ;
228 Incidence * retInc; 229 Incidence * retInc;
229 Incidence * inc = mAlarms.first(); 230 Incidence * inc = mAlarms.first();
230 if ( inc == 0 ) 231 if ( inc == 0 )
231 return 0; 232 return 0;
232 bool ok; 233 bool ok;
233 dt = inc->getNextOccurence( start, &ok ); 234 dt = inc->getNextOccurence( start, &ok );
234 if ( ! ok ) return 0; 235 if ( ! ok ) return 0;
235 QDateTime dtn ; 236 QDateTime dtn ;
236 retInc = inc; 237 retInc = inc;
237 inc = mAlarms.next(); 238 inc = mAlarms.next();
238 while ( inc ) { 239 while ( inc ) {
239 dtn = inc->getNextOccurence( start, &ok ); 240 dtn = inc->getNextOccurence( start, &ok );
240 if ( ! ok ) return 0; 241 if ( ! ok ) return 0;
241 if ( dtn < dt ) { 242 if ( dtn < dt ) {
242 dt = dtn; 243 dt = dtn;
243 retInc = inc; 244 retInc = inc;
244 } 245 }
245 inc = mAlarms.next(); 246 inc = mAlarms.next();
246 } 247 }
247 mAlarms.remove( retInc ); 248 mAlarms.remove( retInc );
248 return retInc; 249 return retInc;
249 250
250} 251}
251void MissedAlarmTextBrowser::setSource(const QString & n) 252void MissedAlarmTextBrowser::setSource(const QString & n)
252{ 253{
253 if (n.startsWith("event:")) { 254 if (n.startsWith("event:")) {
254#ifdef DESKTOP_VERSION 255#ifdef DESKTOP_VERSION
255 emit showIncidence(n.mid(8)); 256 emit showIncidence(n.mid(8));
256#else 257#else
257 emit showIncidence(n.mid(6)); 258 emit showIncidence(n.mid(6));
258#endif 259#endif
259 return; 260 return;
260 } else if (n.startsWith("todo:")) { 261 } else if (n.startsWith("todo:")) {
261#ifdef DESKTOP_VERSION 262#ifdef DESKTOP_VERSION
262 emit showIncidence(n.mid(7)); 263 emit showIncidence(n.mid(7));
263#else 264#else
264 emit showIncidence(n.mid(5)); 265 emit showIncidence(n.mid(5));
265#endif 266#endif
266 return; 267 return;
267 } 268 }
268} 269}
269 270
270 271
271class KOBeamPrefs : public QDialog 272class KOBeamPrefs : public QDialog
272{ 273{
273 public: 274 public:
274 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 275 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
275 QDialog( parent, name, true ) 276 QDialog( parent, name, true )
276 { 277 {
277 setCaption( i18n("Beam Options") ); 278 setCaption( i18n("Beam Options") );
278 QVBoxLayout* lay = new QVBoxLayout( this ); 279 QVBoxLayout* lay = new QVBoxLayout( this );
279 lay->setSpacing( 3 ); 280 lay->setSpacing( 3 );
280 lay->setMargin( 3 ); 281 lay->setMargin( 3 );
281 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 282 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
282 lay->addWidget( format ); 283 lay->addWidget( format );
283 format->setExclusive ( true ) ; 284 format->setExclusive ( true ) ;
284 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 285 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
285 lay->addWidget( time ); time->setExclusive ( true ) ; 286 lay->addWidget( time ); time->setExclusive ( true ) ;
286 vcal = new QRadioButton(" vCalendar ", format ); 287 vcal = new QRadioButton(" vCalendar ", format );
287 ical = new QRadioButton(" iCalendar ", format ); 288 ical = new QRadioButton(" iCalendar ", format );
288 vcal->setChecked( true ); 289 vcal->setChecked( true );
289 tz = new QRadioButton(i18n(" With timezone "), time ); 290 tz = new QRadioButton(i18n(" With timezone "), time );
290 local = new QRadioButton(i18n(" Local time "), time ); 291 local = new QRadioButton(i18n(" Local time "), time );
291 tz->setChecked( true ); 292 tz->setChecked( true );
292 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 293 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
293 lay->addWidget( ok ); 294 lay->addWidget( ok );
294 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 295 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
295 lay->addWidget( cancel ); 296 lay->addWidget( cancel );
296 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 297 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
297 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 298 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
298 resize( 200, 200 ); 299 resize( 200, 200 );
299 } 300 }
300 301
301 bool beamVcal() { return vcal->isChecked(); } 302 bool beamVcal() { return vcal->isChecked(); }
302 bool beamLocal() { return local->isChecked(); } 303 bool beamLocal() { return local->isChecked(); }
303private: 304private:
304 QRadioButton* vcal, *ical, *local, *tz; 305 QRadioButton* vcal, *ical, *local, *tz;
305}; 306};
306class KOCatPrefs : public QDialog 307class KOCatPrefs : public QDialog
307{ 308{
308 public: 309 public:
309 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 310 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
310 QDialog( parent, name, true ) 311 QDialog( parent, name, true )
311 { 312 {
312 setCaption( i18n("Manage new Categories") ); 313 setCaption( i18n("Manage new Categories") );
313 QVBoxLayout* lay = new QVBoxLayout( this ); 314 QVBoxLayout* lay = new QVBoxLayout( this );
314 lay->setSpacing( 3 ); 315 lay->setSpacing( 3 );
315 lay->setMargin( 3 ); 316 lay->setMargin( 3 );
316 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 317 QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:"), this );
317 lay->addWidget( lab ); 318 lay->addWidget( lab );
318 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 319 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
319 lay->addWidget( format ); 320 lay->addWidget( format );
320 format->setExclusive ( true ) ; 321 format->setExclusive ( true ) ;
321 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 322 addCatBut = new QRadioButton(i18n("Add to category list"), format );
322 new QRadioButton(i18n("Remove from Events/Todos"), format ); 323 new QRadioButton(i18n("Remove from Events/Todos"), format );
323 addCatBut->setChecked( true ); 324 addCatBut->setChecked( true );
324 QPushButton * ok = new QPushButton( i18n("OK"), this ); 325 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this );
325 lay->addWidget( ok ); 326 lay->addWidget( ok );
326 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 327 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
327 lay->addWidget( cancel ); 328 lay->addWidget( cancel );
328 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 329 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
329 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 330 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
330 resize( 200, 200 ); 331 resize( 200, 200 );
331 } 332 }
332 333
333 bool addCat() { return addCatBut->isChecked(); } 334 bool addCat() { return addCatBut->isChecked(); }
334private: 335private:
335 QRadioButton* addCatBut; 336 QRadioButton* addCatBut;
336}; 337};
337 338
338 339
339 340
340CalendarView::CalendarView( CalendarResources *calendar, 341CalendarView::CalendarView( CalendarResources *calendar,
341 QWidget *parent, const char *name ) 342 QWidget *parent, const char *name )
342 : CalendarViewBase( parent, name ), 343 : CalendarViewBase( parent, name ),
343 mCalendar( calendar ), 344 mCalendar( calendar ),
344 mResourceManager( calendar->resourceManager() ) 345 mResourceManager( calendar->resourceManager() )
345{ 346{
346 347
347 mEventEditor = 0; 348 mEventEditor = 0;
348 mTodoEditor = 0; 349 mTodoEditor = 0;
349 350
350 init(); 351 init();
351} 352}
352 353
353CalendarView::CalendarView( Calendar *calendar, 354CalendarView::CalendarView( Calendar *calendar,
354 QWidget *parent, const char *name ) 355 QWidget *parent, const char *name )
355 : CalendarViewBase( parent, name ), 356 : CalendarViewBase( parent, name ),
356 mCalendar( calendar ), 357 mCalendar( calendar ),
357 mResourceManager( 0 ) 358 mResourceManager( 0 )
358{ 359{
359 360
360 mEventEditor = 0; 361 mEventEditor = 0;
361 mTodoEditor = 0; 362 mTodoEditor = 0;
362 init(); 363 init();
363} 364}
364 365
365void CalendarView::init() 366void CalendarView::init()
366{ 367{
367 mNextAlarmDateTime = QDateTime::currentDateTime(); 368 mNextAlarmDateTime = QDateTime::currentDateTime();
368 setFocusPolicy ( NoFocus ); 369 setFocusPolicy ( NoFocus );
369 mViewerCallerIsSearchDialog = false; 370 mViewerCallerIsSearchDialog = false;
370 mBlockShowDates = false; 371 mBlockShowDates = false;
371 372
372 mDatePickerMode = 0; 373 mDatePickerMode = 0;
373 mCurrentSyncDevice = ""; 374 mCurrentSyncDevice = "";
374 mViewManager = new KOViewManager( this ); 375 mViewManager = new KOViewManager( this );
375 mDialogManager = new KODialogManager( this ); 376 mDialogManager = new KODialogManager( this );
376 mEventViewerDialog = 0; 377 mEventViewerDialog = 0;
377 mModified = false; 378 mModified = false;
378 mReadOnly = false; 379 mReadOnly = false;
379 mSelectedIncidence = 0; 380 mSelectedIncidence = 0;
380 mCalPrinter = 0; 381 mCalPrinter = 0;
381 mFilters.setAutoDelete(true); 382 mFilters.setAutoDelete(true);
382 383
383 mCalendar->registerObserver( this ); 384 mCalendar->registerObserver( this );
384 // TODO: Make sure that view is updated, when calendar is changed. 385 // TODO: Make sure that view is updated, when calendar is changed.
385 386
386 mStorage = new FileStorage( mCalendar ); 387 mStorage = new FileStorage( mCalendar );
387 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 388 mNavigator = new DateNavigator( this, "datevav", mViewManager );
388 389
389 QBoxLayout *topLayout = (QBoxLayout*)layout(); 390 QBoxLayout *topLayout = (QBoxLayout*)layout();
390#ifndef KORG_NOSPLITTER 391#ifndef KORG_NOSPLITTER
391 // create the main layout frames. 392 // create the main layout frames.
392 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
393 topLayout->addWidget(mPanner); 394 topLayout->addWidget(mPanner);
394 395
395 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
396 "CalendarView::LeftFrame"); 397 "CalendarView::LeftFrame");
397 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
398 399
399 mDateNavigator = new DateNavigatorContainer( mLeftSplitter, 400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
400 "CalendarView::DateNavigator" ); 401 "CalendarView::DateNavigator" );
401 402
402 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
403 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
404 mTodoList->setNavigator( mNavigator ); 405 mTodoList->setNavigator( mNavigator );
405 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
406 407
407#ifdef KORG_NORESOURCEVIEW 408#ifdef KORG_NORESOURCEVIEW
408 mResourceView = 0; 409 mResourceView = 0;
409#else 410#else
410 if ( mResourceManager ) { 411 if ( mResourceManager ) {
411 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
412 mResourceView->updateView(); 413 mResourceView->updateView();
413 connect( mResourceView, SIGNAL( resourcesChanged() ), 414 connect( mResourceView, SIGNAL( resourcesChanged() ),
414 SLOT( updateView() ) ); 415 SLOT( updateView() ) );
415 } else { 416 } else {
416 mResourceView = 0; 417 mResourceView = 0;
417 } 418 }
418#endif 419#endif
419 QWidget *rightBox = new QWidget( mPanner ); 420 QWidget *rightBox = new QWidget( mPanner );
420 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
@@ -2725,192 +2726,198 @@ void CalendarView::slotSelectPickerDate( QDate d)
2725 Todo * to = (Todo *) mMoveIncidence; 2726 Todo * to = (Todo *) mMoveIncidence;
2726 QTime tim; 2727 QTime tim;
2727 int len = 0; 2728 int len = 0;
2728 if ( to->hasStartDate() && to->hasDueDate() ) 2729 if ( to->hasStartDate() && to->hasDueDate() )
2729 len = to->dtStart().secsTo( to->dtDue()); 2730 len = to->dtStart().secsTo( to->dtDue());
2730 if ( to->hasDueDate() ) 2731 if ( to->hasDueDate() )
2731 tim = to->dtDue().time(); 2732 tim = to->dtDue().time();
2732 else { 2733 else {
2733 tim = QTime ( 0,0,0 ); 2734 tim = QTime ( 0,0,0 );
2734 to->setFloats( true ); 2735 to->setFloats( true );
2735 to->setHasDueDate( true ); 2736 to->setHasDueDate( true );
2736 } 2737 }
2737 QDateTime dt ( d,tim ); 2738 QDateTime dt ( d,tim );
2738 to->setDtDue( dt ); 2739 to->setDtDue( dt );
2739 2740
2740 if ( to->hasStartDate() ) { 2741 if ( to->hasStartDate() ) {
2741 if ( len>0 ) 2742 if ( len>0 )
2742 to->setDtStart(to->dtDue().addSecs( -len )); 2743 to->setDtStart(to->dtDue().addSecs( -len ));
2743 else 2744 else
2744 if (to->dtStart() > to->dtDue() ) 2745 if (to->dtStart() > to->dtDue() )
2745 to->setDtStart(to->dtDue().addDays( -3 )); 2746 to->setDtStart(to->dtDue().addDays( -3 ));
2746 } 2747 }
2747 2748
2748 todoChanged( to ); 2749 todoChanged( to );
2749 } else { 2750 } else {
2750 if ( mMoveIncidence->doesRecur() ) { 2751 if ( mMoveIncidence->doesRecur() ) {
2751#if 0 2752#if 0
2752 // PENDING implement this 2753 // PENDING implement this
2753 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2754 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2754 mCalendar()->addIncidence( newInc ); 2755 mCalendar()->addIncidence( newInc );
2755 if ( mMoveIncidence->typeID() == todoID ) 2756 if ( mMoveIncidence->typeID() == todoID )
2756 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2757 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2757 else 2758 else
2758 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2759 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2759 mMoveIncidence = newInc; 2760 mMoveIncidence = newInc;
2760 2761
2761#endif 2762#endif
2762 } 2763 }
2763 QTime tim = mMoveIncidence->dtStart().time(); 2764 QTime tim = mMoveIncidence->dtStart().time();
2764 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2765 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2765 QDateTime dt ( d,tim ); 2766 QDateTime dt ( d,tim );
2766 mMoveIncidence->setDtStart( dt ); 2767 mMoveIncidence->setDtStart( dt );
2767 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2768 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2768 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2769 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2769 } 2770 }
2770 2771
2771 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2772 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2772 } 2773 }
2773} 2774}
2774 2775
2775void CalendarView::removeCategories() 2776void CalendarView::removeCategories()
2776{ 2777{
2777 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2778 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2778 QStringList catList = KOPrefs::instance()->mCustomCategories; 2779 QStringList catList = KOPrefs::instance()->mCustomCategories;
2779 QStringList catIncList; 2780 QStringList catIncList;
2780 QStringList newCatList; 2781 QStringList newCatList;
2781 Incidence* inc = incList.first(); 2782 Incidence* inc = incList.first();
2782 int i; 2783 int i;
2783 int count = 0; 2784 int count = 0;
2784 while ( inc ) { 2785 while ( inc ) {
2785 newCatList.clear(); 2786 newCatList.clear();
2786 catIncList = inc->categories() ; 2787 catIncList = inc->categories() ;
2787 for( i = 0; i< catIncList.count(); ++i ) { 2788 for( i = 0; i< catIncList.count(); ++i ) {
2788 if ( catList.contains (catIncList[i])) 2789 if ( catList.contains (catIncList[i]))
2789 newCatList.append( catIncList[i] ); 2790 newCatList.append( catIncList[i] );
2790 } 2791 }
2791 newCatList.sort(); 2792 newCatList.sort();
2792 inc->setCategories( newCatList.join(",") ); 2793 inc->setCategories( newCatList.join(",") );
2793 inc = incList.next(); 2794 inc = incList.next();
2794 } 2795 }
2795} 2796}
2796 2797
2797int CalendarView::addCategories() 2798int CalendarView::addCategories()
2798{ 2799{
2799 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2800 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2800 QStringList catList = KOPrefs::instance()->mCustomCategories; 2801 QStringList catList = KOPrefs::instance()->mCustomCategories;
2801 QStringList catIncList; 2802 QStringList catIncList;
2802 Incidence* inc = incList.first(); 2803 Incidence* inc = incList.first();
2803 int i; 2804 int i;
2804 int count = 0; 2805 int count = 0;
2805 while ( inc ) { 2806 while ( inc ) {
2806 catIncList = inc->categories() ; 2807 catIncList = inc->categories() ;
2807 for( i = 0; i< catIncList.count(); ++i ) { 2808 for( i = 0; i< catIncList.count(); ++i ) {
2808 if ( !catList.contains (catIncList[i])) { 2809 if ( !catList.contains (catIncList[i])) {
2809 catList.append( catIncList[i] ); 2810 catList.append( catIncList[i] );
2810 //qDebug("add cat %s ", catIncList[i].latin1()); 2811 //qDebug("add cat %s ", catIncList[i].latin1());
2811 ++count; 2812 ++count;
2812 } 2813 }
2813 } 2814 }
2814 inc = incList.next(); 2815 inc = incList.next();
2815 } 2816 }
2816 catList.sort(); 2817 catList.sort();
2817 KOPrefs::instance()->mCustomCategories = catList; 2818 KOPrefs::instance()->mCustomCategories = catList;
2818 return count; 2819 return count;
2819} 2820}
2820 2821
2822void CalendarView::editCategories()
2823{
2824 qDebug("CalendarView::editCategories() ");
2825 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this );
2826 ced.exec();
2827}
2821void CalendarView::manageCategories() 2828void CalendarView::manageCategories()
2822{ 2829{
2823 KOCatPrefs* cp = new KOCatPrefs(); 2830 KOCatPrefs* cp = new KOCatPrefs();
2824 cp->show(); 2831 cp->show();
2825 int w =cp->sizeHint().width() ; 2832 int w =cp->sizeHint().width() ;
2826 int h = cp->sizeHint().height() ; 2833 int h = cp->sizeHint().height() ;
2827 int dw = QApplication::desktop()->width(); 2834 int dw = QApplication::desktop()->width();
2828 int dh = QApplication::desktop()->height(); 2835 int dh = QApplication::desktop()->height();
2829 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2836 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2830 if ( !cp->exec() ) { 2837 if ( !cp->exec() ) {
2831 delete cp; 2838 delete cp;
2832 return; 2839 return;
2833 } 2840 }
2834 int count = 0; 2841 int count = 0;
2835 if ( cp->addCat() ) { 2842 if ( cp->addCat() ) {
2836 count = addCategories(); 2843 count = addCategories();
2837 if ( count ) { 2844 if ( count ) {
2838 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 2845 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
2839 writeSettings(); 2846 writeSettings();
2840 } else 2847 } else
2841 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 2848 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
2842 } else { 2849 } else {
2843 removeCategories(); 2850 removeCategories();
2844 updateView(); 2851 updateView();
2845 } 2852 }
2846 delete cp; 2853 delete cp;
2847} 2854}
2848 2855
2849void CalendarView::beamIncidence(Incidence * Inc) 2856void CalendarView::beamIncidence(Incidence * Inc)
2850{ 2857{
2851 QPtrList<Incidence> delSel ; 2858 QPtrList<Incidence> delSel ;
2852 delSel.append(Inc); 2859 delSel.append(Inc);
2853 beamIncidenceList( delSel ); 2860 beamIncidenceList( delSel );
2854} 2861}
2855void CalendarView::beamCalendar() 2862void CalendarView::beamCalendar()
2856{ 2863{
2857 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 2864 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
2858 //qDebug("beamCalendar() "); 2865 //qDebug("beamCalendar() ");
2859 beamIncidenceList( delSel ); 2866 beamIncidenceList( delSel );
2860} 2867}
2861void CalendarView::beamFilteredCalendar() 2868void CalendarView::beamFilteredCalendar()
2862{ 2869{
2863 QPtrList<Incidence> delSel = mCalendar->incidences(); 2870 QPtrList<Incidence> delSel = mCalendar->incidences();
2864 //qDebug("beamFilteredCalendar() "); 2871 //qDebug("beamFilteredCalendar() ");
2865 beamIncidenceList( delSel ); 2872 beamIncidenceList( delSel );
2866} 2873}
2867void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2874void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2868{ 2875{
2869 2876
2870 KOBeamPrefs beamDialog; 2877 KOBeamPrefs beamDialog;
2871 if ( beamDialog.exec () == QDialog::Rejected ) 2878 if ( beamDialog.exec () == QDialog::Rejected )
2872 return; 2879 return;
2873#ifdef DESKTOP_VERSION 2880#ifdef DESKTOP_VERSION
2874 QString fn = locateLocal( "tmp", "kopibeamfile" ); 2881 QString fn = locateLocal( "tmp", "kopibeamfile" );
2875#else 2882#else
2876 QString fn = "/tmp/kopibeamfile"; 2883 QString fn = "/tmp/kopibeamfile";
2877#endif 2884#endif
2878 QString mes; 2885 QString mes;
2879 bool createbup = true; 2886 bool createbup = true;
2880 if ( createbup ) { 2887 if ( createbup ) {
2881 QString description = "\n"; 2888 QString description = "\n";
2882 CalendarLocal* cal = new CalendarLocal(); 2889 CalendarLocal* cal = new CalendarLocal();
2883 if ( beamDialog.beamLocal() ) 2890 if ( beamDialog.beamLocal() )
2884 cal->setLocalTime(); 2891 cal->setLocalTime();
2885 else 2892 else
2886 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2893 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2887 Incidence *incidence = delSel.first(); 2894 Incidence *incidence = delSel.first();
2888 bool addText = false; 2895 bool addText = false;
2889 if ( delSel.count() < 10 ) 2896 if ( delSel.count() < 10 )
2890 addText = true; 2897 addText = true;
2891 else { 2898 else {
2892 description.sprintf(i18n(" %d items?"),delSel.count() ); 2899 description.sprintf(i18n(" %d items?"),delSel.count() );
2893 } 2900 }
2894 while ( incidence ) { 2901 while ( incidence ) {
2895 Incidence *in = incidence->clone(); 2902 Incidence *in = incidence->clone();
2896 if ( ! in->summary().isEmpty() ) { 2903 if ( ! in->summary().isEmpty() ) {
2897 in->setDescription(""); 2904 in->setDescription("");
2898 } else { 2905 } else {
2899 in->setSummary( in->description().left(20)); 2906 in->setSummary( in->description().left(20));
2900 in->setDescription(""); 2907 in->setDescription("");
2901 } 2908 }
2902 if ( addText ) 2909 if ( addText )
2903 description += in->summary() + "\n"; 2910 description += in->summary() + "\n";
2904 cal->addIncidence( in ); 2911 cal->addIncidence( in );
2905 incidence = delSel.next(); 2912 incidence = delSel.next();
2906 } 2913 }
2907 if ( beamDialog.beamVcal() ) { 2914 if ( beamDialog.beamVcal() ) {
2908 fn += ".vcs"; 2915 fn += ".vcs";
2909 FileStorage storage( cal, fn, new VCalFormat ); 2916 FileStorage storage( cal, fn, new VCalFormat );
2910 storage.save(); 2917 storage.save();
2911 } else { 2918 } else {
2912 fn += ".ics"; 2919 fn += ".ics";
2913 FileStorage storage( cal, fn, new ICalFormat( ) ); 2920 FileStorage storage( cal, fn, new ICalFormat( ) );
2914 storage.save(); 2921 storage.save();
2915 } 2922 }
2916 delete cal; 2923 delete cal;
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index f7e5366..3323a98 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -392,192 +392,193 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
392 void action_mail(); 392 void action_mail();
393 393
394 /* frees a subtodo from it's relation */ 394 /* frees a subtodo from it's relation */
395 void todo_unsub( Todo * ); 395 void todo_unsub( Todo * );
396 void todo_resub( Todo * parent, Todo * sub ); 396 void todo_resub( Todo * parent, Todo * sub );
397 397
398 /** Take ownership of selected event. */ 398 /** Take ownership of selected event. */
399 void takeOverEvent(); 399 void takeOverEvent();
400 400
401 /** Take ownership of all events in calendar. */ 401 /** Take ownership of all events in calendar. */
402 void takeOverCalendar(); 402 void takeOverCalendar();
403 403
404 /** query whether or not the calendar is "dirty". */ 404 /** query whether or not the calendar is "dirty". */
405 bool isModified(); 405 bool isModified();
406 /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ 406 /** set the state of calendar. Modified means "dirty", i.e. needing a save. */
407 void setModified(bool modified=true); 407 void setModified(bool modified=true);
408 408
409 /** query if the calendar is read-only. */ 409 /** query if the calendar is read-only. */
410 bool isReadOnly(); 410 bool isReadOnly();
411 /** set state of calendar to read-only */ 411 /** set state of calendar to read-only */
412 void setReadOnly(bool readOnly=true); 412 void setReadOnly(bool readOnly=true);
413 413
414 void eventUpdated(Incidence *); 414 void eventUpdated(Incidence *);
415 415
416 /* iTIP scheduling actions */ 416 /* iTIP scheduling actions */
417 void schedule_publish(Incidence *incidence = 0); 417 void schedule_publish(Incidence *incidence = 0);
418 void schedule_request(Incidence *incidence = 0); 418 void schedule_request(Incidence *incidence = 0);
419 void schedule_refresh(Incidence *incidence = 0); 419 void schedule_refresh(Incidence *incidence = 0);
420 void schedule_cancel(Incidence *incidence = 0); 420 void schedule_cancel(Incidence *incidence = 0);
421 void schedule_add(Incidence *incidence = 0); 421 void schedule_add(Incidence *incidence = 0);
422 void schedule_reply(Incidence *incidence = 0); 422 void schedule_reply(Incidence *incidence = 0);
423 void schedule_counter(Incidence *incidence = 0); 423 void schedule_counter(Incidence *incidence = 0);
424 void schedule_declinecounter(Incidence *incidence = 0); 424 void schedule_declinecounter(Incidence *incidence = 0);
425 void schedule_publish_freebusy(int daysToPublish = 30); 425 void schedule_publish_freebusy(int daysToPublish = 30);
426 426
427 void openAddressbook(); 427 void openAddressbook();
428 428
429 void editFilters(); 429 void editFilters();
430 void toggleFilerEnabled(); 430 void toggleFilerEnabled();
431 QPtrList<CalFilter> filters(); 431 QPtrList<CalFilter> filters();
432 void toggleFilter(); 432 void toggleFilter();
433 void showFilter(bool visible); 433 void showFilter(bool visible);
434 void updateFilter(); 434 void updateFilter();
435 void filterEdited(); 435 void filterEdited();
436 void selectFilter( int ); 436 void selectFilter( int );
437 KOFilterView *filterView(); 437 KOFilterView *filterView();
438 438
439 void showIntro(); 439 void showIntro();
440 440
441 /** Move the curdatepient view date to today */ 441 /** Move the curdatepient view date to today */
442 void goToday(); 442 void goToday();
443 443
444 /** Move to the next date(s) in the current view */ 444 /** Move to the next date(s) in the current view */
445 void goNext(); 445 void goNext();
446 446
447 /** Move to the previous date(s) in the current view */ 447 /** Move to the previous date(s) in the current view */
448 void goPrevious(); 448 void goPrevious();
449 /** Move to the next date(s) in the current view */ 449 /** Move to the next date(s) in the current view */
450 void goNextMonth(); 450 void goNextMonth();
451 451
452 /** Move to the previous date(s) in the current view */ 452 /** Move to the previous date(s) in the current view */
453 void goPreviousMonth(); 453 void goPreviousMonth();
454 454
455 void toggleExpand(); 455 void toggleExpand();
456 void toggleDateNavigatorWidget(); 456 void toggleDateNavigatorWidget();
457 void toggleAllDaySize(); 457 void toggleAllDaySize();
458 void dialogClosing(Incidence *); 458 void dialogClosing(Incidence *);
459 459
460 /** Look for new messages in the inbox */ 460 /** Look for new messages in the inbox */
461 void lookForIncomingMessages(); 461 void lookForIncomingMessages();
462 /** Look for new messages in the outbox */ 462 /** Look for new messages in the outbox */
463 void lookForOutgoingMessages(); 463 void lookForOutgoingMessages();
464 464
465 void processMainViewSelection( Incidence * ); 465 void processMainViewSelection( Incidence * );
466 void processTodoListSelection( Incidence * ); 466 void processTodoListSelection( Incidence * );
467 467
468 void processIncidenceSelection( Incidence * ); 468 void processIncidenceSelection( Incidence * );
469 469
470 void purgeCompleted(); 470 void purgeCompleted();
471 bool removeCompletedSubTodos( Todo* ); 471 bool removeCompletedSubTodos( Todo* );
472 void slotCalendarChanged(); 472 void slotCalendarChanged();
473 bool importBday(); 473 bool importBday();
474 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); 474 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
475 bool importQtopia( const QString &categoriesFile, 475 bool importQtopia( const QString &categoriesFile,
476 const QString &datebookFile, 476 const QString &datebookFile,
477 const QString &tasklistFile ); 477 const QString &tasklistFile );
478 void syncExternal( int mode ); 478 void syncExternal( int mode );
479 void slotSelectPickerDate( QDate ) ; 479 void slotSelectPickerDate( QDate ) ;
480 void showDatePicker() ; 480 void showDatePicker() ;
481 void showDatePickerPopup() ; 481 void showDatePickerPopup() ;
482 void moveIncidence(Incidence *) ; 482 void moveIncidence(Incidence *) ;
483 void beamIncidence(Incidence *) ; 483 void beamIncidence(Incidence *) ;
484 void beamCalendar() ; 484 void beamCalendar() ;
485 void beamFilteredCalendar() ; 485 void beamFilteredCalendar() ;
486 void beamIncidenceList(QPtrList<Incidence>) ; 486 void beamIncidenceList(QPtrList<Incidence>) ;
487 void manageCategories(); 487 void manageCategories();
488 void editCategories();
488 int addCategories(); 489 int addCategories();
489 void removeCategories(); 490 void removeCategories();
490 void setSyncDevice( QString ); 491 void setSyncDevice( QString );
491 void setSyncName( QString ); 492 void setSyncName( QString );
492 void showDay( QDate ); 493 void showDay( QDate );
493 void undo_delete(); 494 void undo_delete();
494 protected slots: 495 protected slots:
495 void resetFocus(); 496 void resetFocus();
496 void scrollBarValue(int); 497 void scrollBarValue(int);
497 void slotViewerClosed(); 498 void slotViewerClosed();
498 void timerAlarm(); 499 void timerAlarm();
499 void suspendAlarm(); 500 void suspendAlarm();
500 void beamDone( Ir *ir ); 501 void beamDone( Ir *ir );
501 /** Select a view or adapt the current view to display the specified dates. */ 502 /** Select a view or adapt the current view to display the specified dates. */
502 void showDates( const KCal::DateList & ); 503 void showDates( const KCal::DateList & );
503 void selectWeekNum ( int ); 504 void selectWeekNum ( int );
504 505
505 public: 506 public:
506 // show a standard warning 507 // show a standard warning
507 // returns KMsgBox::yesNoCancel() 508 // returns KMsgBox::yesNoCancel()
508 int msgCalModified(); 509 int msgCalModified();
509 virtual bool sync(KSyncManager* manager, QString filename, int mode); 510 virtual bool sync(KSyncManager* manager, QString filename, int mode);
510 511
511 virtual bool syncExternal(KSyncManager* manager, QString resource); 512 virtual bool syncExternal(KSyncManager* manager, QString resource);
512 virtual void removeSyncInfo( QString syncProfile); 513 virtual void removeSyncInfo( QString syncProfile);
513 void setSyncManager(KSyncManager* manager); 514 void setSyncManager(KSyncManager* manager);
514 void setLoadedFileVersion(QDateTime); 515 void setLoadedFileVersion(QDateTime);
515 bool checkFileVersion(QString fn); 516 bool checkFileVersion(QString fn);
516 bool checkAllFileVersions(); 517 bool checkAllFileVersions();
517 bool checkFileChanged(QString fn); 518 bool checkFileChanged(QString fn);
518 Event* getLastSyncEvent(); 519 Event* getLastSyncEvent();
519 /** Adapt navigation units correpsonding to step size of navigation of the 520 /** Adapt navigation units correpsonding to step size of navigation of the
520 * current view. 521 * current view.
521 */ 522 */
522 void adaptNavigationUnits(); 523 void adaptNavigationUnits();
523 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); 524 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode );
524 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); 525 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false );
525 //Attendee* getYourAttendee(Event *event); 526 //Attendee* getYourAttendee(Event *event);
526 void setBlockShowDates( bool b ) { mBlockShowDates = b ;} 527 void setBlockShowDates( bool b ) { mBlockShowDates = b ;}
527 void setScrollBarStep(int val ); 528 void setScrollBarStep(int val );
528 529
529 protected: 530 protected:
530 void schedule(Scheduler::Method, Incidence *incidence = 0); 531 void schedule(Scheduler::Method, Incidence *incidence = 0);
531 532
532 // returns KMsgBox::OKCandel() 533 // returns KMsgBox::OKCandel()
533 int msgItemDelete(const QString name); 534 int msgItemDelete(const QString name);
534 void showEventEditor(); 535 void showEventEditor();
535 void showTodoEditor(); 536 void showTodoEditor();
536 Todo *selectedTodo(); 537 Todo *selectedTodo();
537 private: 538 private:
538#ifdef DESKTOP_VERSION 539#ifdef DESKTOP_VERSION
539 QScrollBar * mDateScrollBar; 540 QScrollBar * mDateScrollBar;
540#endif 541#endif
541 QDateTime mNextAlarmDateTime; 542 QDateTime mNextAlarmDateTime;
542 bool mViewerCallerIsSearchDialog; 543 bool mViewerCallerIsSearchDialog;
543 bool mBlockShowDates; 544 bool mBlockShowDates;
544 KSyncManager* mSyncManager; 545 KSyncManager* mSyncManager;
545 AlarmDialog * mAlarmDialog; 546 AlarmDialog * mAlarmDialog;
546 QString mAlarmNotification; 547 QString mAlarmNotification;
547 QString mSuspendAlarmNotification; 548 QString mSuspendAlarmNotification;
548 QTimer* mSuspendTimer; 549 QTimer* mSuspendTimer;
549 QTimer* mAlarmTimer; 550 QTimer* mAlarmTimer;
550 QTimer* mRecheckAlarmTimer; 551 QTimer* mRecheckAlarmTimer;
551 void computeAlarm( QString ); 552 void computeAlarm( QString );
552 void startAlarm( QString, QString ); 553 void startAlarm( QString, QString );
553 void setSyncEventsReadOnly(); 554 void setSyncEventsReadOnly();
554 555
555 QDateTime loadedFileVersion; 556 QDateTime loadedFileVersion;
556 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); 557 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete );
557 void checkExternalId( Incidence * inc ); 558 void checkExternalId( Incidence * inc );
558 int mGlobalSyncMode; 559 int mGlobalSyncMode;
559 QString mCurrentSyncDevice; 560 QString mCurrentSyncDevice;
560 QString mCurrentSyncName; 561 QString mCurrentSyncName;
561 void init(); 562 void init();
562 int mDatePickerMode; 563 int mDatePickerMode;
563 bool mFlagEditDescription; 564 bool mFlagEditDescription;
564 QDateTime mLastCalendarSync; 565 QDateTime mLastCalendarSync;
565 void createPrinter(); 566 void createPrinter();
566 567
567 void calendarModified( bool, Calendar * ); 568 void calendarModified( bool, Calendar * );
568 569
569 CalPrinter *mCalPrinter; 570 CalPrinter *mCalPrinter;
570 571
571 QSplitter *mPanner; 572 QSplitter *mPanner;
572 QSplitter *mLeftSplitter; 573 QSplitter *mLeftSplitter;
573 KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; 574 KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame;
574 QWidgetStack *mRightFrame; 575 QWidgetStack *mRightFrame;
575 576
576 KDatePicker* mDatePicker; 577 KDatePicker* mDatePicker;
577 QVBox* mDateFrame; 578 QVBox* mDateFrame;
578 579
579 DateNavigatorContainer *mDateNavigator; // widget showing small month view. 580 DateNavigatorContainer *mDateNavigator; // widget showing small month view.
580 581
581 KOFilterView *mFilterView; 582 KOFilterView *mFilterView;
582 KOCalEditView *mCalEditView; 583 KOCalEditView *mCalEditView;
583 584
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 43e1113..517677c 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -345,193 +345,194 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
345 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 345 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
346 i18n("Beam selected via IR"),this, 346 i18n("Beam selected via IR"),this,
347 SLOT(beamSelected()),true); 347 SLOT(beamSelected()),true);
348#endif 348#endif
349 /* 349 /*
350 mPopupMenu = new QPopupMenu; 350 mPopupMenu = new QPopupMenu;
351 mPopupMenu->insertItem(i18n("Edit Event"), this, 351 mPopupMenu->insertItem(i18n("Edit Event"), this,
352 SLOT (editEvent())); 352 SLOT (editEvent()));
353 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, 353 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this,
354 SLOT (deleteEvent())); 354 SLOT (deleteEvent()));
355 mPopupMenu->insertSeparator(); 355 mPopupMenu->insertSeparator();
356 mPopupMenu->insertItem(i18n("Show Dates"), this, 356 mPopupMenu->insertItem(i18n("Show Dates"), this,
357 SLOT(showDates())); 357 SLOT(showDates()));
358 mPopupMenu->insertItem(i18n("Hide Dates"), this, 358 mPopupMenu->insertItem(i18n("Hide Dates"), this,
359 SLOT(hideDates())); 359 SLOT(hideDates()));
360 */ 360 */
361 QObject::connect(mListView,SIGNAL( newEvent()), 361 QObject::connect(mListView,SIGNAL( newEvent()),
362 this,SIGNAL(signalNewEvent())); 362 this,SIGNAL(signalNewEvent()));
363 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), 363 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)),
364 this,SLOT(defaultItemAction(QListViewItem *))); 364 this,SLOT(defaultItemAction(QListViewItem *)));
365 QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, 365 QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *,
366 const QPoint &, int )), 366 const QPoint &, int )),
367 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); 367 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int)));
368 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), 368 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
369 SLOT(processSelectionChange(QListViewItem *))); 369 SLOT(processSelectionChange(QListViewItem *)));
370 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), 370 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
371 SIGNAL(showIncidenceSignal(Incidence *)) ); 371 SIGNAL(showIncidenceSignal(Incidence *)) );
372 372
373 readSettings(KOGlobals::config(),"KOListView Layout"); 373 readSettings(KOGlobals::config(),"KOListView Layout");
374} 374}
375 375
376KOListView::~KOListView() 376KOListView::~KOListView()
377{ 377{
378 delete mPopupMenu; 378 delete mPopupMenu;
379#if QT_VERSION >= 0x030000 379#if QT_VERSION >= 0x030000
380 380
381#else 381#else
382 delete mKOListViewWhatsThis; 382 delete mKOListViewWhatsThis;
383#endif 383#endif
384} 384}
385 385
386QString KOListView::getWhatsThisText(QPoint p) 386QString KOListView::getWhatsThisText(QPoint p)
387{ 387{
388 KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); 388 KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p );
389 if ( item ) 389 if ( item )
390 return KIncidenceFormatter::instance()->getFormattedText( item->data(), 390 return KIncidenceFormatter::instance()->getFormattedText( item->data(),
391 KOPrefs::instance()->mWTshowDetails, 391 KOPrefs::instance()->mWTshowDetails,
392 KOPrefs::instance()->mWTshowCreated, 392 KOPrefs::instance()->mWTshowCreated,
393 KOPrefs::instance()->mWTshowChanged); 393 KOPrefs::instance()->mWTshowChanged);
394 return i18n("That is the list view" ); 394 return i18n("That is the list view" );
395 395
396} 396}
397 397
398void KOListView::setCalendar( int c ) 398void KOListView::setCalendar( int c )
399{ 399{
400 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), 400 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
401 i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ), 401 i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ),
402 i18n("Continue"), i18n("Cancel"), 0, 402 i18n("Continue"), i18n("Cancel"), 0,
403 0, 1 ); 403 0, 1 );
404 if ( result != 0 ) { 404 if ( result != 0 ) {
405 return; 405 return;
406 } 406 }
407 407
408 QPtrList<Incidence> delSel = getSelectedIncidences() ; 408 QPtrList<Incidence> delSel = getSelectedIncidences() ;
409 int icount = delSel.count(); 409 int icount = delSel.count();
410 if ( icount ) { 410 if ( icount ) {
411 Incidence *incidence = delSel.first(); 411 Incidence *incidence = delSel.first();
412 while ( incidence ) { 412 while ( incidence ) {
413 incidence->setCalID( c ); 413 incidence->setCalID( c );
414 KOListViewItem * item = getItemForEvent( incidence ); 414 KOListViewItem * item = getItemForEvent( incidence );
415 if ( item ) { 415 if ( item ) {
416 ListItemVisitor v(item, mStartDate ); 416 ListItemVisitor v(item, mStartDate );
417 incidence->accept(v); 417 incidence->accept(v);
418 } 418 }
419 incidence = delSel.next(); 419 incidence = delSel.next();
420 } 420 }
421 } 421 }
422 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 422 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
423 KopiCalendarFile * cal = calendars.first(); 423 KopiCalendarFile * cal = calendars.first();
424 while ( cal ) { 424 while ( cal ) {
425 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 425 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
426 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 426 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
427 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 427 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
428 if ( cal->isStandard ) 428 if ( cal->isStandard )
429 mCalendar->setDefaultCalendar( cal->mCalNumber ); 429 mCalendar->setDefaultCalendar( cal->mCalNumber );
430 cal = calendars.next(); 430 cal = calendars.next();
431 } 431 }
432 mCalendar->setSyncEventsReadOnly(); 432 mCalendar->setSyncEventsReadOnly();
433 mCalendar->reInitAlarmSettings(); 433 mCalendar->reInitAlarmSettings();
434 434
435} 435}
436void KOListView::populateCalPopup() 436void KOListView::populateCalPopup()
437{ 437{
438 mCalPopup->clear(); 438 mCalPopup->clear();
439 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 439 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
440 while ( kkf ) { 440 while ( kkf ) {
441 mCalPopup->insertItem( kkf->mName, kkf->mCalNumber); 441 int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
442 mCalPopup->setItemEnabled( index, !kkf->isReadOnly );
442 kkf = KOPrefs::instance()->mCalendars.next(); 443 kkf = KOPrefs::instance()->mCalendars.next();
443 } 444 }
444} 445}
445void KOListView::updateList() 446void KOListView::updateList()
446{ 447{
447 // qDebug(" KOListView::updateList() "); 448 // qDebug(" KOListView::updateList() ");
448 449
449} 450}
450 451
451void KOListView::clearList() 452void KOListView::clearList()
452{ 453{
453 clear (); 454 clear ();
454} 455}
455void KOListView::addCat( ) 456void KOListView::addCat( )
456{ 457{
457 setCategories( false ); 458 setCategories( false );
458} 459}
459void KOListView::setCat() 460void KOListView::setCat()
460{ 461{
461 setCategories( true ); 462 setCategories( true );
462} 463}
463 464
464void KOListView::setAlarm() 465void KOListView::setAlarm()
465{ 466{
466 KOAlarmPrefs kap( this); 467 KOAlarmPrefs kap( this);
467 if ( !kap.exec() ) 468 if ( !kap.exec() )
468 return; 469 return;
469 QStringList itemList; 470 QStringList itemList;
470 QPtrList<KOListViewItem> sel ; 471 QPtrList<KOListViewItem> sel ;
471 QListViewItem *qitem = mListView->firstChild (); 472 QListViewItem *qitem = mListView->firstChild ();
472 while ( qitem ) { 473 while ( qitem ) {
473 if ( qitem->isSelected() ) { 474 if ( qitem->isSelected() ) {
474 Incidence* inc = ((KOListViewItem *) qitem)->data(); 475 Incidence* inc = ((KOListViewItem *) qitem)->data();
475 if ( inc->typeID() != journalID ) { 476 if ( inc->typeID() != journalID ) {
476 if ( inc->typeID() == todoID ) { 477 if ( inc->typeID() == todoID ) {
477 if ( ((Todo*)inc)->hasDueDate() ) 478 if ( ((Todo*)inc)->hasDueDate() )
478 sel.append(((KOListViewItem *)qitem)); 479 sel.append(((KOListViewItem *)qitem));
479 } else 480 } else
480 sel.append(((KOListViewItem *)qitem)); 481 sel.append(((KOListViewItem *)qitem));
481 } 482 }
482 } 483 }
483 qitem = qitem->nextSibling(); 484 qitem = qitem->nextSibling();
484 } 485 }
485 int count = 0; 486 int count = 0;
486 KOListViewItem * item, *temp; 487 KOListViewItem * item, *temp;
487 item = sel.first(); 488 item = sel.first();
488 Incidence* inc; 489 Incidence* inc;
489 while ( item ) { 490 while ( item ) {
490 inc = item->data(); 491 inc = item->data();
491 ++count; 492 ++count;
492 if (kap.mAlarmButton->isChecked()) { 493 if (kap.mAlarmButton->isChecked()) {
493 if (inc->alarms().count() == 0) 494 if (inc->alarms().count() == 0)
494 inc->newAlarm(); 495 inc->newAlarm();
495 QPtrList<Alarm> alarms = inc->alarms(); 496 QPtrList<Alarm> alarms = inc->alarms();
496 Alarm *alarm; 497 Alarm *alarm;
497 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { 498 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {
498 alarm->setEnabled(true); 499 alarm->setEnabled(true);
499 int j = kap.mAlarmTimeEdit->value()* -60; 500 int j = kap.mAlarmTimeEdit->value()* -60;
500 if (kap.mAlarmIncrCombo->currentItem() == 1) 501 if (kap.mAlarmIncrCombo->currentItem() == 1)
501 j = j * 60; 502 j = j * 60;
502 else if (kap.mAlarmIncrCombo->currentItem() == 2) 503 else if (kap.mAlarmIncrCombo->currentItem() == 2)
503 j = j * (60 * 24); 504 j = j * (60 * 24);
504 alarm->setStartOffset( j ); 505 alarm->setStartOffset( j );
505 506
506 if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) { 507 if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) {
507 alarm->setProcedureAlarm(kap.mAlarmProgram); 508 alarm->setProcedureAlarm(kap.mAlarmProgram);
508 } 509 }
509 else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) 510 else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn())
510 alarm->setAudioAlarm(kap.mAlarmSound); 511 alarm->setAudioAlarm(kap.mAlarmSound);
511 else 512 else
512 alarm->setType(Alarm::Invalid); 513 alarm->setType(Alarm::Invalid);
513 //alarm->setAudioAlarm("default"); 514 //alarm->setAudioAlarm("default");
514 // TODO: Deal with multiple alarms 515 // TODO: Deal with multiple alarms
515 break; // For now, stop after the first alarm 516 break; // For now, stop after the first alarm
516 } 517 }
517 } else { 518 } else {
518 Alarm* alarm = inc->alarms().first(); 519 Alarm* alarm = inc->alarms().first();
519 if ( alarm ) { 520 if ( alarm ) {
520 alarm->setEnabled(false); 521 alarm->setEnabled(false);
521 alarm->setType(Alarm::Invalid); 522 alarm->setType(Alarm::Invalid);
522 } 523 }
523 } 524 }
524 ListItemVisitor v(item, mStartDate ); 525 ListItemVisitor v(item, mStartDate );
525 inc->accept(v); 526 inc->accept(v);
526 item = sel.next(); 527 item = sel.next();
527 } 528 }
528 topLevelWidget()->setCaption( i18n("Changed alarm for %1 items").arg( count ) ); 529 topLevelWidget()->setCaption( i18n("Changed alarm for %1 items").arg( count ) );
529 qDebug("KO: Set alarm for %d items", count); 530 qDebug("KO: Set alarm for %d items", count);
530 calendar()->reInitAlarmSettings(); 531 calendar()->reInitAlarmSettings();
531 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); 532 QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
532} 533}
533void KOListView::setCategories( bool removeOld ) 534void KOListView::setCategories( bool removeOld )
534{ 535{
535 536
536 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 537 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
537 csd->setColorEnabled(); 538 csd->setColorEnabled();
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 873a776..8d354c8 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -508,206 +508,206 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
508 topLayout->addWidget(mQuickAdd); 508 topLayout->addWidget(mQuickAdd);
509 509
510 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); 510 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide();
511 511
512 mTodoListView = new KOTodoListView(calendar,this, name ); 512 mTodoListView = new KOTodoListView(calendar,this, name );
513 topLayout->addWidget(mTodoListView); 513 topLayout->addWidget(mTodoListView);
514 //mTodoListView->header()->setMaximumHeight(30); 514 //mTodoListView->header()->setMaximumHeight(30);
515 mTodoListView->setRootIsDecorated(true); 515 mTodoListView->setRootIsDecorated(true);
516 mTodoListView->setAllColumnsShowFocus(true); 516 mTodoListView->setAllColumnsShowFocus(true);
517 517
518 mTodoListView->setShowSortIndicator(true); 518 mTodoListView->setShowSortIndicator(true);
519 519
520 mTodoListView->addColumn(i18n("Todo")); 520 mTodoListView->addColumn(i18n("Todo"));
521 mTodoListView->addColumn(i18n("Prio")); 521 mTodoListView->addColumn(i18n("Prio"));
522 mTodoListView->setColumnAlignment(1,AlignHCenter); 522 mTodoListView->setColumnAlignment(1,AlignHCenter);
523 mTodoListView->addColumn(i18n("Complete")); 523 mTodoListView->addColumn(i18n("Complete"));
524 mTodoListView->setColumnAlignment(2,AlignCenter); 524 mTodoListView->setColumnAlignment(2,AlignCenter);
525 525
526 mTodoListView->addColumn(i18n("Due Date")); 526 mTodoListView->addColumn(i18n("Due Date"));
527 mTodoListView->setColumnAlignment(3,AlignLeft); 527 mTodoListView->setColumnAlignment(3,AlignLeft);
528 mTodoListView->addColumn(i18n("Due Time")); 528 mTodoListView->addColumn(i18n("Due Time"));
529 mTodoListView->setColumnAlignment(4,AlignHCenter); 529 mTodoListView->setColumnAlignment(4,AlignHCenter);
530 530
531 mTodoListView->addColumn(i18n("Start Date")); 531 mTodoListView->addColumn(i18n("Start Date"));
532 mTodoListView->setColumnAlignment(5,AlignLeft); 532 mTodoListView->setColumnAlignment(5,AlignLeft);
533 mTodoListView->addColumn(i18n("Start Time")); 533 mTodoListView->addColumn(i18n("Start Time"));
534 mTodoListView->setColumnAlignment(6,AlignHCenter); 534 mTodoListView->setColumnAlignment(6,AlignHCenter);
535 535
536 mTodoListView->addColumn(i18n("Cancelled")); 536 mTodoListView->addColumn(i18n("Cancelled"));
537 mTodoListView->addColumn(i18n("Categories")); 537 mTodoListView->addColumn(i18n("Categories"));
538 mTodoListView->addColumn(i18n("Calendar")); 538 mTodoListView->addColumn(i18n("Calendar"));
539#if 0 539#if 0
540 mTodoListView->addColumn(i18n("Sort Id")); 540 mTodoListView->addColumn(i18n("Sort Id"));
541 mTodoListView->setColumnAlignment(4,AlignHCenter); 541 mTodoListView->setColumnAlignment(4,AlignHCenter);
542#endif 542#endif
543 543
544 mTodoListView->setMinimumHeight( 60 ); 544 mTodoListView->setMinimumHeight( 60 );
545 mTodoListView->setItemsRenameable( true ); 545 mTodoListView->setItemsRenameable( true );
546 mTodoListView->setRenameable( 0 ); 546 mTodoListView->setRenameable( 0 );
547 mTodoListView->setColumnWidth( 0, 120 ); 547 mTodoListView->setColumnWidth( 0, 120 );
548 int iii = 0; 548 int iii = 0;
549 for ( iii = 0; iii< 10 ; ++iii ) 549 for ( iii = 0; iii< 10 ; ++iii )
550 mTodoListView->setColumnWidthMode( iii, QListView::Manual ); 550 mTodoListView->setColumnWidthMode( iii, QListView::Manual );
551 551
552 552
553 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 553 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
554 554
555 mPriorityPopupMenu = new QPopupMenu(this); 555 mPriorityPopupMenu = new QPopupMenu(this);
556 for (int i = 1; i <= 5; i++) { 556 for (int i = 1; i <= 5; i++) {
557 QString label = QString ("%1").arg (i); 557 QString label = QString ("%1").arg (i);
558 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 558 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
559 } 559 }
560 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 560 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
561 561
562 mPercentageCompletedPopupMenu = new QPopupMenu(this); 562 mPercentageCompletedPopupMenu = new QPopupMenu(this);
563 for (int i = 0; i <= 100; i+=20) { 563 for (int i = 0; i <= 100; i+=20) {
564 QString label = QString ("%1 %").arg (i); 564 QString label = QString ("%1 %").arg (i);
565 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 565 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
566 } 566 }
567 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 567 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
568 568
569 569
570 570
571 mItemPopupMenu = new QPopupMenu(this); 571 mItemPopupMenu = new QPopupMenu(this);
572 mItemPopupMenu->insertItem(i18n("Show..."), this, 572 mItemPopupMenu->insertItem(i18n("Show..."), this,
573 SLOT (showTodo())); 573 SLOT (showTodo()));
574 mItemPopupMenu->insertItem(i18n("Edit..."), this, 574 mItemPopupMenu->insertItem(i18n("Edit..."), this,
575 SLOT (editTodo())); 575 SLOT (editTodo()));
576 mItemPopupMenu->insertItem( i18n("Delete"), this, 576 mItemPopupMenu->insertItem( i18n("Delete"), this,
577 SLOT (deleteTodo())); 577 SLOT (deleteTodo()));
578 mItemPopupMenu->insertItem( i18n("Clone..."), this, 578 mItemPopupMenu->insertItem( i18n("Clone..."), this,
579 SLOT (cloneTodo())); 579 SLOT (cloneTodo()));
580 mItemPopupMenu->insertItem( i18n("Move..."), this, 580 mItemPopupMenu->insertItem( i18n("Move..."), this,
581 SLOT (moveTodo())); 581 SLOT (moveTodo()));
582#ifndef DESKTOP_VERSION 582#ifndef DESKTOP_VERSION
583 mItemPopupMenu->insertItem( i18n("Beam..."), this, 583 mItemPopupMenu->insertItem( i18n("Beam..."), this,
584 SLOT (beamTodo())); 584 SLOT (beamTodo()));
585#endif 585#endif
586 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 586 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
587 SLOT (cancelTodo())); 587 SLOT (cancelTodo()));
588 mItemPopupMenu->insertSeparator(); 588 mItemPopupMenu->insertSeparator();
589 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, 589 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
590 SLOT (toggleRunningItem())); 590 SLOT (toggleRunningItem()));
591 mItemPopupMenu->insertSeparator(); 591 mItemPopupMenu->insertSeparator();
592 /* 592 /*
593 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 593 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
594 SLOT (newTodo())); 594 SLOT (newTodo()));
595 */ 595 */
596 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 596 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
597 SLOT (newSubTodo())); 597 SLOT (newSubTodo()));
598 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 598 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
599 SLOT (unparentTodo()),0,21); 599 SLOT (unparentTodo()),0,21);
600 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 600 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
601 SLOT (reparentTodo()),0,22); 601 SLOT (reparentTodo()),0,22);
602 mItemPopupMenu->insertSeparator(); 602 mItemPopupMenu->insertSeparator();
603#if 0 603#if 0
604 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), 604 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."),
605 this, SLOT( purgeCompleted() ) ); 605 this, SLOT( purgeCompleted() ) );
606 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 606 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
607 this, SLOT( toggleCompleted() ),0, 33 ); 607 this, SLOT( toggleCompleted() ),0, 33 );
608 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 608 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
609 this, SLOT( toggleQuickTodo() ),0, 34 ); 609 this, SLOT( toggleQuickTodo() ),0, 34 );
610 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 610 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
611 this, SLOT( toggleRunning() ),0, 35 ); 611 this, SLOT( toggleRunning() ),0, 35 );
612 612
613#endif 613#endif
614 mPopupMenu = new QPopupMenu(this); 614 mPopupMenu = new QPopupMenu(this);
615 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 615 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
616 SLOT (newTodo()),0,1); 616 SLOT (newTodo()),0,1);
617 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), 617 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."),
618 this, SLOT(purgeCompleted()),0,2); 618 this, SLOT(purgeCompleted()),0,2);
619 mPopupMenu->insertItem(i18n("Show Completed"), 619 mPopupMenu->insertItem(i18n("Show Completed"),
620 this, SLOT( toggleCompleted() ),0,3 ); 620 this, SLOT( toggleCompleted() ),0,3 );
621 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 621 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
622 this, SLOT( toggleRunning() ),0,5 ); 622 this, SLOT( toggleRunning() ),0,5 );
623 mPopupMenu->insertItem(i18n(" set all open","Display all opened"), 623 mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
624 this, SLOT( setAllOpen() ),0,6 ); 624 this, SLOT( setAllOpen() ),0,6 );
625 mPopupMenu->insertItem(i18n(" set all close","Display all closed"), 625 mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
626 this, SLOT( setAllClose() ),0,7 ); 626 this, SLOT( setAllClose() ),0,7 );
627 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), 627 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"),
628 this, SLOT( setAllFlat() ),0,8 ); 628 this, SLOT( setAllFlat() ),0,8 );
629 mPopupMenu->insertSeparator(); 629 mPopupMenu->insertSeparator();
630 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 630 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
631 this, SLOT( toggleQuickTodo() ),0,4 ); 631 this, SLOT( toggleQuickTodo() ),0,4 );
632 mDocPrefs = new DocPrefs( name ); 632 mDocPrefs = new DocPrefs( name );
633 633
634 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); 634 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu );
635 mPopupMenu->setCheckable( true ); 635 mPopupMenu->setCheckable( true );
636 mItemPopupMenu->setCheckable( true ); 636 mItemPopupMenu->setCheckable( true );
637 637
638 638
639 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 639 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
640 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 640 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
641 641
642 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 642 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
643 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 643 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
644 644
645 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 645 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
646 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 646 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
647 647
648 648
649 // Double clicking conflicts with opening/closing the subtree 649 // Double clicking conflicts with opening/closing the subtree
650 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 650 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
651 SLOT( editItem( QListViewItem *) ) ); 651 SLOT( editItem( QListViewItem *) ) );
652 /* 652 /*
653 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 653 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
654 const QPoint &,int ) ), 654 const QPoint &,int ) ),
655 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 655 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
656 */ 656 */
657 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 657 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
658 const QPoint &,int ) ), 658 const QPoint &,int ) ),
659 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 659 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
660 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 660 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
661 SLOT( itemClicked( QListViewItem * ) ) ); 661 SLOT( itemClicked( QListViewItem * ) ) );
662 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 662 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
663 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 663 SLOT( itemDoubleClicked( QListViewItem * ) ) );
664 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 664 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
665 SLOT( updateView() ) ); 665 SLOT( updateView() ) );
666 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 666 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
667 SLOT( todoModified(Todo *, int) ) ); 667 SLOT( todoModified(Todo *, int) ) );
668 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 668 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
669 SLOT( itemStateChanged( QListViewItem * ) ) ); 669 SLOT( itemStateChanged( QListViewItem * ) ) );
670 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 670 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
671 SLOT( itemStateChanged( QListViewItem * ) ) ); 671 SLOT( itemStateChanged( QListViewItem * ) ) );
672 connect( mTodoListView, SIGNAL( paintNeeded() ), 672 connect( mTodoListView, SIGNAL( paintNeeded() ),
673 SLOT( paintNeeded()) ); 673 SLOT( paintNeeded()) );
674 674
675#if 0 675#if 0
676 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 676 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
677 SLOT(selectionChanged(QListViewItem *))); 677 SLOT(selectionChanged(QListViewItem *)));
678 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 678 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
679 SLOT(selectionChanged(QListViewItem *))); 679 SLOT(selectionChanged(QListViewItem *)));
680 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 680 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
681 SLOT(selectionChanged(QListViewItem *))); 681 SLOT(selectionChanged(QListViewItem *)));
682#endif 682#endif
683 683
684 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 684 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
685 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 685 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
686 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 686 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
687 687
688 connect( mTodoListView, SIGNAL(selectionChanged() ), 688 connect( mTodoListView, SIGNAL(selectionChanged() ),
689 SLOT( processSelectionChange() ) ); 689 SLOT( processSelectionChange() ) );
690 connect( mQuickAdd, SIGNAL( returnPressed () ), 690 connect( mQuickAdd, SIGNAL( returnPressed () ),
691 SLOT( addQuickTodo() ) ); 691 SLOT( addQuickTodo() ) );
692 692
693} 693}
694 694
695KOTodoView::~KOTodoView() 695KOTodoView::~KOTodoView()
696{ 696{
697 697
698#if QT_VERSION >= 0x030000 698#if QT_VERSION >= 0x030000
699 699
700#else 700#else
701 delete mKOTodoViewWhatsThis; 701 delete mKOTodoViewWhatsThis;
702#endif 702#endif
703 703
704 delete mDocPrefs; 704 delete mDocPrefs;
705} 705}
706QString KOTodoView::getWhatsThisText(QPoint p) 706QString KOTodoView::getWhatsThisText(QPoint p)
707{ 707{
708 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 708 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
709 if ( item ) 709 if ( item )
710 return KIncidenceFormatter::instance()->getFormattedText( item->todo(), 710 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
711 KOPrefs::instance()->mWTshowDetails, 711 KOPrefs::instance()->mWTshowDetails,
712 KOPrefs::instance()->mWTshowCreated, 712 KOPrefs::instance()->mWTshowCreated,
713 KOPrefs::instance()->mWTshowChanged); 713 KOPrefs::instance()->mWTshowChanged);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 23537a6..a5d8824 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -561,667 +561,688 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
561 msg = allmsg; 561 msg = allmsg;
562 allmsg = ""; 562 allmsg = "";
563 } else{ 563 } else{
564 msg = allmsg.left( nextC ); 564 msg = allmsg.left( nextC );
565 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 565 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
566 } 566 }
567 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 567 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
568 if ( msg == "-newEvent" ) { 568 if ( msg == "-newEvent" ) {
569 QTimer::singleShot( 0, mView, SLOT ( newEvent())); 569 QTimer::singleShot( 0, mView, SLOT ( newEvent()));
570 } 570 }
571 if ( msg == "-newTodo" ) { 571 if ( msg == "-newTodo" ) {
572 QTimer::singleShot( 0, mView, SLOT ( newTodo())); 572 QTimer::singleShot( 0, mView, SLOT ( newTodo()));
573 } 573 }
574 if ( msg == "-showWN" ) { 574 if ( msg == "-showWN" ) {
575 mView->viewManager()->showWhatsNextView(); 575 mView->viewManager()->showWhatsNextView();
576 } 576 }
577 if ( msg == "-showTodo" ) { 577 if ( msg == "-showTodo" ) {
578 mView->viewManager()->showTodoView(); 578 mView->viewManager()->showTodoView();
579 } 579 }
580 if ( msg == "-showList" ) { 580 if ( msg == "-showList" ) {
581 mView->viewManager()->showListView(); 581 mView->viewManager()->showListView();
582 } 582 }
583 else if ( msg == "-showDay" ) { 583 else if ( msg == "-showDay" ) {
584 mView->viewManager()->showDayView(); 584 mView->viewManager()->showDayView();
585 } 585 }
586 else if ( msg == "-showWWeek" ) { 586 else if ( msg == "-showWWeek" ) {
587 mView->viewManager()->showWorkWeekView(); 587 mView->viewManager()->showWorkWeekView();
588 } 588 }
589 else if ( msg == "-ringSync" ) { 589 else if ( msg == "-ringSync" ) {
590 QTimer::singleShot( 0, this, SLOT (startMultiSync())); 590 QTimer::singleShot( 0, this, SLOT (startMultiSync()));
591 } 591 }
592 else if ( msg == "-showWeek" ) { 592 else if ( msg == "-showWeek" ) {
593 mView->viewManager()->showWeekView(); 593 mView->viewManager()->showWeekView();
594 } 594 }
595 else if ( msg == "-showTodo" ) { 595 else if ( msg == "-showTodo" ) {
596 mView->viewManager()->showTodoView(); 596 mView->viewManager()->showTodoView();
597 } 597 }
598 else if ( msg == "-showJournal" ) { 598 else if ( msg == "-showJournal" ) {
599 mView->dateNavigator()->selectDates( 1 ); 599 mView->dateNavigator()->selectDates( 1 );
600 mView->dateNavigator()->selectToday(); 600 mView->dateNavigator()->selectToday();
601 mView->viewManager()->showJournalView(); 601 mView->viewManager()->showJournalView();
602 } 602 }
603 else if ( msg == "-showKO" ) { 603 else if ( msg == "-showKO" ) {
604 mView->viewManager()->showNextXView(); 604 mView->viewManager()->showNextXView();
605 } 605 }
606 else if ( msg == "-showWNext" ) { 606 else if ( msg == "-showWNext" ) {
607 mView->viewManager()->showWhatsNextView(); 607 mView->viewManager()->showWhatsNextView();
608 } 608 }
609 else if ( msg == "nextView()" ) { 609 else if ( msg == "nextView()" ) {
610 mView->viewManager()->showNextView(); 610 mView->viewManager()->showNextView();
611 } 611 }
612 else if ( msg == "-showNextXView" ) { 612 else if ( msg == "-showNextXView" ) {
613 mView->viewManager()->showNextXView(); 613 mView->viewManager()->showNextXView();
614 } 614 }
615 615
616 616
617 } 617 }
618 618
619 showMaximized(); 619 showMaximized();
620 raise(); 620 raise();
621} 621}
622void MainWindow::startMultiSync() 622void MainWindow::startMultiSync()
623{ 623{
624 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 624 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
625 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), 625 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"),
626 question, 626 question,
627 i18n("Yes"), i18n("No"), 627 i18n("Yes"), i18n("No"),
628 0, 0 ) != 0 ) { 628 0, 0 ) != 0 ) {
629 setCaption(i18n("Aborted! Nothing synced!")); 629 setCaption(i18n("Aborted! Nothing synced!"));
630 return; 630 return;
631 } 631 }
632 mSyncManager->multiSync( false ); 632 mSyncManager->multiSync( false );
633#ifndef DESKTOP_VERSION 633#ifndef DESKTOP_VERSION
634 QCopEnvelope e("QPE/Application/kapi", "doRingSync"); 634 QCopEnvelope e("QPE/Application/kapi", "doRingSync");
635#endif 635#endif
636} 636}
637QPixmap MainWindow::loadPixmap( QString name ) 637QPixmap MainWindow::loadPixmap( QString name )
638{ 638{
639 return SmallIcon( name ); 639 return SmallIcon( name );
640 640
641} 641}
642void MainWindow::setUsesBigPixmaps ( bool b ) 642void MainWindow::setUsesBigPixmaps ( bool b )
643{ 643{
644 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 644 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
645 if ( b ) 645 if ( b )
646 qDebug("KO: BigPixmaps are not supported "); 646 qDebug("KO: BigPixmaps are not supported ");
647} 647}
648void MainWindow::initActions() 648void MainWindow::initActions()
649{ 649{
650 //KOPrefs::instance()->mShowFullMenu 650 //KOPrefs::instance()->mShowFullMenu
651 iconToolBar->clear(); 651 iconToolBar->clear();
652 KOPrefs *p = KOPrefs::instance(); 652 KOPrefs *p = KOPrefs::instance();
653 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 653 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
654 654
655 QPopupMenu *viewMenu = new QPopupMenu( this ); 655 QPopupMenu *viewMenu = new QPopupMenu( this );
656 QPopupMenu *actionMenu = new QPopupMenu( this ); 656 QPopupMenu *actionMenu = new QPopupMenu( this );
657#ifdef DESKTOP_VERSION
658 mCurrentItemMenu = actionMenu;
659#else
660 mCurrentItemMenu = new QPopupMenu ( this );
661#endif
657 QPopupMenu *importMenu = new QPopupMenu( this ); 662 QPopupMenu *importMenu = new QPopupMenu( this );
658 QPopupMenu *importMenu_X = new QPopupMenu( this ); 663 QPopupMenu *importMenu_X = new QPopupMenu( this );
659 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 664 QPopupMenu *exportMenu_X = new QPopupMenu( this );
660 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 665 QPopupMenu *beamMenu_X = new QPopupMenu( this );
661 selectFilterMenu = new QPopupMenu( this ); 666 selectFilterMenu = new QPopupMenu( this );
662 selectFilterMenu->setCheckable( true ); 667 selectFilterMenu->setCheckable( true );
663 syncMenu = new QPopupMenu( this ); 668 syncMenu = new QPopupMenu( this );
664 configureAgendaMenu = new QPopupMenu( this ); 669 configureAgendaMenu = new QPopupMenu( this );
665 configureToolBarMenu = new QPopupMenu( this ); 670 configureToolBarMenu = new QPopupMenu( this );
666 QPopupMenu *helpMenu = new QPopupMenu( this ); 671 QPopupMenu *helpMenu = new QPopupMenu( this );
667 QIconSet icon; 672 QIconSet icon;
668 int pixWid = 22, pixHei = 22; 673 int pixWid = 22, pixHei = 22;
669 QString pathString = ""; 674 QString pathString = "";
670 if ( !p->mToolBarMiniIcons ) { 675 if ( !p->mToolBarMiniIcons ) {
671 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 676 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
672 pathString += "icons16/"; 677 pathString += "icons16/";
673 pixWid = 18; pixHei = 16; 678 pixWid = 18; pixHei = 16;
674 } 679 }
675 } else { 680 } else {
676 pathString += "iconsmini/"; 681 pathString += "iconsmini/";
677 pixWid = 18; pixHei = 16; 682 pixWid = 18; pixHei = 16;
678 } 683 }
679 if ( KOPrefs::instance()->mShowFullMenu ) { 684 if ( KOPrefs::instance()->mShowFullMenu ) {
680 QMenuBar *menuBar1; 685 QMenuBar *menuBar1;
681 menuBar1 = menuBar(); 686 menuBar1 = menuBar();
682 menuBar1->insertItem( i18n("File"), importMenu ); 687 menuBar1->insertItem( i18n("File"), importMenu );
683 menuBar1->insertItem( i18n("View"), viewMenu ); 688 menuBar1->insertItem( i18n("View"), viewMenu );
684 menuBar1->insertItem( i18n("Actions"), actionMenu ); 689 menuBar1->insertItem( i18n("Actions"), actionMenu );
685#ifdef DESKTOP_VERSION 690#ifdef DESKTOP_VERSION
686 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 691 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
687 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 692 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
688#else 693#else
689 menuBar1->insertItem( i18n("Sync"), syncMenu ); 694 menuBar1->insertItem( i18n("Sync"), syncMenu );
690 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 695 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
691#endif 696#endif
692 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 697 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
693 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 698 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
694 menuBar1->insertItem( i18n("Help"), helpMenu ); 699 menuBar1->insertItem( i18n("Help"), helpMenu );
695 } else { 700 } else {
696 QPEMenuBar *menuBar1; 701 QPEMenuBar *menuBar1;
697 menuBar1 = new QPEMenuBar( iconToolBar ); 702 menuBar1 = new QPEMenuBar( iconToolBar );
698 QPopupMenu *menuBar = new QPopupMenu( this ); 703 QPopupMenu *menuBar = new QPopupMenu( this );
699 icon = loadPixmap( pathString + "z_menu" ); 704 icon = loadPixmap( pathString + "z_menu" );
700 menuBar1->insertItem( icon.pixmap(), menuBar); 705 menuBar1->insertItem( icon.pixmap(), menuBar);
701 //menuBar1->insertItem( i18n("ME"), menuBar); 706 //menuBar1->insertItem( i18n("ME"), menuBar);
702 menuBar->insertItem( i18n("File"), importMenu ); 707 menuBar->insertItem( i18n("File"), importMenu );
703 menuBar->insertItem( i18n("View"), viewMenu ); 708 menuBar->insertItem( i18n("View"), viewMenu );
704 menuBar->insertItem( i18n("Actions"), actionMenu ); 709 menuBar->insertItem( i18n("Actions"), actionMenu );
705 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 710 menuBar->insertItem( i18n("Synchronize"), syncMenu );
706 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 711 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
707 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 712 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
708 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 713 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
709 menuBar->insertItem( i18n("Help"), helpMenu ); 714 menuBar->insertItem( i18n("Help"), helpMenu );
710 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 715 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
711 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 716 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
712 } 717 }
713 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 718 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
714 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 719 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
715 720
716 721
717 mWeekBgColor = iconToolBar->backgroundColor(); 722 mWeekBgColor = iconToolBar->backgroundColor();
718 mWeekPixmap.resize( pixWid , pixHei ); 723 mWeekPixmap.resize( pixWid , pixHei );
719 mWeekPixmap.fill( mWeekBgColor ); 724 mWeekPixmap.fill( mWeekBgColor );
720 icon = mWeekPixmap; 725 icon = mWeekPixmap;
721 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 726 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
722 if ( p-> mShowIconWeekNum ) 727 if ( p-> mShowIconWeekNum )
723 mWeekAction->addTo( iconToolBar ); 728 mWeekAction->addTo( iconToolBar );
724 mWeekFont = font(); 729 mWeekFont = font();
725 730
726 int fontPoint = mWeekFont.pointSize(); 731 int fontPoint = mWeekFont.pointSize();
727 QFontMetrics f( mWeekFont ); 732 QFontMetrics f( mWeekFont );
728 int fontWid = f.width( "30" ); 733 int fontWid = f.width( "30" );
729 while ( fontWid > pixWid ) { 734 while ( fontWid > pixWid ) {
730 --fontPoint; 735 --fontPoint;
731 mWeekFont.setPointSize( fontPoint ); 736 mWeekFont.setPointSize( fontPoint );
732 QFontMetrics f( mWeekFont ); 737 QFontMetrics f( mWeekFont );
733 fontWid = f.width( "30" ); 738 fontWid = f.width( "30" );
734 //qDebug("dec-- "); 739 //qDebug("dec-- ");
735 } 740 }
736 741
737 connect( mWeekAction, SIGNAL( activated() ), 742 connect( mWeekAction, SIGNAL( activated() ),
738 this, SLOT( weekAction() ) ); 743 this, SLOT( weekAction() ) );
739 744
740 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 745 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
741 if ( p->mShowIconFilterview ) { 746 if ( p->mShowIconFilterview ) {
742 icon = loadPixmap( pathString + "filter" ); 747 icon = loadPixmap( pathString + "filter" );
743 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 748 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
744 connect( actionFilterMenuTB, SIGNAL( activated() ), 749 connect( actionFilterMenuTB, SIGNAL( activated() ),
745 this, SLOT( fillFilterMenuTB() ) ); 750 this, SLOT( fillFilterMenuTB() ) );
746 actionFilterMenuTB->addTo( iconToolBar ); 751 actionFilterMenuTB->addTo( iconToolBar );
747 selectFilterMenuTB = new QPopupMenu( this ); 752 selectFilterMenuTB = new QPopupMenu( this );
748 selectFilterMenuTB->setCheckable( true ); 753 selectFilterMenuTB->setCheckable( true );
749 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 754 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
750 } 755 }
751 756
752 //#endif 757 //#endif
753 // ****************** 758 // ******************
754 QAction *action; 759 QAction *action;
755 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 760 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
756 configureToolBarMenu->setCheckable( true ); 761 configureToolBarMenu->setCheckable( true );
757 762
758 763
759 configureAgendaMenu->setCheckable( true ); 764 configureAgendaMenu->setCheckable( true );
760 int iii ; 765 int iii ;
761 for ( iii = 1;iii<= 10 ;++iii ){ 766 for ( iii = 1;iii<= 10 ;++iii ){
762 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 767 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
763 } 768 }
764 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 769 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
765 770
766 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 771 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
767 this, SLOT( showConfigureAgenda( ) ) ); 772 this, SLOT( showConfigureAgenda( ) ) );
773 icon = loadPixmap( pathString + "today" );
774 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
775 today_action->addTo( actionMenu );
776 connect( today_action, SIGNAL( activated() ),
777 mView, SLOT( goToday() ) );
778
779 icon = loadPixmap( pathString + "picker" );
780 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
781 dPickerAction->addTo( actionMenu );
782 connect( dPickerAction, SIGNAL( activated() ),
783 mView, SLOT( showDatePicker() ) );
784
785 icon = loadPixmap( pathString + "search" );
786 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
787 search_action->addTo( actionMenu );
788 connect( search_action, SIGNAL( activated() ),
789 mView->dialogManager(), SLOT( showSearchDialog() ) );
768 790
769 icon = loadPixmap( pathString + "configure" );
770 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
771 action->addTo( actionMenu );
772 connect( action, SIGNAL( activated() ),
773 mView, SLOT( edit_options() ) );
774 icon = loadPixmap( pathString + "configure" );
775 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
776 action->addTo( actionMenu );
777 connect( action, SIGNAL( activated() ),
778 mView, SLOT( edit_global_options() ) );
779 actionMenu->insertSeparator(); 791 actionMenu->insertSeparator();
792
793
780 794
781 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 795 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
782 action->addTo( actionMenu ); 796 action->addTo( actionMenu );
783 connect( action, SIGNAL( activated() ), 797 connect( action, SIGNAL( activated() ),
784 mView, SLOT( undo_delete() ) ); 798 mView, SLOT( undo_delete() ) );
785 actionMenu->insertSeparator();
786 799
787 icon = loadPixmap( pathString + "newevent" ); 800 icon = loadPixmap( pathString + "newevent" );
788 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 801 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
789 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 802 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
790 configureToolBarMenu->insertSeparator(); 803 configureToolBarMenu->insertSeparator();
791 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 804 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
792 configureToolBarMenu->insertSeparator(); 805 configureToolBarMenu->insertSeparator();
793 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 806 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
794 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 807 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
808
809#ifndef DESKTOP_VERSION
810 actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
811#endif
812 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
813 mShowAction->addTo( mCurrentItemMenu );
814 connect( mShowAction, SIGNAL( activated() ),
815 mView, SLOT( showIncidence() ) );
816
817 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
818 mEditAction->addTo( mCurrentItemMenu );
819 connect( mEditAction, SIGNAL( activated() ),
820 mView, SLOT( editIncidence() ) );
821
822 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
823 mDeleteAction->addTo( mCurrentItemMenu );
824 connect( mDeleteAction, SIGNAL( activated() ),
825 mView, SLOT( deleteIncidence() ) );
826
827
828 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
829 mCloneAction->addTo( mCurrentItemMenu );
830 connect( mCloneAction, SIGNAL( activated() ),
831 mView, SLOT( cloneIncidence() ) );
832 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
833 mMoveAction->addTo( mCurrentItemMenu );
834 connect( mMoveAction, SIGNAL( activated() ),
835 mView, SLOT( moveIncidence() ) );
836 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
837 mBeamAction->addTo(mCurrentItemMenu );
838 connect( mBeamAction, SIGNAL( activated() ),
839 mView, SLOT( beamIncidence() ) );
840 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
841 mCancelAction->addTo( mCurrentItemMenu );
842 connect( mCancelAction, SIGNAL( activated() ),
843 mView, SLOT( toggleCancelIncidence() ) );
844#ifdef DESKTOP_VERSION
845 actionMenu->insertSeparator();
846#endif
847
848
795 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 849 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
796 ne_action->addTo( actionMenu ); 850 ne_action->addTo( actionMenu );
797 connect( ne_action, SIGNAL( activated() ), 851 connect( ne_action, SIGNAL( activated() ),
798 mView, SLOT( newEvent() ) ); 852 mView, SLOT( newEvent() ) );
799 icon = loadPixmap( pathString + "newtodo" ); 853 icon = loadPixmap( pathString + "newtodo" );
800 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 854 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
801 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 855 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
802 nt_action->addTo( actionMenu ); 856 nt_action->addTo( actionMenu );
803 connect( nt_action, SIGNAL( activated() ), 857 connect( nt_action, SIGNAL( activated() ),
804 mView, SLOT( newTodo() ) ); 858 mView, SLOT( newTodo() ) );
805 859
806 icon = loadPixmap( pathString + "today" ); 860
807 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
808 today_action->addTo( viewMenu );
809 connect( today_action, SIGNAL( activated() ),
810 mView, SLOT( goToday() ) );
811 viewMenu->insertSeparator();
812 861
813 // *********************** 862 // ***********************
814 if ( KOPrefs::instance()->mVerticalScreen ) { 863 if ( KOPrefs::instance()->mVerticalScreen ) {
815 icon = SmallIcon( "1updownarrow" ); 864 icon = SmallIcon( "1updownarrow" );
816 } else { 865 } else {
817 icon = SmallIcon("1leftrightarrow" ); 866 icon = SmallIcon("1leftrightarrow" );
818 } 867 }
819 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 868 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
820 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 869 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
821 FSaction->addTo( viewMenu ); 870 FSaction->addTo( viewMenu );
822 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 871 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
823 872
824 873
825 icon = loadPixmap( pathString + "filter" ); 874 icon = loadPixmap( pathString + "filter" );
826 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 875 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
827 icon = loadPixmap( pathString + "configure" ); 876 icon = loadPixmap( pathString + "configure" );
828 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); 877 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
829 action->addTo( viewMenu ); 878 action->addTo( viewMenu );
830 connect( action, SIGNAL( activated() ), 879 connect( action, SIGNAL( activated() ),
831 mView, SLOT( toggleFilter() ) ); 880 mView, SLOT( toggleFilter() ) );
832 mToggleFilter = action; 881 mToggleFilter = action;
833 icon = loadPixmap( pathString + "navi" ); 882 icon = loadPixmap( pathString + "navi" );
834 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 883 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
835 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 884 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
836 action->addTo( viewMenu ); 885 action->addTo( viewMenu );
837 connect( action, SIGNAL( activated() ), 886 connect( action, SIGNAL( activated() ),
838 mView, SLOT( toggleDateNavigatorWidget() ) ); 887 mView, SLOT( toggleDateNavigatorWidget() ) );
839 mToggleNav = action ; 888 mToggleNav = action ;
840 icon = loadPixmap( pathString + "allday" ); 889 icon = loadPixmap( pathString + "allday" );
841 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 890 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
842 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 891 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
843 action->addTo( viewMenu ); 892 action->addTo( viewMenu );
844 connect( action, SIGNAL( activated() ), 893 connect( action, SIGNAL( activated() ),
845 mView, SLOT( toggleAllDaySize() ) ); 894 mView, SLOT( toggleAllDaySize() ) );
846 mToggleAllday = action; 895 mToggleAllday = action;
847 896
848 897
849 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 898 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
850 mToggleNav, SLOT( setEnabled ( bool ) ) ); 899 mToggleNav, SLOT( setEnabled ( bool ) ) );
851 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 900 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
852 // mToggleFilter, SLOT( setEnabled ( bool ) ) ); 901 // mToggleFilter, SLOT( setEnabled ( bool ) ) );
853 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 902 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
854 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 903 mToggleAllday, SLOT( setEnabled ( bool ) ) );
855 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 904 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
856 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); 905 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) );
857 906
858 viewMenu->insertSeparator(); 907
859 icon = loadPixmap( pathString + "picker" ); 908 dPickerAction->addTo( iconToolBar );
860 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
861 action->addTo( viewMenu );
862 connect( action, SIGNAL( activated() ),
863 mView, SLOT( showDatePicker() ) );
864 action->addTo( iconToolBar );
865 viewMenu->insertSeparator(); 909 viewMenu->insertSeparator();
866 910
867 if ( p-> mShowIconToggleFull ) 911 if ( p-> mShowIconToggleFull )
868 FSaction->addTo( iconToolBar ); 912 FSaction->addTo( iconToolBar );
869 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 913 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
870 914
871 //******************** 915 //********************
872 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 916 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
873 917
874 918
875 icon = loadPixmap( pathString + "whatsnext" ); 919 icon = loadPixmap( pathString + "whatsnext" );
876 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 920 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
877 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 921 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
878 whatsnext_action->addTo( viewMenu ); 922 whatsnext_action->addTo( viewMenu );
879 connect( whatsnext_action, SIGNAL( activated() ), 923 connect( whatsnext_action, SIGNAL( activated() ),
880 mView->viewManager(), SLOT( showWhatsNextView() ) ); 924 mView->viewManager(), SLOT( showWhatsNextView() ) );
881 925
882 icon = loadPixmap( pathString + "xdays" ); 926 icon = loadPixmap( pathString + "xdays" );
883 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 927 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
884 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 928 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
885 xdays_action->addTo( viewMenu ); 929 xdays_action->addTo( viewMenu );
886 connect( xdays_action, SIGNAL( activated() ), 930 connect( xdays_action, SIGNAL( activated() ),
887 mView->viewManager(), SLOT( showNextXView() ) ); 931 mView->viewManager(), SLOT( showNextXView() ) );
888 932
889 933
890 icon = loadPixmap( pathString + "journal" ); 934 icon = loadPixmap( pathString + "journal" );
891 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 935 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
892 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 936 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
893 viewjournal_action->addTo( viewMenu ); 937 viewjournal_action->addTo( viewMenu );
894 connect( viewjournal_action, SIGNAL( activated() ), 938 connect( viewjournal_action, SIGNAL( activated() ),
895 mView->viewManager(), SLOT( showJournalView() ) ); 939 mView->viewManager(), SLOT( showJournalView() ) );
896 940
897 941
898 icon = loadPixmap( pathString + "day" ); 942 icon = loadPixmap( pathString + "day" );
899 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 943 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
900 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 944 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
901 day1_action->addTo( viewMenu ); 945 day1_action->addTo( viewMenu );
902 // action->addTo( toolBar ); 946 // action->addTo( toolBar );
903 connect( day1_action, SIGNAL( activated() ), 947 connect( day1_action, SIGNAL( activated() ),
904 mView->viewManager(), SLOT( showDayView() ) ); 948 mView->viewManager(), SLOT( showDayView() ) );
905 949
906 icon = loadPixmap( pathString + "workweek" ); 950 icon = loadPixmap( pathString + "workweek" );
907 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 951 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
908 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 952 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
909 day5_action->addTo( viewMenu ); 953 day5_action->addTo( viewMenu );
910 connect( day5_action, SIGNAL( activated() ), 954 connect( day5_action, SIGNAL( activated() ),
911 mView->viewManager(), SLOT( showWorkWeekView() ) ); 955 mView->viewManager(), SLOT( showWorkWeekView() ) );
912 956
913 icon = loadPixmap( pathString + "week" ); 957 icon = loadPixmap( pathString + "week" );
914 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 958 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
915 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 959 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
916 day7_action->addTo( viewMenu ); 960 day7_action->addTo( viewMenu );
917 connect( day7_action, SIGNAL( activated() ), 961 connect( day7_action, SIGNAL( activated() ),
918 mView->viewManager(), SLOT( showWeekView() ) ); 962 mView->viewManager(), SLOT( showWeekView() ) );
919 963
920 icon = loadPixmap( pathString + "workweek2" ); 964 icon = loadPixmap( pathString + "workweek2" );
921 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 965 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
922 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 966 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
923 day6_action->addTo( viewMenu ); 967 day6_action->addTo( viewMenu );
924 connect( day6_action, SIGNAL( activated() ), 968 connect( day6_action, SIGNAL( activated() ),
925 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 969 mView->viewManager(), SLOT( showMonthViewWeek() ) );
926 970
927 icon = loadPixmap( pathString + "month" ); 971 icon = loadPixmap( pathString + "month" );
928 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 972 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
929 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 973 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
930 month_action->addTo( viewMenu ); 974 month_action->addTo( viewMenu );
931 connect( month_action, SIGNAL( activated() ), 975 connect( month_action, SIGNAL( activated() ),
932 mView->viewManager(), SLOT( showMonthView() ) ); 976 mView->viewManager(), SLOT( showMonthView() ) );
933 977
934 icon = loadPixmap( pathString + "list" ); 978 icon = loadPixmap( pathString + "list" );
935 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 979 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
936 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 980 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
937 showlist_action->addTo( viewMenu ); 981 showlist_action->addTo( viewMenu );
938 connect( showlist_action, SIGNAL( activated() ), 982 connect( showlist_action, SIGNAL( activated() ),
939 mView->viewManager(), SLOT( showListView() ) ); 983 mView->viewManager(), SLOT( showListView() ) );
940 984
941 icon = loadPixmap( pathString + "todo" ); 985 icon = loadPixmap( pathString + "todo" );
942 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 986 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
943 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 987 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
944 todoview_action->addTo( viewMenu ); 988 todoview_action->addTo( viewMenu );
945 connect( todoview_action, SIGNAL( activated() ), 989 connect( todoview_action, SIGNAL( activated() ),
946 mView->viewManager(), SLOT( showTodoView() ) ); 990 mView->viewManager(), SLOT( showTodoView() ) );
947 991
948 992
949 993
950#if 0 994#if 0
951 action = new QAction( "view_timespan", "Time Span", 0, this ); 995 action = new QAction( "view_timespan", "Time Span", 0, this );
952 action->addTo( viewMenu ); 996 action->addTo( viewMenu );
953 connect( action, SIGNAL( activated() ), 997 connect( action, SIGNAL( activated() ),
954 mView->viewManager(), SLOT( showTimeSpanView() ) ); 998 mView->viewManager(), SLOT( showTimeSpanView() ) );
955#endif 999#endif
956 1000
957 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 1001 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
958 this ); 1002 this );
959 mNewSubTodoAction->addTo( actionMenu ); 1003 mNewSubTodoAction->addTo( actionMenu );
960 connect( mNewSubTodoAction, SIGNAL( activated() ), 1004 connect( mNewSubTodoAction, SIGNAL( activated() ),
961 mView, SLOT( newSubTodo() ) ); 1005 mView, SLOT( newSubTodo() ) );
962 1006
963 actionMenu->insertSeparator(); 1007 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0,
964 1008 this );
965 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 1009 action->addTo( actionMenu );
966 mShowAction->addTo( actionMenu ); 1010 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
967 connect( mShowAction, SIGNAL( activated() ),
968 mView, SLOT( showIncidence() ) );
969 1011
970 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 1012
971 mEditAction->addTo( actionMenu ); 1013 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
972 connect( mEditAction, SIGNAL( activated() ),
973 mView, SLOT( editIncidence() ) );
974 1014
975 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
976 mDeleteAction->addTo( actionMenu );
977 connect( mDeleteAction, SIGNAL( activated() ),
978 mView, SLOT( deleteIncidence() ) );
979 1015
980 1016
981 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
982 mCloneAction->addTo( actionMenu );
983 connect( mCloneAction, SIGNAL( activated() ),
984 mView, SLOT( cloneIncidence() ) );
985 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
986 mMoveAction->addTo( actionMenu );
987 connect( mMoveAction, SIGNAL( activated() ),
988 mView, SLOT( moveIncidence() ) );
989 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
990 mBeamAction->addTo( actionMenu );
991 connect( mBeamAction, SIGNAL( activated() ),
992 mView, SLOT( beamIncidence() ) );
993 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
994 mCancelAction->addTo( actionMenu );
995 connect( mCancelAction, SIGNAL( activated() ),
996 mView, SLOT( toggleCancelIncidence() ) );
997
998 actionMenu->insertSeparator(); 1017 actionMenu->insertSeparator();
999 1018 action = new QAction( "manage cat", i18n("Edit category list..."), 0,
1000 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
1001 this ); 1019 this );
1002 action->addTo( actionMenu ); 1020 action->addTo( actionMenu );
1003 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 1021 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) );
1004 1022
1005 icon = loadPixmap( pathString + "search" ); 1023 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
1006 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 1024 this );
1007 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 1025 action->addTo( actionMenu );
1008 search_action->addTo( actionMenu ); 1026 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1009 connect( search_action, SIGNAL( activated() ),
1010 mView->dialogManager(), SLOT( showSearchDialog() ) );
1011 1027
1012
1013 1028
1029 actionMenu->insertSeparator();
1030 icon = loadPixmap( pathString + "configure" );
1031 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
1032 action->addTo( actionMenu );
1033 connect( action, SIGNAL( activated() ),
1034 mView, SLOT( edit_options() ) );
1035 icon = loadPixmap( pathString + "configure" );
1036 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
1037 action->addTo( actionMenu );
1038 connect( action, SIGNAL( activated() ),
1039 mView, SLOT( edit_global_options() ) );
1014 if ( KOPrefs::instance()->mShowFullMenu ) { 1040 if ( KOPrefs::instance()->mShowFullMenu ) {
1015 actionMenu->insertSeparator();
1016 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 1041 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
1017 1042
1018 } 1043 }
1019 // actionMenu->insertSeparator(); 1044 // actionMenu->insertSeparator();
1020 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 1045 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
1021 this ); 1046 this );
1022 action->addTo( importMenu_X ); 1047 action->addTo( importMenu_X );
1023 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 1048 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
1024 action = new QAction( "import_quick", i18n("Import last file"), 0, 1049 action = new QAction( "import_quick", i18n("Import last file"), 0,
1025 this ); 1050 this );
1026 action->addTo( importMenu_X ); 1051 action->addTo( importMenu_X );
1027 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 1052 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
1028 importMenu_X->insertSeparator(); 1053 importMenu_X->insertSeparator();
1029 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 1054 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
1030 this ); 1055 this );
1031 action->addTo( importMenu_X ); 1056 action->addTo( importMenu_X );
1032 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 1057 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
1033 //#ifndef DESKTOP_VERSION 1058 //#ifndef DESKTOP_VERSION
1034 importMenu_X->insertSeparator(); 1059 importMenu_X->insertSeparator();
1035 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 1060 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
1036 this ); 1061 this );
1037 action->addTo( importMenu_X ); 1062 action->addTo( importMenu_X );
1038 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 1063 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
1039 //#else 1064 //#else
1040#ifdef _OL_IMPORT_ 1065#ifdef _OL_IMPORT_
1041 importMenu_X->insertSeparator(); 1066 importMenu_X->insertSeparator();
1042 action = new QAction( "import_ol", i18n("Import from OL"), 0, 1067 action = new QAction( "import_ol", i18n("Import from OL"), 0,
1043 this ); 1068 this );
1044 action->addTo( importMenu_X ); 1069 action->addTo( importMenu_X );
1045 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 1070 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
1046#endif 1071#endif
1047 //#endif 1072 //#endif
1048 1073
1049 //importMenu->insertSeparator(); 1074 //importMenu->insertSeparator();
1050#if 0 1075#if 0
1051 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 1076 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
1052 this ); 1077 this );
1053 action->addTo( importMenu ); 1078 action->addTo( importMenu );
1054 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 1079 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
1055#endif 1080#endif
1056 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 1081 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
1057 this ); 1082 this );
1058 action->addTo( importMenu ); 1083 action->addTo( importMenu );
1059 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 1084 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
1060 importMenu->insertSeparator(); 1085 importMenu->insertSeparator();
1061 importMenu->insertItem( i18n("Import"), importMenu_X ); 1086 importMenu->insertItem( i18n("Import"), importMenu_X );
1062 //importMenu->insertSeparator(); 1087 //importMenu->insertSeparator();
1063 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 1088 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
1064 this ); 1089 this );
1065 action->addTo( exportMenu_X ); 1090 action->addTo( exportMenu_X );
1066 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 1091 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
1067 1092
1068 1093
1069 //LR 1094 //LR
1070 QPopupMenu *ex2phone = new QPopupMenu( this ); 1095 QPopupMenu *ex2phone = new QPopupMenu( this );
1071 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1096 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1072 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1097 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1073 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 1098 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
1074 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 1099 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
1075 1100
1076 importMenu->insertItem( i18n("Export"), exportMenu_X ); 1101 importMenu->insertItem( i18n("Export"), exportMenu_X );
1077#ifndef DESKTOP_VERSION 1102#ifndef DESKTOP_VERSION
1078 //importMenu->insertSeparator(); 1103 //importMenu->insertSeparator();
1079 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 1104 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
1080 this ); 1105 this );
1081 brAction->addTo( beamMenu_X ); 1106 brAction->addTo( beamMenu_X );
1082 brAction->setToggleAction (true ) ; 1107 brAction->setToggleAction (true ) ;
1083 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 1108 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
1084 1109
1085 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 1110 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
1086 this ); 1111 this );
1087 action->addTo( beamMenu_X ); 1112 action->addTo( beamMenu_X );
1088 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 1113 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
1089 1114
1090 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 1115 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
1091 this ); 1116 this );
1092 action->addTo( beamMenu_X ); 1117 action->addTo( beamMenu_X );
1093 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 1118 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
1094 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 1119 importMenu->insertItem( i18n("Beam"), beamMenu_X );
1095#else 1120#else
1096 //importMenu->insertSeparator(); 1121 //importMenu->insertSeparator();
1097 icon = loadPixmap( pathString + "print" ); 1122 icon = loadPixmap( pathString + "print" );
1098 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 1123 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
1099 action->addTo( beamMenu_X ); 1124 action->addTo( beamMenu_X );
1100 connect( action, SIGNAL( activated() ), 1125 connect( action, SIGNAL( activated() ),
1101 this, SLOT( printCal() ) ); 1126 this, SLOT( printCal() ) );
1102 1127
1103 icon = loadPixmap( pathString + "print" ); 1128 icon = loadPixmap( pathString + "print" );
1104 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 1129 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
1105 action->addTo( beamMenu_X ); 1130 action->addTo( beamMenu_X );
1106 connect( action, SIGNAL( activated() ), 1131 connect( action, SIGNAL( activated() ),
1107 this, SLOT( printSel() ) ); 1132 this, SLOT( printSel() ) );
1108 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 1133 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
1109 action->addTo( beamMenu_X ); 1134 action->addTo( beamMenu_X );
1110 connect( action, SIGNAL( activated() ), 1135 connect( action, SIGNAL( activated() ),
1111 mView->viewManager(), SLOT( slotprintWNV() ) ); 1136 mView->viewManager(), SLOT( slotprintWNV() ) );
1112 1137
1113 1138
1114 icon = loadPixmap( pathString + "print" ); 1139 icon = loadPixmap( pathString + "print" );
1115 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); 1140 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this );
1116 action->addTo( beamMenu_X ); 1141 action->addTo( beamMenu_X );
1117 connect( action, SIGNAL( activated() ), 1142 connect( action, SIGNAL( activated() ),
1118 this, SLOT( printListView() ) ); 1143 this, SLOT( printListView() ) );
1119 1144
1120 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); 1145 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
1121 action->addTo( beamMenu_X ); 1146 action->addTo( beamMenu_X );
1122 connect( action, SIGNAL( activated() ), 1147 connect( action, SIGNAL( activated() ),
1123 mView, SLOT( slotprintSelInc() ) ); 1148 mView, SLOT( slotprintSelInc() ) );
1124 1149
1125 importMenu->insertItem( i18n("Print"), beamMenu_X ); 1150 importMenu->insertItem( i18n("Print"), beamMenu_X );
1126#endif 1151#endif
1127 importMenu->insertSeparator(); 1152
1128 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
1129 this );
1130 action->addTo( importMenu );
1131 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1132 importMenu->insertSeparator(); 1153 importMenu->insertSeparator();
1133 action = new QAction( "beam all", i18n("Save"), 0, 1154 action = new QAction( "beam all", i18n("Save"), 0,
1134 this ); 1155 this );
1135 action->addTo( importMenu ); 1156 action->addTo( importMenu );
1136 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 1157 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
1137 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 1158 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
1138 this ); 1159 this );
1139 action->addTo( importMenu ); 1160 action->addTo( importMenu );
1140 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 1161 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
1141 1162
1142 //menuBar->insertItem( "Configure",configureMenu ); 1163 //menuBar->insertItem( "Configure",configureMenu );
1143 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 1164 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
1144 icon = loadPixmap( "korganizer/korganizer" ); 1165 icon = loadPixmap( "korganizer/korganizer" );
1145 1166
1146 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 1167 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
1147 action->addTo( helpMenu ); 1168 action->addTo( helpMenu );
1148 connect( action, SIGNAL( activated() ), 1169 connect( action, SIGNAL( activated() ),
1149 SLOT( whatsNew() ) ); 1170 SLOT( whatsNew() ) );
1150 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 1171 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
1151 action->addTo( helpMenu ); 1172 action->addTo( helpMenu );
1152 connect( action, SIGNAL( activated() ), 1173 connect( action, SIGNAL( activated() ),
1153 SLOT( features() ) ); 1174 SLOT( features() ) );
1154 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 1175 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
1155 action->addTo( helpMenu ); 1176 action->addTo( helpMenu );
1156 connect( action, SIGNAL( activated() ), 1177 connect( action, SIGNAL( activated() ),
1157 SLOT( keyBindings() ) ); 1178 SLOT( keyBindings() ) );
1158 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); 1179 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this );
1159 action->addTo( helpMenu ); 1180 action->addTo( helpMenu );
1160 connect( action, SIGNAL( activated() ), 1181 connect( action, SIGNAL( activated() ),
1161 SLOT( storagehowto() ) ); 1182 SLOT( storagehowto() ) );
1162 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); 1183 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this );
1163 action->addTo( helpMenu ); 1184 action->addTo( helpMenu );
1164 connect( action, SIGNAL( activated() ), 1185 connect( action, SIGNAL( activated() ),
1165 SLOT( timetrackinghowto() ) ); 1186 SLOT( timetrackinghowto() ) );
1166 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 1187 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
1167 action->addTo( helpMenu ); 1188 action->addTo( helpMenu );
1168 connect( action, SIGNAL( activated() ), 1189 connect( action, SIGNAL( activated() ),
1169 SLOT( synchowto() ) ); 1190 SLOT( synchowto() ) );
1170 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 1191 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
1171 action->addTo( helpMenu ); 1192 action->addTo( helpMenu );
1172 connect( action, SIGNAL( activated() ), 1193 connect( action, SIGNAL( activated() ),
1173 SLOT( kdesynchowto() ) ); 1194 SLOT( kdesynchowto() ) );
1174 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 1195 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
1175 action->addTo( helpMenu ); 1196 action->addTo( helpMenu );
1176 connect( action, SIGNAL( activated() ), 1197 connect( action, SIGNAL( activated() ),
1177 SLOT( multisynchowto() ) ); 1198 SLOT( multisynchowto() ) );
1178 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 1199 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
1179 action->addTo( helpMenu ); 1200 action->addTo( helpMenu );
1180 connect( action, SIGNAL( activated() ), 1201 connect( action, SIGNAL( activated() ),
1181 SLOT( aboutAutoSaving() ) ); 1202 SLOT( aboutAutoSaving() ) );
1182 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 1203 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
1183 action->addTo( helpMenu ); 1204 action->addTo( helpMenu );
1184 connect( action, SIGNAL( activated() ), 1205 connect( action, SIGNAL( activated() ),
1185 SLOT( aboutKnownBugs() ) ); 1206 SLOT( aboutKnownBugs() ) );
1186 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 1207 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
1187 action->addTo( helpMenu ); 1208 action->addTo( helpMenu );
1188 connect( action, SIGNAL( activated() ), 1209 connect( action, SIGNAL( activated() ),
1189 SLOT( usertrans() ) ); 1210 SLOT( usertrans() ) );
1190 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 1211 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
1191 action->addTo( helpMenu ); 1212 action->addTo( helpMenu );
1192 connect( action, SIGNAL( activated() ), 1213 connect( action, SIGNAL( activated() ),
1193 SLOT( faq() ) ); 1214 SLOT( faq() ) );
1194 action = new QAction( "licence", i18n("Licence..."), 0, this ); 1215 action = new QAction( "licence", i18n("Licence..."), 0, this );
1195 action->addTo( helpMenu ); 1216 action->addTo( helpMenu );
1196 connect( action, SIGNAL( activated() ), 1217 connect( action, SIGNAL( activated() ),
1197 SLOT( licence() ) ); 1218 SLOT( licence() ) );
1198 action = new QAction( "about", i18n("About..."), 0, this ); 1219 action = new QAction( "about", i18n("About..."), 0, this );
1199 action->addTo( helpMenu ); 1220 action->addTo( helpMenu );
1200 connect( action, SIGNAL( activated() ), 1221 connect( action, SIGNAL( activated() ),
1201 SLOT( about() ) ); 1222 SLOT( about() ) );
1202 //menuBar->insertSeparator(); 1223 //menuBar->insertSeparator();
1203 1224
1204 // ****************************************************** 1225 // ******************************************************
1205 // menubar icons 1226 // menubar icons
1206 1227
1207 1228
1208 1229
1209 //menuBar->insertItem( iconToolBar ); 1230 //menuBar->insertItem( iconToolBar );
1210 //xdays_action 1231 //xdays_action
1211 if (p-> mShowIconNewEvent) 1232 if (p-> mShowIconNewEvent)
1212 ne_action->addTo( iconToolBar ); 1233 ne_action->addTo( iconToolBar );
1213 if (p->mShowIconNewTodo ) 1234 if (p->mShowIconNewTodo )
1214 nt_action->addTo( iconToolBar ); 1235 nt_action->addTo( iconToolBar );
1215 if (p-> mShowIconSearch) 1236 if (p-> mShowIconSearch)
1216 search_action->addTo( iconToolBar ); 1237 search_action->addTo( iconToolBar );
1217 if (p-> mShowIconWhatsThis) 1238 if (p-> mShowIconWhatsThis)
1218 QWhatsThis::whatsThisButton ( iconToolBar ); 1239 QWhatsThis::whatsThisButton ( iconToolBar );
1219 if (p-> mShowIconNext) 1240 if (p-> mShowIconNext)
1220 whatsnext_action->addTo( viewToolBar ); 1241 whatsnext_action->addTo( viewToolBar );
1221 if (p-> mShowIconNextDays) 1242 if (p-> mShowIconNextDays)
1222 xdays_action->addTo( viewToolBar ); 1243 xdays_action->addTo( viewToolBar );
1223 if (p-> mShowIconJournal) 1244 if (p-> mShowIconJournal)
1224 viewjournal_action->addTo( viewToolBar ); 1245 viewjournal_action->addTo( viewToolBar );
1225 if (p-> mShowIconDay1) 1246 if (p-> mShowIconDay1)
1226 day1_action->addTo( viewToolBar ); 1247 day1_action->addTo( viewToolBar );
1227 if (p-> mShowIconDay5) 1248 if (p-> mShowIconDay5)
@@ -1621,200 +1642,205 @@ QString MainWindow::syncFileName()
1621 return QString( "/tmp/synccalendar.ics" ); 1642 return QString( "/tmp/synccalendar.ics" );
1622#endif 1643#endif
1623} 1644}
1624#include "koglobals.h" 1645#include "koglobals.h"
1625#include <kcalendarsystem.h> 1646#include <kcalendarsystem.h>
1626void MainWindow::updateWeek(QDate seda) 1647void MainWindow::updateWeek(QDate seda)
1627{ 1648{
1628 int weekNum = KGlobal::locale()->weekNum ( seda ); 1649 int weekNum = KGlobal::locale()->weekNum ( seda );
1629 mWeekPixmap.fill( mWeekBgColor ); 1650 mWeekPixmap.fill( mWeekBgColor );
1630 QPainter p ( &mWeekPixmap ); 1651 QPainter p ( &mWeekPixmap );
1631 p.setFont( mWeekFont ); 1652 p.setFont( mWeekFont );
1632 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1653 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1633 p.end(); 1654 p.end();
1634 QIconSet icon3 ( mWeekPixmap ); 1655 QIconSet icon3 ( mWeekPixmap );
1635 mWeekAction->setIconSet ( icon3 ); 1656 mWeekAction->setIconSet ( icon3 );
1636 1657
1637} 1658}
1638void MainWindow::updateWeekNum(const DateList &selectedDates) 1659void MainWindow::updateWeekNum(const DateList &selectedDates)
1639{ 1660{
1640 updateWeek( selectedDates.first() ); 1661 updateWeek( selectedDates.first() );
1641} 1662}
1642void MainWindow::processIncidenceSelection( Incidence *incidence ) 1663void MainWindow::processIncidenceSelection( Incidence *incidence )
1643{ 1664{
1644 1665
1645 if ( !incidence ) { 1666 if ( !incidence ) {
1646 enableIncidenceActions( false ); 1667 enableIncidenceActions( false );
1647 1668
1648 mNewSubTodoAction->setEnabled( false ); 1669 mNewSubTodoAction->setEnabled( false );
1649 setCaptionToDates(); 1670 setCaptionToDates();
1650 return; 1671 return;
1651 1672
1652 } 1673 }
1653 1674
1654 //KGlobal::locale()->formatDateTime(nextA, true); 1675 //KGlobal::locale()->formatDateTime(nextA, true);
1655 QString startString = ""; 1676 QString startString = "";
1656 if ( incidence->typeID() != todoID ) { 1677 if ( incidence->typeID() != todoID ) {
1657 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1678 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1658 if ( incidence->doesFloat() ) { 1679 if ( incidence->doesFloat() ) {
1659 startString += ": "+incidence->dtStartDateStr( true ); 1680 startString += ": "+incidence->dtStartDateStr( true );
1660 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1681 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1661 1682
1662 } else { 1683 } else {
1663 startString = ": "+incidence->dtStartStr(true); 1684 startString = ": "+incidence->dtStartStr(true);
1664 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1685 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1665 1686
1666 } 1687 }
1667 1688
1668 } else { 1689 } else {
1669 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1690 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1670 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1691 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1671 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1692 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1672 1693
1673 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1694 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1674 bool ok; 1695 bool ok;
1675 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1696 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1676 if ( ok ) { 1697 if ( ok ) {
1677 int years = noc.date().year() - incidence->dtStart().date().year(); 1698 int years = noc.date().year() - incidence->dtStart().date().year();
1678 startString += i18n(" (%1 y.)"). arg( years ); 1699 startString += i18n(" (%1 y.)"). arg( years );
1679 } 1700 }
1680 } 1701 }
1681 else 1702 else
1682 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1703 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1683 } 1704 }
1684 1705
1685 } 1706 }
1686 else 1707 else
1687 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1708 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1688 if ( !incidence->location().isEmpty() ) 1709 if ( !incidence->location().isEmpty() )
1689 startString += " (" +incidence->location()+")"; 1710 startString += " (" +incidence->location()+")";
1690 setCaption( incidence->summary()+startString); 1711 setCaption( incidence->summary()+startString);
1691 1712
1692 enableIncidenceActions( true ); 1713 enableIncidenceActions( true );
1693 1714
1694 if ( incidence->typeID() == eventID ) { 1715 if ( incidence->typeID() == eventID ) {
1695 mShowAction->setText( i18n("Show Event...") ); 1716 mShowAction->setText( i18n("Show Event...") );
1696 mEditAction->setText( i18n("Edit Event...") ); 1717 mEditAction->setText( i18n("Edit Event...") );
1697 mDeleteAction->setText( i18n("Delete Event...") ); 1718 mDeleteAction->setText( i18n("Delete Event...") );
1698 1719
1699 mNewSubTodoAction->setEnabled( false ); 1720 mNewSubTodoAction->setEnabled( false );
1700 } else if ( incidence->typeID() == todoID ) { 1721 } else if ( incidence->typeID() == todoID ) {
1701 mShowAction->setText( i18n("Show Todo...") ); 1722 mShowAction->setText( i18n("Show Todo...") );
1702 mEditAction->setText( i18n("Edit Todo...") ); 1723 mEditAction->setText( i18n("Edit Todo...") );
1703 mDeleteAction->setText( i18n("Delete Todo...") ); 1724 mDeleteAction->setText( i18n("Delete Todo...") );
1704 1725
1705 mNewSubTodoAction->setEnabled( true ); 1726 mNewSubTodoAction->setEnabled( true );
1706 } else { 1727 } else {
1707 mShowAction->setText( i18n("Show...") ); 1728 mShowAction->setText( i18n("Show...") );
1708 mShowAction->setText( i18n("Edit...") ); 1729 mShowAction->setText( i18n("Edit...") );
1709 mShowAction->setText( i18n("Delete...") ); 1730 mShowAction->setText( i18n("Delete...") );
1710 1731
1711 mNewSubTodoAction->setEnabled( false ); 1732 mNewSubTodoAction->setEnabled( false );
1712 } 1733 }
1713} 1734}
1714 1735
1715void MainWindow::enableIncidenceActions( bool enabled ) 1736void MainWindow::enableIncidenceActions( bool enabled )
1716{ 1737{
1738
1739#ifndef DESKTOP_VERSION
1740 mCurrentItemMenu->setEnabled( enabled );
1741#else
1717 mShowAction->setEnabled( enabled ); 1742 mShowAction->setEnabled( enabled );
1718 mEditAction->setEnabled( enabled ); 1743 mEditAction->setEnabled( enabled );
1719 mDeleteAction->setEnabled( enabled ); 1744 mDeleteAction->setEnabled( enabled );
1720 1745
1721 mCloneAction->setEnabled( enabled ); 1746 mCloneAction->setEnabled( enabled );
1722 mMoveAction->setEnabled( enabled ); 1747 mMoveAction->setEnabled( enabled );
1723 mBeamAction->setEnabled( enabled ); 1748 mBeamAction->setEnabled( enabled );
1724 mCancelAction->setEnabled( enabled ); 1749 mCancelAction->setEnabled( enabled );
1750#endif
1725} 1751}
1726 1752
1727void MainWindow::importOL() 1753void MainWindow::importOL()
1728{ 1754{
1729#ifdef _OL_IMPORT_ 1755#ifdef _OL_IMPORT_
1730 mView->clearAllViews(); 1756 mView->clearAllViews();
1731 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1757 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1732 id->exec(); 1758 id->exec();
1733 delete id; 1759 delete id;
1734 mView->calendar()->checkAlarmForIncidence( 0, true ); 1760 mView->calendar()->checkAlarmForIncidence( 0, true );
1735 mView->updateView(); 1761 mView->updateView();
1736#endif 1762#endif
1737} 1763}
1738void MainWindow::importBday() 1764void MainWindow::importBday()
1739{ 1765{
1740 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), 1766 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1741 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1767 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1742 i18n("Import!"), i18n("Cancel"), 0, 1768 i18n("Import!"), i18n("Cancel"), 0,
1743 0, 1 ); 1769 0, 1 );
1744 if ( result == 0 ) { 1770 if ( result == 0 ) {
1745 mView->importBday(); 1771 mView->importBday();
1746 1772
1747 } 1773 }
1748 1774
1749 1775
1750} 1776}
1751void MainWindow::importQtopia() 1777void MainWindow::importQtopia()
1752{ 1778{
1753 //#ifndef DESKTOP_VERSION 1779 //#ifndef DESKTOP_VERSION
1754 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1780 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1755#ifdef DESKTOP_VERSION 1781#ifdef DESKTOP_VERSION
1756 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1782 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1757#endif 1783#endif
1758 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1784 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1759 i18n("Import!"), i18n("Cancel"), 0, 1785 i18n("Import!"), i18n("Cancel"), 0,
1760 0, 1 ); 1786 0, 1 );
1761 if ( result == 0 ) { 1787 if ( result == 0 ) {
1762#ifndef DESKTOP_VERSION 1788#ifndef DESKTOP_VERSION
1763 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1789 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1764 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1790 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1765 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1791 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1766#else 1792#else
1767 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1793 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1768 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1794 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1769 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1795 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1770#endif 1796#endif
1771 mView->importQtopia( categories, datebook, todolist ); 1797 mView->importQtopia( categories, datebook, todolist );
1772 } 1798 }
1773 mView->calendar()->reInitAlarmSettings(); 1799 mView->calendar()->reInitAlarmSettings();
1774#if 0 1800#if 0
1775 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1801 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1776 i18n("Not supported \non desktop!\n"), 1802 i18n("Not supported \non desktop!\n"),
1777 i18n("Ok"), i18n("Cancel"), 0, 1803 i18n("Ok"), i18n("Cancel"), 0,
1778 0, 1 ); 1804 0, 1 );
1779 1805
1780#endif 1806#endif
1781} 1807}
1782 1808
1783void MainWindow::saveOnClose() 1809void MainWindow::saveOnClose()
1784{ 1810{
1785 KOPrefs *p = KOPrefs::instance(); 1811 KOPrefs *p = KOPrefs::instance();
1786 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1812 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1787 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1813 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1788 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1814 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1789 if ( filterToolBar ) { 1815 if ( filterToolBar ) {
1790 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1816 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1791 } 1817 }
1792#ifdef DESKTOP_VERSION 1818#ifdef DESKTOP_VERSION
1793 1819
1794 QPoint myP; 1820 QPoint myP;
1795 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1821 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
1796 if ( p->mToolBarHor ) 1822 if ( p->mToolBarHor )
1797 p->mToolBarUp = myP.y() > height()/2; 1823 p->mToolBarUp = myP.y() > height()/2;
1798 else 1824 else
1799 p->mToolBarUp = myP.x() > width()/2; 1825 p->mToolBarUp = myP.x() > width()/2;
1800 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); 1826 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
1801 if ( p->mToolBarHorV ) 1827 if ( p->mToolBarHorV )
1802 p->mToolBarUpV = myP.y() > height()/2; 1828 p->mToolBarUpV = myP.y() > height()/2;
1803 else 1829 else
1804 p->mToolBarUpV = myP.x() > width()/2 ; 1830 p->mToolBarUpV = myP.x() > width()/2 ;
1805 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); 1831 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
1806 if ( p->mToolBarHorN ) 1832 if ( p->mToolBarHorN )
1807 p->mToolBarUpN = myP.y() > height()/2; 1833 p->mToolBarUpN = myP.y() > height()/2;
1808 else 1834 else
1809 p->mToolBarUpN = myP.x() > width()/2 ; 1835 p->mToolBarUpN = myP.x() > width()/2 ;
1810 if ( filterToolBar ) { 1836 if ( filterToolBar ) {
1811 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); 1837 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
1812 if ( p->mToolBarHorF ) 1838 if ( p->mToolBarHorF )
1813 p->mToolBarUpF = myP.y() > height()/2; 1839 p->mToolBarUpF = myP.y() > height()/2;
1814 else 1840 else
1815 p->mToolBarUpF = myP.x() > width()/2 ; 1841 p->mToolBarUpF = myP.x() > width()/2 ;
1816 } 1842 }
1817#else 1843#else
1818 if ( p->mToolBarHor ) 1844 if ( p->mToolBarHor )
1819 p->mToolBarUp = iconToolBar->y() > height()/2; 1845 p->mToolBarUp = iconToolBar->y() > height()/2;
1820 else 1846 else
@@ -2181,192 +2207,193 @@ void MainWindow::fillFilterMenu()
2181 selectFilterMenu->setItemChecked( iii, checkitem ); 2207 selectFilterMenu->setItemChecked( iii, checkitem );
2182 filter = fili.next(); 2208 filter = fili.next();
2183 ++iii; 2209 ++iii;
2184 } 2210 }
2185 if ( !checkitem ) 2211 if ( !checkitem )
2186 selectFilterMenu->setItemChecked( 1, true ); 2212 selectFilterMenu->setItemChecked( 1, true );
2187} 2213}
2188void MainWindow::fillFilterMenuPopup() 2214void MainWindow::fillFilterMenuPopup()
2189{ 2215{
2190 filterPopupMenu->clear(); 2216 filterPopupMenu->clear();
2191 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2217 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2192 2218
2193 filterPopupMenu->insertSeparator(); 2219 filterPopupMenu->insertSeparator();
2194 QPtrList<CalFilter> fili = mView->filters(); 2220 QPtrList<CalFilter> fili = mView->filters();
2195 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2221 CalFilter *curfilter = mView->filterView()->selectedFilter();
2196 CalFilter *filter = fili.first(); 2222 CalFilter *filter = fili.first();
2197 int iii = 1; 2223 int iii = 1;
2198 bool checkitem = mView->filterView()->filtersEnabled(); 2224 bool checkitem = mView->filterView()->filtersEnabled();
2199 while(filter) { 2225 while(filter) {
2200 filterPopupMenu->insertItem( filter->name(), iii ); 2226 filterPopupMenu->insertItem( filter->name(), iii );
2201 if ( filter == curfilter) 2227 if ( filter == curfilter)
2202 filterPopupMenu->setItemChecked( iii, checkitem ); 2228 filterPopupMenu->setItemChecked( iii, checkitem );
2203 filter = fili.next(); 2229 filter = fili.next();
2204 ++iii; 2230 ++iii;
2205 } 2231 }
2206 if ( !checkitem ) 2232 if ( !checkitem )
2207 filterPopupMenu->setItemChecked( 0, true ); 2233 filterPopupMenu->setItemChecked( 0, true );
2208} 2234}
2209void MainWindow::selectFilter( int fil ) 2235void MainWindow::selectFilter( int fil )
2210{ 2236{
2211 2237
2212 if ( fil == 0 ) { 2238 if ( fil == 0 ) {
2213 mView->editFilters( ); 2239 mView->editFilters( );
2214 } else if ( fil == 1 ){ 2240 } else if ( fil == 1 ){
2215 if ( mView->filterView()->filtersEnabled() ) 2241 if ( mView->filterView()->filtersEnabled() )
2216 mView->toggleFilerEnabled( ); 2242 mView->toggleFilerEnabled( );
2217 } else { 2243 } else {
2218 if ( !mView->filterView()->filtersEnabled() ) { 2244 if ( !mView->filterView()->filtersEnabled() ) {
2219 mView->filterView()->blockSignals( true ); 2245 mView->filterView()->blockSignals( true );
2220 mView->toggleFilerEnabled( ); 2246 mView->toggleFilerEnabled( );
2221 mView->filterView()->blockSignals( false ); 2247 mView->filterView()->blockSignals( false );
2222 } 2248 }
2223 mView->selectFilter( fil-2 ); 2249 mView->selectFilter( fil-2 );
2224 } 2250 }
2225} 2251}
2226void MainWindow::updateFilterToolbar() 2252void MainWindow::updateFilterToolbar()
2227{ 2253{
2228 if ( filterMenubar ) { 2254 if ( filterMenubar ) {
2229 if ( !mView->filterView()->filtersEnabled() ) { 2255 if ( !mView->filterView()->filtersEnabled() ) {
2230 filterMenubar->changeItem( 0, i18n("No Filter") ); 2256 filterMenubar->changeItem( 0, i18n("No Filter") );
2231 } else { 2257 } else {
2232 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2258 CalFilter *curfilter = mView->filterView()->selectedFilter();
2233 if ( curfilter ) { 2259 if ( curfilter ) {
2234 filterMenubar->changeItem( 0, curfilter->name() ); 2260 filterMenubar->changeItem( 0, curfilter->name() );
2235 } 2261 }
2236 } 2262 }
2237 } 2263 }
2238} 2264}
2239void MainWindow::selectFilterPopup( int fil ) 2265void MainWindow::selectFilterPopup( int fil )
2240{ 2266{
2241 selectFilter( fil + 1 ); 2267 selectFilter( fil + 1 );
2242 2268
2243} 2269}
2244void MainWindow::configureToolBar( int item ) 2270void MainWindow::configureToolBar( int item )
2245{ 2271{
2246 2272
2247 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2273 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2248 KOPrefs *p = KOPrefs::instance(); 2274 KOPrefs *p = KOPrefs::instance();
2249 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2275 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2250 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2276 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2251 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2277 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2252 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2278 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2253 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2279 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2254 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2280 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2255 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2281 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2256 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2282 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2257 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2283 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2258 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2284 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2259 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2285 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2260 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2286 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2261 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2287 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2262 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2288 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2263 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2289 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2264 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2290 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2265 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2291 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2266 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2292 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2267 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2293 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2268 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2294 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2269 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2295 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2270 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2296 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2271 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2297 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2272 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2298 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2273 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2299 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2274 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2300 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2275 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2301 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2276 // initActions(); 2302 // initActions();
2303 setCaption ( i18n("Toolbar changes needs a restart!") );
2277} 2304}
2278void MainWindow::setCaption ( const QString & c ) 2305void MainWindow::setCaption ( const QString & c )
2279{ 2306{
2280 QString cap = c; 2307 QString cap = c;
2281 cap.replace( QRegExp("\n"), " " ); 2308 cap.replace( QRegExp("\n"), " " );
2282 cap = cap.stripWhiteSpace(); 2309 cap = cap.stripWhiteSpace();
2283 if ( cap.isEmpty() ) 2310 if ( cap.isEmpty() )
2284 cap = "KO/Pi"; 2311 cap = "KO/Pi";
2285 QWidget::setCaption( cap ); 2312 QWidget::setCaption( cap );
2286} 2313}
2287void MainWindow::setCaptionToDates() 2314void MainWindow::setCaptionToDates()
2288{ 2315{
2289 QString selDates; 2316 QString selDates;
2290 QDate date = mView->startDate(); 2317 QDate date = mView->startDate();
2291 if ( ! date.isValid() ) { 2318 if ( ! date.isValid() ) {
2292 setCaption(""); 2319 setCaption("");
2293 return; 2320 return;
2294 } 2321 }
2295 selDates = KGlobal::locale()->formatDate( date, true); 2322 selDates = KGlobal::locale()->formatDate( date, true);
2296 if (mView->startDate() < mView->endDate() ) 2323 if (mView->startDate() < mView->endDate() )
2297 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2324 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2298 else { 2325 else {
2299 QString addString; 2326 QString addString;
2300 if ( date == QDateTime::currentDateTime().date() ) 2327 if ( date == QDateTime::currentDateTime().date() )
2301 addString = i18n("Today"); 2328 addString = i18n("Today");
2302 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2329 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
2303 addString = i18n("Tomorrow"); 2330 addString = i18n("Tomorrow");
2304 if ( !addString.isEmpty() ) 2331 if ( !addString.isEmpty() )
2305 selDates = addString+", "+selDates ; 2332 selDates = addString+", "+selDates ;
2306 } 2333 }
2307 setCaption( i18n("Dates: ") + selDates ); 2334 setCaption( i18n("Dates: ") + selDates );
2308 2335
2309} 2336}
2310void MainWindow::showConfigureAgenda( ) 2337void MainWindow::showConfigureAgenda( )
2311{ 2338{
2312 int iii; 2339 int iii;
2313 for ( iii = 1;iii<= 10 ;++iii ){ 2340 for ( iii = 1;iii<= 10 ;++iii ){
2314 configureAgendaMenu->setItemChecked( (iii+1)*2, false ); 2341 configureAgendaMenu->setItemChecked( (iii+1)*2, false );
2315 } 2342 }
2316 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2343 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2317} 2344}
2318void MainWindow::configureAgenda( int item ) 2345void MainWindow::configureAgenda( int item )
2319{ 2346{
2320 if ( KOPrefs::instance()->mHourSize == item ) 2347 if ( KOPrefs::instance()->mHourSize == item )
2321 return; 2348 return;
2322 KOPrefs::instance()->mHourSize=item; 2349 KOPrefs::instance()->mHourSize=item;
2323 mView->viewManager()->agendaView()->updateConfig(); 2350 mView->viewManager()->agendaView()->updateConfig();
2324} 2351}
2325 2352
2326void MainWindow::saveCalendar() 2353void MainWindow::saveCalendar()
2327{ 2354{
2328 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 2355 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
2329 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 2356 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
2330 bupDir = KGlobalSettings::backupDataDir(); 2357 bupDir = KGlobalSettings::backupDataDir();
2331 bupDir = KGlobal::formatMessage ( bupDir, 0 ); 2358 bupDir = KGlobal::formatMessage ( bupDir, 0 );
2332 QString bupHint; 2359 QString bupHint;
2333 if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) 2360 if ( !KPimGlobalPrefs::instance()->mBackupEnabled )
2334 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); 2361 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)");
2335 if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; 2362 if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return;
2336 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; 2363 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled;
2337 KPimGlobalPrefs::instance()->mBackupEnabled = false; 2364 KPimGlobalPrefs::instance()->mBackupEnabled = false;
2338 save(); 2365 save();
2339 KPimGlobalPrefs::instance()->mBackupEnabled = enabled; 2366 KPimGlobalPrefs::instance()->mBackupEnabled = enabled;
2340 backupAllFiles(); 2367 backupAllFiles();
2341} 2368}
2342void MainWindow::loadCalendar() 2369void MainWindow::loadCalendar()
2343{ 2370{
2344 2371
2345 2372
2346#if 0 2373#if 0
2347 QString fn = KOPrefs::instance()->mLastLoadFile; 2374 QString fn = KOPrefs::instance()->mLastLoadFile;
2348 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 2375 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
2349 2376
2350 if ( fn == "" ) 2377 if ( fn == "" )
2351 return; 2378 return;
2352 QFileInfo info; 2379 QFileInfo info;
2353 info.setFile( fn ); 2380 info.setFile( fn );
2354 QString mess; 2381 QString mess;
2355 bool loadbup = true; 2382 bool loadbup = true;
2356 if ( info. exists() ) { 2383 if ( info. exists() ) {
2357 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2384 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2358 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 2385 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
2359 mess, 2386 mess,
2360 i18n("Load!"), i18n("Cancel"), 0, 2387 i18n("Load!"), i18n("Cancel"), 0,
2361 0, 1 ); 2388 0, 1 );
2362 if ( result != 0 ) { 2389 if ( result != 0 ) {
2363 loadbup = false; 2390 loadbup = false;
2364 } 2391 }
2365 } else { 2392 } else {
2366 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2393 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2367 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 2394 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
2368 0, 1 ); 2395 0, 1 );
2369 2396
2370 return; 2397 return;
2371 } 2398 }
2372 if ( loadbup ) { 2399 if ( loadbup ) {
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index a4d0523..953774f 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -36,136 +36,137 @@ class MainWindow : public QMainWindow
36{ 36{
37 Q_OBJECT 37 Q_OBJECT
38 public: 38 public:
39 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); 39 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = "");
40 ~MainWindow(); 40 ~MainWindow();
41 bool beamReceiveEnabled(); 41 bool beamReceiveEnabled();
42 static QString defaultFileName(); 42 static QString defaultFileName();
43 static QString syncFileName(); 43 static QString syncFileName();
44 static QString resourcePath(); 44 static QString resourcePath();
45 public slots: 45 public slots:
46 void setUsesBigPixmaps ( bool ); 46 void setUsesBigPixmaps ( bool );
47 void setCaption ( const QString & ); 47 void setCaption ( const QString & );
48 void updateWeekNum(const KCal::DateList &); 48 void updateWeekNum(const KCal::DateList &);
49 void updateWeek(QDate); 49 void updateWeek(QDate);
50 void updateFilterToolbar(); 50 void updateFilterToolbar();
51 virtual void showMaximized (); 51 virtual void showMaximized ();
52 void configureAgenda( int ); 52 void configureAgenda( int );
53 void recieve( const QCString& msg, const QByteArray& data ); 53 void recieve( const QCString& msg, const QByteArray& data );
54 protected slots: 54 protected slots:
55 void startMultiSync(); 55 void startMultiSync();
56 void setCaptionToDates(); 56 void setCaptionToDates();
57 void weekAction(); 57 void weekAction();
58 void about(); 58 void about();
59 void licence(); 59 void licence();
60 void faq(); 60 void faq();
61 void usertrans(); 61 void usertrans();
62 void features(); 62 void features();
63 void synchowto(); 63 void synchowto();
64 void storagehowto(); 64 void storagehowto();
65 void timetrackinghowto(); 65 void timetrackinghowto();
66 void kdesynchowto(); 66 void kdesynchowto();
67 void multisynchowto(); 67 void multisynchowto();
68 void whatsNew(); 68 void whatsNew();
69 void keyBindings(); 69 void keyBindings();
70 void aboutAutoSaving();; 70 void aboutAutoSaving();;
71 void aboutKnownBugs(); 71 void aboutKnownBugs();
72 72
73 void processIncidenceSelection( Incidence * ); 73 void processIncidenceSelection( Incidence * );
74 74
75 void importQtopia(); 75 void importQtopia();
76 void importBday(); 76 void importBday();
77 void importOL(); 77 void importOL();
78 void importIcal(); 78 void importIcal();
79 void importFile( QString, bool ); 79 void importFile( QString, bool );
80 void quickImportIcal(); 80 void quickImportIcal();
81 81
82 void slotModifiedChanged( bool ); 82 void slotModifiedChanged( bool );
83 83
84 void save(); 84 void save();
85 void backupAllFiles(); 85 void backupAllFiles();
86 void saveStopTimer(); 86 void saveStopTimer();
87 void configureToolBar( int ); 87 void configureToolBar( int );
88 void printSel(); 88 void printSel();
89 void printCal(); 89 void printCal();
90 void printListView(); 90 void printListView();
91 void saveCalendar(); 91 void saveCalendar();
92 void loadCalendar(); 92 void loadCalendar();
93 void exportVCalendar(); 93 void exportVCalendar();
94 void fillFilterMenu(); 94 void fillFilterMenu();
95 void fillFilterMenuTB(); 95 void fillFilterMenuTB();
96 void selectFilter( int ); 96 void selectFilter( int );
97 void fillFilterMenuPopup(); 97 void fillFilterMenuPopup();
98 void selectFilterPopup( int ); 98 void selectFilterPopup( int );
99 void exportToPhone( int ); 99 void exportToPhone( int );
100 void toggleBeamReceive(); 100 void toggleBeamReceive();
101 void disableBR(bool); 101 void disableBR(bool);
102 signals: 102 signals:
103 void selectWeek ( int ); 103 void selectWeek ( int );
104 private slots: 104 private slots:
105 void showConfigureAgenda(); 105 void showConfigureAgenda();
106 void getFile( bool ); 106 void getFile( bool );
107 void syncFileRequest(); 107 void syncFileRequest();
108 108
109 protected: 109 protected:
110 void hideEvent ( QHideEvent * ); 110 void hideEvent ( QHideEvent * );
111 QString sentSyncFile(); 111 QString sentSyncFile();
112 void displayText( QString, QString); 112 void displayText( QString, QString);
113 void enableIncidenceActions( bool ); 113 void enableIncidenceActions( bool );
114 114
115 private: 115 private:
116 bool mBRdisabled; 116 bool mBRdisabled;
117#ifndef DESKTOP_VERSION 117#ifndef DESKTOP_VERSION
118 QCopChannel* infrared; 118 QCopChannel* infrared;
119#endif 119#endif
120 QAction* brAction; 120 QAction* brAction;
121 KSyncManager* mSyncManager; 121 KSyncManager* mSyncManager;
122 bool mClosed; 122 bool mClosed;
123 void saveOnClose(); 123 void saveOnClose();
124 bool mFlagKeyPressed; 124 bool mFlagKeyPressed;
125 bool mBlockAtStartup; 125 bool mBlockAtStartup;
126 QPEToolBar *iconToolBar; 126 QPEToolBar *iconToolBar;
127 QPEToolBar *viewToolBar; 127 QPEToolBar *viewToolBar;
128 QPEToolBar *navigatorToolBar; 128 QPEToolBar *navigatorToolBar;
129 QPEToolBar *filterToolBar; 129 QPEToolBar *filterToolBar;
130 QMenuBar *filterMenubar; 130 QMenuBar *filterMenubar;
131 QPopupMenu * filterPopupMenu; 131 QPopupMenu * filterPopupMenu;
132 QPopupMenu * mCurrentItemMenu;
132 void initActions(); 133 void initActions();
133 void setDefaultPreferences(); 134 void setDefaultPreferences();
134 void resizeEvent( QResizeEvent* e); 135 void resizeEvent( QResizeEvent* e);
135 void keyPressEvent ( QKeyEvent * ) ; 136 void keyPressEvent ( QKeyEvent * ) ;
136 void keyReleaseEvent ( QKeyEvent * ) ; 137 void keyReleaseEvent ( QKeyEvent * ) ;
137 QPopupMenu *configureToolBarMenu; 138 QPopupMenu *configureToolBarMenu;
138 QPopupMenu *selectFilterMenu; 139 QPopupMenu *selectFilterMenu;
139 QPopupMenu *selectFilterMenuTB; 140 QPopupMenu *selectFilterMenuTB;
140 QPopupMenu *configureAgendaMenu, *syncMenu; 141 QPopupMenu *configureAgendaMenu, *syncMenu;
141 CalendarLocal *mCalendar; 142 CalendarLocal *mCalendar;
142 CalendarView *mView; 143 CalendarView *mView;
143 QAction *mNewSubTodoAction; 144 QAction *mNewSubTodoAction;
144 QAction *mWeekAction; 145 QAction *mWeekAction;
145 QFont mWeekFont; 146 QFont mWeekFont;
146 QPixmap mWeekPixmap; 147 QPixmap mWeekPixmap;
147 QColor mWeekBgColor; 148 QColor mWeekBgColor;
148 149
149 QAction *mShowAction; 150 QAction *mShowAction;
150 QAction *mEditAction; 151 QAction *mEditAction;
151 QAction *mDeleteAction; 152 QAction *mDeleteAction;
152 QAction *mCloneAction; 153 QAction *mCloneAction;
153 QAction *mMoveAction; 154 QAction *mMoveAction;
154 QAction *mBeamAction; 155 QAction *mBeamAction;
155 QAction *mCancelAction; 156 QAction *mCancelAction;
156 157
157 QAction *mToggleNav; 158 QAction *mToggleNav;
158 QAction *mToggleFilter; 159 QAction *mToggleFilter;
159 QAction *mToggleAllday; 160 QAction *mToggleAllday;
160 QAction *actionFilterMenuTB; 161 QAction *actionFilterMenuTB;
161 162
162 void closeEvent( QCloseEvent* ce ); 163 void closeEvent( QCloseEvent* ce );
163 QTimer mSaveTimer; 164 QTimer mSaveTimer;
164 //bool mBlockSaveFlag; 165 //bool mBlockSaveFlag;
165 bool mCalendarModifiedFlag; 166 bool mCalendarModifiedFlag;
166 QPixmap loadPixmap( QString ); 167 QPixmap loadPixmap( QString );
167 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80; 168 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80;
168}; 169};
169 170
170 171
171#endif 172#endif