From f3875aba68f175e8da32462f64b12fc46bc31102 Mon Sep 17 00:00:00 2001 From: ulf69 Date: Tue, 17 Aug 2004 00:13:25 +0000 Subject: added listener for reults of Ka/Pi --- diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 6c0aa9b..4b00062 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -11,17 +11,18 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include #ifndef DESKTOP_VERSION #include #include #include #include #include -#include -#include +#include +#include #else #include #include @@ -51,7 +52,9 @@ #include "klocale.h" #include "kconfig.h" #include "simplealarmclient.h" -using namespace KCal; +#include "externalapphandler.h" + +using namespace KCal; #ifndef _WIN32_ #include #else @@ -66,11 +69,11 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : #ifdef DESKTOP_VERSION setFont( QFont("Arial"), 14 ); -#endif +#endif //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; QString confFile = locateLocal("config","korganizerrc"); - QFileInfo finf ( confFile ); + QFileInfo finf ( confFile ); bool showWarning = !finf.exists(); setIcon(SmallIcon( "ko24" ) ); mBlockAtStartup = true; @@ -80,7 +83,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : // if ( QApplication::desktop()->height() > 480 ) { // if ( p->mHourSize == 4 ) // p->mHourSize = 6; -// } +// } if ( p->mHourSize > 18 ) p->mHourSize = 18; QMainWindow::ToolBarDock tbd; @@ -102,8 +105,8 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : iconToolBar = new QPEToolBar( this ); addToolBar (iconToolBar , tbd ); mBlockSaveFlag = false; - mCalendarModifiedFlag = false; - + mCalendarModifiedFlag = false; + QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); splash->setAlignment ( AlignCenter ); setCentralWidget( splash ); @@ -116,9 +119,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : mView = new CalendarView( mCalendar, this,"mCalendar " ); mView->hide(); //mView->resize(splash->size() ); - initActions(); + initActions(); #ifndef DESKTOP_VERSION - iconToolBar->show(); + iconToolBar->show(); qApp->processEvents(); #endif //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); @@ -133,7 +136,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : //mView->setMaximumSize( splash->size() ); //mView->resize( splash->size() ); //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); - mView->readSettings(); + mView->readSettings(); bool oldOpened = false; bool newFile = false; if( !QFile::exists( defaultFileName() ) ) { @@ -148,12 +151,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : qApp->processEvents(); } else { oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); - finfo.setFile( oldFile ); + finfo.setFile( oldFile ); if (finfo.exists() ) { KMessageBox::information( this, message); mView->openCalendar( oldFile ); qApp->processEvents(); - } + } } mView->saveCalendar( defaultFileName() ); newFile = true; @@ -175,7 +178,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : SLOT( processIncidenceSelection( Incidence * ) ) ); connect( mView, SIGNAL( modifiedChanged( bool ) ), SLOT( slotModifiedChanged( bool ) ) ); - + connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); mView->setModified( false ); @@ -184,36 +187,39 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : setCentralWidget( mView ); globalFlagBlockStartup = 0; mView->show(); - delete splash; + delete splash; if ( newFile ) mView->updateConfig(); // qApp->processEvents(); //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); - fillSyncMenu(); + fillSyncMenu(); mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); if ( showWarning ) { - KMessageBox::information( this, + KMessageBox::information( this, "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); qApp->processEvents(); mView->dialogManager()->showSyncOptions(); } + + //US listen for result adressed from Ka/Pi + connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); } MainWindow::~MainWindow() { //qDebug("MainWindow::~MainWindow() "); - //save toolbar location - - delete mCalendar; + //save toolbar location + + delete mCalendar; delete KOPrefs::instance(); delete KIncidenceFormatter::instance(); - - + + } void MainWindow::closeEvent( QCloseEvent* ce ) { - - - + + + if ( ! KOPrefs::instance()->mAskForQuit ) { saveOnClose(); ce->accept(); @@ -223,17 +229,17 @@ void MainWindow::closeEvent( QCloseEvent* ce ) switch( QMessageBox::information( this, "KO/Pi", i18n("Do you really want\nto close KO/Pi?"), - i18n("Close"), i18n("No"), + i18n("Close"), i18n("No"), 0, 0 ) ) { case 0: saveOnClose(); ce->accept(); break; case 1: - ce->ignore(); + ce->ignore(); break; case 2: - + default: break; } @@ -248,18 +254,28 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) //QString datamess; //qDebug("message "); qDebug("KO: QCOP message received: %s ", cmsg.data() ); + + if ( cmsg == "-writeFile" ) { + // I made from the "-writeFile" an "-writeAlarm" + mView->viewManager()->showWhatsNextView(); + mCalendar->checkAlarmForIncidence( 0, true); + showMaximized(); + raise(); + return; + } + if ( cmsg == "-writeFile" ) { // I made from the "-writeFile" an "-writeAlarm" - mView->viewManager()->showWhatsNextView(); + mView->viewManager()->showWhatsNextView(); mCalendar->checkAlarmForIncidence( 0, true); showMaximized(); raise(); return; - + } if ( cmsg == "-writeFileSilent" ) { // I made from the "-writeFile" an "-writeAlarm" - // mView->viewManager()->showWhatsNextView(); + // mView->viewManager()->showWhatsNextView(); mCalendar->checkAlarmForIncidence( 0, true); //showMaximized(); //raise(); @@ -268,7 +284,7 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) } if ( cmsg == "-newCountdown" ) { qDebug("newCountdown "); - + } QString msg ; QString allmsg = cmsg; @@ -287,8 +303,8 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) } if ( msg == "-newTodo" ) { mView->newTodo(); - - } + + } if ( msg == "-showWN" ) { mView->viewManager()->showWhatsNextView(); } @@ -323,11 +339,11 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) } else if ( msg == "-showWNext" || msg == "nextView()" ) { mView->viewManager()->showWhatsNextView(); - } + } else if ( msg == "-showNextXView" ) { mView->viewManager()->showNextXView(); } - + } @@ -351,7 +367,7 @@ void MainWindow::initActions() QPopupMenu *actionMenu = new QPopupMenu( this ); QPopupMenu *importMenu = new QPopupMenu( this ); selectFilterMenu = new QPopupMenu( this ); - selectFilterMenu->setCheckable( true ); + selectFilterMenu->setCheckable( true ); syncMenu = new QPopupMenu( this ); configureAgendaMenu = new QPopupMenu( this ); configureToolBarMenu = new QPopupMenu( this ); @@ -363,11 +379,11 @@ void MainWindow::initActions() menuBar1->insertItem( i18n("View"), viewMenu ); menuBar1->insertItem( i18n("Actions"), actionMenu ); menuBar1->insertItem( i18n("Synchronize"), syncMenu ); - menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); - //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); - menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); - menuBar1->insertItem( i18n("Help"), helpMenu ); - } else { + menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); + //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); + menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); + menuBar1->insertItem( i18n("Help"), helpMenu ); + } else { QPEMenuBar *menuBar1; menuBar1 = new QPEMenuBar( iconToolBar ); QPopupMenu *menuBar = new QPopupMenu( this ); @@ -376,11 +392,11 @@ void MainWindow::initActions() menuBar->insertItem( i18n("View"), viewMenu ); menuBar->insertItem( i18n("Actions"), 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() ); + 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 ( syncMenu, SIGNAL( activated ( int ) ), this, SLOT (slotSyncMenu( int ) ) ); @@ -393,56 +409,56 @@ void MainWindow::initActions() // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); configureToolBarMenu->setCheckable( true ); - QString pathString = ""; + QString pathString = ""; if ( !p->mToolBarMiniIcons ) { - if ( QApplication::desktop()->width() < 480 ) + if ( QApplication::desktop()->width() < 480 ) pathString += "icons16/"; } else pathString += "iconsmini/"; configureAgendaMenu->setCheckable( true ); - configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); - configureAgendaMenu->insertSeparator(); - configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); + configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); + configureAgendaMenu->insertSeparator(); + configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); configureAgendaMenu->insertItem(i18n("Small"), 6 ); configureAgendaMenu->insertItem(i18n("Medium"), 8 ); - configureAgendaMenu->insertItem(i18n("Normal"), 10 ); - configureAgendaMenu->insertItem(i18n("Large"), 12 ); - configureAgendaMenu->insertItem(i18n("Big"), 14 ); - configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); - configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); - //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); - - icon = loadPixmap( pathString + "configure" ); + configureAgendaMenu->insertItem(i18n("Normal"), 10 ); + configureAgendaMenu->insertItem(i18n("Large"), 12 ); + configureAgendaMenu->insertItem(i18n("Big"), 14 ); + configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); + configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); + //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); + + icon = loadPixmap( pathString + "configure" ); action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( edit_options() ) ); actionMenu->insertSeparator(); - icon = loadPixmap( pathString + "newevent" ); - configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); - configureToolBarMenu->insertSeparator(); + icon = loadPixmap( pathString + "newevent" ); + configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); + configureToolBarMenu->insertSeparator(); configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); ne_action->addTo( actionMenu ); connect( ne_action, SIGNAL( activated() ), mView, SLOT( newEvent() ) ); - icon = loadPixmap( pathString + "newtodo" ); - configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); + icon = loadPixmap( pathString + "newtodo" ); + configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); nt_action->addTo( actionMenu ); connect( nt_action, SIGNAL( activated() ), mView, SLOT( newTodo() ) ); - icon = loadPixmap( pathString + "navi" ); + icon = loadPixmap( pathString + "navi" ); action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleDateNavigatorWidget() ) ); - icon = loadPixmap( pathString + "filter" ); + icon = loadPixmap( pathString + "filter" ); action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleFilter() ) ); - + viewMenu->insertSeparator(); icon = loadPixmap( pathString + "picker" ); @@ -452,71 +468,71 @@ void MainWindow::initActions() mView, SLOT( showDatePicker() ) ); action->addTo( iconToolBar ); viewMenu->insertSeparator(); - icon = loadPixmap( pathString + "list" ); - configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); + 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 ); showlist_action->addTo( viewMenu ); connect( showlist_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showListView() ) ); - icon = loadPixmap( pathString + "day" ); - configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); + 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 ); 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 ); + 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 ); day5_action->addTo( viewMenu ); connect( day5_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWorkWeekView() ) ); icon = loadPixmap( pathString + "week" ); - configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); + configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); day7_action->addTo( viewMenu ); connect( day7_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWeekView() ) ); - icon = loadPixmap( pathString + "month" ); - configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); + icon = loadPixmap( pathString + "month" ); + configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); month_action->addTo( viewMenu ); connect( month_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthView() ) ); - icon = loadPixmap( pathString + "todo" ); - configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); + 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 ); todoview_action->addTo( viewMenu ); connect( todoview_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showTodoView() ) ); - icon = loadPixmap( pathString + "journal" ); - configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); + icon = loadPixmap( pathString + "journal" ); + configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); viewjournal_action->addTo( viewMenu ); connect( viewjournal_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showJournalView() ) ); - icon = loadPixmap( pathString + "xdays" ); - configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); + icon = loadPixmap( pathString + "xdays" ); + configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); QAction* xdays_action = new QAction( 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 + "whatsnext" ); - configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); - QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); + icon = loadPixmap( pathString + "whatsnext" ); + configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); + QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); whatsnext_action->addTo( viewMenu ); connect( whatsnext_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWhatsNextView() ) ); - + #if 0 action = new QAction( "view_timespan", "Time Span", 0, this ); action->addTo( viewMenu ); @@ -554,15 +570,15 @@ void MainWindow::initActions() action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); - icon = loadPixmap( pathString + "search" ); + icon = loadPixmap( pathString + "search" ); QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); - configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); + configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); search_action->addTo( actionMenu ); connect( search_action, SIGNAL( activated() ), mView->dialogManager(), SLOT( showSearchDialog() ) ); - icon = loadPixmap( pathString + "today" ); - configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); + icon = loadPixmap( pathString + "today" ); + configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); today_action->addTo( actionMenu ); connect( today_action, SIGNAL( activated() ), @@ -570,8 +586,8 @@ void MainWindow::initActions() if ( KOPrefs::instance()->mShowFullMenu ) { actionMenu->insertSeparator(); - actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); - + actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); + } // actionMenu->insertSeparator(); action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, @@ -629,20 +645,20 @@ void MainWindow::initActions() this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); - + action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); #else - importMenu->insertSeparator(); - icon = loadPixmap( pathString + "print" ); + importMenu->insertSeparator(); + icon = loadPixmap( pathString + "print" ); action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), this, SLOT( printCal() ) ); - - icon = loadPixmap( pathString + "print" ); + + icon = loadPixmap( pathString + "print" ); action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), @@ -657,34 +673,34 @@ void MainWindow::initActions() this ); action->addTo( importMenu ); connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); - + //menuBar->insertItem( "Configure",configureMenu ); //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); - icon = loadPixmap( "korganizer/korganizer" ); + icon = loadPixmap( "korganizer/korganizer" ); action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), - SLOT( keyBindings() ) ); + SLOT( keyBindings() ) ); action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), - SLOT( features() ) ); + SLOT( features() ) ); action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), - SLOT( aboutAutoSaving() ) ); + SLOT( aboutAutoSaving() ) ); action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), - SLOT( aboutKnownBugs() ) ); + SLOT( aboutKnownBugs() ) ); action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), - SLOT( usertrans() ) ); + SLOT( usertrans() ) ); action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), - SLOT( synchowto() ) ); + SLOT( synchowto() ) ); action = new QAction( "Whats New", i18n("What's new?"), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), @@ -692,8 +708,8 @@ void MainWindow::initActions() action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); action->addTo( helpMenu ); connect( action, SIGNAL( activated() ), - SLOT( faq() ) ); - + SLOT( faq() ) ); + action = new QAction( "about", i18n("About..."), 0, this ); action->addTo( helpMenu ); @@ -706,10 +722,10 @@ void MainWindow::initActions() //menuBar->insertSeparator(); // ****************************************************** - // menubar icons - - - iconToolBar->setHorizontalStretchable (true ); + // menubar icons + + + iconToolBar->setHorizontalStretchable (true ); //menuBar->insertItem( iconToolBar ); //xdays_action if (p-> mShowIconNewEvent) @@ -737,7 +753,7 @@ void MainWindow::initActions() if (p-> mShowIconJournal) viewjournal_action->addTo( iconToolBar ); icon = loadPixmap( pathString + "2leftarrowB" ); - configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); + configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); if (p-> mShowIconBackFast) { action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); connect( action, SIGNAL( activated() ), @@ -745,17 +761,17 @@ void MainWindow::initActions() action->addTo( iconToolBar ); } icon = loadPixmap( pathString + "1leftarrowB" ); - configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); + configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); if (p-> mShowIconBack) { action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goPrevious() ) ); action->addTo( iconToolBar ); } - if (p-> mShowIconToday) + if (p-> mShowIconToday) today_action->addTo( iconToolBar ); icon = loadPixmap( pathString + "1rightarrowB" ); - configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); + configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); if (p-> mShowIconForward) { action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); connect( action, SIGNAL( activated() ), @@ -763,16 +779,16 @@ void MainWindow::initActions() action->addTo( iconToolBar ); } icon = loadPixmap( pathString + "2rightarrowB" ); - configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); + configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); if (p-> mShowIconForwardFast) { action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); connect( action, SIGNAL( activated() ), mView, SLOT( goNextMonth() ) ); action->addTo( iconToolBar ); } - - - configureToolBarMenu->insertItem(i18n("What's This?"), 300); + + + configureToolBarMenu->insertItem(i18n("What's This?"), 300); if (p-> mShowIconNewEvent) configureToolBarMenu->setItemChecked( 10, true ); @@ -794,10 +810,10 @@ void MainWindow::initActions() configureToolBarMenu->setItemChecked( 80, true ); if (p-> mShowIconBackFast) configureToolBarMenu->setItemChecked( 200, true ); - if (p-> mShowIconBack) + if (p-> mShowIconBack) configureToolBarMenu->setItemChecked( 210, true ); if (p-> mShowIconToday) - configureToolBarMenu->setItemChecked( 130, true ); + configureToolBarMenu->setItemChecked( 130, true ); if (p-> mShowIconForward) configureToolBarMenu->setItemChecked( 220, true ); if (p-> mShowIconForwardFast) @@ -819,7 +835,7 @@ void MainWindow::initActions() configureToolBarMenu->setItemChecked( 5, true ); if (p-> mShowIconWhatsThis) QWhatsThis::whatsThisButton ( iconToolBar ); - connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); + connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); configureAgenda( p->mHourSize ); connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); } @@ -850,7 +866,7 @@ void MainWindow::fillSyncMenu() config.writeEntry("SyncProfileNames",prof); config.writeEntry("ExternSyncProfiles","Sharp_DTM"); config.sync(); - delete temp; + delete temp; } KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); KOPrefs::instance()->mSyncProfileNames = prof; @@ -866,14 +882,14 @@ void MainWindow::fillSyncMenu() syncMenu->setItemEnabled( false , 1000 ); } mView->setupExternSyncProfiles(); -} +} int MainWindow::ringSync() { int syncedProfiles = 0; - int i; + int i; QTime timer; - KConfig config ( locateLocal( "config","syncprofilesrc" ) ); + KConfig config ( locateLocal( "config","syncprofilesrc" ) ); QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; KSyncProfile* temp = new KSyncProfile (); KOPrefs::instance()->mAskForPreferences = false; @@ -894,7 +910,7 @@ int MainWindow::ringSync() syncSharp(); } else { if ( temp->getIsLocalFileSync() ) { - if ( syncWithFile( temp->getRemoteFileName( ), true ) ) + if ( syncWithFile( temp->getRemoteFileName( ), true ) ) KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); } else { if ( temp->getIsPhoneSync() ) { @@ -904,7 +920,7 @@ int MainWindow::ringSync() syncPhone(); } else syncRemote( temp, false ); - + } } timer.start(); @@ -915,23 +931,23 @@ int MainWindow::ringSync() sleep (1); #endif } - + } } delete temp; return syncedProfiles; -} +} void MainWindow::multiSync( bool askforPrefs ) { if (mBlockSaveFlag) return; - mBlockSaveFlag = true; + mBlockSaveFlag = true; QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); if ( QMessageBox::information( this, i18n("KO/Pi Sync"), question, - i18n("Yes"), i18n("No"), + i18n("Yes"), i18n("No"), 0, 0 ) != 0 ) { mBlockSaveFlag = false; setCaption(i18n("Aborted! Nothing synced!")); @@ -950,7 +966,7 @@ void MainWindow::multiSync( bool askforPrefs ) ringSync(); mBlockSaveFlag = false; if ( num ) - save(); + save(); if ( num ) setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); else @@ -965,11 +981,11 @@ void MainWindow::slotSyncMenu( int action ) confSync(); return; - } - if ( action == 1 ) { + } + if ( action == 1 ) { multiSync( true ); return; - } + } if (mBlockSaveFlag) return; @@ -977,7 +993,7 @@ void MainWindow::slotSyncMenu( int action ) mCurrentSyncProfile = action - 1000 ; mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); - KConfig config ( locateLocal( "config","syncprofilesrc" ) ); + KConfig config ( locateLocal( "config","syncprofilesrc" ) ); KSyncProfile* temp = new KSyncProfile (); temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); temp->readConfig(&config); @@ -997,7 +1013,7 @@ void MainWindow::slotSyncMenu( int action ) } else if ( action >= 1003 ) { if ( temp->getIsLocalFileSync() ) { - if ( syncWithFile( temp->getRemoteFileName( ), false ) ) + if ( syncWithFile( temp->getRemoteFileName( ), false ) ) KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); } else { if ( temp->getIsPhoneSync() ) { @@ -1035,7 +1051,7 @@ void MainWindow::displayText( QString text ,QString cap ) lay->setSpacing( 3 ); lay->setMargin( 3 ); QTextBrowser tb ( &dia ); - lay->addWidget( &tb ); + lay->addWidget( &tb ); tb.setText( text ); #ifdef DESKTOP_VERSION dia.resize( 640, 480); @@ -1047,15 +1063,15 @@ void MainWindow::displayText( QString text ,QString cap ) void MainWindow::displayFile( QString fn, QString cap ) { QString fileName = resourcePath() + fn; - QString text; + QString text; QFile file( fileName ); if (!file.open( IO_ReadOnly ) ) { return ; - - } + + } QTextStream ts( &file ); text = ts.read(); - file.close(); + file.close(); displayText( text, cap); } void MainWindow::features() @@ -1078,7 +1094,7 @@ void MainWindow::usertrans() void MainWindow::synchowto() { #if 0 - QPtrList er = mCalendar->rawIncidences(); + QPtrList er = mCalendar->rawIncidences(); Incidence* inR = er.first(); VCalFormat vf; QString strout; @@ -1092,7 +1108,7 @@ void MainWindow::synchowto() } #endif displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); -} +} void MainWindow::faq() { displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); @@ -1115,7 +1131,7 @@ void MainWindow::about() QMessageBox::about( this, i18n("About KOrganizer/Pi"), i18n("KOrganizer/Platform-independent\n") + "(KO/Pi) " + version + " - " + - + #ifdef DESKTOP_VERSION i18n("Desktop Edition\n") + #else @@ -1175,7 +1191,7 @@ void MainWindow::keyBindings() i18n("

