-rw-r--r-- | korganizer/mainwindow.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 40f2cf4..be69be7 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -40,28 +40,29 @@ | |||
40 | #include "koagendaview.h" | 40 | #include "koagendaview.h" |
41 | #include "koagenda.h" | 41 | #include "koagenda.h" |
42 | #include "kodialogmanager.h" | 42 | #include "kodialogmanager.h" |
43 | #include "kdialogbase.h" | 43 | #include "kdialogbase.h" |
44 | #include "kstandarddirs.h" | 44 | #include "kstandarddirs.h" |
45 | #include "koprefs.h" | 45 | #include "koprefs.h" |
46 | #include "kfiledialog.h" | 46 | #include "kfiledialog.h" |
47 | #include "koglobals.h" | 47 | #include "koglobals.h" |
48 | #include "kglobal.h" | 48 | #include "kglobal.h" |
49 | #include "klocale.h" | 49 | #include "klocale.h" |
50 | #include "kconfig.h" | 50 | #include "kconfig.h" |
51 | #include "simplealarmclient.h" | 51 | #include "simplealarmclient.h" |
52 | |||
53 | using namespace KCal; | 52 | using namespace KCal; |
54 | #ifndef _WIN32_ | 53 | #ifndef _WIN32_ |
55 | #include <unistd.h> | 54 | #include <unistd.h> |
55 | #else | ||
56 | #include "koimportoldialog.h" | ||
56 | #endif | 57 | #endif |
57 | #include "mainwindow.h" | 58 | #include "mainwindow.h" |
58 | 59 | ||
59 | int globalFlagBlockStartup; | 60 | int globalFlagBlockStartup; |
60 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 61 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
61 | QMainWindow( parent, name ) | 62 | QMainWindow( parent, name ) |
62 | { | 63 | { |
63 | 64 | ||
64 | #ifdef DESKTOP_VERSION | 65 | #ifdef DESKTOP_VERSION |
65 | setFont( QFont("Arial"), 14 ); | 66 | setFont( QFont("Arial"), 14 ); |
66 | #endif | 67 | #endif |
67 | 68 | ||
@@ -575,24 +576,32 @@ void MainWindow::initActions() | |||
575 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 576 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
576 | importMenu->insertSeparator(); | 577 | importMenu->insertSeparator(); |
577 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 578 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
578 | this ); | 579 | this ); |
579 | action->addTo( importMenu ); | 580 | action->addTo( importMenu ); |
580 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 581 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
581 | #ifndef DESKTOP_VERSION | 582 | #ifndef DESKTOP_VERSION |
582 | importMenu->insertSeparator(); | 583 | importMenu->insertSeparator(); |
583 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 584 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
584 | this ); | 585 | this ); |
585 | action->addTo( importMenu ); | 586 | action->addTo( importMenu ); |
586 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 587 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
588 | #else | ||
589 | #ifdef _WIN32_ | ||
590 | importMenu->insertSeparator(); | ||
591 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | ||
592 | this ); | ||
593 | action->addTo( importMenu ); | ||
594 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | ||
595 | #endif | ||
587 | #endif | 596 | #endif |
588 | 597 | ||
589 | importMenu->insertSeparator(); | 598 | importMenu->insertSeparator(); |
590 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 599 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
591 | this ); | 600 | this ); |
592 | action->addTo( importMenu ); | 601 | action->addTo( importMenu ); |
593 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 602 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
594 | 603 | ||
595 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 604 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
596 | this ); | 605 | this ); |
597 | action->addTo( importMenu ); | 606 | action->addTo( importMenu ); |
598 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 607 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
@@ -921,25 +930,27 @@ void MainWindow::multiSync( bool askforPrefs ) | |||
921 | if ( num ) | 930 | if ( num ) |
922 | save(); | 931 | save(); |
923 | if ( num ) | 932 | if ( num ) |
924 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); | 933 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); |
925 | else | 934 | else |
926 | setCaption(i18n("Nothing synced! No profiles defined for multisync!")); | 935 | setCaption(i18n("Nothing synced! No profiles defined for multisync!")); |
927 | return; | 936 | return; |
928 | } | 937 | } |
929 | void MainWindow::slotSyncMenu( int action ) | 938 | void MainWindow::slotSyncMenu( int action ) |
930 | { | 939 | { |
931 | //qDebug("syncaction %d ", action); | 940 | //qDebug("syncaction %d ", action); |
932 | if ( action == 0 ) { | 941 | if ( action == 0 ) { |
942 | |||
933 | confSync(); | 943 | confSync(); |
944 | |||
934 | return; | 945 | return; |
935 | } | 946 | } |
936 | if ( action == 1 ) { | 947 | if ( action == 1 ) { |
937 | multiSync( true ); | 948 | multiSync( true ); |
938 | return; | 949 | return; |
939 | } | 950 | } |
940 | 951 | ||
941 | if (mBlockSaveFlag) | 952 | if (mBlockSaveFlag) |
942 | return; | 953 | return; |
943 | mBlockSaveFlag = true; | 954 | mBlockSaveFlag = true; |
944 | mCurrentSyncProfile = action - 1000 ; | 955 | mCurrentSyncProfile = action - 1000 ; |
945 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); | 956 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); |
@@ -1210,24 +1221,33 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1210 | 1221 | ||
1211 | mNewSubTodoAction->setEnabled( false ); | 1222 | mNewSubTodoAction->setEnabled( false ); |
1212 | } | 1223 | } |
1213 | } | 1224 | } |
1214 | 1225 | ||
1215 | void MainWindow::enableIncidenceActions( bool enabled ) | 1226 | void MainWindow::enableIncidenceActions( bool enabled ) |
1216 | { | 1227 | { |
1217 | mShowAction->setEnabled( enabled ); | 1228 | mShowAction->setEnabled( enabled ); |
1218 | mEditAction->setEnabled( enabled ); | 1229 | mEditAction->setEnabled( enabled ); |
1219 | mDeleteAction->setEnabled( enabled ); | 1230 | mDeleteAction->setEnabled( enabled ); |
1220 | } | 1231 | } |
1221 | 1232 | ||
1233 | void MainWindow::importOL() | ||
1234 | { | ||
1235 | #ifdef _WIN32_ | ||
1236 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | ||
1237 | id->exec(); | ||
1238 | delete id; | ||
1239 | mView->updateView(); | ||
1240 | #endif | ||
1241 | } | ||
1222 | void MainWindow::importBday() | 1242 | void MainWindow::importBday() |
1223 | { | 1243 | { |
1224 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1244 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1225 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1245 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1226 | i18n("Import!"), i18n("Cancel"), 0, | 1246 | i18n("Import!"), i18n("Cancel"), 0, |
1227 | 0, 1 ); | 1247 | 0, 1 ); |
1228 | if ( result == 0 ) { | 1248 | if ( result == 0 ) { |
1229 | mView->importBday(); | 1249 | mView->importBday(); |
1230 | 1250 | ||
1231 | } | 1251 | } |
1232 | 1252 | ||
1233 | 1253 | ||