summaryrefslogtreecommitdiffabout
path: root/kaddressbook/old_mainwindow.cpp
Unidiff
Diffstat (limited to 'kaddressbook/old_mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/old_mainwindow.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/kaddressbook/old_mainwindow.cpp b/kaddressbook/old_mainwindow.cpp
index 0e886d9..7a445c7 100644
--- a/kaddressbook/old_mainwindow.cpp
+++ b/kaddressbook/old_mainwindow.cpp
@@ -223,199 +223,199 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
223 223
224 if ( cmsg == "-writeFile" ) { 224 if ( cmsg == "-writeFile" ) {
225 mView->viewManager()->showWhatsNextView(); 225 mView->viewManager()->showWhatsNextView();
226 save(); 226 save();
227 setCaption( i18n("File written on AD request")); 227 setCaption( i18n("File written on AD request"));
228 showMaximized(); 228 showMaximized();
229 raise(); 229 raise();
230#ifndef DESKTOP_VERSION 230#ifndef DESKTOP_VERSION
231 QCopEnvelope e3("kosaved", "blabla"); 231 QCopEnvelope e3("kosaved", "blabla");
232#endif 232#endif
233 return; 233 return;
234 234
235 } 235 }
236 if ( cmsg == "-newCountdown" ) { 236 if ( cmsg == "-newCountdown" ) {
237 qDebug("newCountdown "); 237 qDebug("newCountdown ");
238 238
239 } 239 }
240 QString msg ;; 240 QString msg ;;
241 QString allmsg = cmsg; 241 QString allmsg = cmsg;
242 while ( allmsg.length() > 0 ) { 242 while ( allmsg.length() > 0 ) {
243 int nextC = allmsg.find( "-", 1 ); 243 int nextC = allmsg.find( "-", 1 );
244 if ( nextC == -1 ) { 244 if ( nextC == -1 ) {
245 msg = allmsg; 245 msg = allmsg;
246 allmsg = ""; 246 allmsg = "";
247 } else{ 247 } else{
248 msg = allmsg.left( nextC ); 248 msg = allmsg.left( nextC );
249 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 249 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
250 } 250 }
251 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 251 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
252 if ( msg == "-newEvent" ) { 252 if ( msg == "-newEvent" ) {
253 mView->newEvent(); 253 mView->newEvent();
254 } 254 }
255 if ( msg == "-newTodo" ) { 255 if ( msg == "-newTodo" ) {
256 mView->newTodo(); 256 mView->newTodo();
257 257
258 } 258 }
259 if ( msg == "-showWN" ) { 259 if ( msg == "-showWN" ) {
260 mView->viewManager()->showWhatsNextView(); 260 mView->viewManager()->showWhatsNextView();
261 } 261 }
262 if ( msg == "-showTodo" ) { 262 if ( msg == "-showTodo" ) {
263 mView->viewManager()->showTodoView(); 263 mView->viewManager()->showTodoView();
264 } 264 }
265 if ( msg == "-showList" ) { 265 if ( msg == "-showList" ) {
266 mView->viewManager()->showListView(); 266 mView->viewManager()->showListView();
267 } 267 }
268 else if ( msg == "-showDay" ) { 268 else if ( msg == "-showDay" ) {
269 mView->viewManager()->showDayView(); 269 mView->viewManager()->showDayView();
270 } 270 }
271 else if ( msg == "-showWWeek" ) { 271 else if ( msg == "-showWWeek" ) {
272 mView->viewManager()->showWorkWeekView(); 272 mView->viewManager()->showWorkWeekView();
273 } 273 }
274 else if ( msg == "-showWeek" ) { 274 else if ( msg == "-showWeek" ) {
275 mView->viewManager()->showWeekView(); 275 mView->viewManager()->showWeekView();
276 } 276 }
277 else if ( msg == "-showTodo" ) { 277 else if ( msg == "-showTodo" ) {
278 mView->viewManager()->showTodoView(); 278 mView->viewManager()->showTodoView();
279 } 279 }
280 else if ( msg == "-showJournal" ) { 280 else if ( msg == "-showJournal" ) {
281 mView->viewManager()->showJournalView(); 281 mView->viewManager()->showJournalView();
282 } 282 }
283 else if ( msg == "-showKO" ) { 283 else if ( msg == "-showKO" ) {
284 mView->viewManager()->showNextXView(); 284 mView->viewManager()->showNextXView();
285 } 285 }
286 else if ( msg == "-showWNext" ) { 286 else if ( msg == "-showWNext" ) {
287 mView->viewManager()->showWhatsNextView(); 287 mView->viewManager()->showWhatsNextView();
288 } 288 }
289 } 289 }
290 290
291 showMaximized(); 291 showMaximized();
292 raise(); 292 raise();
293*/ 293*/
294} 294}
295 295
296 296
297QPixmap MainWindow::loadPixmap( QString name ) 297QPixmap MainWindow::loadPixmap( QString name )
298{ 298{
299 return KGlobal::iconLoader().loadPixmap( name ); 299 return KGlobal::iconLoader().loadPixmap( name );
300/*US use the advanced version of the iconloader 300/*US use the advanced version of the iconloader
301#ifdef DESKTOP_VERSION 301#ifdef DESKTOP_VERSION
302 QPixmap pixmapLoader; 302 QPixmap pixmapLoader;
303 QString file; 303 QString file;
304 file = QDir::homeDirPath()+"/kaddressbook/pics/" + name+".png"; 304 file = QDir::homeDirPath()+"/kaddressbook/pics/" + name+".png";
305 //qDebug("pixmap name %s ", file.latin1()); 305 //qDebug("pixmap name %s ", file.latin1());
306 pixmapLoader.load( file ); 306 pixmapLoader.load( file );
307 return pixmapLoader; 307 return pixmapLoader;
308#else 308#else
309 return Resource::loadPixmap( name ); 309 return Resource::loadPixmap( name );
310#endif 310#endif
311*/ 311*/
312} 312}
313 313
314void MainWindow::initActions() 314void MainWindow::initActions()
315{ 315{
316 iconToolBar->clear(); 316 iconToolBar->clear();
317 KABPrefs *p = KABPrefs::instance(); 317 KABPrefs *p = KABPrefs::instance();
318 QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar ); 318 QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar );
319 QPopupMenu *menuBar = new QPopupMenu( this ); 319 Q3PopupMenu *menuBar = new Q3PopupMenu( this );
320 menuBar1->insertItem( "ME", menuBar); 320 menuBar1->insertItem( "ME", menuBar);
321 QPopupMenu *fileMenu = new QPopupMenu( this ); 321 Q3PopupMenu *fileMenu = new Q3PopupMenu( this );
322 QPopupMenu *editMenu = new QPopupMenu( this ); 322 Q3PopupMenu *editMenu = new Q3PopupMenu( this );
323 QPopupMenu *viewMenu = new QPopupMenu( this ); 323 Q3PopupMenu *viewMenu = new Q3PopupMenu( this );
324 QPopupMenu *settingsMenu = new QPopupMenu( this ); 324 Q3PopupMenu *settingsMenu = new Q3PopupMenu( this );
325 QPopupMenu *importMenu = new QPopupMenu( this ); 325 Q3PopupMenu *importMenu = new Q3PopupMenu( this );
326 326
327 menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 327 menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
328 328
329 QIconSet icon; 329 QIconSet icon;
330 330
331 331
332 icon = loadPixmap( pathString + "newtodo" ); 332 icon = loadPixmap( pathString + "newtodo" );
333 configureToolBarMenu->insertItem(icon, "New todo", 20 ); 333 configureToolBarMenu->insertItem(icon, "New todo", 20 );
334 QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this ); 334 QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this );
335 nt_action->addTo( actionMenu ); 335 nt_action->addTo( actionMenu );
336 connect( nt_action, SIGNAL( activated() ), 336 connect( nt_action, SIGNAL( activated() ),
337 mView, SLOT( newTodo() ) ); 337 mView, SLOT( newTodo() ) );
338 338
339/* 339/*
340 QAction *action; 340 QAction *action;
341 QIconSet icon; 341 QIconSet icon;
342 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 342 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
343 configureToolBarMenu = new QPopupMenu( this ); 343 configureToolBarMenu = new QPopupMenu( this );
344 configureToolBarMenu->setCheckable( true ); 344 configureToolBarMenu->setCheckable( true );
345#ifdef DESKTOP_VERSION 345#ifdef DESKTOP_VERSION
346 QString pathString = ""; 346 QString pathString = "";
347#else 347#else
348 QString pathString = "kaddressbook/"; 348 QString pathString = "kaddressbook/";
349#endif 349#endif
350 if ( QApplication::desktop()->width() < 480 ) 350 if ( QApplication::desktop()->width() < 480 )
351 pathString += "icons16/"; 351 pathString += "icons16/";
352 configureAgendaMenu = new QPopupMenu( menuBar ); 352 configureAgendaMenu = new QPopupMenu( menuBar );
353 configureAgendaMenu->setCheckable( true ); 353 configureAgendaMenu->setCheckable( true );
354 configureAgendaMenu->insertItem("Toggle Allday", 1 ); 354 configureAgendaMenu->insertItem("Toggle Allday", 1 );
355 configureAgendaMenu->insertSeparator(); 355 configureAgendaMenu->insertSeparator();
356 configureAgendaMenu->insertItem("Tiny", 4 ); 356 configureAgendaMenu->insertItem("Tiny", 4 );
357 configureAgendaMenu->insertItem("Small", 6 ); 357 configureAgendaMenu->insertItem("Small", 6 );
358 configureAgendaMenu->insertItem("Medium", 8 ); 358 configureAgendaMenu->insertItem("Medium", 8 );
359 configureAgendaMenu->insertItem("Normal", 10 ); 359 configureAgendaMenu->insertItem("Normal", 10 );
360 configureAgendaMenu->insertItem("Large", 12 ); 360 configureAgendaMenu->insertItem("Large", 12 );
361 configureAgendaMenu->insertItem("Big", 14 ); 361 configureAgendaMenu->insertItem("Big", 14 );
362 configureAgendaMenu->insertItem("Bigger", 16 ); 362 configureAgendaMenu->insertItem("Bigger", 16 );
363 configureAgendaMenu->insertItem("Biggest", 18 ); 363 configureAgendaMenu->insertItem("Biggest", 18 );
364 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 364 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
365 icon = loadPixmap( pathString + "newevent" ); 365 icon = loadPixmap( pathString + "newevent" );
366 icon = loadPixmap( pathString + "newevent" ); 366 icon = loadPixmap( pathString + "newevent" );
367 configureToolBarMenu->insertItem("Stretched TB", 5 ); 367 configureToolBarMenu->insertItem("Stretched TB", 5 );
368 configureToolBarMenu->insertSeparator(); 368 configureToolBarMenu->insertSeparator();
369 configureToolBarMenu->insertItem(icon, "New event", 10 ); 369 configureToolBarMenu->insertItem(icon, "New event", 10 );
370 QAction* ne_action = new QAction( "New Event", icon, "New Event...", 0, this ); 370 QAction* ne_action = new QAction( "New Event", icon, "New Event...", 0, this );
371 ne_action->addTo( actionMenu ); 371 ne_action->addTo( actionMenu );
372*/ 372*/
373/* 373/*
374 connect( ne_action, SIGNAL( activated() ), 374 connect( ne_action, SIGNAL( activated() ),
375 mView, SLOT( newEvent() ) ); 375 mView, SLOT( newEvent() ) );
376 icon = loadPixmap( pathString + "newtodo" ); 376 icon = loadPixmap( pathString + "newtodo" );
377 configureToolBarMenu->insertItem(icon, "New todo", 20 ); 377 configureToolBarMenu->insertItem(icon, "New todo", 20 );
378 QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this ); 378 QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this );
379 nt_action->addTo( actionMenu ); 379 nt_action->addTo( actionMenu );
380 connect( nt_action, SIGNAL( activated() ), 380 connect( nt_action, SIGNAL( activated() ),
381 mView, SLOT( newTodo() ) ); 381 mView, SLOT( newTodo() ) );
382 382
383 action = new QAction( "Toggle FilterView", QPixmap(), "Toggle FilterView", 0, this ); 383 action = new QAction( "Toggle FilterView", QPixmap(), "Toggle FilterView", 0, this );
384 action->addTo( viewMenu ); 384 action->addTo( viewMenu );
385 connect( action, SIGNAL( activated() ), 385 connect( action, SIGNAL( activated() ),
386 mView, SLOT( toggleFilter() ) ); 386 mView, SLOT( toggleFilter() ) );
387 387
388 viewMenu->insertSeparator(); 388 viewMenu->insertSeparator();
389 icon = loadPixmap( pathString + "picker" ); 389 icon = loadPixmap( pathString + "picker" );
390 action = new QAction( "Date Picker", icon, "Date Picker", 0, this ); 390 action = new QAction( "Date Picker", icon, "Date Picker", 0, this );
391 action->addTo( viewMenu ); 391 action->addTo( viewMenu );
392 connect( action, SIGNAL( activated() ), 392 connect( action, SIGNAL( activated() ),
393 mView, SLOT( showDatePicker() ) ); 393 mView, SLOT( showDatePicker() ) );
394 action->addTo( iconToolBar ); 394 action->addTo( iconToolBar );
395 viewMenu->insertSeparator(); 395 viewMenu->insertSeparator();
396 icon = loadPixmap( pathString + "list" ); 396 icon = loadPixmap( pathString + "list" );
397 configureToolBarMenu->insertItem(icon, "Event list", 30 ); 397 configureToolBarMenu->insertItem(icon, "Event list", 30 );
398 QAction* showlist_action = new QAction( "List", icon, "List", 0, this ); 398 QAction* showlist_action = new QAction( "List", icon, "List", 0, this );
399 showlist_action->addTo( viewMenu ); 399 showlist_action->addTo( viewMenu );
400 connect( showlist_action, SIGNAL( activated() ), 400 connect( showlist_action, SIGNAL( activated() ),
401 mView->viewManager(), SLOT( showListView() ) ); 401 mView->viewManager(), SLOT( showListView() ) );
402 402
403 403
404 icon = loadPixmap( pathString + "day" ); 404 icon = loadPixmap( pathString + "day" );
405 configureToolBarMenu->insertItem(icon, "One day", 40 ); 405 configureToolBarMenu->insertItem(icon, "One day", 40 );
406 QAction* day1_action = new QAction( "Day", icon, "Day", 0, this ); 406 QAction* day1_action = new QAction( "Day", icon, "Day", 0, this );
407 day1_action->addTo( viewMenu ); 407 day1_action->addTo( viewMenu );
408 // action->addTo( toolBar ); 408 // action->addTo( toolBar );
409 connect( day1_action, SIGNAL( activated() ), 409 connect( day1_action, SIGNAL( activated() ),
410 mView->viewManager(), SLOT( showDayView() ) ); 410 mView->viewManager(), SLOT( showDayView() ) );
411 411
412 icon = loadPixmap( pathString + "workweek" ); 412 icon = loadPixmap( pathString + "workweek" );
413 configureToolBarMenu->insertItem(icon, "Work week", 50 ); 413 configureToolBarMenu->insertItem(icon, "Work week", 50 );
414 QAction* day5_action = new QAction( "Work Week", icon, "Work Week", 0, this ); 414 QAction* day5_action = new QAction( "Work Week", icon, "Work Week", 0, this );
415 day5_action->addTo( viewMenu ); 415 day5_action->addTo( viewMenu );
416 connect( day5_action, SIGNAL( activated() ), 416 connect( day5_action, SIGNAL( activated() ),
417 mView->viewManager(), SLOT( showWorkWeekView() ) ); 417 mView->viewManager(), SLOT( showWorkWeekView() ) );
418 418
419 icon = loadPixmap( pathString + "week" ); 419 icon = loadPixmap( pathString + "week" );
420 configureToolBarMenu->insertItem(icon, "Week", 60 ); 420 configureToolBarMenu->insertItem(icon, "Week", 60 );
421 QAction* day7_action = new QAction( "Week", icon, "Week", 0, this ); 421 QAction* day7_action = new QAction( "Week", icon, "Week", 0, this );