author | zautrix <zautrix> | 2005-07-28 10:38:58 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-28 10:38:58 (UTC) |
commit | fee4c893fe8fd01af1b55c1ccd40213fc18a36b4 (patch) (side-by-side diff) | |
tree | 83a3018d54d60e880d441a6f91ef8fe54254aaff | |
parent | 27ffa2e08ebb38e71f613af3a214750442418e2c (diff) | |
download | kdepimpi-fee4c893fe8fd01af1b55c1ccd40213fc18a36b4.zip kdepimpi-fee4c893fe8fd01af1b55c1ccd40213fc18a36b4.tar.gz kdepimpi-fee4c893fe8fd01af1b55c1ccd40213fc18a36b4.tar.bz2 |
fixxxx
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 10 | ||||
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 21 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 71 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 5 | ||||
-rw-r--r-- | libkcal/alarm.cpp | 2 | ||||
-rw-r--r-- | libkcal/event.cpp | 8 | ||||
-rw-r--r-- | libkcal/event.h | 1 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 29 | ||||
-rw-r--r-- | libkcal/incidence.h | 3 | ||||
-rw-r--r-- | libkcal/todo.cpp | 10 | ||||
-rw-r--r-- | libkcal/todo.h | 1 |
11 files changed, 105 insertions, 56 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index f3f5333..ab8339f 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -154,19 +154,19 @@ { "Edit Todo...","Berabeite Todo..." }, { "Edit To-Do","Todo bearbeiten" }, { "E&mail address:","E&mail Adresse:" }, { "(EmptyEmail)","(KeineEmail)" }, { "(EmptyName)","(KeinName)" }, { "Enable Recurrence","Wiederholung anschalten" }, { "End after","Endet nach"}, { "End by:","Endet am"}, -{ "End Date","End Datum" }, +{ "End/Due Date","Ende/Fällig am" }, { "End:","Ende:" }, -{ "End Time","End Zeit" }, +{ "End/Due Time","Ende/Fällig um" }, { "English","Englisch" }, { "Event","Termin" }, { "Event list","Termin Liste" }, { "Events","Termine" }, { "Event Viewer:","Termin Übersicht:" }, { "every","jede" }, { "Exceptions...","Ausnahmen..." }, { "Exceptions","Ausnahmen" }, @@ -359,19 +359,19 @@ { "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, { "&Show","Anzeigen" }, { "Show...","Anzeigen..." }, { "Show","Anzeigen" }, { "Small","Klein" }, { "Sorry","Tut mir leid" }, {"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, { "Start:","Start:" }, -{ "Start Date","Start Datum" }, +{ "Start Date","Start am" }, { "Start date: %1","Start Datum: %1" }, -{ "Start Time","Start Zeit" }, +{ "Start Time","Start um" }, { "Status:","Status:" }, { "Status","Status:" }, { "Summaries","Titel" }, { "Summary:","Titel:" }, { "Summary","Titel" }, { "Sunday","Sonntag" }, { "Sun","So" }, { "Sync preferences:","Sync Einstellungen" }, @@ -1526,16 +1526,18 @@ { "Writing back file ...","Schreibe Datei zurück..." }, { "Sending back file ...","Sende Datei zurück..." }, { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, { "Created","Angelegt" }, { "Last Modified Sub","Zuletzt geändertes Sub" }, { "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, { "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, +{ "Duration","Dauer" }, +{ " day"," Tag" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index 965cf47..10d9a8c 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp @@ -92,40 +92,39 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); timeGroupBox->layout()->setMargin( KDialog::marginHint() ); QFrame *timeBoxFrame = new QFrame(timeGroupBox); QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); layoutTimeBox->setColStretch( 1, 1 ); + mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); + layoutTimeBox->addWidget(mStartCheck,0,0); + connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); + + mStartDateEdit = new KDateEdit(timeBoxFrame); + layoutTimeBox->addWidget(mStartDateEdit,0,1); + + mStartTimeEdit = new KOTimeEdit(timeBoxFrame); + layoutTimeBox->addWidget(mStartTimeEdit,0,2); + mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); layoutTimeBox->addWidget(mDueCheck,1,0); connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm())); mDueDateEdit = new KDateEdit(timeBoxFrame); layoutTimeBox->addWidget(mDueDateEdit,1,1); mDueTimeEdit = new KOTimeEdit(timeBoxFrame); layoutTimeBox->addWidget(mDueTimeEdit,1,2); - mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); - layoutTimeBox->addWidget(mStartCheck,0,0); - connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); - - mStartDateEdit = new KDateEdit(timeBoxFrame); - layoutTimeBox->addWidget(mStartDateEdit,0,1); - - mStartTimeEdit = new KOTimeEdit(timeBoxFrame); - layoutTimeBox->addWidget(mStartTimeEdit,0,2); - - mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(startDateChanged(QDate))); diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index e7a5e0e..e560ce4 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -123,30 +123,29 @@ bool ListItemVisitor::visit(Event *e) mItem->setText(2,"---"); else mItem->setText(2,e->dtStartTimeStr()); mItem->setText(3,end); if ( e->doesFloat() ) mItem->setText(4,"---"); else mItem->setText(4,e->dtEndTimeStr()); + mItem->setText(5, e->durationText()); if ( e->isAlarmEnabled() ) { - mItem->setText(5,e->alarms().first()->offsetText() ); + mItem->setText(6,e->alarms().first()->offsetText() ); } else { - mItem->setText(5, i18n("No")); + mItem->setText(6, i18n("No")); } - mItem->setText(6, e->recurrenceText()); + mItem->setText(7, e->recurrenceText()); if( ! e->doesRecur() ) - mItem->setSortKey( 6, "-" ); - mItem->setText(7,"---"); - mItem->setText(8,"---"); - mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); - mItem->setText(10,e->categoriesStr()); - mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); - mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); + mItem->setSortKey( 7, "-" ); + mItem->setText(8, e->cancelled() ? i18n("Yes") : i18n("No")); + mItem->setText(9,e->categoriesStr()); + mItem->setText(10, KOPrefs::instance()->calName( e->calID() )); + mItem->setText(11, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); QString key; QDate d = e->lastModified().date(); QTime t = e->lastModified().time(); key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); mItem->setSortKey(12,key); t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); @@ -172,51 +171,50 @@ bool ListItemVisitor::visit(Todo *t) mItem->setText(2,"---"); } else { mItem->setText(2,t->dtStartTimeStr()); } } else { mItem->setText(1,"---"); mItem->setText(2,"---"); } - mItem->setText(3,"---"); - mItem->setText(4,"---"); if ( t->isAlarmEnabled() ) { - mItem->setText(5,t->alarms().first()->offsetText() ); + mItem->setText(6,t->alarms().first()->offsetText() ); } else { - mItem->setText(5, i18n("No")); + mItem->setText(6, i18n("No")); } - mItem->setText(6, t->recurrenceText()); + mItem->setText(7, t->recurrenceText()); if( ! t->doesRecur() ) - mItem->setSortKey( 6, "-" ); + mItem->setSortKey( 7, "-" ); if (t->hasDueDate()) { - mItem->setText(7,t->dtDueDateStr()); + mItem->setText(3,t->dtDueDateStr()); if (t->doesFloat()) { - mItem->setText(8,"---"); + mItem->setText(4,"---"); } else { - mItem->setText(8,t->dtDueTimeStr()); + mItem->setText(4,t->dtDueTimeStr()); } } else { - mItem->setText(7,"---"); - mItem->setText(8,"---"); + mItem->setText(3,"---"); + mItem->setText(4,"---"); } - mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); - mItem->setText(10,t->categoriesStr()); - mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); - mItem->setText(12, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); + mItem->setText(5, t->durationText()); + mItem->setText(8, t->cancelled() ? i18n("Yes") : i18n("No")); + mItem->setText(9,t->categoriesStr()); + mItem->setText(10, KOPrefs::instance()->calName( t->calID() )); + mItem->setText(11, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); QString key; QDate d = t->lastModified().date(); QTime tm = t->lastModified().time(); key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); - mItem->setSortKey(12,key); + mItem->setSortKey(11,key); if (t->hasDueDate()) { d = t->dtDue().date(); tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); - mItem->setSortKey(7,key); + mItem->setSortKey(3,key); } if ( t->hasStartDate() ) { d = t->dtStart().date(); tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); mItem->setSortKey(1,key); } return true; @@ -238,22 +236,21 @@ bool ListItemVisitor::visit(Journal * j) mItem->setText(0,des.left(25)); mItem->setSortKey(0,"0"+ des.left(25)); mItem->setText(1,j->dtStartDateStr()); mItem->setText(2,"---"); mItem->setText(3,"---"); mItem->setText(4,"---"); mItem->setText(5,"---"); mItem->setText(6,"---"); - mItem->setText(7,j->dtStartDateStr()); + mItem->setText(7,"---"); mItem->setText(8,"---"); - mItem->setText(9,"---"); - mItem->setText(10,j->categoriesStr()); - mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); - mItem->setText(12, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); + mItem->setText(9,j->categoriesStr()); + mItem->setText(10, KOPrefs::instance()->calName( j->calID() )); + mItem->setText(11, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); QString key; QDate d = j->lastModified().date(); QTime tm = j->lastModified().time(); key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); mItem->setSortKey(12,key); d = j->dtStart().date(); key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); @@ -269,22 +266,21 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, { mActiveItem = 0; mForceShowCompletedTodos = false; mListView = new KOListViewListView(this); mListView->addColumn(i18n("Summary")); mListView->addColumn(i18n("Start Date")); mListView->addColumn(i18n("Start Time")); - mListView->addColumn(i18n("End Date")); - mListView->addColumn(i18n("End Time")); + mListView->addColumn(i18n("End/Due Date")); + mListView->addColumn(i18n("End/Due Time")); + mListView->addColumn(i18n("Duration")); mListView->addColumn(i18n("Alarm")); // alarm set? mListView->addColumn(i18n("Recurs")); // recurs? - mListView->addColumn(i18n("Due Date")); - mListView->addColumn(i18n("Due Time")); mListView->addColumn(i18n("Cancelled")); mListView->addColumn(i18n("Categories")); mListView->addColumn(i18n("Calendar")); mListView->addColumn(i18n("Last Modified")); mListView->setColumnAlignment(0,AlignLeft); mListView->setColumnAlignment(1,AlignLeft); mListView->setColumnAlignment(2,AlignHCenter); @@ -292,21 +288,20 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mListView->setColumnAlignment(4,AlignHCenter); mListView->setColumnAlignment(5,AlignLeft); mListView->setColumnAlignment(6,AlignLeft); mListView->setColumnAlignment(7,AlignLeft); mListView->setColumnAlignment(8,AlignLeft); mListView->setColumnAlignment(9,AlignLeft); mListView->setColumnAlignment(10,AlignLeft); mListView->setColumnAlignment(11,AlignLeft); - mListView->setColumnAlignment(12,AlignLeft); mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); int iii = 0; - for ( iii = 0; iii< 13 ; ++iii ) + for ( iii = 0; iii< 12 ; ++iii ) mListView->setColumnWidthMode( iii, QListView::Manual ); QBoxLayout *layoutTop = new QVBoxLayout(this); layoutTop->addWidget(mListView); mListView->setFont ( KOPrefs::instance()->mListViewFont ); mPopupMenu = eventPopup(); QPopupMenu* selPopup = new QPopupMenu ( this ); mPopupMenu->insertSeparator(); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 77d0ac8..98a820d 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -220,17 +220,20 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : if ( p->mToolBarUpF ) tbd = Right; else tbd = Left; } filterToolBar = new QPEToolBar ( this ); filterMenubar = new KMenuBar( 0 ); QFontMetrics fm ( filterMenubar->font() ); - +#ifndef DESKTOP_VERSION + filterToolBar->setFocusPolicy( NoFocus ); + filterMenubar->setFocusPolicy( NoFocus ); +#endif filterPopupMenu = new QPopupMenu( this ); filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); QString addTest = "A"; filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); #ifdef DESKTOP_VERSION addTest = "AAABBBCCCx"; #else addTest = "AAx"; diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 79e0464..3157214 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp @@ -345,17 +345,17 @@ int Alarm::offset() return mParent->dtStart().secsTo( mAlarmTime ) ; } else { return mOffset.asSeconds(); } } -QString Alarm::offsetText() +QString Alarm::offsetText() { int min = -offset()/60; int hours = min /60; min = min % 60; int days = hours /24; hours = hours % 24; QString message; //qDebug("%d %d %d ", days, hours, min ); diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 0766fd9..fdf5657 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp @@ -409,8 +409,16 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_ * offset = off; return alarmStart; } } *ok = false; return QDateTime (); } + +QString Event::durationText() +{ + int sec = mDtStart.secsTo( mDtEnd ); + if ( doesFloat() ) + sec += 86400; + return durationText4Time( sec ); +} diff --git a/libkcal/event.h b/libkcal/event.h index 2da9770..6a58618 100644 --- a/libkcal/event.h +++ b/libkcal/event.h @@ -71,16 +71,17 @@ class Event : public Incidence /** get the event's time transparency level. */ Transparency transparency() const; void setDuration(int seconds); bool contains ( Event*); bool isOverlapping ( Event*, QDateTime*, QDateTime* ); + QString durationText(); private: bool accept(Visitor &v) { return v.visit(this); } QDateTime mDtEnd; bool mHasEndDate; Transparency mTransparency; }; diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 4643a3a..201f593 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -95,17 +95,46 @@ Incidence::~Incidence() for (ev=Relations.first();ev;ev=Relations.next()) { if (ev->relatedTo() == this) ev->setRelatedTo(0); } if (relatedTo()) relatedTo()->removeRelation(this); if ( mRecurrence ) delete mRecurrence; } +QString Incidence::durationText() +{ + return "---"; +} +QString Incidence::durationText4Time( int offset ) +{ + int min = offset/60; + int hours = min /60; + min = min % 60; + int days = hours /24; + hours = hours % 24; + + if ( doesFloat() || ( min == 0 && hours == 0 ) ) { + if ( days == 1 ) + return "1" + i18n(" day"); + else + return QString::number( days )+ i18n(" days"); + } + QString message = QString::number ( hours ) +":"; + if ( min < 10 ) message += "0"; + message += QString::number ( min ); + if ( days > 0 ) { + if ( days == 1 ) + message = "1" + i18n(" day") + " "+message; + else + message = QString::number( days )+ i18n(" days") + " "+message; + } + return message; +} bool Incidence::isHoliday() const { return mHoliday; } bool Incidence::isBirthday() const { return mBirthday ; diff --git a/libkcal/incidence.h b/libkcal/incidence.h index 8519f01..88df217 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h @@ -276,17 +276,18 @@ class Incidence : public IncidenceBase QDateTime dtStart() const; bool isHoliday() const; bool isBirthday() const; bool isAnniversary() const; QDateTime lastModifiedSub(); QString recurrenceText() const; void setLastModifiedSubInvalid(); - + virtual QString durationText(); + QString durationText4Time( int secs ); Recurrence *mRecurrence; protected: QPtrList<Alarm> mAlarms; QPtrList<Incidence> mRelations; QDateTime mRecurrenceID; bool mHasRecurrenceID; private: void checkCategories(); diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 7bf756a..e4508a0 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -609,8 +609,18 @@ void Todo::checkSetCompletedFalse() QDateTime dt = QDateTime::currentDateTime(); if ( dt > mDtStart && dt > mRecurrenceID ) { qDebug("start: %s --due: %s --recID: %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); setCompleted( false ); qDebug("Todo::checkSetCompletedFalse "); } } } +QString Todo::durationText() +{ + if ( mHasDueDate && hasStartDate() ) { + int sec = dtStart().secsTo( dtDue() ); + if ( doesFloat() ) + sec += 86400; + return durationText4Time( sec ); + } + return "---"; +} diff --git a/libkcal/todo.h b/libkcal/todo.h index 425dfad..7feb32e 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h @@ -125,16 +125,17 @@ namespace KCal { void stopRunning(); int runTime(); QDateTime runStart () const { return mRunStart;} void saveRunningInfo( QString comment, QDateTime start, QDateTime end ); public slots: void saveRunningInfoToFile( QString st ); void saveRunningInfoToFile( ); void saveParents(); + QString durationText(); private: bool mRunning; QTimer * mRunSaveTimer; QDateTime mRunStart; QDateTime mRunEnd; bool accept(Visitor &v) { return v.visit(this); } QDateTime mDtDue; // due date of todo |