-rw-r--r-- | korganizer/mainwindow.cpp | 316 |
1 files changed, 163 insertions, 153 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 69ccde1..2004939 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1,48 +1,58 @@ #include <stdlib.h> #include <qaction.h> -#include <qpopupmenu.h> +#include <Q3Action> +#include <q3popupmenu.h> #include <qpainter.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <qpushbutton.h> #include <qmessagebox.h> #include <qlineedit.h> #include <qtextcodec.h> #include <qfile.h> #include <qdir.h> -#include <qapp.h> +#include <qapplication.h> #include <qfileinfo.h> #include <qlabel.h> #include <qspinbox.h> #include <qcheckbox.h> #include <qmap.h> -#include <qwmatrix.h> -#include <qtextbrowser.h> -#include <qtextstream.h> +#include <qmatrix.h> +#include <q3textbrowser.h> +#include <q3textstream.h> #ifndef DESKTOP_VERSION #include <qpe/global.h> #include <qpe/qpetoolbar.h> #include <qpe/resource.h> #include <qpe/qpeapplication.h> #include <qtopia/alarmserver.h> #include <qtopia/qcopenvelope_qws.h> //#include <unistd.h> // for sleep #else -#include <qtoolbar.h> +#include <q3toolbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QPixmap> +#include <QCloseEvent> +#include <QKeyEvent> +#include <Q3VBoxLayout> +#include <QHideEvent> +#include <Q3CString> +#include <Q3PtrList> //#include <resource.h> #endif #include <libkcal/calendarlocal.h> #include <libkcal/todo.h> #include <libkcal/phoneformat.h> #include <libkdepim/ksyncprofile.h> #include <libkdepim/phoneaccess.h> #include <libkcal/kincidenceformatter.h> #include <libkdepim/kpimglobalprefs.h> #include "calendarview.h" #include "koviewmanager.h" #include "datenavigator.h" #include "koagendaview.h" #include "kojournalview.h" @@ -67,87 +77,87 @@ using namespace KCal; #include <unistd.h> #else #ifdef _OL_IMPORT_ #include "koimportoldialog.h" #endif #endif #include "mainwindow.h" class KOex2phonePrefs : public QDialog { public: KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : QDialog( parent, name, true ) { setCaption( i18n("Export to phone options") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel *lab; lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); - lab->setAlignment (AlignHCenter ); - QHBox* temphb; - temphb = new QHBox( this ); + lab->setAlignment (Qt::AlignHCenter ); + Q3HBox* temphb; + temphb = new Q3HBox( this ); new QLabel( i18n("I/O device: "), temphb ); mPhoneDevice = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Connection: "), temphb ); mPhoneConnection = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Model(opt.): "), temphb ); mPhoneModel = new QLineEdit( temphb); lay->addWidget( temphb ); mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); mWriteBackFuture->setChecked( true ); lay->addWidget( mWriteBackFuture ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Max. weeks in future: ") , temphb ); mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); mWriteBackFutureWeeks->setValue( 8 ); lay->addWidget( temphb ); lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); - lab->setAlignment (AlignHCenter ); + lab->setAlignment (Qt::AlignHCenter ); QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); lay->addWidget( ok ); QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); lay->addWidget( cancel ); connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); resize( 220, 240 ); qApp->processEvents(); int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); move( (dw-width())/2, (dh - height() )/2 ); } public: QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; QCheckBox* mWriteBackFuture; QSpinBox* mWriteBackFutureWeeks; }; QPixmap* sgListViewCompletedPix[6]; QPixmap* sgListViewJournalPix; int globalFlagBlockStartup; MainWindow::MainWindow( QWidget *parent, const char *name ) : - QMainWindow( parent, name ) + Q3MainWindow( parent, name ) { sgListViewCompletedPix[5] = &listviewPix; sgListViewCompletedPix[0] = &listviewPix0; sgListViewCompletedPix[1] = &listviewPix20; sgListViewCompletedPix[2] = &listviewPix40; sgListViewCompletedPix[3] = &listviewPix60; sgListViewCompletedPix[4] = &listviewPix80; //int size = 12; { sgListViewCompletedPix[5]->resize( 11, 11 ); sgListViewCompletedPix[5]->fill( Qt::white ); QPainter p ( sgListViewCompletedPix[5] ); p.drawRect( 0,0,11,11); p.drawLine ( 2, 5, 4 , 7 ) ; p.drawLine ( 4 , 7 , 8, 3) ; int iii = 0; @@ -172,129 +182,129 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : } mAutoSaveDisabled = false; mClosed = false; //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; QString confFile = locateLocal("config","korganizerrc"); QFileInfo finf ( confFile ); bool showWarning = !finf.exists(); setIcon(SmallIcon( "ko24" ) ); mBlockAtStartup = true; mFlagKeyPressed = false; setCaption("KO/Pi"); KOPrefs *p = KOPrefs::instance(); //KPimGlobalPrefs::instance()->setGlobalConfig(); p->mCurrentDisplayedView = 0; if ( p->mHourSize > 22 ) p->mHourSize = 22; - QMainWindow::ToolBarDock tbd; + Qt::ToolBarDock tbd; if ( p->mToolBarHor ) { if ( p->mToolBarUp ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUp ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } if ( KOPrefs::instance()->mUseAppColors ) QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); globalFlagBlockStartup = 1; iconToolBar = new QPEToolBar( this ); addToolBar (iconToolBar , tbd ); #ifdef DESKTOP_VERSION if ( KOPrefs::instance()->mShowIconFilter ) #else if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) #endif { if ( p->mToolBarHorF ) { if ( p->mToolBarUpF ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpF ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } filterToolBar = new QPEToolBar ( this ); filterMenubar = new KMenuBar( 0 ); QFontMetrics fm ( filterMenubar->font() ); #ifndef DESKTOP_VERSION filterToolBar->setFocusPolicy( NoFocus ); filterMenubar->setFocusPolicy( NoFocus ); #endif - filterPopupMenu = new QPopupMenu( this ); + filterPopupMenu = new Q3PopupMenu( this ); filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); QString addTest = "A"; filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); #ifdef DESKTOP_VERSION addTest = "AAAAAABBBCCCx"; #else addTest = "AAAAAx"; #endif filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); addToolBar (filterToolBar , tbd ); connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) filterToolBar->hide(); } else { filterToolBar = 0; filterMenubar = 0; filterPopupMenu = 0; } if ( p->mShowIconOnetoolbar ) { viewToolBar = iconToolBar ; navigatorToolBar = iconToolBar ; } else { #ifndef DESKTOP_VERSION setToolBarsMovable( false ); #endif if ( p->mToolBarHorV ) { if ( p->mToolBarUpV ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpV ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } viewToolBar = new QPEToolBar( this ); addToolBar (viewToolBar , tbd ); if ( p->mToolBarHorN ) { if ( p->mToolBarUpN ) - tbd = Bottom; + tbd = Qt::Bottom; else - tbd = Top; + tbd = Qt::Top; } else { if ( p->mToolBarUpN ) - tbd = Right; + tbd = Qt::Right; else - tbd = Left; + tbd = Qt::Left; } navigatorToolBar = new QPEToolBar( this ); addToolBar (navigatorToolBar , tbd ); } mCalendarModifiedFlag = false; // QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); //splash->setAlignment ( AlignCenter ); //setCentralWidget( splash ); #ifndef DESKTOP_VERSION //showMaximized(); #endif //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); @@ -427,35 +437,35 @@ void MainWindow::loadDataAfterStart() qDebug("KO: Start loading files..." ); QTime neededSaveTime = QDateTime::currentDateTime().time(); mView->loadCalendars(); int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); qDebug("KO: Calendar loading time: %d ms",msNeeded ); //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); mView->setModified( false ); mBlockAtStartup = false; mView->setModified( false ); connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); processIncidenceSelection( 0 ); connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), SLOT( processIncidenceSelection( Incidence * ) ) ); connect( mView, SIGNAL( modifiedChanged( bool ) ), SLOT( slotModifiedChanged( bool ) ) ); #ifndef DESKTOP_VERSION - connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); - connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); - disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); + connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & ))); + connect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(recieve( const Q3CString&, const QByteArray& ))); + disconnect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(receiveStart( const Q3CString&, const QByteArray& ))); if ( !mCStringMess.isEmpty() ) recieve( mCStringMess, mByteData ); #endif QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); } void MainWindow::slotResetFocus() { //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); mFocusLoop = 3; QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); } void MainWindow::slotResetFocusLoop() { --mFocusLoop; QWidget* fw = mView->viewManager()->currentView(); @@ -496,33 +506,33 @@ bool MainWindow::beamReceiveEnabled() void MainWindow::toggleBeamReceive() { if ( mBRdisabled ) return; #ifndef DESKTOP_VERSION if ( infrared ) { qDebug("KO: Disable BeamReceive "); delete infrared; infrared = 0; brAction->setOn(false); return; } qDebug("KO: Enable BeamReceive "); brAction->setOn(true); infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; - QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); + QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(recieve( const Q3CString&, const QByteArray& ))); #endif } void MainWindow::showMaximized () { #ifndef DESKTOP_VERSION if ( ! globalFlagBlockStartup ) if ( mClosed ) mView->goToday(); #endif QWidget::showMaximized () ; mClosed = false; } bool MainWindow::askForQuitOnSaveError() { bool retval = false; @@ -587,48 +597,48 @@ void MainWindow::closeEvent( QCloseEvent* ce ) } } mClosed = true; ce->accept(); break; case 1: ce->ignore(); break; case 2: default: break; } } -void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) +void MainWindow::receiveStart( const Q3CString& cmsg, const QByteArray& data ) { qDebug("KO: QCOP start message received: %s ", cmsg.data() ); mCStringMess = cmsg; mByteData = data; } -void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) +void MainWindow::recieve( const Q3CString& cmsg, const QByteArray& data ) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); //QString datamess; //qDebug("message "); qDebug("KO: QCOP message received: %s ", cmsg.data() ); if ( cmsg == "setDocument(QString)" ) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); QString fileName; stream >> fileName; //qDebug("filename %s ", fileName.latin1()); showMaximized(); raise(); KOPrefs::instance()->mLastSyncedLocalFile = fileName ; mSyncManager->slotSyncMenu( 1002 ); return; } if ( cmsg == "-writeFile" ) { // I made from the "-writeFile" an "-writeAlarm" mView->viewManager()->showWhatsNextView(); mCalendar->checkAlarmForIncidence( 0, true); showMaximized(); raise(); @@ -731,698 +741,698 @@ QPixmap MainWindow::loadPixmap( QString name ) return SmallIcon( name ); } void MainWindow::setUsesBigPixmaps ( bool b ) { qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); if ( b ) qDebug("KO: BigPixmaps are not supported "); } void MainWindow::initActions() { //KOPrefs::instance()->mShowFullMenu iconToolBar->clear(); KOPrefs *p = KOPrefs::instance(); //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); - QPopupMenu *viewMenu = new QPopupMenu( this ); - QPopupMenu *actionMenu = new QPopupMenu( this ); - mCurrentItemMenu = new QPopupMenu ( this ); - QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); - QPopupMenu *importMenu = new QPopupMenu( this ); - QPopupMenu *importMenu_X = new QPopupMenu( this ); - QPopupMenu *exportMenu_X = new QPopupMenu( this ); - QPopupMenu *beamMenu_X = new QPopupMenu( this ); - selectFilterMenu = new QPopupMenu( this ); + Q3PopupMenu *viewMenu = new Q3PopupMenu( this ); + Q3PopupMenu *actionMenu = new Q3PopupMenu( this ); + mCurrentItemMenu = new Q3PopupMenu ( this ); + Q3PopupMenu *nextConflictMenu = new Q3PopupMenu ( this ); + Q3PopupMenu *importMenu = new Q3PopupMenu( this ); + Q3PopupMenu *importMenu_X = new Q3PopupMenu( this ); + Q3PopupMenu *exportMenu_X = new Q3PopupMenu( this ); + Q3PopupMenu *beamMenu_X = new Q3PopupMenu( this ); + selectFilterMenu = new Q3PopupMenu( this ); selectFilterMenu->setCheckable( true ); - syncMenu = new QPopupMenu( this ); - configureAgendaMenu = new QPopupMenu( this ); - configureToolBarMenu = new QPopupMenu( this ); - QPopupMenu *helpMenu = new QPopupMenu( this ); - QIconSet icon; + syncMenu = new Q3PopupMenu( this ); + configureAgendaMenu = new Q3PopupMenu( this ); + configureToolBarMenu = new Q3PopupMenu( this ); + Q3PopupMenu *helpMenu = new Q3PopupMenu( this ); + QIcon icon; int pixWid = 22, pixHei = 22; QString pathString = ""; if ( !p->mToolBarMiniIcons ) { if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { pathString += "icons16/"; pixWid = 18; pixHei = 16; } } else { pathString += "iconsmini/"; pixWid = 18; pixHei = 16; } if ( KOPrefs::instance()->mShowFullMenu ) { menuBar1 = new KMenuBar( this );//menuBar(); //setMenuBar( menuBar1 ); menuBar1->show(); menuBar1->insertItem( i18n("File"), importMenu ); menuBar1->insertItem( i18n("View"), viewMenu ); menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); menuBar1->insertItem( i18n("Action"), actionMenu ); #ifdef DESKTOP_VERSION menuBar1->insertItem( i18n("Synchronize"), syncMenu ); menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); #else menuBar1->insertItem( i18n("Sync"), syncMenu ); menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); #endif //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); menuBar1->insertItem( i18n("Help"), helpMenu ); } else { menuBar1 = new KMenuBar( iconToolBar ); - QPopupMenu *menuBar = new QPopupMenu( this ); + Q3PopupMenu *menuBar = new Q3PopupMenu( this ); icon = loadPixmap( pathString + "z_menu" ); menuBar1->insertItem( icon.pixmap(), menuBar); //menuBar1->insertItem( i18n("ME"), menuBar); menuBar->insertItem( i18n("File"), importMenu ); menuBar->insertItem( i18n("View"), viewMenu ); menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); menuBar->insertItem( i18n("Action"), actionMenu ); menuBar->insertItem( i18n("Synchronize"), syncMenu ); menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); menuBar->insertItem( i18n("Filter"),selectFilterMenu ); menuBar->insertItem( i18n("Help"), helpMenu ); //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); menuBar1->setMaximumSize( menuBar1->sizeHint( )); connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); } connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); mWeekBgColor = iconToolBar->backgroundColor(); mWeekPixmap.resize( pixWid , pixHei ); mWeekPixmap.fill( mWeekBgColor ); icon = mWeekPixmap; - mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); + mWeekAction = new Q3Action( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); if ( p-> mShowIconWeekNum ) mWeekAction->addTo( iconToolBar ); mWeekFont = font(); int fontPoint = mWeekFont.pointSize(); QFontMetrics f( mWeekFont ); int fontWid = f.width( "30" ); while ( fontWid > pixWid ) { --fontPoint; mWeekFont.setPointSize( fontPoint ); QFontMetrics f( mWeekFont ); fontWid = f.width( "30" ); //qDebug("dec-- "); } connect( mWeekAction, SIGNAL( activated() ), this, SLOT( weekAction() ) ); connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); if ( p->mShowIconFilterview ) { icon = loadPixmap( pathString + "filter" ); - actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); + actionFilterMenuTB = new Q3Action( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); connect( actionFilterMenuTB, SIGNAL( activated() ), this, SLOT( fillFilterMenuTB() ) ); actionFilterMenuTB->addTo( iconToolBar ); - selectFilterMenuTB = new QPopupMenu( this ); + selectFilterMenuTB = new Q3PopupMenu( this ); selectFilterMenuTB->setCheckable( true ); connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); } //#endif // ****************** - QAction *action; + Q3Action *action; // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); configureToolBarMenu->setCheckable( true ); configureAgendaMenu->setCheckable( true ); int iii ; for ( iii = 1;iii<= 10 ;++iii ){ configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); } //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); connect( configureAgendaMenu, SIGNAL( aboutToShow()), this, SLOT( showConfigureAgenda( ) ) ); icon = loadPixmap( pathString + "today" ); - QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); + Q3Action* today_action = new Q3Action( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); today_action->addTo( actionMenu ); connect( today_action, SIGNAL( activated() ), mView, SLOT( goToday() ) ); icon = loadPixmap( pathString + "picker" ); - QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); + Q3Action* dPickerAction = new Q3Action( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); dPickerAction->addTo( actionMenu ); connect( dPickerAction, SIGNAL( activated() ), mView, SLOT( showDatePicker() ) ); icon = loadPixmap( pathString + "search" ); - QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); + Q3Action* search_action = new Q3Action( i18n("Search"), icon, i18n("Search..."), 0, this ); search_action->addTo( actionMenu ); connect( search_action, SIGNAL( activated() ), mView->dialogManager(), SLOT( showSearchDialog() ) ); actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); - action = new QAction( "Undo Delete", i18n("All events"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("All events"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictAll() ) ); - action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("Allday events"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictAllday() ) ); - action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); + action = new Q3Action( "Undo Delete", i18n("Events with time"), 0, this ); action->addTo( nextConflictMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( conflictNotAll() ) ); actionMenu->insertSeparator(); icon = loadPixmap( pathString + "newevent" ); - QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); + Q3Action* ne_action = new Q3Action( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); ne_action->addTo( mCurrentItemMenu ); connect( ne_action, SIGNAL( activated() ), mView, SLOT( newEvent() ) ); icon = loadPixmap( pathString + "newtodo" ); - QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); + Q3Action* nt_action = new Q3Action( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); nt_action->addTo( mCurrentItemMenu ); connect( nt_action, SIGNAL( activated() ), mView, SLOT( newTodo() ) ); - mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, + mNewSubTodoAction = new Q3Action( "new_subtodo", i18n("New Sub-Todo..."), 0, this ); mNewSubTodoAction->addTo( mCurrentItemMenu ); connect( mNewSubTodoAction, SIGNAL( activated() ), mView, SLOT( newSubTodo() ) ); mCurrentItemMenu->insertSeparator(); icon = loadPixmap( pathString + "newevent" ); configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); configureToolBarMenu->insertSeparator(); configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); configureToolBarMenu->insertSeparator(); configureToolBarMenu->insertItem(i18n("Week Number"), 400); configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); icon = loadPixmap( pathString + "newtodo" ); configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); - mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); + mShowAction = new Q3Action( "show_incidence", i18n("Show"), 0, this ); mShowAction->addTo( mCurrentItemMenu ); connect( mShowAction, SIGNAL( activated() ), mView, SLOT( showIncidence() ) ); - mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); + mEditAction = new Q3Action( "edit_incidence", i18n("Edit..."), 0, this ); mEditAction->addTo( mCurrentItemMenu ); connect( mEditAction, SIGNAL( activated() ), mView, SLOT( editIncidence() ) ); - mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); + mDeleteAction = new Q3Action( "delete_incidence", i18n("Delete..."), 0, this ); mDeleteAction->addTo( mCurrentItemMenu ); connect( mDeleteAction, SIGNAL( activated() ), mView, SLOT( deleteIncidence() ) ); - mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); + mCloneAction = new Q3Action( "clone_incidence", i18n("Clone..."), 0, this ); mCloneAction->addTo( mCurrentItemMenu ); connect( mCloneAction, SIGNAL( activated() ), mView, SLOT( cloneIncidence() ) ); - mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); + mMoveAction = new Q3Action( "Move_incidence", i18n("Move..."), 0, this ); mMoveAction->addTo( mCurrentItemMenu ); connect( mMoveAction, SIGNAL( activated() ), mView, SLOT( moveIncidence() ) ); #ifndef DESKTOP_VERSION - mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); + mBeamAction = new Q3Action( "Beam_incidence", i18n("Beam..."), 0, this ); mBeamAction->addTo(mCurrentItemMenu ); connect( mBeamAction, SIGNAL( activated() ), mView, SLOT( beamIncidence() ) ); #endif - mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); + mCancelAction = new Q3Action( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); mCancelAction->addTo( mCurrentItemMenu ); connect( mCancelAction, SIGNAL( activated() ), mView, SLOT( toggleCancelIncidence() ) ); mCurrentItemMenu->insertSeparator(); - action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); + action = new Q3Action( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); action->addTo( mCurrentItemMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( undo_delete() ) ); // *********************** if ( KOPrefs::instance()->mVerticalScreen ) { icon = SmallIcon( "1updownarrow" ); } else { icon = SmallIcon("1leftrightarrow" ); } configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); - QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); + Q3Action* FSaction = new Q3Action( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); FSaction->addTo( viewMenu ); connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); icon = loadPixmap( pathString + "filter" ); configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); + action = new Q3Action( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleFilter() ) ); mToggleFilter = action; icon = loadPixmap( pathString + "navi" ); configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); - action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); + action = new Q3Action( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleDateNavigatorWidget() ) ); mToggleNav = action ; icon = loadPixmap( pathString + "allday" ); configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); - action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); + action = new Q3Action( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleAllDaySize() ) ); mToggleAllday = action; connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), mToggleNav, SLOT( setEnabled ( bool ) ) ); //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), // mToggleFilter, SLOT( setEnabled ( bool ) ) ); connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), mToggleAllday, SLOT( setEnabled ( bool ) ) ); // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); dPickerAction->addTo( iconToolBar ); viewMenu->insertSeparator(); if ( p-> mShowIconToggleFull ) FSaction->addTo( iconToolBar ); if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); //******************** if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); icon = loadPixmap( pathString + "whatsnext" ); configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); - QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); + Q3Action* whatsnext_action = new Q3Action( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); whatsnext_action->addTo( viewMenu ); connect( whatsnext_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWhatsNextView() ) ); icon = loadPixmap( pathString + "xdays" ); configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); - QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); + Q3Action* xdays_action = new Q3Action( i18n("Next days"), icon, i18n("Next days"), 0, this ); xdays_action->addTo( viewMenu ); connect( xdays_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showNextXView() ) ); icon = loadPixmap( pathString + "journal" ); configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); - QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); + Q3Action* viewjournal_action = new Q3Action( i18n("Journal"), icon, i18n("Journal"), 0, this ); viewjournal_action->addTo( viewMenu ); connect( viewjournal_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showJournalView() ) ); icon = loadPixmap( pathString + "day" ); configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); - QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); + Q3Action* day1_action = new Q3Action( i18n("Day View"), icon, i18n("Day View"), 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, i18n("Work Week"), 50 ); - QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); + Q3Action* day5_action = new Q3Action( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); day5_action->addTo( viewMenu ); connect( day5_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWorkWeekView() ) ); icon = loadPixmap( pathString + "week" ); configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); - QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); + Q3Action* day7_action = new Q3Action( i18n("Week"), icon, i18n("Week"), 0, this ); day7_action->addTo( viewMenu ); connect( day7_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWeekView() ) ); icon = loadPixmap( pathString + "workweek2" ); configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); - QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); + Q3Action* day6_action = new Q3Action( i18n("List week"), icon, i18n("List week"), 0, this ); day6_action->addTo( viewMenu ); connect( day6_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthViewWeek() ) ); icon = loadPixmap( pathString + "month" ); configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); - QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); + Q3Action* month_action = new Q3Action( i18n("Month"), icon, i18n("Month"), 0, this ); month_action->addTo( viewMenu ); connect( month_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthView() ) ); icon = loadPixmap( pathString + "list" ); configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); - QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); + Q3Action* showlist_action = new Q3Action( i18n("List View"), icon, i18n("List View"), 0, this ); showlist_action->addTo( viewMenu ); connect( showlist_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showListView() ) ); icon = loadPixmap( pathString + "todo" ); configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); - QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); + Q3Action* todoview_action = new Q3Action( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); todoview_action->addTo( viewMenu ); connect( todoview_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showTodoView() ) ); #if 0 - action = new QAction( "view_timespan", "Time Span", 0, this ); + action = new Q3Action( "view_timespan", "Time Span", 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView->viewManager(), SLOT( showTimeSpanView() ) ); #endif - action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, + action = new Q3Action( "purge_completed", i18n("Purge Completed..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); icon = loadPixmap( pathString + "search" ); configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); actionMenu->insertSeparator(); - action = new QAction( "manage cat", i18n("Edit category list..."), 0, + action = new Q3Action( "manage cat", i18n("Edit category list..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); - action = new QAction( "manage cat", i18n("Manage new categories..."), 0, + action = new Q3Action( "manage cat", i18n("Manage new categories..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); actionMenu->insertSeparator(); icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( edit_options() ) ); - action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), this, SLOT( calHint() ) ); - action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); + action = new Q3Action( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( edit_global_options() ) ); if ( KOPrefs::instance()->mShowFullMenu ) { actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); } // actionMenu->insertSeparator(); - action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, + action = new Q3Action( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); - action = new QAction( "import_quick", i18n("Import last file"), 0, + action = new Q3Action( "import_quick", i18n("Import last file"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); importMenu_X->insertSeparator(); - action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, + action = new Q3Action( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); //#ifndef DESKTOP_VERSION importMenu_X->insertSeparator(); - action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, + action = new Q3Action( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); //#else #ifdef _OL_IMPORT_ importMenu_X->insertSeparator(); - action = new QAction( "import_ol", i18n("Import from OL"), 0, + action = new Q3Action( "import_ol", i18n("Import from OL"), 0, this ); action->addTo( importMenu_X ); connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); #endif //#endif //importMenu->insertSeparator(); #if 0 - action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, + action = new Q3Action( "load_cal", i18n("Load Calendar Backup"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); #endif - action = new QAction( "save_cal", i18n("Save Backup..."), 0, + action = new Q3Action( "save_cal", i18n("Save Backup..."), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); importMenu->insertSeparator(); importMenu->insertItem( i18n("Import"), importMenu_X ); //importMenu->insertSeparator(); - action = new QAction( "export ical", i18n("Export All Data"), 0, + action = new Q3Action( "export ical", i18n("Export All Data"), 0, this ); action->addTo( exportMenu_X ); connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) ); - action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, + action = new Q3Action( "import_qtopia", i18n("Export VCalendar"), 0, this ); action->addTo( exportMenu_X ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); //LR - QPopupMenu *ex2phone = new QPopupMenu( this ); + Q3PopupMenu *ex2phone = new Q3PopupMenu( this ); ex2phone->insertItem(i18n("Complete calendar..."), 1 ); ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); importMenu->insertItem( i18n("Export"), exportMenu_X ); mPrintSelAction = 0; #ifndef DESKTOP_VERSION //importMenu->insertSeparator(); - brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, + brAction = new Q3Action( "beam toggle", i18n("Beam receive enabled"), 0, this ); brAction->addTo( beamMenu_X ); brAction->setToggleAction (true ) ; connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); - action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, + action = new Q3Action( "beam all", i18n("Beam complete calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); - action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, + action = new Q3Action( "beam all", i18n("Beam filtered calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); importMenu->insertItem( i18n("Beam"), beamMenu_X ); #else //importMenu->insertSeparator(); icon = loadPixmap( pathString + "print" ); - action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); + action = new Q3Action( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printCal() ) ); icon = loadPixmap( pathString + "week" ); - action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); + action = new Q3Action( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printSel() ) ); icon = loadPixmap( pathString + "whatsnext" ); - action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); + action = new Q3Action( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView->viewManager(), SLOT( slotprintWNV() ) ); icon = loadPixmap( pathString + "list" ); - action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); + action = new Q3Action( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), this, SLOT( printListView() ) ); icon = loadPixmap( pathString + "newevent" ); - action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); + action = new Q3Action( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); action->addTo( beamMenu_X ); connect( action, SIGNAL( activated() ), mView, SLOT( slotprintSelInc() ) ); mPrintSelAction = action; importMenu->insertItem( i18n("Print"), beamMenu_X ); #endif importMenu->insertSeparator(); - action = new QAction( "beam all", i18n("Save"), 0, + action = new Q3Action( "beam all", i18n("Save"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); - action = new QAction( "beam all", i18n("Exit (+save)"), 0, + action = new Q3Action( "beam all", i18n("Exit (+save)"), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); //menuBar->insertItem( "Configure",configureMenu ); //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); icon = loadPixmap( "korganizer/korganizer" ); - action = new QAction( "Whats New", i18n("What's new?"), 0,this ); + action = new Q3Action( "Whats New", i18n("What's new?"), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( whatsNew() ) ); - action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); + action = new Q3Action( "featureHowto", i18n("Features + hints..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( features() ) ); - action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); + action = new Q3Action( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( keyBindings() ) ); - action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); + action = new Q3Action( "Storage Howto", i18n("Storage HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( storagehowto() ) ); - action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); + action = new Q3Action( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( timetrackinghowto() ) ); - action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); + action = new Q3Action( "Sync Howto", i18n("Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( synchowto() ) ); - action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); + action = new Q3Action( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( kdesynchowto() ) ); - action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); + action = new Q3Action( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( multisynchowto() ) ); - action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); + action = new Q3Action( "Auto saving", i18n("Auto saving..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( aboutAutoSaving() ) ); - action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); + action = new Q3Action( "Problemd", i18n("Known Problems..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( aboutKnownBugs() ) ); - action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); + action = new Q3Action( "Translate Howto", i18n("User translation..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( usertrans() ) ); - action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); + action = new Q3Action( "Frequently asked questions", i18n("FAQ..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( faq() ) ); - action = new QAction( "licence", i18n("Licence..."), 0, this ); + action = new Q3Action( "licence", i18n("Licence..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( licence() ) ); - action = new QAction( "about", i18n("About..."), 0, this ); + action = new Q3Action( "about", i18n("About..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), SLOT( about() ) ); //menuBar->insertSeparator(); // ****************************************************** // menubar icons //menuBar->insertItem( iconToolBar ); //xdays_action if (p-> mShowIconNewEvent) ne_action->addTo( iconToolBar ); if (p->mShowIconNewTodo ) nt_action->addTo( iconToolBar ); if (p-> mShowIconSearch) search_action->addTo( iconToolBar ); if (p-> mShowIconWhatsThis) - QWhatsThis::whatsThisButton ( iconToolBar ); + Q3WhatsThis::whatsThisButton ( iconToolBar ); if (p-> mShowIconNext) whatsnext_action->addTo( viewToolBar ); if (p-> mShowIconNextDays) xdays_action->addTo( viewToolBar ); if (p-> mShowIconJournal) viewjournal_action->addTo( viewToolBar ); if (p-> mShowIconDay1) day1_action->addTo( viewToolBar ); if (p-> mShowIconDay5) day5_action->addTo( viewToolBar ); if (p-> mShowIconDay7) day7_action->addTo( viewToolBar ); if (p-> mShowIconDay6) day6_action->addTo( viewToolBar ); if (p-> mShowIconMonth) month_action->addTo( viewToolBar ); if (p-> mShowIconList) showlist_action->addTo( viewToolBar ); if (p-> mShowIconTodoview) todoview_action->addTo( viewToolBar ); icon = loadPixmap( pathString + "2leftarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); if (p-> mShowIconBackFast) { - action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); + action = new Q3Action( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goPreviousMonth() ) ); action->addTo( navigatorToolBar ); } icon = loadPixmap( pathString + "1leftarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); if (p-> mShowIconBack) { - action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); + action = new Q3Action( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goPrevious() ) ); action->addTo( navigatorToolBar ); } icon = loadPixmap( pathString + "today" ); configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); if (p-> mShowIconToday) today_action->addTo( navigatorToolBar ); icon = loadPixmap( pathString + "1rightarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); if (p-> mShowIconForward) { - action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); + action = new Q3Action( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goNext() ) ); action->addTo( navigatorToolBar ); } icon = loadPixmap( pathString + "2rightarrowB" ); configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); if (p-> mShowIconForwardFast) { - action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); + action = new Q3Action( i18n("Next month"), icon, i18n("Next month"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goNextMonth() ) ); action->addTo( navigatorToolBar ); } configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); if (p-> mShowIconNewEvent) configureToolBarMenu->setItemChecked( 10, true ); @@ -1511,33 +1521,33 @@ void MainWindow::exportToPhone( int mode ) ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); if ( mode == 1 ) ex2phone.setCaption(i18n("Export complete calendar")); if ( mode == 2 ) ex2phone.setCaption(i18n("Export filtered calendar")); if ( !ex2phone.exec() ) { return; } KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); int inFuture = 0; if ( ex2phone.mWriteBackFuture->isChecked() ) inFuture = ex2phone.mWriteBackFutureWeeks->value(); - QPtrList<Incidence> delSel; + Q3PtrList<Incidence> delSel; if ( mode == 1 ) delSel = mCalendar->rawIncidences(); if ( mode == 2 ) delSel = mCalendar->incidences(); CalendarLocal* cal = new CalendarLocal(); cal->setLocalTime(); Incidence *incidence = delSel.first(); QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); while ( incidence ) { if ( incidence->typeID() != journalID ) { bool add = true; if ( inFuture ) { QDateTime dt; if ( incidence->typeID() == todoID ) { Todo * t = (Todo*)incidence; @@ -1582,36 +1592,36 @@ void MainWindow::setDefaultPreferences() p->mCompactDialogs = true; p->mConfirm = true; // p->mEnableQuickTodo = false; } QString MainWindow::resourcePath() { return KGlobal::iconLoader()->iconPath(); } void MainWindow::displayText( QString text ,QString cap ) { QDialog dia( this, "name", true ); ; dia.setCaption( cap ); - QVBoxLayout* lay = new QVBoxLayout( &dia ); + Q3VBoxLayout* lay = new Q3VBoxLayout( &dia ); lay->setSpacing( 3 ); lay->setMargin( 3 ); - QTextBrowser tb ( &dia ); + Q3TextBrowser tb ( &dia ); lay->addWidget( &tb ); tb.setText( text ); #ifdef DESKTOP_VERSION dia.resize( 640, 480); #else dia.showMaximized(); #endif dia.exec(); } void MainWindow::features() { KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); } @@ -1764,68 +1774,68 @@ QString MainWindow::defaultFileName() QString MainWindow::syncFileName() { #ifdef DESKTOP_VERSION return QDir::convertSeparators( locateLocal( "tmp", "synccalendar.ics" ) ); #else return QString( "/tmp/synccalendar.ics" ); #endif } #include "koglobals.h" #include <kcalendarsystem.h> void MainWindow::updateWeek(QDate seda) { int weekNum = KGlobal::locale()->weekNum ( seda ); mWeekPixmap.fill( mWeekBgColor ); QPainter p ( &mWeekPixmap ); p.setFont( mWeekFont ); - p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); + p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),Qt::AlignCenter, QString::number( weekNum) ); p.end(); - QIconSet icon3 ( mWeekPixmap ); + QIcon icon3 ( mWeekPixmap ); mWeekAction->setIconSet ( icon3 ); } void MainWindow::updateWeekNum(const DateList &selectedDates) { updateWeek( selectedDates.first() ); } void MainWindow::processIncidenceSelection( Incidence *incidence ) { if ( !incidence ) { mShowAction->setMenuText( i18n("Show") ); enableIncidenceActions( false ); mNewSubTodoAction->setEnabled( false ); setCaptionToDates(); return; } QString startString = ""; if ( incidence->typeID() != todoID ) { if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { if ( incidence->doesFloat() ) { startString += ": "+incidence->dtStartDateStr( true ); startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); } else { startString = ": "+incidence->dtStartStr(true); startString += " --- "+((Event*)incidence)->dtEndStr(true); } } else { if ( incidence->dtStart().time() != incidence->dtEnd().time() ) startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); if ( incidence->isBirthday() || incidence->isAnniversary() ) { bool ok; - QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); + QDateTime noc = incidence->getNextOccurence( (QDateTime)mView->startDate().addDays(-1), &ok ); if ( ok ) { int years = noc.date().year() - incidence->dtStart().date().year(); startString += i18n(" (%1 y.)"). arg( years ); } } else startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); } } else { if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); else startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); } if ( !incidence->location().isEmpty() ) @@ -1833,39 +1843,39 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) setCaption( incidence->summary()+startString); enableIncidenceActions( true ); if ( incidence->typeID() == eventID ) { mShowAction->setMenuText( i18n("Show Event") ); mNewSubTodoAction->setEnabled( false ); } else if ( incidence->typeID() == todoID ) { mShowAction->setMenuText( i18n("Show Todo") ); mNewSubTodoAction->setEnabled( true ); } else { mShowAction->setMenuText( i18n("Show") ); mNewSubTodoAction->setEnabled( false ); } #ifdef DESKTOP_VERSION static QPixmap jP = SmallIcon( "journal" ); static QPixmap eP = SmallIcon( "newevent" ); static QPixmap tP = SmallIcon( "newtodo" ); - QIconSet icon; + QIcon icon; if ( incidence->typeID() == todoID ) - icon = QIconSet ( tP ); + icon = QIcon ( tP ); else if ( incidence->typeID() == eventID ) - icon = QIconSet ( eP ); + icon = QIcon ( eP ); else if ( incidence->typeID() == journalID ) - icon = QIconSet ( jP ); + icon = QIcon ( jP ); mPrintSelAction->setIconSet ( icon ); #endif } void MainWindow::enableIncidenceActions( bool enabled ) { mShowAction->setEnabled( enabled ); mEditAction->setEnabled( enabled ); mDeleteAction->setEnabled( enabled ); mCloneAction->setEnabled( enabled ); mMoveAction->setEnabled( enabled ); #ifndef DESKTOP_VERSION mBeamAction->setEnabled( enabled ); #else mPrintSelAction->setEnabled( enabled ); @@ -2032,33 +2042,33 @@ void MainWindow::backupAllFiles() int daysTo = reference.daysTo ( QDate::currentDate() ); setCaption(i18n("Creating backup ... please wait ..." )); qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); // we need the file path, the backup dir and the number of bups as param QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) bupDir = KGlobalSettings::backupDataDir(); int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); if ( retval == 0 ) { setCaption(i18n("Backup cancelled" )); qDebug("KO: Backup cancelled. Will try again tomorrow "); // retval == 0 : backup skipped for today, try again tomorrow KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; } else if ( retval == 1 ){ qDebug("KO: Backup created."); // backup ok - QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; KopiCalendarFile * cal = calendars.first(); cal = calendars.next(); while ( cal ) { if ( !cal->mErrorOnLoad ) { KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); } cal = calendars.next(); } KOPrefs::instance()->mLastBackupDate = daysTo; setCaption(i18n("Backup succesfully finished" )); } else if ( retval == 2 ){ setCaption(i18n("Backup globally disabled" )); qDebug("KO: Backup globally cancelled."); // backup globally cancelled KPimGlobalPrefs::instance()->mBackupEnabled = false; } @@ -2328,33 +2338,33 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) if ( pro > 0 ) { selectFilter( pro+1 ); } if ( showSelectedDates ) { ;// setCaptionToDates(); } } void MainWindow::fillFilterMenuTB() { selectFilterMenuTB->clear(); selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); selectFilterMenuTB->insertSeparator(); selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); selectFilterMenuTB->insertSeparator(); - QPtrList<CalFilter> fili = mView->filters(); + Q3PtrList<CalFilter> fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 2; bool checkitem = mView->filterView()->filtersEnabled(); while(filter) { selectFilterMenuTB->insertItem( filter->name(), iii ); if ( filter == curfilter) selectFilterMenuTB->setItemChecked( iii, checkitem ); filter = fili.next(); ++iii; } if ( !checkitem ) selectFilterMenuTB->setItemChecked( 1, true ); int x = 0; int y = iconToolBar->height(); @@ -2373,54 +2383,54 @@ void MainWindow::fillFilterMenuTB() } else { x= iconToolBar->width(); y = 0; } } //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); } void MainWindow::fillFilterMenu() { selectFilterMenu->clear(); selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); selectFilterMenu->insertSeparator(); selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); selectFilterMenu->insertSeparator(); - QPtrList<CalFilter> fili = mView->filters(); + Q3PtrList<CalFilter> fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 2; bool checkitem = mView->filterView()->filtersEnabled(); while(filter) { selectFilterMenu->insertItem( filter->name(), iii ); if ( filter == curfilter) selectFilterMenu->setItemChecked( iii, checkitem ); filter = fili.next(); ++iii; } if ( !checkitem ) selectFilterMenu->setItemChecked( 1, true ); } void MainWindow::fillFilterMenuPopup() { filterPopupMenu->clear(); filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); filterPopupMenu->insertSeparator(); - QPtrList<CalFilter> fili = mView->filters(); + Q3PtrList<CalFilter> fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); int iii = 1; bool checkitem = mView->filterView()->filtersEnabled(); while(filter) { filterPopupMenu->insertItem( filter->name(), iii ); if ( filter == curfilter) filterPopupMenu->setItemChecked( iii, checkitem ); filter = fili.next(); ++iii; } if ( !checkitem ) filterPopupMenu->setItemChecked( 0, true ); } void MainWindow::selectFilter( int fil ) { @@ -2806,18 +2816,18 @@ void MainWindow::hideEvent ( QHideEvent * ) setCaption( message ); } } void MainWindow::resizeEvent( QResizeEvent* e) { #ifndef DESKTOP_VERSION if ( filterToolBar ) { if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { if (QApplication::desktop()->width() > QApplication::desktop()->height() ) filterToolBar->hide(); else filterToolBar->show(); } } #endif - QMainWindow::resizeEvent( e); + Q3MainWindow::resizeEvent( e); } |