author | zautrix <zautrix> | 2004-10-06 12:40:40 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-06 12:40:40 (UTC) |
commit | 3e949ed97c7a65eeaddecb1048872cd8595b3caf (patch) (unidiff) | |
tree | a964f4f0ac4d0390655f72aec71185c3f26f04de | |
parent | 8ac1973bfa65844df80d74c482559470bc704041 (diff) | |
download | kdepimpi-3e949ed97c7a65eeaddecb1048872cd8595b3caf.zip kdepimpi-3e949ed97c7a65eeaddecb1048872cd8595b3caf.tar.gz kdepimpi-3e949ed97c7a65eeaddecb1048872cd8595b3caf.tar.bz2 |
added missing actions in kopi
-rw-r--r-- | korganizer/calendarview.cpp | 35 | ||||
-rw-r--r-- | korganizer/calendarview.h | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 25 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 6 |
4 files changed, 69 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index b1da144..38b55f7 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2386,32 +2386,67 @@ void CalendarView::showDatePicker( ) | |||
2386 | void CalendarView::showEventEditor() | 2386 | void CalendarView::showEventEditor() |
2387 | { | 2387 | { |
2388 | #ifdef DESKTOP_VERSION | 2388 | #ifdef DESKTOP_VERSION |
2389 | mEventEditor->show(); | 2389 | mEventEditor->show(); |
2390 | #else | 2390 | #else |
2391 | mEventEditor->showMaximized(); | 2391 | mEventEditor->showMaximized(); |
2392 | #endif | 2392 | #endif |
2393 | } | 2393 | } |
2394 | void CalendarView::showTodoEditor() | 2394 | void CalendarView::showTodoEditor() |
2395 | { | 2395 | { |
2396 | #ifdef DESKTOP_VERSION | 2396 | #ifdef DESKTOP_VERSION |
2397 | mTodoEditor->show(); | 2397 | mTodoEditor->show(); |
2398 | #else | 2398 | #else |
2399 | mTodoEditor->showMaximized(); | 2399 | mTodoEditor->showMaximized(); |
2400 | #endif | 2400 | #endif |
2401 | } | 2401 | } |
2402 | |||
2403 | void CalendarView::cloneIncidence() | ||
2404 | { | ||
2405 | Incidence *incidence = currentSelection(); | ||
2406 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | ||
2407 | if ( incidence ) { | ||
2408 | cloneIncidence(incidence); | ||
2409 | } | ||
2410 | } | ||
2411 | void CalendarView::moveIncidence() | ||
2412 | { | ||
2413 | Incidence *incidence = currentSelection(); | ||
2414 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | ||
2415 | if ( incidence ) { | ||
2416 | moveIncidence(incidence); | ||
2417 | } | ||
2418 | } | ||
2419 | void CalendarView::beamIncidence() | ||
2420 | { | ||
2421 | Incidence *incidence = currentSelection(); | ||
2422 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | ||
2423 | if ( incidence ) { | ||
2424 | beamIncidence(incidence); | ||
2425 | } | ||
2426 | } | ||
2427 | void CalendarView::toggleCancelIncidence() | ||
2428 | { | ||
2429 | Incidence *incidence = currentSelection(); | ||
2430 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | ||
2431 | if ( incidence ) { | ||
2432 | cancelIncidence(incidence); | ||
2433 | } | ||
2434 | } | ||
2435 | |||
2436 | |||
2402 | void CalendarView::cancelIncidence(Incidence * inc ) | 2437 | void CalendarView::cancelIncidence(Incidence * inc ) |
2403 | { | 2438 | { |
2404 | inc->setCancelled( ! inc->cancelled() ); | 2439 | inc->setCancelled( ! inc->cancelled() ); |
2405 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 2440 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
2406 | updateView(); | 2441 | updateView(); |
2407 | } | 2442 | } |
2408 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 2443 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
2409 | { | 2444 | { |
2410 | Incidence * newInc = orgInc->clone(); | 2445 | Incidence * newInc = orgInc->clone(); |
2411 | newInc->recreate(); | 2446 | newInc->recreate(); |
2412 | 2447 | ||
2413 | if ( newInc->type() == "Todo" ) { | 2448 | if ( newInc->type() == "Todo" ) { |
2414 | Todo* t = (Todo*) newInc; | 2449 | Todo* t = (Todo*) newInc; |
2415 | mTodoEditor->editTodo( t ); | 2450 | mTodoEditor->editTodo( t ); |
2416 | showTodoEditor(); | 2451 | showTodoEditor(); |
2417 | if ( mTodoEditor->exec() ) { | 2452 | if ( mTodoEditor->exec() ) { |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index cd54685..a713c91 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -198,32 +198,36 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
198 | */ | 198 | */ |
199 | bool saveCalendar(QString filename); | 199 | bool saveCalendar(QString filename); |
200 | 200 | ||
201 | /** | 201 | /** |
202 | Close calendar. Clear calendar data and reset views to display an empty | 202 | Close calendar. Clear calendar data and reset views to display an empty |
203 | calendar. | 203 | calendar. |
204 | */ | 204 | */ |
205 | void closeCalendar(); | 205 | void closeCalendar(); |
206 | 206 | ||
207 | /** Archive old events of calendar */ | 207 | /** Archive old events of calendar */ |
208 | void archiveCalendar(); | 208 | void archiveCalendar(); |
209 | 209 | ||
210 | void showIncidence(); | 210 | void showIncidence(); |
211 | void editIncidence(); | 211 | void editIncidence(); |
212 | void editIncidenceDescription(); | 212 | void editIncidenceDescription(); |
213 | void deleteIncidence(); | 213 | void deleteIncidence(); |
214 | void cloneIncidence(); | ||
215 | void moveIncidence(); | ||
216 | void beamIncidence(); | ||
217 | void toggleCancelIncidence(); | ||
214 | 218 | ||
215 | /** create an editeventwin with supplied date/time, and if bool is true, | 219 | /** create an editeventwin with supplied date/time, and if bool is true, |
216 | * make the event take all day. */ | 220 | * make the event take all day. */ |
217 | void newEvent(QDateTime, QDateTime, bool allDay = false); | 221 | void newEvent(QDateTime, QDateTime, bool allDay = false); |
218 | void newEvent(QDateTime fh); | 222 | void newEvent(QDateTime fh); |
219 | void newEvent(QDate dt); | 223 | void newEvent(QDate dt); |
220 | /** create new event without having a date hint. Takes current date as | 224 | /** create new event without having a date hint. Takes current date as |
221 | default hint. */ | 225 | default hint. */ |
222 | void newEvent(); | 226 | void newEvent(); |
223 | void newFloatingEvent(); | 227 | void newFloatingEvent(); |
224 | 228 | ||
225 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ | 229 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ |
226 | void showIncidence(Incidence *); | 230 | void showIncidence(Incidence *); |
227 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ | 231 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ |
228 | void editIncidence(Incidence *); | 232 | void editIncidence(Incidence *); |
229 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ | 233 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 6a9a2f1..bd14fbf 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -624,32 +624,50 @@ void MainWindow::initActions() | |||
624 | 624 | ||
625 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 625 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
626 | mShowAction->addTo( actionMenu ); | 626 | mShowAction->addTo( actionMenu ); |
627 | connect( mShowAction, SIGNAL( activated() ), | 627 | connect( mShowAction, SIGNAL( activated() ), |
628 | mView, SLOT( showIncidence() ) ); | 628 | mView, SLOT( showIncidence() ) ); |
629 | 629 | ||
630 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 630 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
631 | mEditAction->addTo( actionMenu ); | 631 | mEditAction->addTo( actionMenu ); |
632 | connect( mEditAction, SIGNAL( activated() ), | 632 | connect( mEditAction, SIGNAL( activated() ), |
633 | mView, SLOT( editIncidence() ) ); | 633 | mView, SLOT( editIncidence() ) ); |
634 | 634 | ||
635 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 635 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
636 | mDeleteAction->addTo( actionMenu ); | 636 | mDeleteAction->addTo( actionMenu ); |
637 | connect( mDeleteAction, SIGNAL( activated() ), | 637 | connect( mDeleteAction, SIGNAL( activated() ), |
638 | mView, SLOT( deleteIncidence() ) ); | 638 | mView, SLOT( deleteIncidence() ) ); |
639 | 639 | ||
640 | |||
641 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | ||
642 | mCloneAction->addTo( actionMenu ); | ||
643 | connect( mCloneAction, SIGNAL( activated() ), | ||
644 | mView, SLOT( cloneIncidence() ) ); | ||
645 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | ||
646 | mMoveAction->addTo( actionMenu ); | ||
647 | connect( mMoveAction, SIGNAL( activated() ), | ||
648 | mView, SLOT( moveIncidence() ) ); | ||
649 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | ||
650 | mBeamAction->addTo( actionMenu ); | ||
651 | connect( mBeamAction, SIGNAL( activated() ), | ||
652 | mView, SLOT( beamIncidence() ) ); | ||
653 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | ||
654 | mCancelAction->addTo( actionMenu ); | ||
655 | connect( mCancelAction, SIGNAL( activated() ), | ||
656 | mView, SLOT( toggleCancelIncidence() ) ); | ||
657 | |||
640 | actionMenu->insertSeparator(); | 658 | actionMenu->insertSeparator(); |
641 | 659 | ||
642 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 660 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
643 | this ); | 661 | this ); |
644 | action->addTo( actionMenu ); | 662 | action->addTo( actionMenu ); |
645 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 663 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
646 | 664 | ||
647 | icon = loadPixmap( pathString + "search" ); | 665 | icon = loadPixmap( pathString + "search" ); |
648 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 666 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
649 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 667 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
650 | search_action->addTo( actionMenu ); | 668 | search_action->addTo( actionMenu ); |
651 | connect( search_action, SIGNAL( activated() ), | 669 | connect( search_action, SIGNAL( activated() ), |
652 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 670 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
653 | 671 | ||
654 | icon = loadPixmap( pathString + "today" ); | 672 | icon = loadPixmap( pathString + "today" ); |
655 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 673 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
@@ -1173,33 +1191,33 @@ void MainWindow::exportToPhone( int mode ) | |||
1173 | KOPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1191 | KOPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1174 | 1192 | ||
1175 | int inFuture = 0; | 1193 | int inFuture = 0; |
1176 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1194 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1177 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1195 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1178 | QPtrList<Incidence> delSel; | 1196 | QPtrList<Incidence> delSel; |
1179 | if ( mode == 1 ) | 1197 | if ( mode == 1 ) |
1180 | delSel = mCalendar->rawIncidences(); | 1198 | delSel = mCalendar->rawIncidences(); |
1181 | if ( mode == 2 ) | 1199 | if ( mode == 2 ) |
1182 | delSel = mCalendar->incidences(); | 1200 | delSel = mCalendar->incidences(); |
1183 | CalendarLocal* cal = new CalendarLocal(); | 1201 | CalendarLocal* cal = new CalendarLocal(); |
1184 | cal->setLocalTime(); | 1202 | cal->setLocalTime(); |
1185 | Incidence *incidence = delSel.first(); | 1203 | Incidence *incidence = delSel.first(); |
1186 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1204 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1187 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1205 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1188 | while ( incidence ) { | 1206 | while ( incidence ) { |
1189 | if ( incidence->type() != "journal" ) { | 1207 | if ( incidence->type() != "Journal" ) { |
1190 | bool add = true; | 1208 | bool add = true; |
1191 | if ( inFuture ) { | 1209 | if ( inFuture ) { |
1192 | QDateTime dt; | 1210 | QDateTime dt; |
1193 | if ( incidence->type() == "Todo" ) { | 1211 | if ( incidence->type() == "Todo" ) { |
1194 | Todo * t = (Todo*)incidence; | 1212 | Todo * t = (Todo*)incidence; |
1195 | if ( t->hasDueDate() ) | 1213 | if ( t->hasDueDate() ) |
1196 | dt = t->dtDue(); | 1214 | dt = t->dtDue(); |
1197 | else | 1215 | else |
1198 | dt = cur.addSecs( 62 ); | 1216 | dt = cur.addSecs( 62 ); |
1199 | } | 1217 | } |
1200 | else { | 1218 | else { |
1201 | bool ok; | 1219 | bool ok; |
1202 | dt = incidence->getNextOccurence( cur, &ok ); | 1220 | dt = incidence->getNextOccurence( cur, &ok ); |
1203 | if ( !ok ) | 1221 | if ( !ok ) |
1204 | dt = cur.addSecs( -62 ); | 1222 | dt = cur.addSecs( -62 ); |
1205 | } | 1223 | } |
@@ -1485,32 +1503,37 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1485 | 1503 | ||
1486 | mNewSubTodoAction->setEnabled( true ); | 1504 | mNewSubTodoAction->setEnabled( true ); |
1487 | } else { | 1505 | } else { |
1488 | mShowAction->setText( i18n("Show...") ); | 1506 | mShowAction->setText( i18n("Show...") ); |
1489 | mShowAction->setText( i18n("Edit...") ); | 1507 | mShowAction->setText( i18n("Edit...") ); |
1490 | mShowAction->setText( i18n("Delete...") ); | 1508 | mShowAction->setText( i18n("Delete...") ); |
1491 | 1509 | ||
1492 | mNewSubTodoAction->setEnabled( false ); | 1510 | mNewSubTodoAction->setEnabled( false ); |
1493 | } | 1511 | } |
1494 | } | 1512 | } |
1495 | 1513 | ||
1496 | void MainWindow::enableIncidenceActions( bool enabled ) | 1514 | void MainWindow::enableIncidenceActions( bool enabled ) |
1497 | { | 1515 | { |
1498 | mShowAction->setEnabled( enabled ); | 1516 | mShowAction->setEnabled( enabled ); |
1499 | mEditAction->setEnabled( enabled ); | 1517 | mEditAction->setEnabled( enabled ); |
1500 | mDeleteAction->setEnabled( enabled ); | 1518 | mDeleteAction->setEnabled( enabled ); |
1519 | |||
1520 | mCloneAction->setEnabled( enabled ); | ||
1521 | mMoveAction->setEnabled( enabled ); | ||
1522 | mBeamAction->setEnabled( enabled ); | ||
1523 | mCancelAction->setEnabled( enabled ); | ||
1501 | } | 1524 | } |
1502 | 1525 | ||
1503 | void MainWindow::importOL() | 1526 | void MainWindow::importOL() |
1504 | { | 1527 | { |
1505 | #ifdef _WIN32_ | 1528 | #ifdef _WIN32_ |
1506 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1529 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1507 | id->exec(); | 1530 | id->exec(); |
1508 | delete id; | 1531 | delete id; |
1509 | mView->updateView(); | 1532 | mView->updateView(); |
1510 | #endif | 1533 | #endif |
1511 | } | 1534 | } |
1512 | void MainWindow::importBday() | 1535 | void MainWindow::importBday() |
1513 | { | 1536 | { |
1514 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1537 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1515 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1538 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1516 | i18n("Import!"), i18n("Cancel"), 0, | 1539 | i18n("Import!"), i18n("Cancel"), 0, |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 74c7f45..4f89e03 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -184,27 +184,33 @@ class MainWindow : public QMainWindow | |||
184 | QPEToolBar *iconToolBar; | 184 | QPEToolBar *iconToolBar; |
185 | void initActions(); | 185 | void initActions(); |
186 | void setDefaultPreferences(); | 186 | void setDefaultPreferences(); |
187 | void keyPressEvent ( QKeyEvent * ) ; | 187 | void keyPressEvent ( QKeyEvent * ) ; |
188 | void keyReleaseEvent ( QKeyEvent * ) ; | 188 | void keyReleaseEvent ( QKeyEvent * ) ; |
189 | QPopupMenu *configureToolBarMenu; | 189 | QPopupMenu *configureToolBarMenu; |
190 | QPopupMenu *selectFilterMenu; | 190 | QPopupMenu *selectFilterMenu; |
191 | QPopupMenu *configureAgendaMenu, *syncMenu; | 191 | QPopupMenu *configureAgendaMenu, *syncMenu; |
192 | CalendarLocal *mCalendar; | 192 | CalendarLocal *mCalendar; |
193 | CalendarView *mView; | 193 | CalendarView *mView; |
194 | QString getPassword(); | 194 | QString getPassword(); |
195 | QAction *mNewSubTodoAction; | 195 | QAction *mNewSubTodoAction; |
196 | 196 | ||
197 | QAction *mShowAction; | 197 | QAction *mShowAction; |
198 | QAction *mEditAction; | 198 | QAction *mEditAction; |
199 | QAction *mDeleteAction; | 199 | QAction *mDeleteAction; |
200 | QAction *mCloneAction; | ||
201 | QAction *mMoveAction; | ||
202 | QAction *mBeamAction; | ||
203 | QAction *mCancelAction; | ||
204 | |||
205 | |||
200 | void closeEvent( QCloseEvent* ce ); | 206 | void closeEvent( QCloseEvent* ce ); |
201 | SimpleAlarmClient mAlarmClient; | 207 | SimpleAlarmClient mAlarmClient; |
202 | QTimer mSaveTimer; | 208 | QTimer mSaveTimer; |
203 | bool mBlockSaveFlag; | 209 | bool mBlockSaveFlag; |
204 | bool mCalendarModifiedFlag; | 210 | bool mCalendarModifiedFlag; |
205 | QPixmap loadPixmap( QString ); | 211 | QPixmap loadPixmap( QString ); |
206 | QDialog * mSyncActionDialog; | 212 | QDialog * mSyncActionDialog; |
207 | }; | 213 | }; |
208 | 214 | ||
209 | 215 | ||
210 | #endif | 216 | #endif |