Diffstat (limited to 'kaddressbook/old_mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/old_mainwindow.cpp | 12 |
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 @@ -191,263 +191,263 @@ void MainWindow::closeEvent( QCloseEvent* ce ) ce->accept(); return; } switch( QMessageBox::information( this, "KA/Pi", i18n("Do you really want\nto close KA/Pi?"), i18n("Close!"), i18n("No"), 0, 0 ) ) { case 0: ce->accept(); break; case 1: ce->ignore(); break; case 2: default: break; } } void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) { /* QDataStream stream( data, IO_ReadOnly ); // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); if ( cmsg == "-writeFile" ) { mView->viewManager()->showWhatsNextView(); save(); setCaption( i18n("File written on AD request")); showMaximized(); raise(); #ifndef DESKTOP_VERSION QCopEnvelope e3("kosaved", "blabla"); #endif return; } if ( cmsg == "-newCountdown" ) { qDebug("newCountdown "); } QString msg ;; QString allmsg = cmsg; while ( allmsg.length() > 0 ) { int nextC = allmsg.find( "-", 1 ); if ( nextC == -1 ) { msg = allmsg; allmsg = ""; } else{ msg = allmsg.left( nextC ); allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); } //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); if ( msg == "-newEvent" ) { mView->newEvent(); } if ( msg == "-newTodo" ) { mView->newTodo(); } if ( msg == "-showWN" ) { mView->viewManager()->showWhatsNextView(); } if ( msg == "-showTodo" ) { mView->viewManager()->showTodoView(); } if ( msg == "-showList" ) { mView->viewManager()->showListView(); } else if ( msg == "-showDay" ) { mView->viewManager()->showDayView(); } else if ( msg == "-showWWeek" ) { mView->viewManager()->showWorkWeekView(); } else if ( msg == "-showWeek" ) { mView->viewManager()->showWeekView(); } else if ( msg == "-showTodo" ) { mView->viewManager()->showTodoView(); } else if ( msg == "-showJournal" ) { mView->viewManager()->showJournalView(); } else if ( msg == "-showKO" ) { mView->viewManager()->showNextXView(); } else if ( msg == "-showWNext" ) { mView->viewManager()->showWhatsNextView(); } } showMaximized(); raise(); */ } QPixmap MainWindow::loadPixmap( QString name ) { return KGlobal::iconLoader().loadPixmap( name ); /*US use the advanced version of the iconloader #ifdef DESKTOP_VERSION QPixmap pixmapLoader; QString file; file = QDir::homeDirPath()+"/kaddressbook/pics/" + name+".png"; //qDebug("pixmap name %s ", file.latin1()); pixmapLoader.load( file ); return pixmapLoader; #else return Resource::loadPixmap( name ); #endif */ } void MainWindow::initActions() { iconToolBar->clear(); KABPrefs *p = KABPrefs::instance(); QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar ); - QPopupMenu *menuBar = new QPopupMenu( this ); + Q3PopupMenu *menuBar = new Q3PopupMenu( this ); menuBar1->insertItem( "ME", menuBar); - QPopupMenu *fileMenu = new QPopupMenu( this ); - QPopupMenu *editMenu = new QPopupMenu( this ); - QPopupMenu *viewMenu = new QPopupMenu( this ); - QPopupMenu *settingsMenu = new QPopupMenu( this ); - QPopupMenu *importMenu = new QPopupMenu( this ); + Q3PopupMenu *fileMenu = new Q3PopupMenu( this ); + Q3PopupMenu *editMenu = new Q3PopupMenu( this ); + Q3PopupMenu *viewMenu = new Q3PopupMenu( this ); + Q3PopupMenu *settingsMenu = new Q3PopupMenu( this ); + Q3PopupMenu *importMenu = new Q3PopupMenu( this ); menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); QIconSet icon; icon = loadPixmap( pathString + "newtodo" ); configureToolBarMenu->insertItem(icon, "New todo", 20 ); QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this ); nt_action->addTo( actionMenu ); connect( nt_action, SIGNAL( activated() ), mView, SLOT( newTodo() ) ); /* QAction *action; QIconSet icon; // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); configureToolBarMenu = new QPopupMenu( this ); configureToolBarMenu->setCheckable( true ); #ifdef DESKTOP_VERSION QString pathString = ""; #else QString pathString = "kaddressbook/"; #endif if ( QApplication::desktop()->width() < 480 ) pathString += "icons16/"; configureAgendaMenu = new QPopupMenu( menuBar ); configureAgendaMenu->setCheckable( true ); configureAgendaMenu->insertItem("Toggle Allday", 1 ); configureAgendaMenu->insertSeparator(); configureAgendaMenu->insertItem("Tiny", 4 ); configureAgendaMenu->insertItem("Small", 6 ); configureAgendaMenu->insertItem("Medium", 8 ); configureAgendaMenu->insertItem("Normal", 10 ); configureAgendaMenu->insertItem("Large", 12 ); configureAgendaMenu->insertItem("Big", 14 ); configureAgendaMenu->insertItem("Bigger", 16 ); configureAgendaMenu->insertItem("Biggest", 18 ); //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); icon = loadPixmap( pathString + "newevent" ); icon = loadPixmap( pathString + "newevent" ); configureToolBarMenu->insertItem("Stretched TB", 5 ); configureToolBarMenu->insertSeparator(); configureToolBarMenu->insertItem(icon, "New event", 10 ); QAction* ne_action = new QAction( "New Event", icon, "New Event...", 0, this ); ne_action->addTo( actionMenu ); */ /* connect( ne_action, SIGNAL( activated() ), mView, SLOT( newEvent() ) ); icon = loadPixmap( pathString + "newtodo" ); configureToolBarMenu->insertItem(icon, "New todo", 20 ); QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this ); nt_action->addTo( actionMenu ); connect( nt_action, SIGNAL( activated() ), mView, SLOT( newTodo() ) ); action = new QAction( "Toggle FilterView", QPixmap(), "Toggle FilterView", 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleFilter() ) ); viewMenu->insertSeparator(); icon = loadPixmap( pathString + "picker" ); action = new QAction( "Date Picker", icon, "Date Picker", 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( showDatePicker() ) ); action->addTo( iconToolBar ); viewMenu->insertSeparator(); icon = loadPixmap( pathString + "list" ); configureToolBarMenu->insertItem(icon, "Event list", 30 ); QAction* showlist_action = new QAction( "List", icon, "List", 0, this ); showlist_action->addTo( viewMenu ); connect( showlist_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showListView() ) ); icon = loadPixmap( pathString + "day" ); configureToolBarMenu->insertItem(icon, "One day", 40 ); QAction* day1_action = new QAction( "Day", icon, "Day", 0, this ); day1_action->addTo( viewMenu ); // action->addTo( toolBar ); connect( day1_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showDayView() ) ); icon = loadPixmap( pathString + "workweek" ); configureToolBarMenu->insertItem(icon, "Work week", 50 ); QAction* day5_action = new QAction( "Work Week", icon, "Work Week", 0, this ); day5_action->addTo( viewMenu ); connect( day5_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWorkWeekView() ) ); icon = loadPixmap( pathString + "week" ); configureToolBarMenu->insertItem(icon, "Week", 60 ); QAction* day7_action = new QAction( "Week", icon, "Week", 0, this ); day7_action->addTo( viewMenu ); connect( day7_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWeekView() ) ); icon = loadPixmap( pathString + "month" ); configureToolBarMenu->insertItem(icon, "Month", 70 ); QAction* month_action = new QAction( "Month", icon, "Month", 0, this ); month_action->addTo( viewMenu ); connect( month_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthView() ) ); icon = loadPixmap( pathString + "todo" ); configureToolBarMenu->insertItem(icon, "Todo list", 80 ); QAction* todoview_action = new QAction( "Todo", icon, "Todo", 0, this ); todoview_action->addTo( viewMenu ); connect( todoview_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showTodoView() ) ); icon = loadPixmap( pathString + "journal" ); configureToolBarMenu->insertItem(icon, "Journal", 90 ); QAction* viewjournal_action = new QAction( "Journal", icon, "Journal", 0, this ); viewjournal_action->addTo( viewMenu ); connect( viewjournal_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showJournalView() ) ); icon = loadPixmap( pathString + "xdays" ); configureToolBarMenu->insertItem(icon, "Next days", 100,4 ); QAction* xdays_action = new QAction( "Next days", icon, "Next Days", 0, this ); xdays_action->addTo( viewMenu ); connect( xdays_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showNextXView() ) ); |