Dark yellow: Event/todo with attendees.

\n") + i18n("

White: Item readonly

\n"); displayText( text, cap); - + } void MainWindow::aboutAutoSaving() { @@ -1187,8 +1203,8 @@ void MainWindow::aboutAutoSaving() QMessageBox::NoButton); msg->exec(); delete msg; - - + + } void MainWindow::aboutKnownBugs() { @@ -1205,7 +1221,7 @@ void MainWindow::aboutKnownBugs() QMessageBox::NoButton); msg->exec(); delete msg; - + } QString MainWindow::defaultFileName() @@ -1217,43 +1233,43 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) { if ( !incidence ) { enableIncidenceActions( false ); - - mNewSubTodoAction->setEnabled( false ); + + mNewSubTodoAction->setEnabled( false ); setCaptionToDates(); return; - + } - + //KGlobal::locale()->formatDateTime(nextA, true); QString startString = ""; - if ( incidence->type() != "Todo" ) { - if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { + if ( incidence->type() != "Todo" ) { + if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { if ( incidence->doesFloat() ) { - startString += ": "+incidence->dtStartDateStr( true ); - startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); + startString += ": "+incidence->dtStartDateStr( true ); + startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); } else { - startString = ": "+incidence->dtStartStr(true); + 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()); - startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); + startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); } - + } - else + else startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); if ( !incidence->location().isEmpty() ) startString += " (" +incidence->location()+")"; setCaption( incidence->summary()+startString); - + enableIncidenceActions( true ); - + if ( incidence->type() == "Event" ) { mShowAction->setText( i18n("Show Event...") ); mEditAction->setText( i18n("Edit Event...") ); @@ -1292,16 +1308,16 @@ void MainWindow::importOL() #endif } void MainWindow::importBday() -{ +{ int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), i18n("Import!"), i18n("Cancel"), 0, 0, 1 ); if ( result == 0 ) { mView->importBday(); - + } - + } void MainWindow::importQtopia() @@ -1323,9 +1339,9 @@ void MainWindow::importQtopia() i18n("Ok"), i18n("Cancel"), 0, 0, 1 ); -#endif +#endif } - + void MainWindow::saveOnClose() { KOPrefs *p = KOPrefs::instance(); @@ -1341,7 +1357,7 @@ void MainWindow::slotModifiedChanged( bool changed ) if ( mBlockAtStartup ) return; int msec; - // we store the changes after 1 minute, + // we store the changes after 1 minute, // and for safety reasons after 10 minutes again if ( !mBlockSaveFlag ) msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; @@ -1354,7 +1370,7 @@ void MainWindow::slotModifiedChanged( bool changed ) #include void MainWindow::save() { - if ( mBlockSaveFlag ) + if ( mBlockSaveFlag ) return; bool store = mBlockSaveFlag; mBlockSaveFlag = true; @@ -1370,20 +1386,20 @@ void MainWindow::save() qDebug("KO: Needed %d ms for saving.",msNeeded ); QString savemes; savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); - setCaption(savemes); + setCaption(savemes); } else - setCaption(i18n("Saving cancelled!")); + setCaption(i18n("Saving cancelled!")); mCalendarModifiedFlag = false; mBlockSaveFlag = store; } -void MainWindow::keyReleaseEvent ( QKeyEvent * e) +void MainWindow::keyReleaseEvent ( QKeyEvent * e) { if ( !e->isAutoRepeat() ) { mFlagKeyPressed = false; } } -void MainWindow::keyPressEvent ( QKeyEvent * e ) +void MainWindow::keyPressEvent ( QKeyEvent * e ) { qApp->processEvents(); if ( e->isAutoRepeat() && !mFlagKeyPressed ) { @@ -1418,7 +1434,7 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) break; case Qt::Key_Up: mView->viewManager()->agendaView()->scrollOneHourUp(); - break; + break; case Qt::Key_I: mView->showIncidence(); break; @@ -1440,7 +1456,7 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) case Qt::Key_4: case Qt::Key_5: case Qt::Key_6: - case Qt::Key_7: + case Qt::Key_7: case Qt::Key_8: case Qt::Key_9: pro = e->key()-48; @@ -1459,7 +1475,7 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) case Qt::Key_S : if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) mView->newSubTodo(); - else + else mView->dialogManager()->showSearchDialog(); break; case Qt::Key_Y : @@ -1476,38 +1492,38 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) break; case Qt::Key_W: mView->viewManager()->showWhatsNextView(); - break; + break; case Qt::Key_L: mView->viewManager()->showListView(); - break; + break; case Qt::Key_N: mView->viewManager()->showNextXView(); showSelectedDates = true; - break; + break; case Qt::Key_V: mView->viewManager()->showTodoView(); - break; + break; case Qt::Key_C: mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); - break; + break; case Qt::Key_P: mView->showDatePicker( ); - break; - case Qt::Key_F: + break; + case Qt::Key_F: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) mView->editFilters(); else mView->toggleFilter(); - break; + break; case Qt::Key_X: mView->toggleDateNavigatorWidget(); - break; + break; case Qt::Key_Space: mView->toggleExpand(); - break; + break; case Qt::Key_A: mView->toggleAllDaySize(); - break; + break; case Qt::Key_T: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) mView->newTodo(); @@ -1522,8 +1538,8 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) case Qt::Key_B: mView->editIncidenceDescription();; break; - // case Qt::Key_Return: - case Qt::Key_E: + // case Qt::Key_Return: + case Qt::Key_E: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) mView->newEvent(); else @@ -1539,7 +1555,7 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) if ( size >= 4 ) configureAgenda( size ); break; - + default: e->ignore(); @@ -1564,7 +1580,7 @@ void MainWindow::fillFilterMenu() selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 0 ); disable = true; } - selectFilterMenu->insertSeparator(); + selectFilterMenu->insertSeparator(); QPtrList fili = mView->filters(); CalFilter *curfilter = mView->filterView()->selectedFilter(); CalFilter *filter = fili.first(); @@ -1604,13 +1620,13 @@ void MainWindow::configureToolBar( int item ) p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); - p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); + p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); - p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); + p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); // initActions(); } @@ -1621,11 +1637,11 @@ void MainWindow::setCaptionToDates() if (mView->startDate() < mView->endDate() ) selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); setCaption( i18n("Dates: ") + selDates ); - + } // parameter item == 0: reinit void MainWindow::configureAgenda( int item ) -{ +{ KOPrefs *p = KOPrefs::instance(); @@ -1649,7 +1665,7 @@ void MainWindow::configureAgenda( int item ) } void MainWindow::saveCalendar() -{ +{ QString fn = KOPrefs::instance()->mLastSaveFile; fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); @@ -1659,7 +1675,7 @@ void MainWindow::saveCalendar() info.setFile( fn ); QString mes; bool createbup = true; - if ( info. exists() ) { + if ( info. exists() ) { mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, i18n("Overwrite!"), i18n("Cancel"), 0, @@ -1669,7 +1685,7 @@ void MainWindow::saveCalendar() } } if ( createbup ) { - mView->saveCalendar( fn ); + mView->saveCalendar( fn ); mes = i18n("KO/Pi:Saved %1").arg(fn); KOPrefs::instance()->mLastSaveFile = fn; setCaption(mes); @@ -1677,10 +1693,10 @@ void MainWindow::saveCalendar() } void MainWindow::loadCalendar() { - + QString fn = KOPrefs::instance()->mLastLoadFile; fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); - + if ( fn == "" ) return; QFileInfo info; @@ -1726,9 +1742,9 @@ void MainWindow::importFile( QString fn, bool quick ) int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), mess ); return; - } + } int result = 0; - if ( !quick ) { + if ( !quick ) { mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); result = QMessageBox::warning( this, "KO/Pi: Warning!", mess, @@ -1747,14 +1763,14 @@ void MainWindow::importFile( QString fn, bool quick ) void MainWindow::importIcal() { - + QString fn =KOPrefs::instance()->mLastImportFile; fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); if ( fn == "" ) return; importFile( fn, true ); - + } void MainWindow::exportVCalendar() @@ -1767,7 +1783,7 @@ void MainWindow::exportVCalendar() info.setFile( fn ); QString mes; bool createbup = true; - if ( info. exists() ) { + if ( info. exists() ) { mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, i18n("Overwrite!"), i18n("Cancel"), 0, @@ -1777,8 +1793,8 @@ void MainWindow::exportVCalendar() } } if ( createbup ) { - if ( mView->exportVCalendar( fn ) ) { - KOPrefs::instance()->mLastVcalFile = fn; + if ( mView->exportVCalendar( fn ) ) { + KOPrefs::instance()->mLastVcalFile = fn; if ( fn.length() > 20 ) mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; else @@ -1788,20 +1804,20 @@ void MainWindow::exportVCalendar() } } -#include +#include QString MainWindow::getPassword( ) -{ +{ QString retfile = ""; - QDialog dia ( this, "input-dialog", true ); - QLineEdit lab ( &dia ); + QDialog dia ( this, "input-dialog", true ); + QLineEdit lab ( &dia ); lab.setEchoMode( QLineEdit::Password ); QVBoxLayout lay( &dia ); - lay.setMargin(7); - lay.setSpacing(7); + lay.setMargin(7); + lay.setSpacing(7); lay.addWidget( &lab); dia.setFixedSize( 230,50 ); dia.setCaption( i18n("Enter password") ); - QPushButton pb ( "OK", &dia); + QPushButton pb ( "OK", &dia); lay.addWidget( &pb ); connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); dia.show(); @@ -1844,19 +1860,19 @@ bool MainWindow::syncWithFile( QString fn , bool quick ) int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), mess ); return ret; - } + } int result = 0; - if ( !quick ) { + if ( !quick ) { mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), mess, i18n("Sync"), i18n("Cancel"), 0, 0, 1 ); - if ( result ) + if ( result ) return false; } if ( KOPrefs::instance()->mAskForPreferences ) - mView->edit_sync_options(); + mView->edit_sync_options(); if ( result == 0 ) { //qDebug("Now sycing ... "); if ( ret = mView->syncCalendar( fn, KOPrefs::instance()->mSyncAlgoPrefs ) ) @@ -1887,7 +1903,7 @@ void MainWindow::confSync() mView->confSync(); fillSyncMenu(); //mView->writeSettings(); - + } void MainWindow::syncRemote( KSyncProfile* prof, bool ask) @@ -1897,7 +1913,7 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) question = i18n("Do you really want\nto remote sync\nwith profile \n")+ prof->getName()+" ?\n"; if ( QMessageBox::information( this, i18n("KO/Pi Sync"), question, - i18n("Yes"), i18n("No"), + i18n("Yes"), i18n("No"), 0, 0 ) != 0 ) return; } @@ -1907,9 +1923,9 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) QString pwd = getPassword(); command = command.left( fi )+ pwd + command.mid( fi+5 ); - } + } int maxlen = 30; - if ( QApplication::desktop()->width() > 320 ) + if ( QApplication::desktop()->width() > 320 ) maxlen += 25; setCaption ( i18n( "Copy remote file to local machine..." ) ); int fileSize = 0; @@ -1928,7 +1944,7 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"), question, i18n("Okay!")) ; - setCaption ("KO/Pi"); + setCaption ("KO/Pi"); return; } setCaption ( i18n( "Copying succeed." ) ); @@ -1939,7 +1955,7 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) // e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); // e->setReadOnly( true ); if ( KOPrefs::instance()->mWriteBackFile ) { - command = prof->getPostSyncCommand(); + command = prof->getPostSyncCommand(); setCaption ( i18n( "Writing back file ..." ) ); result = system ( command ); qDebug("KO: Writing back file result: %d ", result); @@ -1954,9 +1970,9 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) return; } void MainWindow::syncSSH() -{ +{ // not used anymore - QTime timer; + QTime timer; timer.start(); //qDebug("MainWindow::syncssh() "); KOPrefs *p = KOPrefs::instance(); @@ -1971,7 +1987,7 @@ void MainWindow::syncSSH() i18n("IP: " ) +remoteIP +"\n" + i18n("User: " ) + remoteUser +"\n" ; int maxlen = 30; - if ( QApplication::desktop()->width() > 320 ) + if ( QApplication::desktop()->width() > 320 ) maxlen += 25; if ( remoteFile.length() > maxlen ) question += i18n("Remote file:\n..." ) + remoteFile.right(maxlen) +"\n"; @@ -1981,10 +1997,10 @@ void MainWindow::syncSSH() question += i18n("Local temp file:\n..." ) + localFile.right(maxlen) +"\n"; else question += i18n("Local temp file:\n " ) + localFile +"\n"; - + if ( QMessageBox::information( this, i18n("KO/Pi Sync"), question, - i18n("Yes"), i18n("No"), + i18n("Yes"), i18n("No"), 0, 0 ) != 0 ) return; // if ( !p->mUsePassWd ) { @@ -2010,7 +2026,7 @@ void MainWindow::syncSSH() QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"), question, i18n("Okay!")) ; - setCaption ("KO/Pi"); + setCaption ("KO/Pi"); return; } @@ -2023,7 +2039,7 @@ void MainWindow::syncSSH() // e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); // e->setReadOnly( true ); if ( KOPrefs::instance()->mWriteBackFile ) { - command = "scp " + localFile +" " +remoteUser + "@" + remoteIP +":" + remoteFile ; + command = "scp " + localFile +" " +remoteUser + "@" + remoteIP +":" + remoteFile ; setCaption ( i18n( "Writing back file ..." ) ); result = system ( command ); if ( result != 0 ) { @@ -2036,7 +2052,7 @@ void MainWindow::syncSSH() QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"), question, i18n("Okay!")) ; - setCaption ("KO/Pi"); + setCaption ("KO/Pi"); return; } else { setCaption ( i18n( "Syncronization sucessfully completed" ) ); @@ -2051,7 +2067,7 @@ void MainWindow::syncSSH() qDebug("MainWindow::merging) "); mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 ); - while ( mBlockSaveFlag ) + while ( mBlockSaveFlag ) qApp->processEvents(); save(); system ("scp /home/polo/Applications/korganizer/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics"); @@ -2066,7 +2082,7 @@ void MainWindow::syncSharp() save(); mView->syncSharp(); slotModifiedChanged( true ); - + } void MainWindow::syncPhone() { @@ -2074,7 +2090,7 @@ void MainWindow::syncPhone() save(); mView->syncPhone(); slotModifiedChanged( true ); - + } void MainWindow::printSel( ) -- cgit v0.9.0.2