-rw-r--r-- | korganizer/kotodoview.cpp | 6 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 47 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
3 files changed, 17 insertions, 37 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 5d7b066..97b4a03 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -889,265 +889,269 @@ void KOTodoView::changedCategories(int index) | |||
889 | } | 889 | } |
890 | void KOTodoView::itemDoubleClicked(QListViewItem *item) | 890 | void KOTodoView::itemDoubleClicked(QListViewItem *item) |
891 | { | 891 | { |
892 | if ( pendingSubtodo != 0 ) { | 892 | if ( pendingSubtodo != 0 ) { |
893 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 893 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
894 | } | 894 | } |
895 | pendingSubtodo = 0; | 895 | pendingSubtodo = 0; |
896 | if (!item) { | 896 | if (!item) { |
897 | newTodo(); | 897 | newTodo(); |
898 | return; | 898 | return; |
899 | } | 899 | } |
900 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 900 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
901 | editItem( item ); | 901 | editItem( item ); |
902 | else | 902 | else |
903 | showItem( item , QPoint(), 0 ); | 903 | showItem( item , QPoint(), 0 ); |
904 | } | 904 | } |
905 | void KOTodoView::itemClicked(QListViewItem *item) | 905 | void KOTodoView::itemClicked(QListViewItem *item) |
906 | { | 906 | { |
907 | 907 | ||
908 | if (!item) { | 908 | if (!item) { |
909 | if ( pendingSubtodo != 0 ) { | 909 | if ( pendingSubtodo != 0 ) { |
910 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 910 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
911 | } | 911 | } |
912 | pendingSubtodo = 0; | 912 | pendingSubtodo = 0; |
913 | return; | 913 | return; |
914 | } | 914 | } |
915 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 915 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
916 | if ( pendingSubtodo != 0 ) { | 916 | if ( pendingSubtodo != 0 ) { |
917 | bool allowReparent = true; | 917 | bool allowReparent = true; |
918 | QListViewItem *par = item; | 918 | QListViewItem *par = item; |
919 | while ( par ) { | 919 | while ( par ) { |
920 | if ( par == pendingSubtodo ) { | 920 | if ( par == pendingSubtodo ) { |
921 | allowReparent = false; | 921 | allowReparent = false; |
922 | break; | 922 | break; |
923 | } | 923 | } |
924 | par = par->parent(); | 924 | par = par->parent(); |
925 | } | 925 | } |
926 | if ( !allowReparent ) { | 926 | if ( !allowReparent ) { |
927 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); | 927 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); |
928 | qDebug("Recursive reparenting not possible "); | 928 | qDebug("Recursive reparenting not possible "); |
929 | pendingSubtodo = 0; | 929 | pendingSubtodo = 0; |
930 | } else { | 930 | } else { |
931 | Todo* newParent = todoItem->todo(); | 931 | Todo* newParent = todoItem->todo(); |
932 | Todo* newSub = pendingSubtodo->todo(); | 932 | Todo* newSub = pendingSubtodo->todo(); |
933 | pendingSubtodo = 0; | 933 | pendingSubtodo = 0; |
934 | emit reparentTodoSignal( newParent,newSub ); | 934 | emit reparentTodoSignal( newParent,newSub ); |
935 | return; | 935 | return; |
936 | } | 936 | } |
937 | } | 937 | } |
938 | int completed = todoItem->todo()->isCompleted(); // Completed or not? | 938 | int completed = todoItem->todo()->isCompleted(); // Completed or not? |
939 | 939 | ||
940 | if (todoItem->isOn()) { | 940 | if (todoItem->isOn()) { |
941 | if (!completed) { | 941 | if (!completed) { |
942 | todoItem->todo()->setCompleted(QDateTime::currentDateTime()); | 942 | todoItem->todo()->setCompleted(QDateTime::currentDateTime()); |
943 | } | 943 | } |
944 | } else { | 944 | } else { |
945 | if (completed) { | 945 | if (completed) { |
946 | todoItem->todo()->setCompleted(false); | 946 | todoItem->todo()->setCompleted(false); |
947 | } | 947 | } |
948 | } | 948 | } |
949 | } | 949 | } |
950 | 950 | ||
951 | void KOTodoView::setDocumentId( const QString &id ) | 951 | void KOTodoView::setDocumentId( const QString &id ) |
952 | { | 952 | { |
953 | kdDebug() << "KOTodoView::setDocumentId()" << endl; | 953 | kdDebug() << "KOTodoView::setDocumentId()" << endl; |
954 | 954 | ||
955 | mDocPrefs->setDoc( id ); | 955 | mDocPrefs->setDoc( id ); |
956 | } | 956 | } |
957 | 957 | ||
958 | void KOTodoView::itemStateChanged( QListViewItem *item ) | 958 | void KOTodoView::itemStateChanged( QListViewItem *item ) |
959 | { | 959 | { |
960 | if (!item) return; | 960 | if (!item) return; |
961 | 961 | ||
962 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 962 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
963 | 963 | ||
964 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; | 964 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; |
965 | 965 | ||
966 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); | 966 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); |
967 | } | 967 | } |
968 | 968 | ||
969 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const | 969 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const |
970 | { | 970 | { |
971 | mTodoListView->saveLayout(config,group); | 971 | mTodoListView->saveLayout(config,group); |
972 | } | 972 | } |
973 | 973 | ||
974 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) | 974 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) |
975 | { | 975 | { |
976 | mTodoListView->restoreLayout(config,group); | 976 | mTodoListView->restoreLayout(config,group); |
977 | } | 977 | } |
978 | 978 | ||
979 | void KOTodoView::processSelectionChange() | 979 | void KOTodoView::processSelectionChange() |
980 | { | 980 | { |
981 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; | 981 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; |
982 | 982 | ||
983 | KOTodoViewItem *item = | 983 | KOTodoViewItem *item = |
984 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); | 984 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); |
985 | 985 | ||
986 | if ( !item ) { | 986 | if ( !item ) { |
987 | emit incidenceSelected( 0 ); | 987 | emit incidenceSelected( 0 ); |
988 | } else { | 988 | } else { |
989 | emit incidenceSelected( item->todo() ); | 989 | emit incidenceSelected( item->todo() ); |
990 | } | 990 | } |
991 | } | 991 | } |
992 | 992 | ||
993 | void KOTodoView::modified(bool b) | 993 | void KOTodoView::modified(bool b) |
994 | { | 994 | { |
995 | emit isModified(b); | 995 | emit isModified(b); |
996 | } | 996 | } |
997 | void KOTodoView::setTodoModified( Todo* todo ) | 997 | void KOTodoView::setTodoModified( Todo* todo ) |
998 | { | 998 | { |
999 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); | 999 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); |
1000 | } | 1000 | } |
1001 | void KOTodoView::clearSelection() | 1001 | void KOTodoView::clearSelection() |
1002 | { | 1002 | { |
1003 | mTodoListView->selectAll( false ); | 1003 | mTodoListView->selectAll( false ); |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | void KOTodoView::purgeCompleted() | 1006 | void KOTodoView::purgeCompleted() |
1007 | { | 1007 | { |
1008 | emit purgeCompletedSignal(); | 1008 | emit purgeCompletedSignal(); |
1009 | } | 1009 | } |
1010 | void KOTodoView::toggleQuickTodo() | 1010 | void KOTodoView::toggleQuickTodo() |
1011 | { | 1011 | { |
1012 | if ( mQuickAdd->isVisible() ) { | 1012 | if ( mQuickAdd->isVisible() ) { |
1013 | mQuickAdd->hide(); | 1013 | mQuickAdd->hide(); |
1014 | KOPrefs::instance()->mEnableQuickTodo = false; | 1014 | KOPrefs::instance()->mEnableQuickTodo = false; |
1015 | } | 1015 | } |
1016 | else { | 1016 | else { |
1017 | mQuickAdd->show(); | 1017 | mQuickAdd->show(); |
1018 | KOPrefs::instance()->mEnableQuickTodo = true; | 1018 | KOPrefs::instance()->mEnableQuickTodo = true; |
1019 | } | 1019 | } |
1020 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 1020 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
1021 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 1021 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | void KOTodoView::toggleRunning() | 1024 | void KOTodoView::toggleRunning() |
1025 | { | 1025 | { |
1026 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; | 1026 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; |
1027 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 1027 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
1028 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 1028 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
1029 | updateView(); | 1029 | updateView(); |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | void KOTodoView::toggleCompleted() | 1032 | void KOTodoView::toggleCompleted() |
1033 | { | 1033 | { |
1034 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; | 1034 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; |
1035 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 1035 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
1036 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 1036 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
1037 | updateView(); | 1037 | updateView(); |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | void KOTodoView::addQuickTodo() | 1040 | void KOTodoView::addQuickTodo() |
1041 | { | 1041 | { |
1042 | Todo *todo = new Todo(); | 1042 | Todo *todo = new Todo(); |
1043 | todo->setSummary(mQuickAdd->text()); | 1043 | todo->setSummary(mQuickAdd->text()); |
1044 | todo->setOrganizer(KOPrefs::instance()->email()); | 1044 | todo->setOrganizer(KOPrefs::instance()->email()); |
1045 | CalFilter * cf = mCalendar->filter(); | 1045 | CalFilter * cf = mCalendar->filter(); |
1046 | if ( cf ) { | 1046 | if ( cf ) { |
1047 | if ( cf->isEnabled()&& cf->showCategories()) { | 1047 | if ( cf->isEnabled()&& cf->showCategories()) { |
1048 | todo->setCategories(cf->categoryList()); | 1048 | todo->setCategories(cf->categoryList()); |
1049 | } | 1049 | } |
1050 | if ( cf->isEnabled() ) | 1050 | if ( cf->isEnabled() ) |
1051 | todo->setSecrecy( cf->getSecrecy()); | 1051 | todo->setSecrecy( cf->getSecrecy()); |
1052 | } | 1052 | } |
1053 | mCalendar->addTodo(todo); | 1053 | mCalendar->addTodo(todo); |
1054 | mQuickAdd->setText(""); | 1054 | mQuickAdd->setText(""); |
1055 | todoModified (todo, KOGlobals::EVENTADDED ); | 1055 | todoModified (todo, KOGlobals::EVENTADDED ); |
1056 | updateView(); | 1056 | updateView(); |
1057 | } | 1057 | } |
1058 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 1058 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
1059 | { | 1059 | { |
1060 | // e->ignore(); | 1060 | // e->ignore(); |
1061 | //return; | 1061 | //return; |
1062 | //qDebug("KOTodoView::keyPressEvent "); | 1062 | //qDebug("KOTodoView::keyPressEvent "); |
1063 | switch ( e->key() ) { | 1063 | switch ( e->key() ) { |
1064 | case Qt::Key_Down: | 1064 | case Qt::Key_Down: |
1065 | case Qt::Key_Up: | 1065 | case Qt::Key_Up: |
1066 | QWidget::keyPressEvent ( e ); | 1066 | QWidget::keyPressEvent ( e ); |
1067 | break; | 1067 | break; |
1068 | 1068 | ||
1069 | case Qt::Key_Q: | 1069 | case Qt::Key_Q: |
1070 | toggleQuickTodo(); | 1070 | toggleQuickTodo(); |
1071 | break; | 1071 | break; |
1072 | case Qt::Key_U: | 1072 | case Qt::Key_U: |
1073 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1073 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1074 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1074 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1075 | unparentTodo(); | 1075 | unparentTodo(); |
1076 | e->accept(); | 1076 | e->accept(); |
1077 | } else | 1077 | } else |
1078 | e->ignore(); | 1078 | e->ignore(); |
1079 | break; | 1079 | break; |
1080 | case Qt::Key_S: | 1080 | case Qt::Key_S: |
1081 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1081 | if ( e->state() == Qt::ControlButton ) { |
1082 | e->ignore(); | ||
1083 | break; | ||
1084 | } | ||
1085 | if ( e->state() == Qt::ShiftButton ) { | ||
1082 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1086 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1083 | reparentTodo(); | 1087 | reparentTodo(); |
1084 | e->accept(); | 1088 | e->accept(); |
1085 | } else | 1089 | } else |
1086 | e->ignore(); | 1090 | e->ignore(); |
1087 | break; | 1091 | break; |
1088 | case Qt::Key_P: | 1092 | case Qt::Key_P: |
1089 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1093 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1090 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1094 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1091 | if ( pendingSubtodo ) | 1095 | if ( pendingSubtodo ) |
1092 | itemClicked(mActiveItem); | 1096 | itemClicked(mActiveItem); |
1093 | e->accept(); | 1097 | e->accept(); |
1094 | } else | 1098 | } else |
1095 | e->ignore(); | 1099 | e->ignore(); |
1096 | break; | 1100 | break; |
1097 | case Qt::Key_Escape: | 1101 | case Qt::Key_Escape: |
1098 | if ( pendingSubtodo ) { | 1102 | if ( pendingSubtodo ) { |
1099 | itemClicked(0); | 1103 | itemClicked(0); |
1100 | e->accept(); | 1104 | e->accept(); |
1101 | } else | 1105 | } else |
1102 | e->ignore(); | 1106 | e->ignore(); |
1103 | break; | 1107 | break; |
1104 | default: | 1108 | default: |
1105 | e->ignore(); | 1109 | e->ignore(); |
1106 | } | 1110 | } |
1107 | 1111 | ||
1108 | if ( true ) { | 1112 | if ( true ) { |
1109 | if ( e->key() == Qt::Key_I ) { | 1113 | if ( e->key() == Qt::Key_I ) { |
1110 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); | 1114 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); |
1111 | if ( cn ) { | 1115 | if ( cn ) { |
1112 | mActiveItem = cn; | 1116 | mActiveItem = cn; |
1113 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 1117 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
1114 | if ( ci ){ | 1118 | if ( ci ){ |
1115 | showTodo(); | 1119 | showTodo(); |
1116 | cn = (KOTodoViewItem*)cn->itemBelow(); | 1120 | cn = (KOTodoViewItem*)cn->itemBelow(); |
1117 | if ( cn ) { | 1121 | if ( cn ) { |
1118 | mTodoListView->setCurrentItem ( cn ); | 1122 | mTodoListView->setCurrentItem ( cn ); |
1119 | mTodoListView->ensureItemVisible ( cn ); | 1123 | mTodoListView->ensureItemVisible ( cn ); |
1120 | } | 1124 | } |
1121 | 1125 | ||
1122 | } | 1126 | } |
1123 | } | 1127 | } |
1124 | e->accept(); | 1128 | e->accept(); |
1125 | 1129 | ||
1126 | } | 1130 | } |
1127 | 1131 | ||
1128 | } | 1132 | } |
1129 | 1133 | ||
1130 | } | 1134 | } |
1131 | void KOTodoView::updateTodo( Todo * t, int type ) | 1135 | void KOTodoView::updateTodo( Todo * t, int type ) |
1132 | { | 1136 | { |
1133 | if ( mBlockUpdate) | 1137 | if ( mBlockUpdate) |
1134 | return; | 1138 | return; |
1135 | 1139 | ||
1136 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 1140 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
1137 | itemIterator = mTodoMap.find(t); | 1141 | itemIterator = mTodoMap.find(t); |
1138 | if (itemIterator != mTodoMap.end()) { | 1142 | if (itemIterator != mTodoMap.end()) { |
1139 | (*itemIterator)->construct(); | 1143 | (*itemIterator)->construct(); |
1140 | } else { | 1144 | } else { |
1141 | if ( type == KOGlobals::EVENTADDED ) { | 1145 | if ( type == KOGlobals::EVENTADDED ) { |
1142 | insertTodoItem( t ); | 1146 | insertTodoItem( t ); |
1143 | } | 1147 | } |
1144 | } | 1148 | } |
1145 | 1149 | ||
1146 | } | 1150 | } |
1147 | 1151 | ||
1148 | void KOTodoView::todoModified(Todo * t , int p ) | 1152 | void KOTodoView::todoModified(Todo * t , int p ) |
1149 | { | 1153 | { |
1150 | mBlockUpdate = true; | 1154 | mBlockUpdate = true; |
1151 | emit todoModifiedSignal ( t, p ); | 1155 | emit todoModifiedSignal ( t, p ); |
1152 | mBlockUpdate = false; | 1156 | mBlockUpdate = false; |
1153 | } | 1157 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index a652c05..6bc5b3a 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -369,434 +369,435 @@ void MainWindow::closeEvent( QCloseEvent* ce ) | |||
369 | switch( QMessageBox::information( this, "KO/Pi", | 369 | switch( QMessageBox::information( this, "KO/Pi", |
370 | i18n("Do you really want\nto close KO/Pi?"), | 370 | i18n("Do you really want\nto close KO/Pi?"), |
371 | i18n("Close"), i18n("No"), | 371 | i18n("Close"), i18n("No"), |
372 | 0, 0 ) ) { | 372 | 0, 0 ) ) { |
373 | case 0: | 373 | case 0: |
374 | saveOnClose(); | 374 | saveOnClose(); |
375 | mClosed = true; | 375 | mClosed = true; |
376 | ce->accept(); | 376 | ce->accept(); |
377 | break; | 377 | break; |
378 | case 1: | 378 | case 1: |
379 | ce->ignore(); | 379 | ce->ignore(); |
380 | break; | 380 | break; |
381 | case 2: | 381 | case 2: |
382 | 382 | ||
383 | default: | 383 | default: |
384 | break; | 384 | break; |
385 | } | 385 | } |
386 | 386 | ||
387 | 387 | ||
388 | } | 388 | } |
389 | 389 | ||
390 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 390 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
391 | { | 391 | { |
392 | QDataStream stream( data, IO_ReadOnly ); | 392 | QDataStream stream( data, IO_ReadOnly ); |
393 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 393 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
394 | //QString datamess; | 394 | //QString datamess; |
395 | //qDebug("message "); | 395 | //qDebug("message "); |
396 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 396 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
397 | 397 | ||
398 | if ( cmsg == "setDocument(QString)" ) { | 398 | if ( cmsg == "setDocument(QString)" ) { |
399 | QDataStream stream( data, IO_ReadOnly ); | 399 | QDataStream stream( data, IO_ReadOnly ); |
400 | QString fileName; | 400 | QString fileName; |
401 | stream >> fileName; | 401 | stream >> fileName; |
402 | //qDebug("filename %s ", fileName.latin1()); | 402 | //qDebug("filename %s ", fileName.latin1()); |
403 | showMaximized(); | 403 | showMaximized(); |
404 | raise(); | 404 | raise(); |
405 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 405 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
406 | mSyncManager->slotSyncMenu( 1002 ); | 406 | mSyncManager->slotSyncMenu( 1002 ); |
407 | return; | 407 | return; |
408 | } | 408 | } |
409 | 409 | ||
410 | if ( cmsg == "-writeFile" ) { | 410 | if ( cmsg == "-writeFile" ) { |
411 | // I made from the "-writeFile" an "-writeAlarm" | 411 | // I made from the "-writeFile" an "-writeAlarm" |
412 | mView->viewManager()->showWhatsNextView(); | 412 | mView->viewManager()->showWhatsNextView(); |
413 | mCalendar->checkAlarmForIncidence( 0, true); | 413 | mCalendar->checkAlarmForIncidence( 0, true); |
414 | showMaximized(); | 414 | showMaximized(); |
415 | raise(); | 415 | raise(); |
416 | return; | 416 | return; |
417 | 417 | ||
418 | } | 418 | } |
419 | if ( cmsg == "-writeFileSilent" ) { | 419 | if ( cmsg == "-writeFileSilent" ) { |
420 | // I made from the "-writeFile" an "-writeAlarm" | 420 | // I made from the "-writeFile" an "-writeAlarm" |
421 | // mView->viewManager()->showWhatsNextView(); | 421 | // mView->viewManager()->showWhatsNextView(); |
422 | mCalendar->checkAlarmForIncidence( 0, true); | 422 | mCalendar->checkAlarmForIncidence( 0, true); |
423 | //showMaximized(); | 423 | //showMaximized(); |
424 | //raise(); | 424 | //raise(); |
425 | hide(); | 425 | hide(); |
426 | return; | 426 | return; |
427 | } | 427 | } |
428 | if ( cmsg == "-newCountdown" ) { | 428 | if ( cmsg == "-newCountdown" ) { |
429 | qDebug("newCountdown "); | 429 | qDebug("newCountdown "); |
430 | 430 | ||
431 | } | 431 | } |
432 | QString msg ; | 432 | QString msg ; |
433 | QString allmsg = cmsg; | 433 | QString allmsg = cmsg; |
434 | while ( allmsg.length() > 0 ) { | 434 | while ( allmsg.length() > 0 ) { |
435 | int nextC = allmsg.find( "-", 1 ); | 435 | int nextC = allmsg.find( "-", 1 ); |
436 | if ( nextC == -1 ) { | 436 | if ( nextC == -1 ) { |
437 | msg = allmsg; | 437 | msg = allmsg; |
438 | allmsg = ""; | 438 | allmsg = ""; |
439 | } else{ | 439 | } else{ |
440 | msg = allmsg.left( nextC ); | 440 | msg = allmsg.left( nextC ); |
441 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 441 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
442 | } | 442 | } |
443 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 443 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
444 | if ( msg == "-newEvent" ) { | 444 | if ( msg == "-newEvent" ) { |
445 | mView->newEvent(); | 445 | mView->newEvent(); |
446 | } | 446 | } |
447 | if ( msg == "-newTodo" ) { | 447 | if ( msg == "-newTodo" ) { |
448 | mView->newTodo(); | 448 | mView->newTodo(); |
449 | 449 | ||
450 | } | 450 | } |
451 | if ( msg == "-showWN" ) { | 451 | if ( msg == "-showWN" ) { |
452 | mView->viewManager()->showWhatsNextView(); | 452 | mView->viewManager()->showWhatsNextView(); |
453 | } | 453 | } |
454 | if ( msg == "-showTodo" ) { | 454 | if ( msg == "-showTodo" ) { |
455 | mView->viewManager()->showTodoView(); | 455 | mView->viewManager()->showTodoView(); |
456 | } | 456 | } |
457 | if ( msg == "-showList" ) { | 457 | if ( msg == "-showList" ) { |
458 | mView->viewManager()->showListView(); | 458 | mView->viewManager()->showListView(); |
459 | } | 459 | } |
460 | else if ( msg == "-showDay" ) { | 460 | else if ( msg == "-showDay" ) { |
461 | mView->viewManager()->showDayView(); | 461 | mView->viewManager()->showDayView(); |
462 | } | 462 | } |
463 | else if ( msg == "-showWWeek" ) { | 463 | else if ( msg == "-showWWeek" ) { |
464 | mView->viewManager()->showWorkWeekView(); | 464 | mView->viewManager()->showWorkWeekView(); |
465 | } | 465 | } |
466 | else if ( msg == "-ringSync" ) { | 466 | else if ( msg == "-ringSync" ) { |
467 | mSyncManager->multiSync( false ); | 467 | mSyncManager->multiSync( false ); |
468 | } | 468 | } |
469 | else if ( msg == "-showWeek" ) { | 469 | else if ( msg == "-showWeek" ) { |
470 | mView->viewManager()->showWeekView(); | 470 | mView->viewManager()->showWeekView(); |
471 | } | 471 | } |
472 | else if ( msg == "-showTodo" ) { | 472 | else if ( msg == "-showTodo" ) { |
473 | mView->viewManager()->showTodoView(); | 473 | mView->viewManager()->showTodoView(); |
474 | } | 474 | } |
475 | else if ( msg == "-showJournal" ) { | 475 | else if ( msg == "-showJournal" ) { |
476 | mView->dateNavigator()->selectDates( 1 ); | 476 | mView->dateNavigator()->selectDates( 1 ); |
477 | mView->dateNavigator()->selectToday(); | 477 | mView->dateNavigator()->selectToday(); |
478 | mView->viewManager()->showJournalView(); | 478 | mView->viewManager()->showJournalView(); |
479 | } | 479 | } |
480 | else if ( msg == "-showKO" ) { | 480 | else if ( msg == "-showKO" ) { |
481 | mView->viewManager()->showNextXView(); | 481 | mView->viewManager()->showNextXView(); |
482 | } | 482 | } |
483 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 483 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
484 | mView->viewManager()->showWhatsNextView(); | 484 | mView->viewManager()->showWhatsNextView(); |
485 | } | 485 | } |
486 | else if ( msg == "-showNextXView" ) { | 486 | else if ( msg == "-showNextXView" ) { |
487 | mView->viewManager()->showNextXView(); | 487 | mView->viewManager()->showNextXView(); |
488 | } | 488 | } |
489 | 489 | ||
490 | 490 | ||
491 | } | 491 | } |
492 | 492 | ||
493 | showMaximized(); | 493 | showMaximized(); |
494 | raise(); | 494 | raise(); |
495 | } | 495 | } |
496 | 496 | ||
497 | QPixmap MainWindow::loadPixmap( QString name ) | 497 | QPixmap MainWindow::loadPixmap( QString name ) |
498 | { | 498 | { |
499 | return SmallIcon( name ); | 499 | return SmallIcon( name ); |
500 | 500 | ||
501 | } | 501 | } |
502 | void MainWindow::initActions() | 502 | void MainWindow::initActions() |
503 | { | 503 | { |
504 | //KOPrefs::instance()->mShowFullMenu | 504 | //KOPrefs::instance()->mShowFullMenu |
505 | iconToolBar->clear(); | 505 | iconToolBar->clear(); |
506 | KOPrefs *p = KOPrefs::instance(); | 506 | KOPrefs *p = KOPrefs::instance(); |
507 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 507 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
508 | 508 | ||
509 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 509 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
510 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 510 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
511 | QPopupMenu *importMenu = new QPopupMenu( this ); | 511 | QPopupMenu *importMenu = new QPopupMenu( this ); |
512 | selectFilterMenu = new QPopupMenu( this ); | 512 | selectFilterMenu = new QPopupMenu( this ); |
513 | selectFilterMenu->setCheckable( true ); | 513 | selectFilterMenu->setCheckable( true ); |
514 | syncMenu = new QPopupMenu( this ); | 514 | syncMenu = new QPopupMenu( this ); |
515 | configureAgendaMenu = new QPopupMenu( this ); | 515 | configureAgendaMenu = new QPopupMenu( this ); |
516 | configureToolBarMenu = new QPopupMenu( this ); | 516 | configureToolBarMenu = new QPopupMenu( this ); |
517 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 517 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
518 | if ( KOPrefs::instance()->mShowFullMenu ) { | 518 | if ( KOPrefs::instance()->mShowFullMenu ) { |
519 | QMenuBar *menuBar1; | 519 | QMenuBar *menuBar1; |
520 | menuBar1 = menuBar(); | 520 | menuBar1 = menuBar(); |
521 | menuBar1->insertItem( i18n("File"), importMenu ); | 521 | menuBar1->insertItem( i18n("File"), importMenu ); |
522 | menuBar1->insertItem( i18n("View"), viewMenu ); | 522 | menuBar1->insertItem( i18n("View"), viewMenu ); |
523 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 523 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
524 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 524 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
525 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 525 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
526 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 526 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
527 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 527 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
528 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 528 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
529 | } else { | 529 | } else { |
530 | QPEMenuBar *menuBar1; | 530 | QPEMenuBar *menuBar1; |
531 | menuBar1 = new QPEMenuBar( iconToolBar ); | 531 | menuBar1 = new QPEMenuBar( iconToolBar ); |
532 | QPopupMenu *menuBar = new QPopupMenu( this ); | 532 | QPopupMenu *menuBar = new QPopupMenu( this ); |
533 | menuBar1->insertItem( i18n("ME"), menuBar); | 533 | menuBar1->insertItem( i18n("ME"), menuBar); |
534 | menuBar->insertItem( i18n("File"), importMenu ); | 534 | menuBar->insertItem( i18n("File"), importMenu ); |
535 | menuBar->insertItem( i18n("View"), viewMenu ); | 535 | menuBar->insertItem( i18n("View"), viewMenu ); |
536 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 536 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
537 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 537 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
538 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 538 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
539 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 539 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
540 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 540 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
541 | menuBar->insertItem( i18n("Help"), helpMenu ); | 541 | menuBar->insertItem( i18n("Help"), helpMenu ); |
542 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 542 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
543 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 543 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
544 | } | 544 | } |
545 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 545 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
546 | connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); | 546 | connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); |
547 | 547 | ||
548 | // ****************** | 548 | // ****************** |
549 | QAction *action; | 549 | QAction *action; |
550 | QIconSet icon; | 550 | QIconSet icon; |
551 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 551 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
552 | configureToolBarMenu->setCheckable( true ); | 552 | configureToolBarMenu->setCheckable( true ); |
553 | 553 | ||
554 | QString pathString = ""; | 554 | QString pathString = ""; |
555 | if ( !p->mToolBarMiniIcons ) { | 555 | if ( !p->mToolBarMiniIcons ) { |
556 | if ( QApplication::desktop()->width() < 480 ) | 556 | if ( QApplication::desktop()->width() < 480 ) |
557 | pathString += "icons16/"; | 557 | pathString += "icons16/"; |
558 | } else | 558 | } else |
559 | pathString += "iconsmini/"; | 559 | pathString += "iconsmini/"; |
560 | configureAgendaMenu->setCheckable( true ); | 560 | configureAgendaMenu->setCheckable( true ); |
561 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); | ||
562 | configureAgendaMenu->insertSeparator(); | ||
563 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); | 561 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); |
564 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); | 562 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); |
565 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); | 563 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); |
566 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); | 564 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); |
567 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); | 565 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); |
568 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); | 566 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); |
569 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); | 567 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); |
570 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); | 568 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); |
571 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 569 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
572 | 570 | ||
573 | icon = loadPixmap( pathString + "configure" ); | 571 | icon = loadPixmap( pathString + "configure" ); |
574 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 572 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
575 | action->addTo( actionMenu ); | 573 | action->addTo( actionMenu ); |
576 | connect( action, SIGNAL( activated() ), | 574 | connect( action, SIGNAL( activated() ), |
577 | mView, SLOT( edit_options() ) ); | 575 | mView, SLOT( edit_options() ) ); |
578 | actionMenu->insertSeparator(); | 576 | actionMenu->insertSeparator(); |
579 | 577 | ||
580 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 578 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
581 | action->addTo( actionMenu ); | 579 | action->addTo( actionMenu ); |
582 | connect( action, SIGNAL( activated() ), | 580 | connect( action, SIGNAL( activated() ), |
583 | mView, SLOT( undo_delete() ) ); | 581 | mView, SLOT( undo_delete() ) ); |
584 | actionMenu->insertSeparator(); | 582 | actionMenu->insertSeparator(); |
585 | 583 | ||
586 | icon = loadPixmap( pathString + "newevent" ); | 584 | icon = loadPixmap( pathString + "newevent" ); |
587 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 585 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
588 | configureToolBarMenu->insertSeparator(); | 586 | configureToolBarMenu->insertSeparator(); |
589 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 587 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
590 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 588 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
591 | ne_action->addTo( actionMenu ); | 589 | ne_action->addTo( actionMenu ); |
592 | connect( ne_action, SIGNAL( activated() ), | 590 | connect( ne_action, SIGNAL( activated() ), |
593 | mView, SLOT( newEvent() ) ); | 591 | mView, SLOT( newEvent() ) ); |
594 | icon = loadPixmap( pathString + "newtodo" ); | 592 | icon = loadPixmap( pathString + "newtodo" ); |
595 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 593 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
596 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 594 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
597 | nt_action->addTo( actionMenu ); | 595 | nt_action->addTo( actionMenu ); |
598 | connect( nt_action, SIGNAL( activated() ), | 596 | connect( nt_action, SIGNAL( activated() ), |
599 | mView, SLOT( newTodo() ) ); | 597 | mView, SLOT( newTodo() ) ); |
600 | icon = loadPixmap( pathString + "navi" ); | 598 | icon = loadPixmap( pathString + "navi" ); |
601 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 599 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
602 | action->addTo( viewMenu ); | 600 | action->addTo( viewMenu ); |
603 | connect( action, SIGNAL( activated() ), | 601 | connect( action, SIGNAL( activated() ), |
604 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 602 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
605 | icon = loadPixmap( pathString + "filter" ); | 603 | icon = loadPixmap( pathString + "filter" ); |
606 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 604 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
607 | action->addTo( viewMenu ); | 605 | action->addTo( viewMenu ); |
608 | connect( action, SIGNAL( activated() ), | 606 | connect( action, SIGNAL( activated() ), |
609 | mView, SLOT( toggleFilter() ) ); | 607 | mView, SLOT( toggleFilter() ) ); |
610 | 608 | action = new QAction( i18n("Toggle Allday"), i18n("Toggle Allday"), 0, this ); | |
609 | action->addTo( viewMenu ); | ||
610 | connect( action, SIGNAL( activated() ), | ||
611 | mView, SLOT( toggleAllDaySize() ) ); | ||
611 | 612 | ||
612 | viewMenu->insertSeparator(); | 613 | viewMenu->insertSeparator(); |
613 | icon = loadPixmap( pathString + "picker" ); | 614 | icon = loadPixmap( pathString + "picker" ); |
614 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 615 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
615 | action->addTo( viewMenu ); | 616 | action->addTo( viewMenu ); |
616 | connect( action, SIGNAL( activated() ), | 617 | connect( action, SIGNAL( activated() ), |
617 | mView, SLOT( showDatePicker() ) ); | 618 | mView, SLOT( showDatePicker() ) ); |
618 | action->addTo( iconToolBar ); | 619 | action->addTo( iconToolBar ); |
619 | viewMenu->insertSeparator(); | 620 | viewMenu->insertSeparator(); |
620 | icon = loadPixmap( pathString + "list" ); | 621 | icon = loadPixmap( pathString + "list" ); |
621 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 622 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
622 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 623 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
623 | showlist_action->addTo( viewMenu ); | 624 | showlist_action->addTo( viewMenu ); |
624 | connect( showlist_action, SIGNAL( activated() ), | 625 | connect( showlist_action, SIGNAL( activated() ), |
625 | mView->viewManager(), SLOT( showListView() ) ); | 626 | mView->viewManager(), SLOT( showListView() ) ); |
626 | 627 | ||
627 | 628 | ||
628 | icon = loadPixmap( pathString + "day" ); | 629 | icon = loadPixmap( pathString + "day" ); |
629 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 630 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
630 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 631 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
631 | day1_action->addTo( viewMenu ); | 632 | day1_action->addTo( viewMenu ); |
632 | // action->addTo( toolBar ); | 633 | // action->addTo( toolBar ); |
633 | connect( day1_action, SIGNAL( activated() ), | 634 | connect( day1_action, SIGNAL( activated() ), |
634 | mView->viewManager(), SLOT( showDayView() ) ); | 635 | mView->viewManager(), SLOT( showDayView() ) ); |
635 | 636 | ||
636 | icon = loadPixmap( pathString + "workweek" ); | 637 | icon = loadPixmap( pathString + "workweek" ); |
637 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 638 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
638 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 639 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
639 | day5_action->addTo( viewMenu ); | 640 | day5_action->addTo( viewMenu ); |
640 | connect( day5_action, SIGNAL( activated() ), | 641 | connect( day5_action, SIGNAL( activated() ), |
641 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 642 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
642 | 643 | ||
643 | icon = loadPixmap( pathString + "week" ); | 644 | icon = loadPixmap( pathString + "week" ); |
644 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 645 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
645 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 646 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
646 | day7_action->addTo( viewMenu ); | 647 | day7_action->addTo( viewMenu ); |
647 | connect( day7_action, SIGNAL( activated() ), | 648 | connect( day7_action, SIGNAL( activated() ), |
648 | mView->viewManager(), SLOT( showWeekView() ) ); | 649 | mView->viewManager(), SLOT( showWeekView() ) ); |
649 | 650 | ||
650 | icon = loadPixmap( pathString + "month" ); | 651 | icon = loadPixmap( pathString + "month" ); |
651 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 652 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
652 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 653 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
653 | month_action->addTo( viewMenu ); | 654 | month_action->addTo( viewMenu ); |
654 | connect( month_action, SIGNAL( activated() ), | 655 | connect( month_action, SIGNAL( activated() ), |
655 | mView->viewManager(), SLOT( showMonthView() ) ); | 656 | mView->viewManager(), SLOT( showMonthView() ) ); |
656 | 657 | ||
657 | icon = loadPixmap( pathString + "todo" ); | 658 | icon = loadPixmap( pathString + "todo" ); |
658 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 659 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
659 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 660 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
660 | todoview_action->addTo( viewMenu ); | 661 | todoview_action->addTo( viewMenu ); |
661 | connect( todoview_action, SIGNAL( activated() ), | 662 | connect( todoview_action, SIGNAL( activated() ), |
662 | mView->viewManager(), SLOT( showTodoView() ) ); | 663 | mView->viewManager(), SLOT( showTodoView() ) ); |
663 | 664 | ||
664 | icon = loadPixmap( pathString + "journal" ); | 665 | icon = loadPixmap( pathString + "journal" ); |
665 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 666 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
666 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 667 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
667 | viewjournal_action->addTo( viewMenu ); | 668 | viewjournal_action->addTo( viewMenu ); |
668 | connect( viewjournal_action, SIGNAL( activated() ), | 669 | connect( viewjournal_action, SIGNAL( activated() ), |
669 | mView->viewManager(), SLOT( showJournalView() ) ); | 670 | mView->viewManager(), SLOT( showJournalView() ) ); |
670 | 671 | ||
671 | icon = loadPixmap( pathString + "xdays" ); | 672 | icon = loadPixmap( pathString + "xdays" ); |
672 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 673 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
673 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 674 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
674 | xdays_action->addTo( viewMenu ); | 675 | xdays_action->addTo( viewMenu ); |
675 | connect( xdays_action, SIGNAL( activated() ), | 676 | connect( xdays_action, SIGNAL( activated() ), |
676 | mView->viewManager(), SLOT( showNextXView() ) ); | 677 | mView->viewManager(), SLOT( showNextXView() ) ); |
677 | 678 | ||
678 | icon = loadPixmap( pathString + "whatsnext" ); | 679 | icon = loadPixmap( pathString + "whatsnext" ); |
679 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 680 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
680 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 681 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
681 | whatsnext_action->addTo( viewMenu ); | 682 | whatsnext_action->addTo( viewMenu ); |
682 | connect( whatsnext_action, SIGNAL( activated() ), | 683 | connect( whatsnext_action, SIGNAL( activated() ), |
683 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 684 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
684 | 685 | ||
685 | #if 0 | 686 | #if 0 |
686 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 687 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
687 | action->addTo( viewMenu ); | 688 | action->addTo( viewMenu ); |
688 | connect( action, SIGNAL( activated() ), | 689 | connect( action, SIGNAL( activated() ), |
689 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 690 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
690 | #endif | 691 | #endif |
691 | 692 | ||
692 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 693 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
693 | this ); | 694 | this ); |
694 | mNewSubTodoAction->addTo( actionMenu ); | 695 | mNewSubTodoAction->addTo( actionMenu ); |
695 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 696 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
696 | mView, SLOT( newSubTodo() ) ); | 697 | mView, SLOT( newSubTodo() ) ); |
697 | 698 | ||
698 | actionMenu->insertSeparator(); | 699 | actionMenu->insertSeparator(); |
699 | 700 | ||
700 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 701 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
701 | mShowAction->addTo( actionMenu ); | 702 | mShowAction->addTo( actionMenu ); |
702 | connect( mShowAction, SIGNAL( activated() ), | 703 | connect( mShowAction, SIGNAL( activated() ), |
703 | mView, SLOT( showIncidence() ) ); | 704 | mView, SLOT( showIncidence() ) ); |
704 | 705 | ||
705 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 706 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
706 | mEditAction->addTo( actionMenu ); | 707 | mEditAction->addTo( actionMenu ); |
707 | connect( mEditAction, SIGNAL( activated() ), | 708 | connect( mEditAction, SIGNAL( activated() ), |
708 | mView, SLOT( editIncidence() ) ); | 709 | mView, SLOT( editIncidence() ) ); |
709 | 710 | ||
710 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 711 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
711 | mDeleteAction->addTo( actionMenu ); | 712 | mDeleteAction->addTo( actionMenu ); |
712 | connect( mDeleteAction, SIGNAL( activated() ), | 713 | connect( mDeleteAction, SIGNAL( activated() ), |
713 | mView, SLOT( deleteIncidence() ) ); | 714 | mView, SLOT( deleteIncidence() ) ); |
714 | 715 | ||
715 | 716 | ||
716 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 717 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
717 | mCloneAction->addTo( actionMenu ); | 718 | mCloneAction->addTo( actionMenu ); |
718 | connect( mCloneAction, SIGNAL( activated() ), | 719 | connect( mCloneAction, SIGNAL( activated() ), |
719 | mView, SLOT( cloneIncidence() ) ); | 720 | mView, SLOT( cloneIncidence() ) ); |
720 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 721 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
721 | mMoveAction->addTo( actionMenu ); | 722 | mMoveAction->addTo( actionMenu ); |
722 | connect( mMoveAction, SIGNAL( activated() ), | 723 | connect( mMoveAction, SIGNAL( activated() ), |
723 | mView, SLOT( moveIncidence() ) ); | 724 | mView, SLOT( moveIncidence() ) ); |
724 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 725 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
725 | mBeamAction->addTo( actionMenu ); | 726 | mBeamAction->addTo( actionMenu ); |
726 | connect( mBeamAction, SIGNAL( activated() ), | 727 | connect( mBeamAction, SIGNAL( activated() ), |
727 | mView, SLOT( beamIncidence() ) ); | 728 | mView, SLOT( beamIncidence() ) ); |
728 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 729 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
729 | mCancelAction->addTo( actionMenu ); | 730 | mCancelAction->addTo( actionMenu ); |
730 | connect( mCancelAction, SIGNAL( activated() ), | 731 | connect( mCancelAction, SIGNAL( activated() ), |
731 | mView, SLOT( toggleCancelIncidence() ) ); | 732 | mView, SLOT( toggleCancelIncidence() ) ); |
732 | 733 | ||
733 | actionMenu->insertSeparator(); | 734 | actionMenu->insertSeparator(); |
734 | 735 | ||
735 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 736 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
736 | this ); | 737 | this ); |
737 | action->addTo( actionMenu ); | 738 | action->addTo( actionMenu ); |
738 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 739 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
739 | 740 | ||
740 | icon = loadPixmap( pathString + "search" ); | 741 | icon = loadPixmap( pathString + "search" ); |
741 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 742 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
742 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 743 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
743 | search_action->addTo( actionMenu ); | 744 | search_action->addTo( actionMenu ); |
744 | connect( search_action, SIGNAL( activated() ), | 745 | connect( search_action, SIGNAL( activated() ), |
745 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 746 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
746 | 747 | ||
747 | icon = loadPixmap( pathString + "today" ); | 748 | icon = loadPixmap( pathString + "today" ); |
748 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 749 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
749 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 750 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
750 | today_action->addTo( actionMenu ); | 751 | today_action->addTo( actionMenu ); |
751 | connect( today_action, SIGNAL( activated() ), | 752 | connect( today_action, SIGNAL( activated() ), |
752 | mView, SLOT( goToday() ) ); | 753 | mView, SLOT( goToday() ) ); |
753 | 754 | ||
754 | if ( KOPrefs::instance()->mShowFullMenu ) { | 755 | if ( KOPrefs::instance()->mShowFullMenu ) { |
755 | actionMenu->insertSeparator(); | 756 | actionMenu->insertSeparator(); |
756 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 757 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
757 | 758 | ||
758 | } | 759 | } |
759 | // actionMenu->insertSeparator(); | 760 | // actionMenu->insertSeparator(); |
760 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 761 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
761 | this ); | 762 | this ); |
762 | action->addTo( importMenu ); | 763 | action->addTo( importMenu ); |
763 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 764 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
764 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 765 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
765 | this ); | 766 | this ); |
766 | action->addTo( importMenu ); | 767 | action->addTo( importMenu ); |
767 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 768 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
768 | importMenu->insertSeparator(); | 769 | importMenu->insertSeparator(); |
769 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 770 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
770 | this ); | 771 | this ); |
771 | action->addTo( importMenu ); | 772 | action->addTo( importMenu ); |
772 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 773 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
773 | #ifndef DESKTOP_VERSION | 774 | #ifndef DESKTOP_VERSION |
774 | importMenu->insertSeparator(); | 775 | importMenu->insertSeparator(); |
775 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 776 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
776 | this ); | 777 | this ); |
777 | action->addTo( importMenu ); | 778 | action->addTo( importMenu ); |
778 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 779 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
779 | #else | 780 | #else |
780 | #ifdef _WIN32_ | 781 | #ifdef _WIN32_ |
781 | importMenu->insertSeparator(); | 782 | importMenu->insertSeparator(); |
782 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 783 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
783 | this ); | 784 | this ); |
784 | action->addTo( importMenu ); | 785 | action->addTo( importMenu ); |
785 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 786 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
786 | #endif | 787 | #endif |
787 | #endif | 788 | #endif |
788 | 789 | ||
789 | importMenu->insertSeparator(); | 790 | importMenu->insertSeparator(); |
790 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 791 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
791 | this ); | 792 | this ); |
792 | action->addTo( importMenu ); | 793 | action->addTo( importMenu ); |
793 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 794 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
794 | 795 | ||
795 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 796 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
796 | this ); | 797 | this ); |
797 | action->addTo( importMenu ); | 798 | action->addTo( importMenu ); |
798 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 799 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
799 | 800 | ||
800 | importMenu->insertSeparator(); | 801 | importMenu->insertSeparator(); |
801 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 802 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
802 | this ); | 803 | this ); |
@@ -949,520 +950,500 @@ void MainWindow::initActions() | |||
949 | mView, SLOT( goPreviousMonth() ) ); | 950 | mView, SLOT( goPreviousMonth() ) ); |
950 | action->addTo( iconToolBar ); | 951 | action->addTo( iconToolBar ); |
951 | } | 952 | } |
952 | icon = loadPixmap( pathString + "1leftarrowB" ); | 953 | icon = loadPixmap( pathString + "1leftarrowB" ); |
953 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 954 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
954 | if (p-> mShowIconBack) { | 955 | if (p-> mShowIconBack) { |
955 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 956 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
956 | connect( action, SIGNAL( activated() ), | 957 | connect( action, SIGNAL( activated() ), |
957 | mView, SLOT( goPrevious() ) ); | 958 | mView, SLOT( goPrevious() ) ); |
958 | action->addTo( iconToolBar ); | 959 | action->addTo( iconToolBar ); |
959 | } | 960 | } |
960 | if (p-> mShowIconToday) | 961 | if (p-> mShowIconToday) |
961 | today_action->addTo( iconToolBar ); | 962 | today_action->addTo( iconToolBar ); |
962 | icon = loadPixmap( pathString + "1rightarrowB" ); | 963 | icon = loadPixmap( pathString + "1rightarrowB" ); |
963 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 964 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
964 | if (p-> mShowIconForward) { | 965 | if (p-> mShowIconForward) { |
965 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 966 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
966 | connect( action, SIGNAL( activated() ), | 967 | connect( action, SIGNAL( activated() ), |
967 | mView, SLOT( goNext() ) ); | 968 | mView, SLOT( goNext() ) ); |
968 | action->addTo( iconToolBar ); | 969 | action->addTo( iconToolBar ); |
969 | } | 970 | } |
970 | icon = loadPixmap( pathString + "2rightarrowB" ); | 971 | icon = loadPixmap( pathString + "2rightarrowB" ); |
971 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 972 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
972 | if (p-> mShowIconForwardFast) { | 973 | if (p-> mShowIconForwardFast) { |
973 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 974 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
974 | connect( action, SIGNAL( activated() ), | 975 | connect( action, SIGNAL( activated() ), |
975 | mView, SLOT( goNextMonth() ) ); | 976 | mView, SLOT( goNextMonth() ) ); |
976 | action->addTo( iconToolBar ); | 977 | action->addTo( iconToolBar ); |
977 | } | 978 | } |
978 | 979 | ||
979 | 980 | ||
980 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 981 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
981 | 982 | ||
982 | if (p-> mShowIconNewEvent) | 983 | if (p-> mShowIconNewEvent) |
983 | configureToolBarMenu->setItemChecked( 10, true ); | 984 | configureToolBarMenu->setItemChecked( 10, true ); |
984 | if (p->mShowIconNewTodo ) | 985 | if (p->mShowIconNewTodo ) |
985 | configureToolBarMenu->setItemChecked( 20, true ); | 986 | configureToolBarMenu->setItemChecked( 20, true ); |
986 | if (p-> mShowIconSearch) | 987 | if (p-> mShowIconSearch) |
987 | configureToolBarMenu->setItemChecked( 120, true ); | 988 | configureToolBarMenu->setItemChecked( 120, true ); |
988 | if (p-> mShowIconList) | 989 | if (p-> mShowIconList) |
989 | configureToolBarMenu->setItemChecked( 30, true ); | 990 | configureToolBarMenu->setItemChecked( 30, true ); |
990 | if (p-> mShowIconDay1) | 991 | if (p-> mShowIconDay1) |
991 | configureToolBarMenu->setItemChecked( 40, true ); | 992 | configureToolBarMenu->setItemChecked( 40, true ); |
992 | if (p-> mShowIconDay5) | 993 | if (p-> mShowIconDay5) |
993 | configureToolBarMenu->setItemChecked( 50, true ); | 994 | configureToolBarMenu->setItemChecked( 50, true ); |
994 | if (p-> mShowIconDay7) | 995 | if (p-> mShowIconDay7) |
995 | configureToolBarMenu->setItemChecked( 60, true ); | 996 | configureToolBarMenu->setItemChecked( 60, true ); |
996 | if (p-> mShowIconMonth) | 997 | if (p-> mShowIconMonth) |
997 | configureToolBarMenu->setItemChecked( 70, true ); | 998 | configureToolBarMenu->setItemChecked( 70, true ); |
998 | if (p-> mShowIconTodoview) | 999 | if (p-> mShowIconTodoview) |
999 | configureToolBarMenu->setItemChecked( 80, true ); | 1000 | configureToolBarMenu->setItemChecked( 80, true ); |
1000 | if (p-> mShowIconBackFast) | 1001 | if (p-> mShowIconBackFast) |
1001 | configureToolBarMenu->setItemChecked( 200, true ); | 1002 | configureToolBarMenu->setItemChecked( 200, true ); |
1002 | if (p-> mShowIconBack) | 1003 | if (p-> mShowIconBack) |
1003 | configureToolBarMenu->setItemChecked( 210, true ); | 1004 | configureToolBarMenu->setItemChecked( 210, true ); |
1004 | if (p-> mShowIconToday) | 1005 | if (p-> mShowIconToday) |
1005 | configureToolBarMenu->setItemChecked( 130, true ); | 1006 | configureToolBarMenu->setItemChecked( 130, true ); |
1006 | if (p-> mShowIconForward) | 1007 | if (p-> mShowIconForward) |
1007 | configureToolBarMenu->setItemChecked( 220, true ); | 1008 | configureToolBarMenu->setItemChecked( 220, true ); |
1008 | if (p-> mShowIconForwardFast) | 1009 | if (p-> mShowIconForwardFast) |
1009 | configureToolBarMenu->setItemChecked( 230, true ); | 1010 | configureToolBarMenu->setItemChecked( 230, true ); |
1010 | if (p-> mShowIconNextDays) | 1011 | if (p-> mShowIconNextDays) |
1011 | configureToolBarMenu->setItemChecked( 100, true ); | 1012 | configureToolBarMenu->setItemChecked( 100, true ); |
1012 | if (p-> mShowIconNext) | 1013 | if (p-> mShowIconNext) |
1013 | configureToolBarMenu->setItemChecked( 110, true ); | 1014 | configureToolBarMenu->setItemChecked( 110, true ); |
1014 | if (p-> mShowIconJournal) | 1015 | if (p-> mShowIconJournal) |
1015 | configureToolBarMenu->setItemChecked( 90, true ); | 1016 | configureToolBarMenu->setItemChecked( 90, true ); |
1016 | if (p-> mShowIconWhatsThis) | 1017 | if (p-> mShowIconWhatsThis) |
1017 | configureToolBarMenu->setItemChecked( 300, true ); | 1018 | configureToolBarMenu->setItemChecked( 300, true ); |
1018 | 1019 | ||
1019 | QLabel* dummy = new QLabel( iconToolBar ); | 1020 | QLabel* dummy = new QLabel( iconToolBar ); |
1020 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1021 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1021 | if (!p-> mShowIconStretch) | 1022 | if (!p-> mShowIconStretch) |
1022 | iconToolBar->setStretchableWidget ( dummy ) ; | 1023 | iconToolBar->setStretchableWidget ( dummy ) ; |
1023 | else | 1024 | else |
1024 | configureToolBarMenu->setItemChecked( 5, true ); | 1025 | configureToolBarMenu->setItemChecked( 5, true ); |
1025 | if (p-> mShowIconWhatsThis) | 1026 | if (p-> mShowIconWhatsThis) |
1026 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1027 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1027 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1028 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1028 | configureAgenda( p->mHourSize ); | 1029 | configureAgenda( p->mHourSize ); |
1029 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1030 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1030 | } | 1031 | } |
1031 | 1032 | ||
1032 | void MainWindow::exportToPhone( int mode ) | 1033 | void MainWindow::exportToPhone( int mode ) |
1033 | { | 1034 | { |
1034 | 1035 | ||
1035 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1036 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1036 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1037 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1037 | KOex2phonePrefs ex2phone; | 1038 | KOex2phonePrefs ex2phone; |
1038 | 1039 | ||
1039 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1040 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1040 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1041 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1041 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1042 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1042 | if ( mode == 1 ) | 1043 | if ( mode == 1 ) |
1043 | ex2phone.setCaption(i18n("Export complete calendar")); | 1044 | ex2phone.setCaption(i18n("Export complete calendar")); |
1044 | if ( mode == 2 ) | 1045 | if ( mode == 2 ) |
1045 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1046 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1046 | 1047 | ||
1047 | if ( !ex2phone.exec() ) { | 1048 | if ( !ex2phone.exec() ) { |
1048 | return; | 1049 | return; |
1049 | } | 1050 | } |
1050 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1051 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1051 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1052 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1052 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1053 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1053 | 1054 | ||
1054 | int inFuture = 0; | 1055 | int inFuture = 0; |
1055 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1056 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1056 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1057 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1057 | QPtrList<Incidence> delSel; | 1058 | QPtrList<Incidence> delSel; |
1058 | if ( mode == 1 ) | 1059 | if ( mode == 1 ) |
1059 | delSel = mCalendar->rawIncidences(); | 1060 | delSel = mCalendar->rawIncidences(); |
1060 | if ( mode == 2 ) | 1061 | if ( mode == 2 ) |
1061 | delSel = mCalendar->incidences(); | 1062 | delSel = mCalendar->incidences(); |
1062 | CalendarLocal* cal = new CalendarLocal(); | 1063 | CalendarLocal* cal = new CalendarLocal(); |
1063 | cal->setLocalTime(); | 1064 | cal->setLocalTime(); |
1064 | Incidence *incidence = delSel.first(); | 1065 | Incidence *incidence = delSel.first(); |
1065 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1066 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1066 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1067 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1067 | while ( incidence ) { | 1068 | while ( incidence ) { |
1068 | if ( incidence->type() != "Journal" ) { | 1069 | if ( incidence->type() != "Journal" ) { |
1069 | bool add = true; | 1070 | bool add = true; |
1070 | if ( inFuture ) { | 1071 | if ( inFuture ) { |
1071 | QDateTime dt; | 1072 | QDateTime dt; |
1072 | if ( incidence->type() == "Todo" ) { | 1073 | if ( incidence->type() == "Todo" ) { |
1073 | Todo * t = (Todo*)incidence; | 1074 | Todo * t = (Todo*)incidence; |
1074 | if ( t->hasDueDate() ) | 1075 | if ( t->hasDueDate() ) |
1075 | dt = t->dtDue(); | 1076 | dt = t->dtDue(); |
1076 | else | 1077 | else |
1077 | dt = cur.addSecs( 62 ); | 1078 | dt = cur.addSecs( 62 ); |
1078 | } | 1079 | } |
1079 | else { | 1080 | else { |
1080 | bool ok; | 1081 | bool ok; |
1081 | dt = incidence->getNextOccurence( cur, &ok ); | 1082 | dt = incidence->getNextOccurence( cur, &ok ); |
1082 | if ( !ok ) | 1083 | if ( !ok ) |
1083 | dt = cur.addSecs( -62 ); | 1084 | dt = cur.addSecs( -62 ); |
1084 | } | 1085 | } |
1085 | if ( dt < cur || dt > end ) { | 1086 | if ( dt < cur || dt > end ) { |
1086 | add = false; | 1087 | add = false; |
1087 | } | 1088 | } |
1088 | } | 1089 | } |
1089 | if ( add ) { | 1090 | if ( add ) { |
1090 | Incidence *in = incidence->clone(); | 1091 | Incidence *in = incidence->clone(); |
1091 | cal->addIncidence( in ); | 1092 | cal->addIncidence( in ); |
1092 | } | 1093 | } |
1093 | } | 1094 | } |
1094 | incidence = delSel.next(); | 1095 | incidence = delSel.next(); |
1095 | } | 1096 | } |
1096 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1097 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1097 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1098 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1098 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1099 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1099 | 1100 | ||
1100 | setCaption( i18n("Writing to phone...")); | 1101 | setCaption( i18n("Writing to phone...")); |
1101 | if ( PhoneFormat::writeToPhone( cal ) ) | 1102 | if ( PhoneFormat::writeToPhone( cal ) ) |
1102 | setCaption( i18n("Export to phone successful!")); | 1103 | setCaption( i18n("Export to phone successful!")); |
1103 | else | 1104 | else |
1104 | setCaption( i18n("Error exporting to phone!")); | 1105 | setCaption( i18n("Error exporting to phone!")); |
1105 | delete cal; | 1106 | delete cal; |
1106 | } | 1107 | } |
1107 | 1108 | ||
1108 | 1109 | ||
1109 | void MainWindow::setDefaultPreferences() | 1110 | void MainWindow::setDefaultPreferences() |
1110 | { | 1111 | { |
1111 | KOPrefs *p = KOPrefs::instance(); | 1112 | KOPrefs *p = KOPrefs::instance(); |
1112 | 1113 | ||
1113 | p->mCompactDialogs = true; | 1114 | p->mCompactDialogs = true; |
1114 | p->mConfirm = true; | 1115 | p->mConfirm = true; |
1115 | // p->mEnableQuickTodo = false; | 1116 | // p->mEnableQuickTodo = false; |
1116 | 1117 | ||
1117 | } | 1118 | } |
1118 | 1119 | ||
1119 | QString MainWindow::resourcePath() | 1120 | QString MainWindow::resourcePath() |
1120 | { | 1121 | { |
1121 | return KGlobal::iconLoader()->iconPath(); | 1122 | return KGlobal::iconLoader()->iconPath(); |
1122 | } | 1123 | } |
1123 | 1124 | ||
1124 | void MainWindow::displayText( QString text ,QString cap ) | 1125 | void MainWindow::displayText( QString text ,QString cap ) |
1125 | { | 1126 | { |
1126 | QDialog dia( this, "name", true ); ; | 1127 | QDialog dia( this, "name", true ); ; |
1127 | dia.setCaption( cap ); | 1128 | dia.setCaption( cap ); |
1128 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1129 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1129 | lay->setSpacing( 3 ); | 1130 | lay->setSpacing( 3 ); |
1130 | lay->setMargin( 3 ); | 1131 | lay->setMargin( 3 ); |
1131 | QTextBrowser tb ( &dia ); | 1132 | QTextBrowser tb ( &dia ); |
1132 | lay->addWidget( &tb ); | 1133 | lay->addWidget( &tb ); |
1133 | tb.setText( text ); | 1134 | tb.setText( text ); |
1134 | #ifdef DESKTOP_VERSION | 1135 | #ifdef DESKTOP_VERSION |
1135 | dia.resize( 640, 480); | 1136 | dia.resize( 640, 480); |
1136 | #else | 1137 | #else |
1137 | dia.showMaximized(); | 1138 | dia.showMaximized(); |
1138 | #endif | 1139 | #endif |
1139 | dia.exec(); | 1140 | dia.exec(); |
1140 | } | 1141 | } |
1141 | void MainWindow::displayFile( QString fn, QString cap ) | ||
1142 | { | ||
1143 | QString fileName = resourcePath() + fn; | ||
1144 | QString text; | ||
1145 | QFile file( fileName ); | ||
1146 | if (!file.open( IO_ReadOnly ) ) { | ||
1147 | return ; | ||
1148 | 1142 | ||
1149 | } | ||
1150 | QTextStream ts( &file ); | ||
1151 | text = ts.read(); | ||
1152 | file.close(); | ||
1153 | displayText( text, cap); | ||
1154 | } | ||
1155 | void MainWindow::features() | 1143 | void MainWindow::features() |
1156 | { | 1144 | { |
1157 | 1145 | ||
1158 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); | 1146 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1159 | } | 1147 | } |
1160 | 1148 | ||
1161 | void MainWindow::usertrans() | 1149 | void MainWindow::usertrans() |
1162 | { | 1150 | { |
1163 | 1151 | ||
1164 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); | 1152 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1165 | } | 1153 | } |
1166 | 1154 | ||
1167 | void MainWindow::kdesynchowto() | 1155 | void MainWindow::kdesynchowto() |
1168 | { | 1156 | { |
1169 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1157 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1170 | } | 1158 | } |
1171 | void MainWindow::multisynchowto() | 1159 | void MainWindow::multisynchowto() |
1172 | { | 1160 | { |
1173 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1161 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1174 | } | 1162 | } |
1175 | void MainWindow::synchowto() | 1163 | void MainWindow::synchowto() |
1176 | { | 1164 | { |
1177 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1165 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1178 | } | 1166 | } |
1179 | void MainWindow::faq() | 1167 | void MainWindow::faq() |
1180 | { | 1168 | { |
1181 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); | 1169 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1182 | 1170 | ||
1183 | } | 1171 | } |
1184 | void MainWindow::whatsNew() | 1172 | void MainWindow::whatsNew() |
1185 | { | 1173 | { |
1186 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1174 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1187 | 1175 | ||
1188 | } | 1176 | } |
1189 | void MainWindow::licence() | 1177 | void MainWindow::licence() |
1190 | { | 1178 | { |
1191 | KApplication::showLicence(); | 1179 | KApplication::showLicence(); |
1192 | 1180 | ||
1193 | } | 1181 | } |
1194 | void MainWindow::about() | 1182 | void MainWindow::about() |
1195 | { | 1183 | { |
1196 | QString version; | 1184 | QString version; |
1197 | #include <../version> | 1185 | #include <../version> |
1198 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1186 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1199 | i18n("KOrganizer/Platform-independent\n") + | 1187 | i18n("KOrganizer/Platform-independent\n") + |
1200 | "(KO/Pi) " + version + " - " + | 1188 | "(KO/Pi) " + version + " - " + |
1201 | 1189 | ||
1202 | #ifdef DESKTOP_VERSION | 1190 | #ifdef DESKTOP_VERSION |
1203 | i18n("Desktop Edition\n") + | 1191 | i18n("Desktop Edition\n") + |
1204 | #else | 1192 | #else |
1205 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + | 1193 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + |
1206 | #endif | 1194 | #endif |
1207 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); | 1195 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); |
1208 | } | 1196 | } |
1209 | void MainWindow::keyBindings() | 1197 | void MainWindow::keyBindings() |
1210 | { | 1198 | { |
1211 | QString cap = i18n("Key bindings KOrganizer/Pi"); | 1199 | QString cap = i18n("KO/Pi Keys + Colors"); |
1212 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1200 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1213 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1201 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1214 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1202 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1215 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1203 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1216 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1204 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1217 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1205 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1218 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1206 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1219 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1207 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1220 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1208 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1221 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1209 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1222 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1210 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1223 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1211 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1224 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1212 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1225 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1213 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1226 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1214 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1227 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1215 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1228 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1216 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1229 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1217 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1230 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1218 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1231 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1219 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1232 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1220 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1233 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1221 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1234 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1222 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1235 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1223 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1236 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1224 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1237 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1225 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1238 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1226 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1239 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1227 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1240 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1228 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1241 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1229 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1242 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1230 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1243 | i18n("<p><h3>In list view:</h3></p>\n") + | 1231 | i18n("<p><h3>In list view:</h3></p>\n") + |
1244 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1232 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1245 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1233 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1246 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1234 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1247 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1235 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1248 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1236 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1249 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1237 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1250 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1238 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1251 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1239 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1252 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1240 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1253 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1241 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1254 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1242 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1255 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1243 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1256 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1244 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1257 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1245 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1258 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1246 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1259 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1247 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1260 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1248 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1261 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1249 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1262 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1250 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1263 | displayText( text, cap); | 1251 | displayText( text, cap); |
1264 | |||
1265 | } | 1252 | } |
1266 | void MainWindow::aboutAutoSaving() | 1253 | void MainWindow::aboutAutoSaving() |
1267 | { | 1254 | { |
1268 | QMessageBox* msg; | 1255 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); |
1269 | msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"), | 1256 | |
1270 | i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon, | 1257 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1271 | QMessageBox::Ok, | ||
1272 | QMessageBox::NoButton, | ||
1273 | QMessageBox::NoButton); | ||
1274 | msg->exec(); | ||
1275 | delete msg; | ||
1276 | |||
1277 | 1258 | ||
1278 | } | 1259 | } |
1279 | void MainWindow::aboutKnownBugs() | 1260 | void MainWindow::aboutKnownBugs() |
1280 | { | 1261 | { |
1281 | QMessageBox* msg; | 1262 | QMessageBox* msg; |
1282 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1263 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1283 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ | 1264 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ |
1284 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1265 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1285 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + | 1266 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + |
1286 | i18n("\nor report them in the bugtracker on\n") + | 1267 | i18n("\nor report them in the bugtracker on\n") + |
1287 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1268 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1288 | QMessageBox::NoIcon, | 1269 | QMessageBox::NoIcon, |
1289 | QMessageBox::Ok, | 1270 | QMessageBox::Ok, |
1290 | QMessageBox::NoButton, | 1271 | QMessageBox::NoButton, |
1291 | QMessageBox::NoButton); | 1272 | QMessageBox::NoButton); |
1292 | msg->exec(); | 1273 | msg->exec(); |
1293 | delete msg; | 1274 | delete msg; |
1294 | 1275 | ||
1295 | } | 1276 | } |
1296 | 1277 | ||
1297 | QString MainWindow::defaultFileName() | 1278 | QString MainWindow::defaultFileName() |
1298 | { | 1279 | { |
1299 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1280 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1300 | } | 1281 | } |
1301 | QString MainWindow::syncFileName() | 1282 | QString MainWindow::syncFileName() |
1302 | { | 1283 | { |
1303 | #ifdef DESKTOP_VERSION | 1284 | #ifdef DESKTOP_VERSION |
1304 | return locateLocal( "tmp", "synccalendar.ics" ); | 1285 | return locateLocal( "tmp", "synccalendar.ics" ); |
1305 | #else | 1286 | #else |
1306 | return QString( "/tmp/synccalendar.ics" ); | 1287 | return QString( "/tmp/synccalendar.ics" ); |
1307 | #endif | 1288 | #endif |
1308 | } | 1289 | } |
1309 | 1290 | ||
1310 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1291 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1311 | { | 1292 | { |
1312 | if ( !incidence ) { | 1293 | if ( !incidence ) { |
1313 | enableIncidenceActions( false ); | 1294 | enableIncidenceActions( false ); |
1314 | 1295 | ||
1315 | mNewSubTodoAction->setEnabled( false ); | 1296 | mNewSubTodoAction->setEnabled( false ); |
1316 | setCaptionToDates(); | 1297 | setCaptionToDates(); |
1317 | return; | 1298 | return; |
1318 | 1299 | ||
1319 | } | 1300 | } |
1320 | 1301 | ||
1321 | //KGlobal::locale()->formatDateTime(nextA, true); | 1302 | //KGlobal::locale()->formatDateTime(nextA, true); |
1322 | QString startString = ""; | 1303 | QString startString = ""; |
1323 | if ( incidence->type() != "Todo" ) { | 1304 | if ( incidence->type() != "Todo" ) { |
1324 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1305 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1325 | if ( incidence->doesFloat() ) { | 1306 | if ( incidence->doesFloat() ) { |
1326 | startString += ": "+incidence->dtStartDateStr( true ); | 1307 | startString += ": "+incidence->dtStartDateStr( true ); |
1327 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1308 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1328 | 1309 | ||
1329 | } else { | 1310 | } else { |
1330 | startString = ": "+incidence->dtStartStr(true); | 1311 | startString = ": "+incidence->dtStartStr(true); |
1331 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1312 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1332 | 1313 | ||
1333 | } | 1314 | } |
1334 | 1315 | ||
1335 | } else { | 1316 | } else { |
1336 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1317 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1337 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1318 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1338 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1319 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1339 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1320 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1340 | } | 1321 | } |
1341 | 1322 | ||
1342 | } | 1323 | } |
1343 | else | 1324 | else |
1344 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1325 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1345 | if ( !incidence->location().isEmpty() ) | 1326 | if ( !incidence->location().isEmpty() ) |
1346 | startString += " (" +incidence->location()+")"; | 1327 | startString += " (" +incidence->location()+")"; |
1347 | setCaption( incidence->summary()+startString); | 1328 | setCaption( incidence->summary()+startString); |
1348 | 1329 | ||
1349 | enableIncidenceActions( true ); | 1330 | enableIncidenceActions( true ); |
1350 | 1331 | ||
1351 | if ( incidence->type() == "Event" ) { | 1332 | if ( incidence->type() == "Event" ) { |
1352 | mShowAction->setText( i18n("Show Event...") ); | 1333 | mShowAction->setText( i18n("Show Event...") ); |
1353 | mEditAction->setText( i18n("Edit Event...") ); | 1334 | mEditAction->setText( i18n("Edit Event...") ); |
1354 | mDeleteAction->setText( i18n("Delete Event...") ); | 1335 | mDeleteAction->setText( i18n("Delete Event...") ); |
1355 | 1336 | ||
1356 | mNewSubTodoAction->setEnabled( false ); | 1337 | mNewSubTodoAction->setEnabled( false ); |
1357 | } else if ( incidence->type() == "Todo" ) { | 1338 | } else if ( incidence->type() == "Todo" ) { |
1358 | mShowAction->setText( i18n("Show Todo...") ); | 1339 | mShowAction->setText( i18n("Show Todo...") ); |
1359 | mEditAction->setText( i18n("Edit Todo...") ); | 1340 | mEditAction->setText( i18n("Edit Todo...") ); |
1360 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1341 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1361 | 1342 | ||
1362 | mNewSubTodoAction->setEnabled( true ); | 1343 | mNewSubTodoAction->setEnabled( true ); |
1363 | } else { | 1344 | } else { |
1364 | mShowAction->setText( i18n("Show...") ); | 1345 | mShowAction->setText( i18n("Show...") ); |
1365 | mShowAction->setText( i18n("Edit...") ); | 1346 | mShowAction->setText( i18n("Edit...") ); |
1366 | mShowAction->setText( i18n("Delete...") ); | 1347 | mShowAction->setText( i18n("Delete...") ); |
1367 | 1348 | ||
1368 | mNewSubTodoAction->setEnabled( false ); | 1349 | mNewSubTodoAction->setEnabled( false ); |
1369 | } | 1350 | } |
1370 | } | 1351 | } |
1371 | 1352 | ||
1372 | void MainWindow::enableIncidenceActions( bool enabled ) | 1353 | void MainWindow::enableIncidenceActions( bool enabled ) |
1373 | { | 1354 | { |
1374 | mShowAction->setEnabled( enabled ); | 1355 | mShowAction->setEnabled( enabled ); |
1375 | mEditAction->setEnabled( enabled ); | 1356 | mEditAction->setEnabled( enabled ); |
1376 | mDeleteAction->setEnabled( enabled ); | 1357 | mDeleteAction->setEnabled( enabled ); |
1377 | 1358 | ||
1378 | mCloneAction->setEnabled( enabled ); | 1359 | mCloneAction->setEnabled( enabled ); |
1379 | mMoveAction->setEnabled( enabled ); | 1360 | mMoveAction->setEnabled( enabled ); |
1380 | mBeamAction->setEnabled( enabled ); | 1361 | mBeamAction->setEnabled( enabled ); |
1381 | mCancelAction->setEnabled( enabled ); | 1362 | mCancelAction->setEnabled( enabled ); |
1382 | } | 1363 | } |
1383 | 1364 | ||
1384 | void MainWindow::importOL() | 1365 | void MainWindow::importOL() |
1385 | { | 1366 | { |
1386 | #ifdef _WIN32_ | 1367 | #ifdef _WIN32_ |
1387 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1368 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1388 | id->exec(); | 1369 | id->exec(); |
1389 | delete id; | 1370 | delete id; |
1390 | mView->updateView(); | 1371 | mView->updateView(); |
1391 | #endif | 1372 | #endif |
1392 | } | 1373 | } |
1393 | void MainWindow::importBday() | 1374 | void MainWindow::importBday() |
1394 | { | 1375 | { |
1395 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1376 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1396 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1377 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1397 | i18n("Import!"), i18n("Cancel"), 0, | 1378 | i18n("Import!"), i18n("Cancel"), 0, |
1398 | 0, 1 ); | 1379 | 0, 1 ); |
1399 | if ( result == 0 ) { | 1380 | if ( result == 0 ) { |
1400 | mView->importBday(); | 1381 | mView->importBday(); |
1401 | 1382 | ||
1402 | } | 1383 | } |
1403 | 1384 | ||
1404 | 1385 | ||
1405 | } | 1386 | } |
1406 | void MainWindow::importQtopia() | 1387 | void MainWindow::importQtopia() |
1407 | { | 1388 | { |
1408 | #ifndef DESKTOP_VERSION | 1389 | #ifndef DESKTOP_VERSION |
1409 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1390 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1410 | i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"), | 1391 | i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"), |
1411 | i18n("Import!"), i18n("Cancel"), 0, | 1392 | i18n("Import!"), i18n("Cancel"), 0, |
1412 | 0, 1 ); | 1393 | 0, 1 ); |
1413 | if ( result == 0 ) { | 1394 | if ( result == 0 ) { |
1414 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1395 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1415 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1396 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1416 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1397 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1417 | mView->importQtopia( categories, datebook, todolist ); | 1398 | mView->importQtopia( categories, datebook, todolist ); |
1418 | } | 1399 | } |
1419 | #else | 1400 | #else |
1420 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1401 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1421 | i18n("Not supported \non desktop!\n"), | 1402 | i18n("Not supported \non desktop!\n"), |
1422 | i18n("Ok"), i18n("Cancel"), 0, | 1403 | i18n("Ok"), i18n("Cancel"), 0, |
1423 | 0, 1 ); | 1404 | 0, 1 ); |
1424 | 1405 | ||
1425 | #endif | 1406 | #endif |
1426 | } | 1407 | } |
1427 | 1408 | ||
1428 | void MainWindow::saveOnClose() | 1409 | void MainWindow::saveOnClose() |
1429 | { | 1410 | { |
1430 | KOPrefs *p = KOPrefs::instance(); | 1411 | KOPrefs *p = KOPrefs::instance(); |
1431 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1412 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1432 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1413 | p->mToolBarUp = iconToolBar->x() > width()/2 || |
1433 | iconToolBar->y() > height()/2; | 1414 | iconToolBar->y() > height()/2; |
1434 | mView->writeSettings(); | 1415 | mView->writeSettings(); |
1435 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1416 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1436 | save(); | 1417 | save(); |
1437 | } | 1418 | } |
1438 | void MainWindow::slotModifiedChanged( bool changed ) | 1419 | void MainWindow::slotModifiedChanged( bool changed ) |
1439 | { | 1420 | { |
1440 | if ( mBlockAtStartup ) | 1421 | if ( mBlockAtStartup ) |
1441 | return; | 1422 | return; |
1442 | int msec; | 1423 | int msec; |
1443 | // we store the changes after 1 minute, | 1424 | // we store the changes after 1 minute, |
1444 | // and for safety reasons after 10 minutes again | 1425 | // and for safety reasons after 10 minutes again |
1445 | if ( !mSyncManager->blockSave() ) | 1426 | if ( !mSyncManager->blockSave() ) |
1446 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1427 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1447 | else | 1428 | else |
1448 | msec = 1000 * 600; | 1429 | msec = 1000 * 600; |
1449 | mSaveTimer.start( msec, true ); // 1 minute | 1430 | mSaveTimer.start( msec, true ); // 1 minute |
1450 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1431 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1451 | mCalendarModifiedFlag = true; | 1432 | mCalendarModifiedFlag = true; |
1452 | } | 1433 | } |
1453 | void MainWindow::save() | 1434 | void MainWindow::save() |
1454 | { | 1435 | { |
1455 | if ( mSyncManager->blockSave() ) | 1436 | if ( mSyncManager->blockSave() ) |
1456 | return; | 1437 | return; |
1457 | mSyncManager->setBlockSave(true); | 1438 | mSyncManager->setBlockSave(true); |
1458 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1439 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1459 | 1440 | ||
1460 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1441 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1461 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1442 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1462 | qDebug("KO: Start saving data to file!"); | 1443 | qDebug("KO: Start saving data to file!"); |
1463 | mView->saveCalendar( defaultFileName() ); | 1444 | mView->saveCalendar( defaultFileName() ); |
1464 | 1445 | ||
1465 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1446 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1466 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1447 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1467 | QString savemes; | 1448 | QString savemes; |
1468 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1449 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
@@ -1537,381 +1518,377 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1537 | case Qt::Key_5: | 1518 | case Qt::Key_5: |
1538 | case Qt::Key_6: | 1519 | case Qt::Key_6: |
1539 | case Qt::Key_7: | 1520 | case Qt::Key_7: |
1540 | case Qt::Key_8: | 1521 | case Qt::Key_8: |
1541 | case Qt::Key_9: | 1522 | case Qt::Key_9: |
1542 | pro = e->key()-48; | 1523 | pro = e->key()-48; |
1543 | if ( pro == 0 ) | 1524 | if ( pro == 0 ) |
1544 | pro = 10; | 1525 | pro = 10; |
1545 | if ( e->state() == Qt::ControlButton) | 1526 | if ( e->state() == Qt::ControlButton) |
1546 | pro += 10; | 1527 | pro += 10; |
1547 | break; | 1528 | break; |
1548 | case Qt::Key_M: | 1529 | case Qt::Key_M: |
1549 | mView->viewManager()->showMonthView(); | 1530 | mView->viewManager()->showMonthView(); |
1550 | showSelectedDates = true; | 1531 | showSelectedDates = true; |
1551 | break; | 1532 | break; |
1552 | case Qt::Key_Insert: | 1533 | case Qt::Key_Insert: |
1553 | mView->newEvent(); | 1534 | mView->newEvent(); |
1554 | break; | 1535 | break; |
1555 | case Qt::Key_S : | 1536 | case Qt::Key_S : |
1556 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1537 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1557 | mView->newSubTodo(); | 1538 | mView->newSubTodo(); |
1558 | else | 1539 | else |
1559 | mView->dialogManager()->showSearchDialog(); | 1540 | mView->dialogManager()->showSearchDialog(); |
1560 | break; | 1541 | break; |
1561 | case Qt::Key_Y : | 1542 | case Qt::Key_Y : |
1562 | case Qt::Key_Z : | 1543 | case Qt::Key_Z : |
1563 | mView->viewManager()->showWorkWeekView(); | 1544 | mView->viewManager()->showWorkWeekView(); |
1564 | showSelectedDates = true; | 1545 | showSelectedDates = true; |
1565 | break; | 1546 | break; |
1566 | case Qt::Key_U : | 1547 | case Qt::Key_U : |
1567 | mView->viewManager()->showWeekView(); | 1548 | mView->viewManager()->showWeekView(); |
1568 | showSelectedDates = true; | 1549 | showSelectedDates = true; |
1569 | break; | 1550 | break; |
1570 | case Qt::Key_H : | 1551 | case Qt::Key_H : |
1571 | keyBindings(); | 1552 | keyBindings(); |
1572 | break; | 1553 | break; |
1573 | case Qt::Key_W: | 1554 | case Qt::Key_W: |
1574 | mView->viewManager()->showWhatsNextView(); | 1555 | mView->viewManager()->showWhatsNextView(); |
1575 | break; | 1556 | break; |
1576 | case Qt::Key_L: | 1557 | case Qt::Key_L: |
1577 | mView->viewManager()->showListView(); | 1558 | mView->viewManager()->showListView(); |
1578 | break; | 1559 | break; |
1579 | case Qt::Key_N: | 1560 | case Qt::Key_N: |
1580 | mView->viewManager()->showNextXView(); | 1561 | mView->viewManager()->showNextXView(); |
1581 | showSelectedDates = true; | 1562 | showSelectedDates = true; |
1582 | break; | 1563 | break; |
1583 | case Qt::Key_V: | 1564 | case Qt::Key_V: |
1584 | mView->viewManager()->showTodoView(); | 1565 | mView->viewManager()->showTodoView(); |
1585 | break; | 1566 | break; |
1586 | case Qt::Key_C: | 1567 | case Qt::Key_C: |
1587 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1568 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1588 | break; | 1569 | break; |
1589 | case Qt::Key_P: | 1570 | case Qt::Key_P: |
1590 | mView->showDatePicker( ); | 1571 | mView->showDatePicker( ); |
1591 | break; | 1572 | break; |
1592 | case Qt::Key_F: | 1573 | case Qt::Key_F: |
1593 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1574 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1594 | mView->editFilters(); | 1575 | mView->editFilters(); |
1595 | else | 1576 | else |
1596 | mView->toggleFilter(); | 1577 | mView->toggleFilter(); |
1597 | break; | 1578 | break; |
1598 | case Qt::Key_X: | 1579 | case Qt::Key_X: |
1599 | mView->toggleDateNavigatorWidget(); | 1580 | mView->toggleDateNavigatorWidget(); |
1600 | break; | 1581 | break; |
1601 | case Qt::Key_Space: | 1582 | case Qt::Key_Space: |
1602 | mView->toggleExpand(); | 1583 | mView->toggleExpand(); |
1603 | break; | 1584 | break; |
1604 | case Qt::Key_A: | 1585 | case Qt::Key_A: |
1605 | mView->toggleAllDaySize(); | 1586 | mView->toggleAllDaySize(); |
1606 | break; | 1587 | break; |
1607 | case Qt::Key_T: | 1588 | case Qt::Key_T: |
1608 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1589 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1609 | mView->newTodo(); | 1590 | mView->newTodo(); |
1610 | else { | 1591 | else { |
1611 | mView->goToday(); | 1592 | mView->goToday(); |
1612 | showSelectedDates = true; | 1593 | showSelectedDates = true; |
1613 | } | 1594 | } |
1614 | break; | 1595 | break; |
1615 | case Qt::Key_J: | 1596 | case Qt::Key_J: |
1616 | mView->viewManager()->showJournalView(); | 1597 | mView->viewManager()->showJournalView(); |
1617 | break; | 1598 | break; |
1618 | case Qt::Key_B: | 1599 | case Qt::Key_B: |
1619 | mView->editIncidenceDescription();; | 1600 | mView->editIncidenceDescription();; |
1620 | break; | 1601 | break; |
1621 | // case Qt::Key_Return: | 1602 | // case Qt::Key_Return: |
1622 | case Qt::Key_E: | 1603 | case Qt::Key_E: |
1623 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1604 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1624 | mView->newEvent(); | 1605 | mView->newEvent(); |
1625 | else | 1606 | else |
1626 | mView->editIncidence(); | 1607 | mView->editIncidence(); |
1627 | break; | 1608 | break; |
1628 | case Qt::Key_Plus: | 1609 | case Qt::Key_Plus: |
1629 | size = p->mHourSize +2; | 1610 | size = p->mHourSize +2; |
1630 | if ( size <= 18 ) | 1611 | if ( size <= 18 ) |
1631 | configureAgenda( size ); | 1612 | configureAgenda( size ); |
1632 | break; | 1613 | break; |
1633 | case Qt::Key_Minus: | 1614 | case Qt::Key_Minus: |
1634 | size = p->mHourSize - 2; | 1615 | size = p->mHourSize - 2; |
1635 | if ( size >= 4 ) | 1616 | if ( size >= 4 ) |
1636 | configureAgenda( size ); | 1617 | configureAgenda( size ); |
1637 | break; | 1618 | break; |
1638 | 1619 | ||
1639 | 1620 | ||
1640 | default: | 1621 | default: |
1641 | e->ignore(); | 1622 | e->ignore(); |
1642 | } | 1623 | } |
1643 | if ( pro > 0 ) { | 1624 | if ( pro > 0 ) { |
1644 | mView->selectFilter( pro-1 ); | 1625 | mView->selectFilter( pro-1 ); |
1645 | } | 1626 | } |
1646 | if ( showSelectedDates ) { | 1627 | if ( showSelectedDates ) { |
1647 | ;// setCaptionToDates(); | 1628 | ;// setCaptionToDates(); |
1648 | } | 1629 | } |
1649 | 1630 | ||
1650 | } | 1631 | } |
1651 | 1632 | ||
1652 | void MainWindow::fillFilterMenu() | 1633 | void MainWindow::fillFilterMenu() |
1653 | { | 1634 | { |
1654 | selectFilterMenu->clear(); | 1635 | selectFilterMenu->clear(); |
1655 | bool disable = false; | 1636 | bool disable = false; |
1656 | if ( mView->filterView()->filtersEnabled() ) { | 1637 | if ( mView->filterView()->filtersEnabled() ) { |
1657 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 0 ); | 1638 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 0 ); |
1658 | } | 1639 | } |
1659 | else { | 1640 | else { |
1660 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 0 ); | 1641 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 0 ); |
1661 | disable = true; | 1642 | disable = true; |
1662 | } | 1643 | } |
1663 | selectFilterMenu->insertSeparator(); | 1644 | selectFilterMenu->insertSeparator(); |
1664 | QPtrList<CalFilter> fili = mView->filters(); | 1645 | QPtrList<CalFilter> fili = mView->filters(); |
1665 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1646 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1666 | CalFilter *filter = fili.first(); | 1647 | CalFilter *filter = fili.first(); |
1667 | int iii = 1; | 1648 | int iii = 1; |
1668 | while(filter) { | 1649 | while(filter) { |
1669 | selectFilterMenu->insertItem( filter->name(), iii ); | 1650 | selectFilterMenu->insertItem( filter->name(), iii ); |
1670 | if ( filter == curfilter) | 1651 | if ( filter == curfilter) |
1671 | selectFilterMenu->setItemChecked( iii, true ); | 1652 | selectFilterMenu->setItemChecked( iii, true ); |
1672 | if ( disable ) | 1653 | if ( disable ) |
1673 | selectFilterMenu->setItemEnabled( iii, false ); | 1654 | selectFilterMenu->setItemEnabled( iii, false ); |
1674 | filter = fili.next(); | 1655 | filter = fili.next(); |
1675 | ++iii; | 1656 | ++iii; |
1676 | } | 1657 | } |
1677 | } | 1658 | } |
1678 | void MainWindow::selectFilter( int fil ) | 1659 | void MainWindow::selectFilter( int fil ) |
1679 | { | 1660 | { |
1680 | if ( fil == 0 ) { | 1661 | if ( fil == 0 ) { |
1681 | mView->toggleFilerEnabled( ); | 1662 | mView->toggleFilerEnabled( ); |
1682 | } else { | 1663 | } else { |
1683 | mView->selectFilter( fil-1 ); | 1664 | mView->selectFilter( fil-1 ); |
1684 | } | 1665 | } |
1685 | } | 1666 | } |
1686 | void MainWindow::configureToolBar( int item ) | 1667 | void MainWindow::configureToolBar( int item ) |
1687 | { | 1668 | { |
1688 | 1669 | ||
1689 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1670 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1690 | KOPrefs *p = KOPrefs::instance(); | 1671 | KOPrefs *p = KOPrefs::instance(); |
1691 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1672 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1692 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1673 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1693 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1674 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1694 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1675 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1695 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1676 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1696 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1677 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
1697 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 1678 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
1698 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 1679 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
1699 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 1680 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
1700 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 1681 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
1701 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1682 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1702 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1683 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1703 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1684 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1704 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 1685 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1705 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 1686 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
1706 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 1687 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
1707 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 1688 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1708 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 1689 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1709 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 1690 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1710 | // initActions(); | 1691 | // initActions(); |
1711 | } | 1692 | } |
1712 | 1693 | ||
1713 | void MainWindow::setCaptionToDates() | 1694 | void MainWindow::setCaptionToDates() |
1714 | { | 1695 | { |
1715 | QString selDates; | 1696 | QString selDates; |
1716 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); | 1697 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); |
1717 | if (mView->startDate() < mView->endDate() ) | 1698 | if (mView->startDate() < mView->endDate() ) |
1718 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1699 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1719 | setCaption( i18n("Dates: ") + selDates ); | 1700 | setCaption( i18n("Dates: ") + selDates ); |
1720 | 1701 | ||
1721 | } | 1702 | } |
1722 | // parameter item == 0: reinit | 1703 | // parameter item == 0: reinit |
1723 | void MainWindow::configureAgenda( int item ) | 1704 | void MainWindow::configureAgenda( int item ) |
1724 | { | 1705 | { |
1725 | 1706 | ||
1726 | KOPrefs *p = KOPrefs::instance(); | 1707 | KOPrefs *p = KOPrefs::instance(); |
1727 | 1708 | ||
1728 | int i; | 1709 | int i; |
1729 | if ( item == 1 ) { | ||
1730 | mView->toggleAllDaySize(); | ||
1731 | return; | ||
1732 | } | ||
1733 | // do not allow 4 for widgets higher than 480 | 1710 | // do not allow 4 for widgets higher than 480 |
1734 | // if ( QApplication::desktop()->height() > 480 ) { | 1711 | // if ( QApplication::desktop()->height() > 480 ) { |
1735 | // if ( item == 4 ) | 1712 | // if ( item == 4 ) |
1736 | // item = 6; | 1713 | // item = 6; |
1737 | // } | 1714 | // } |
1738 | for ( i = 4; i <= 18; i= i+2 ) | 1715 | for ( i = 4; i <= 18; i= i+2 ) |
1739 | configureAgendaMenu->setItemChecked( i, false ); | 1716 | configureAgendaMenu->setItemChecked( i, false ); |
1740 | configureAgendaMenu->setItemChecked( item, true ); | 1717 | configureAgendaMenu->setItemChecked( item, true ); |
1741 | if ( p->mHourSize == item ) | 1718 | if ( p->mHourSize == item ) |
1742 | return; | 1719 | return; |
1743 | p->mHourSize=item; | 1720 | p->mHourSize=item; |
1744 | mView->viewManager()->agendaView()->updateConfig(); | 1721 | mView->viewManager()->agendaView()->updateConfig(); |
1745 | } | 1722 | } |
1746 | 1723 | ||
1747 | void MainWindow::saveCalendar() | 1724 | void MainWindow::saveCalendar() |
1748 | { | 1725 | { |
1749 | QString fn = KOPrefs::instance()->mLastSaveFile; | 1726 | QString fn = KOPrefs::instance()->mLastSaveFile; |
1750 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); | 1727 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); |
1751 | 1728 | ||
1752 | if ( fn == "" ) | 1729 | if ( fn == "" ) |
1753 | return; | 1730 | return; |
1754 | QFileInfo info; | 1731 | QFileInfo info; |
1755 | info.setFile( fn ); | 1732 | info.setFile( fn ); |
1756 | QString mes; | 1733 | QString mes; |
1757 | bool createbup = true; | 1734 | bool createbup = true; |
1758 | if ( info. exists() ) { | 1735 | if ( info. exists() ) { |
1759 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; | 1736 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; |
1760 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1737 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1761 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1738 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1762 | 0, 1 ); | 1739 | 0, 1 ); |
1763 | if ( result != 0 ) { | 1740 | if ( result != 0 ) { |
1764 | createbup = false; | 1741 | createbup = false; |
1765 | } | 1742 | } |
1766 | } | 1743 | } |
1767 | if ( createbup ) { | 1744 | if ( createbup ) { |
1768 | mView->saveCalendar( fn ); | 1745 | mView->saveCalendar( fn ); |
1769 | mes = i18n("KO/Pi:Saved %1").arg(fn); | 1746 | mes = i18n("KO/Pi:Saved %1").arg(fn); |
1770 | KOPrefs::instance()->mLastSaveFile = fn; | 1747 | KOPrefs::instance()->mLastSaveFile = fn; |
1771 | setCaption(mes); | 1748 | setCaption(mes); |
1772 | } | 1749 | } |
1773 | } | 1750 | } |
1774 | void MainWindow::loadCalendar() | 1751 | void MainWindow::loadCalendar() |
1775 | { | 1752 | { |
1776 | 1753 | ||
1777 | QString fn = KOPrefs::instance()->mLastLoadFile; | 1754 | QString fn = KOPrefs::instance()->mLastLoadFile; |
1778 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 1755 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
1779 | 1756 | ||
1780 | if ( fn == "" ) | 1757 | if ( fn == "" ) |
1781 | return; | 1758 | return; |
1782 | QFileInfo info; | 1759 | QFileInfo info; |
1783 | info.setFile( fn ); | 1760 | info.setFile( fn ); |
1784 | QString mess; | 1761 | QString mess; |
1785 | bool loadbup = true; | 1762 | bool loadbup = true; |
1786 | if ( info. exists() ) { | 1763 | if ( info. exists() ) { |
1787 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1764 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1788 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1765 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1789 | mess, | 1766 | mess, |
1790 | i18n("Load!"), i18n("Cancel"), 0, | 1767 | i18n("Load!"), i18n("Cancel"), 0, |
1791 | 0, 1 ); | 1768 | 0, 1 ); |
1792 | if ( result != 0 ) { | 1769 | if ( result != 0 ) { |
1793 | loadbup = false; | 1770 | loadbup = false; |
1794 | } | 1771 | } |
1795 | } else { | 1772 | } else { |
1796 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1773 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1797 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 1774 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
1798 | 0, 1 ); | 1775 | 0, 1 ); |
1799 | 1776 | ||
1800 | return; | 1777 | return; |
1801 | } | 1778 | } |
1802 | if ( loadbup ) { | 1779 | if ( loadbup ) { |
1803 | mView->openCalendar( fn ); | 1780 | mView->openCalendar( fn ); |
1804 | KOPrefs::instance()->mLastLoadFile = fn; | 1781 | KOPrefs::instance()->mLastLoadFile = fn; |
1805 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 1782 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
1806 | setCaption(mess); | 1783 | setCaption(mess); |
1807 | } | 1784 | } |
1808 | 1785 | ||
1809 | } | 1786 | } |
1810 | void MainWindow::quickImportIcal() | 1787 | void MainWindow::quickImportIcal() |
1811 | { | 1788 | { |
1812 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 1789 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
1813 | } | 1790 | } |
1814 | void MainWindow::importFile( QString fn, bool quick ) | 1791 | void MainWindow::importFile( QString fn, bool quick ) |
1815 | { | 1792 | { |
1816 | QFileInfo info; | 1793 | QFileInfo info; |
1817 | info.setFile( fn ); | 1794 | info.setFile( fn ); |
1818 | QString mess; | 1795 | QString mess; |
1819 | bool loadbup = true; | 1796 | bool loadbup = true; |
1820 | if ( !info. exists() ) { | 1797 | if ( !info. exists() ) { |
1821 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 1798 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
1822 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1799 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1823 | mess ); | 1800 | mess ); |
1824 | return; | 1801 | return; |
1825 | } | 1802 | } |
1826 | int result = 0; | 1803 | int result = 0; |
1827 | if ( !quick ) { | 1804 | if ( !quick ) { |
1828 | 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 )); | 1805 | 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 )); |
1829 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1806 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1830 | mess, | 1807 | mess, |
1831 | "Import", "Cancel", 0, | 1808 | "Import", "Cancel", 0, |
1832 | 0, 1 ); | 1809 | 0, 1 ); |
1833 | } | 1810 | } |
1834 | if ( result == 0 ) { | 1811 | if ( result == 0 ) { |
1835 | if ( mView->openCalendar( fn, true )) { | 1812 | if ( mView->openCalendar( fn, true )) { |
1836 | KOPrefs::instance()->mLastImportFile = fn; | 1813 | KOPrefs::instance()->mLastImportFile = fn; |
1837 | setCaption(i18n("Imported file successfully")); | 1814 | setCaption(i18n("Imported file successfully")); |
1838 | } else { | 1815 | } else { |
1839 | setCaption(i18n("Error importing file")); | 1816 | setCaption(i18n("Error importing file")); |
1840 | } | 1817 | } |
1841 | } | 1818 | } |
1842 | } | 1819 | } |
1843 | 1820 | ||
1844 | void MainWindow::importIcal() | 1821 | void MainWindow::importIcal() |
1845 | { | 1822 | { |
1846 | 1823 | ||
1847 | QString fn =KOPrefs::instance()->mLastImportFile; | 1824 | QString fn =KOPrefs::instance()->mLastImportFile; |
1848 | 1825 | ||
1849 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 1826 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
1850 | if ( fn == "" ) | 1827 | if ( fn == "" ) |
1851 | return; | 1828 | return; |
1852 | importFile( fn, true ); | 1829 | importFile( fn, true ); |
1853 | 1830 | ||
1854 | } | 1831 | } |
1855 | 1832 | ||
1856 | void MainWindow::exportVCalendar() | 1833 | void MainWindow::exportVCalendar() |
1857 | { | 1834 | { |
1858 | QString fn = KOPrefs::instance()->mLastVcalFile; | 1835 | QString fn = KOPrefs::instance()->mLastVcalFile; |
1859 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 1836 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
1860 | if ( fn == "" ) | 1837 | if ( fn == "" ) |
1861 | return; | 1838 | return; |
1862 | QFileInfo info; | 1839 | QFileInfo info; |
1863 | info.setFile( fn ); | 1840 | info.setFile( fn ); |
1864 | QString mes; | 1841 | QString mes; |
1865 | bool createbup = true; | 1842 | bool createbup = true; |
1866 | if ( info. exists() ) { | 1843 | if ( info. exists() ) { |
1867 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 1844 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
1868 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1845 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1869 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1846 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1870 | 0, 1 ); | 1847 | 0, 1 ); |
1871 | if ( result != 0 ) { | 1848 | if ( result != 0 ) { |
1872 | createbup = false; | 1849 | createbup = false; |
1873 | } | 1850 | } |
1874 | } | 1851 | } |
1875 | if ( createbup ) { | 1852 | if ( createbup ) { |
1876 | if ( mView->exportVCalendar( fn ) ) { | 1853 | if ( mView->exportVCalendar( fn ) ) { |
1877 | KOPrefs::instance()->mLastVcalFile = fn; | 1854 | KOPrefs::instance()->mLastVcalFile = fn; |
1878 | if ( fn.length() > 20 ) | 1855 | if ( fn.length() > 20 ) |
1879 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 1856 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
1880 | else | 1857 | else |
1881 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 1858 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
1882 | setCaption(mes); | 1859 | setCaption(mes); |
1883 | } | 1860 | } |
1884 | } | 1861 | } |
1885 | 1862 | ||
1886 | } | 1863 | } |
1887 | 1864 | ||
1888 | void MainWindow::syncFileRequest() | 1865 | void MainWindow::syncFileRequest() |
1889 | { | 1866 | { |
1890 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 1867 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
1891 | mSyncManager->slotSyncMenu( 999 ); | 1868 | mSyncManager->slotSyncMenu( 999 ); |
1892 | } | 1869 | } |
1893 | save(); | 1870 | save(); |
1894 | } | 1871 | } |
1895 | void MainWindow::getFile( bool success ) | 1872 | void MainWindow::getFile( bool success ) |
1896 | { | 1873 | { |
1897 | if ( ! success ) { | 1874 | if ( ! success ) { |
1898 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 1875 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
1899 | return; | 1876 | return; |
1900 | } | 1877 | } |
1901 | mView->openCalendar( defaultFileName() ); | 1878 | mView->openCalendar( defaultFileName() ); |
1902 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 1879 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
1903 | mSyncManager->slotSyncMenu( 999 ); | 1880 | mSyncManager->slotSyncMenu( 999 ); |
1904 | } | 1881 | } |
1905 | setCaption( i18n("Pi-Sync successful!") ); | 1882 | setCaption( i18n("Pi-Sync successful!") ); |
1906 | } | 1883 | } |
1907 | 1884 | ||
1908 | void MainWindow::printSel( ) | 1885 | void MainWindow::printSel( ) |
1909 | { | 1886 | { |
1910 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 1887 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
1911 | } | 1888 | } |
1912 | 1889 | ||
1913 | void MainWindow::printCal() | 1890 | void MainWindow::printCal() |
1914 | { | 1891 | { |
1915 | mView->print();//mCp->showDialog(); | 1892 | mView->print();//mCp->showDialog(); |
1916 | } | 1893 | } |
1917 | 1894 | ||
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index ed65d36..96e627e 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -1,140 +1,139 @@ | |||
1 | #ifndef KORGE_MAINWINDOW_H | 1 | #ifndef KORGE_MAINWINDOW_H |
2 | #define KORGE_MAINWINDOW_H | 2 | #define KORGE_MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qtimer.h> | 5 | #include <qtimer.h> |
6 | #include <qdict.h> | 6 | #include <qdict.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qtextstream.h> | 8 | #include <qtextstream.h> |
9 | #include <qregexp.h> | 9 | #include <qregexp.h> |
10 | 10 | ||
11 | #include <libkcal/incidence.h> | 11 | #include <libkcal/incidence.h> |
12 | #include "simplealarmclient.h" | 12 | #include "simplealarmclient.h" |
13 | #include <ksyncmanager.h> | 13 | #include <ksyncmanager.h> |
14 | #ifndef DESKTOP_VERSION | 14 | #ifndef DESKTOP_VERSION |
15 | #include <qcopchannel_qws.h> | 15 | #include <qcopchannel_qws.h> |
16 | #endif | 16 | #endif |
17 | class QAction; | 17 | class QAction; |
18 | class CalendarView; | 18 | class CalendarView; |
19 | class KSyncProfile; | 19 | class KSyncProfile; |
20 | #ifdef DESKTOP_VERSION | 20 | #ifdef DESKTOP_VERSION |
21 | 21 | ||
22 | #define QPEToolBar QToolBar | 22 | #define QPEToolBar QToolBar |
23 | #define QPEMenuBar QMenuBar | 23 | #define QPEMenuBar QMenuBar |
24 | #endif | 24 | #endif |
25 | class QPEToolBar; | 25 | class QPEToolBar; |
26 | 26 | ||
27 | 27 | ||
28 | namespace KCal { | 28 | namespace KCal { |
29 | class CalendarLocal; | 29 | class CalendarLocal; |
30 | } | 30 | } |
31 | 31 | ||
32 | using namespace KCal; | 32 | using namespace KCal; |
33 | 33 | ||
34 | class MainWindow : public QMainWindow | 34 | class MainWindow : public QMainWindow |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | public: | 37 | public: |
38 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 38 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); |
39 | ~MainWindow(); | 39 | ~MainWindow(); |
40 | bool beamReceiveEnabled(); | 40 | bool beamReceiveEnabled(); |
41 | public slots: | 41 | public slots: |
42 | virtual void showMaximized (); | 42 | virtual void showMaximized (); |
43 | void configureAgenda( int ); | 43 | void configureAgenda( int ); |
44 | void recieve( const QCString& msg, const QByteArray& data ); | 44 | void recieve( const QCString& msg, const QByteArray& data ); |
45 | static QString defaultFileName(); | 45 | static QString defaultFileName(); |
46 | static QString syncFileName(); | 46 | static QString syncFileName(); |
47 | static QString resourcePath(); | 47 | static QString resourcePath(); |
48 | protected slots: | 48 | protected slots: |
49 | void setCaptionToDates(); | 49 | void setCaptionToDates(); |
50 | void about(); | 50 | void about(); |
51 | void licence(); | 51 | void licence(); |
52 | void faq(); | 52 | void faq(); |
53 | void usertrans(); | 53 | void usertrans(); |
54 | void features(); | 54 | void features(); |
55 | void synchowto(); | 55 | void synchowto(); |
56 | void kdesynchowto(); | 56 | void kdesynchowto(); |
57 | void multisynchowto(); | 57 | void multisynchowto(); |
58 | void whatsNew(); | 58 | void whatsNew(); |
59 | void keyBindings(); | 59 | void keyBindings(); |
60 | void aboutAutoSaving();; | 60 | void aboutAutoSaving();; |
61 | void aboutKnownBugs(); | 61 | void aboutKnownBugs(); |
62 | 62 | ||
63 | void processIncidenceSelection( Incidence * ); | 63 | void processIncidenceSelection( Incidence * ); |
64 | 64 | ||
65 | void importQtopia(); | 65 | void importQtopia(); |
66 | void importBday(); | 66 | void importBday(); |
67 | void importOL(); | 67 | void importOL(); |
68 | void importIcal(); | 68 | void importIcal(); |
69 | void importFile( QString, bool ); | 69 | void importFile( QString, bool ); |
70 | void quickImportIcal(); | 70 | void quickImportIcal(); |
71 | 71 | ||
72 | void slotModifiedChanged( bool ); | 72 | void slotModifiedChanged( bool ); |
73 | 73 | ||
74 | void save(); | 74 | void save(); |
75 | void configureToolBar( int ); | 75 | void configureToolBar( int ); |
76 | void printSel(); | 76 | void printSel(); |
77 | void printCal(); | 77 | void printCal(); |
78 | void saveCalendar(); | 78 | void saveCalendar(); |
79 | void loadCalendar(); | 79 | void loadCalendar(); |
80 | void exportVCalendar(); | 80 | void exportVCalendar(); |
81 | void fillFilterMenu(); | 81 | void fillFilterMenu(); |
82 | void selectFilter( int ); | 82 | void selectFilter( int ); |
83 | void exportToPhone( int ); | 83 | void exportToPhone( int ); |
84 | void toggleBeamReceive(); | 84 | void toggleBeamReceive(); |
85 | void disableBR(bool); | 85 | void disableBR(bool); |
86 | 86 | ||
87 | 87 | ||
88 | protected: | 88 | protected: |
89 | void displayText( QString, QString); | 89 | void displayText( QString, QString); |
90 | void displayFile( QString, QString); | ||
91 | 90 | ||
92 | void enableIncidenceActions( bool ); | 91 | void enableIncidenceActions( bool ); |
93 | 92 | ||
94 | private slots: | 93 | private slots: |
95 | QSocket* piSocket; | 94 | QSocket* piSocket; |
96 | QString piFileString; | 95 | QString piFileString; |
97 | QTime piTime; | 96 | QTime piTime; |
98 | void getFile( bool ); | 97 | void getFile( bool ); |
99 | void syncFileRequest(); | 98 | void syncFileRequest(); |
100 | private: | 99 | private: |
101 | bool mBRdisabled; | 100 | bool mBRdisabled; |
102 | #ifndef DESKTOP_VERSION | 101 | #ifndef DESKTOP_VERSION |
103 | QCopChannel* infrared; | 102 | QCopChannel* infrared; |
104 | #endif | 103 | #endif |
105 | QAction* brAction; | 104 | QAction* brAction; |
106 | KSyncManager* mSyncManager; | 105 | KSyncManager* mSyncManager; |
107 | bool mClosed; | 106 | bool mClosed; |
108 | void saveOnClose(); | 107 | void saveOnClose(); |
109 | bool mFlagKeyPressed; | 108 | bool mFlagKeyPressed; |
110 | bool mBlockAtStartup; | 109 | bool mBlockAtStartup; |
111 | QPEToolBar *iconToolBar; | 110 | QPEToolBar *iconToolBar; |
112 | void initActions(); | 111 | void initActions(); |
113 | void setDefaultPreferences(); | 112 | void setDefaultPreferences(); |
114 | void keyPressEvent ( QKeyEvent * ) ; | 113 | void keyPressEvent ( QKeyEvent * ) ; |
115 | void keyReleaseEvent ( QKeyEvent * ) ; | 114 | void keyReleaseEvent ( QKeyEvent * ) ; |
116 | QPopupMenu *configureToolBarMenu; | 115 | QPopupMenu *configureToolBarMenu; |
117 | QPopupMenu *selectFilterMenu; | 116 | QPopupMenu *selectFilterMenu; |
118 | QPopupMenu *configureAgendaMenu, *syncMenu; | 117 | QPopupMenu *configureAgendaMenu, *syncMenu; |
119 | CalendarLocal *mCalendar; | 118 | CalendarLocal *mCalendar; |
120 | CalendarView *mView; | 119 | CalendarView *mView; |
121 | QAction *mNewSubTodoAction; | 120 | QAction *mNewSubTodoAction; |
122 | 121 | ||
123 | QAction *mShowAction; | 122 | QAction *mShowAction; |
124 | QAction *mEditAction; | 123 | QAction *mEditAction; |
125 | QAction *mDeleteAction; | 124 | QAction *mDeleteAction; |
126 | QAction *mCloneAction; | 125 | QAction *mCloneAction; |
127 | QAction *mMoveAction; | 126 | QAction *mMoveAction; |
128 | QAction *mBeamAction; | 127 | QAction *mBeamAction; |
129 | QAction *mCancelAction; | 128 | QAction *mCancelAction; |
130 | 129 | ||
131 | void closeEvent( QCloseEvent* ce ); | 130 | void closeEvent( QCloseEvent* ce ); |
132 | SimpleAlarmClient mAlarmClient; | 131 | SimpleAlarmClient mAlarmClient; |
133 | QTimer mSaveTimer; | 132 | QTimer mSaveTimer; |
134 | //bool mBlockSaveFlag; | 133 | //bool mBlockSaveFlag; |
135 | bool mCalendarModifiedFlag; | 134 | bool mCalendarModifiedFlag; |
136 | QPixmap loadPixmap( QString ); | 135 | QPixmap loadPixmap( QString ); |
137 | }; | 136 | }; |
138 | 137 | ||
139 | 138 | ||
140 | #endif | 139 | #endif |