author | zautrix <zautrix> | 2005-01-22 10:18:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-22 10:18:16 (UTC) |
commit | 6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452 (patch) (side-by-side diff) | |
tree | 006248579ca44ad2e0c1a67db55b1a8013180ed7 /korganizer | |
parent | b715b109b70b8cd24a2d9da1d4863c44d79fb2a4 (diff) | |
download | kdepimpi-6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452.zip kdepimpi-6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452.tar.gz kdepimpi-6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452.tar.bz2 |
some small fixes
-rw-r--r-- | korganizer/calendarview.cpp | 52 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 20 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.h | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 5 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 11 |
6 files changed, 65 insertions, 26 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8f05276..038da54 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2176,27 +2176,27 @@ void CalendarView::updateView() if ( KOPrefs::instance()->mHideNonStartedTodos ) mTodoList->updateView(); // We assume that the navigator only selects consecutive days. updateView( tmpList.first(), tmpList.last() ); } void CalendarView::updateUnmanagedViews() { mDateNavigator->updateDayMatrix(); } -int CalendarView::msgItemDelete() +int CalendarView::msgItemDelete(const QString name) { - return KMessageBox::warningContinueCancel(this, + return KMessageBox::warningContinueCancel(this,name +"\n\n"+ i18n("This item will be\npermanently deleted."), i18n("KO/Pi Confirmation"),i18n("Delete")); } void CalendarView::edit_cut() { Event *anEvent=0; Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); if (mViewManager->currentView()->isEventView()) { @@ -2879,58 +2879,61 @@ void CalendarView::todo_unsub(Todo *anTodo ) anTodo->setRelatedToUid(""); setModified(true); updateView(); } void CalendarView::deleteTodo(Todo *todo) { if (!todo) { KNotifyClient::beep(); return; } if (KOPrefs::instance()->mConfirm) { - switch (msgItemDelete()) { + QString text = todo->summary().left(20); + if (!todo->relations().isEmpty()) { + text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); + + } + switch (msgItemDelete(text)) { case KMessageBox::Continue: // OK + bool deleteT = false; if (!todo->relations().isEmpty()) { - KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), - i18n("Delete To-Do")); - } else { + deleteT = removeCompletedSubTodos( todo ); + } + // deleteT == true: todo already deleted in removeCompletedSubTodos + if ( !deleteT ) { checkExternalId( todo ); calendar()->deleteTodo(todo); changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); updateView(); } break; } // switch } else { - if (!todo->relations().isEmpty()) { - KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), - i18n("Delete To-Do")); - } else { - checkExternalId( todo ); - mCalendar->deleteTodo(todo); - changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); - updateView(); - } + checkExternalId( todo ); + mCalendar->deleteTodo(todo); + changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); + updateView(); } + emit updateSearchDialog(); } void CalendarView::deleteJournal(Journal *jour) { if (!jour) { KNotifyClient::beep(); return; } if (KOPrefs::instance()->mConfirm) { - switch (msgItemDelete()) { + switch (msgItemDelete( jour->description().left(20))) { case KMessageBox::Continue: // OK calendar()->deleteJournal(jour); updateView(); break; } // switch } else { calendar()->deleteJournal(jour);; updateView(); } emit updateSearchDialog(); } @@ -3474,24 +3477,41 @@ void CalendarView::showDates(const DateList &selectedDates) if ( !mBlockShowDates ) { if ( mViewManager->currentView() ) { updateView( selectedDates.first(), selectedDates.last() ); } else { mViewManager->showAgendaView(); } } QString selDates; selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); if (selectedDates.first() < selectedDates.last() ) selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); + else { + QString addString; + if ( selectedDates.first() == QDateTime::currentDateTime().date() ) + addString = i18n("Today"); + else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) + addString = i18n("Tomorrow"); + else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) + addString = i18n("Yesterday"); + else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) + addString = i18n("Day before yesterday"); + else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) + addString = i18n("Day after tomorrow"); + if ( !addString.isEmpty() ) { + topLevelWidget()->setCaption( addString+", " + selDates ); + return; + } + } topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); } QPtrList<CalFilter> CalendarView::filters() { return mFilters; } void CalendarView::editFilters() { // kdDebug() << "CalendarView::editFilters()" << endl; diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index e27da9a..c8d6bdd 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -476,25 +476,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser /** Adapt navigation units correpsonding to step size of navigation of the * current view. */ void adaptNavigationUnits(); bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); //Attendee* getYourAttendee(Event *event); void setBlockShowDates( bool b ) { mBlockShowDates = b ;} protected: void schedule(Scheduler::Method, Incidence *incidence = 0); // returns KMsgBox::OKCandel() - int msgItemDelete(); + int msgItemDelete(const QString name); void showEventEditor(); void showTodoEditor(); void writeLocale(); Todo *selectedTodo(); private: bool mBlockShowDates; KSyncManager* mSyncManager; AlarmDialog * mAlarmDialog; QString mAlarmNotification; QString mSuspendAlarmNotification; QTimer* mSuspendTimer; diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 94e1f4c..b4fe965 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -274,44 +274,58 @@ void KOEditorGeneral::pickAlarmProgram() } else { mAlarmProgramButton->setOn(false); mAlarmSoundButton->setOn(true); } } if (mAlarmProgramButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram ); if ( mAlarmSoundButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound ); } +QString KOEditorGeneral::getFittingPath( const QString s ) +{ + int maxlen = 50; + if ( QApplication::desktop()->width() < 640 ) { + if ( QApplication::desktop()->width() < 320 ) + maxlen = 22; + else + maxlen = 35; + } + if ( s.length() > maxlen ) { + return "..."+s.right(maxlen -3); + } + return s; +} void KOEditorGeneral::enableAlarmEdit(bool enable) { if ( enable ) { if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { mAlarmSoundButton->setOn( true ); if ( mAlarmSound.isEmpty() ) mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; else { if ( ! QFile::exists( mAlarmSound ) ) mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; } } if (mAlarmProgramButton->isOn()) - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram ); + ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound ); + ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); } else { - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled")); + ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item")); } mAlarmTimeEdit->setEnabled(enable); mAlarmSoundButton->setEnabled(enable); mAlarmProgramButton->setEnabled(enable); mAlarmIncrCombo->setEnabled(enable); } void KOEditorGeneral::disableAlarmEdit(bool disable) { enableAlarmEdit( !disable ); } diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index c58335e..de8edaf 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h @@ -96,17 +96,18 @@ class KOEditorGeneral : public QObject QSpinBox *mAlarmTimeEdit; QPushButton *mAlarmSoundButton; QPushButton *mAlarmProgramButton; QComboBox *mAlarmIncrCombo; KTextEdit *mDescriptionEdit; QLabel *mOwnerLabel; QComboBox *mSecrecyCombo; QCheckBox *mCancelBox; QPushButton *mCategoriesButton; QLabel *mCategoriesLabel; private: + QString getFittingPath( const QString ) ; QString mAlarmSound; QString mAlarmProgram; }; #endif diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 97b4a03..30adb06 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -809,30 +809,25 @@ void KOTodoView::beamTodo() void KOTodoView::showTodo() { if (mActiveItem) { emit showTodoSignal(mActiveItem->todo()); } } void KOTodoView::deleteTodo() { if (mActiveItem) { - if (mActiveItem->childCount()) { - KMessageBox::sorry(this,i18n("Cannot delete To-Do which has children."), - i18n("Delete To-Do")); - } else { emit deleteTodoSignal(mActiveItem->todo()); - } } } void KOTodoView::setNewPriority(int index) { if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { mActiveItem->todo()->setPriority(mPriority[index]); mActiveItem->construct(); todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); } } diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 151b55b..7b07a2e 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1695,25 +1695,34 @@ void MainWindow::configureToolBar( int item ) p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); // initActions(); } void MainWindow::setCaptionToDates() { QString selDates; selDates = KGlobal::locale()->formatDate(mView->startDate(), true); if (mView->startDate() < mView->endDate() ) - selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); + selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); + else { + QString addString; + if ( mView->startDate() == QDateTime::currentDateTime().date() ) + addString = i18n("Today"); + else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) + addString = i18n("Tomorrow"); + if ( !addString.isEmpty() ) + selDates = addString+", "+selDates ; + } setCaption( i18n("Dates: ") + selDates ); } // parameter item == 0: reinit void MainWindow::configureAgenda( int item ) { KOPrefs *p = KOPrefs::instance(); int i; // do not allow 4 for widgets higher than 480 // if ( QApplication::desktop()->height() > 480 ) { |