author | zautrix <zautrix> | 2005-06-15 18:23:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-15 18:23:08 (UTC) |
commit | ccfe3f97afd65c75ee6c7c931cb3694919a4e29b (patch) (side-by-side diff) | |
tree | 117d3467ef1d9678f31dea1b506390707f88d94a | |
parent | cba0ac17d3d505805be6aa4b4fea6f63473a1e00 (diff) | |
download | kdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.zip kdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.tar.gz kdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.tar.bz2 |
fixess
-rw-r--r-- | korganizer/calendarview.cpp | 9 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 0 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 68 | ||||
-rw-r--r-- | korganizer/kolistview.h | 5 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 4 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | libkcal/calendar.h | 1 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 10 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 1 | ||||
-rw-r--r-- | libkcal/incidencebase.cpp | 2 |
10 files changed, 86 insertions, 15 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 377a66f..2012e92 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1835,10 +1835,3 @@ void CalendarView::setSyncEventsReadOnly() { - Event * ev; - QPtrList<Event> eL = mCalendar->rawEvents(); - ev = eL.first(); - while ( ev ) { - if ( ev->uid().left(15) == QString("last-syncEvent-") ) - ev->setReadOnly( true ); - ev = eL.next(); - } + mCalendar->setSyncEventsReadOnly(); } diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index b2b136a..93ff55e 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 1f3b4c6..c705c73 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -69,5 +69,2 @@ - - - class KOListViewWhatsThis :public QWhatsThis @@ -142,2 +139,3 @@ bool ListItemVisitor::visit(Event *e) mItem->setText(10,e->categoriesStr()); + mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); @@ -191,2 +189,3 @@ bool ListItemVisitor::visit(Todo *t) mItem->setText(10,t->categoriesStr()); + mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); @@ -226,2 +225,3 @@ bool ListItemVisitor::visit(Journal * j) mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); + mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); @@ -253,2 +253,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mListView->addColumn(i18n("Categories")); + mListView->addColumn(i18n("Calendar")); @@ -265,3 +266,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mListView->setColumnAlignment(10,AlignLeft); - mListView->setColumnWidthMode(10, QListView::Manual); + mListView->setColumnAlignment(11,AlignLeft); mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); @@ -269,3 +270,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, int iii = 0; - for ( iii = 0; iii< 10 ; ++iii ) + for ( iii = 0; iii< 12 ; ++iii ) mListView->setColumnWidthMode( iii, QListView::Manual ); @@ -297,2 +298,9 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, #endif + mCalPopup = new QPopupMenu ( this ); + mPopupMenu->insertItem( i18n("Set Calendar"), mCalPopup ); + + QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, + SLOT( populateCalPopup() )); + QObject::connect(mCalPopup,SIGNAL(activated( int )),this, + SLOT( setCalendar( int ) )); QPopupMenu * exportPO = new QPopupMenu ( this ); @@ -318,2 +326,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, + #ifndef DESKTOP_VERSION @@ -373,2 +382,49 @@ QString KOListView::getWhatsThisText(QPoint p) +void KOListView::setCalendar( int c ) +{ + int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), + i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ), + i18n("Continue"), i18n("Cancel"), 0, + 0, 1 ); + if ( result != 0 ) { + return; + } + + QPtrList<Incidence> delSel = getSelectedIncidences() ; + int icount = delSel.count(); + if ( icount ) { + Incidence *incidence = delSel.first(); + while ( incidence ) { + incidence->setCalID( c ); + KOListViewItem * item = getItemForEvent( incidence ); + if ( item ) { + ListItemVisitor v(item, mStartDate ); + incidence->accept(v); + } + incidence = delSel.next(); + } + } + QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; + KopiCalendarFile * cal = calendars.first(); + while ( cal ) { + mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); + mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); + mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); + if ( cal->isStandard ) + mCalendar->setDefaultCalendar( cal->mCalNumber ); + cal = calendars.next(); + } + mCalendar->setSyncEventsReadOnly(); + mCalendar->reInitAlarmSettings(); + +} +void KOListView::populateCalPopup() +{ + mCalPopup->clear(); + KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); + while ( kkf ) { + mCalPopup->insertItem( kkf->mName, kkf->mCalNumber); + kkf = KOPrefs::instance()->mCalendars.next(); + } +} void KOListView::updateList() @@ -1041,3 +1097,3 @@ void KOListView::changeEventDisplay(Event *event, int action) -KOListViewItem *KOListView::getItemForEvent(Event *event) +KOListViewItem *KOListView::getItemForEvent(Incidence *event) { diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index 9da5497..d384af0 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h @@ -297,2 +297,4 @@ class KOListView : public KOEventView void popupMenu(QListViewItem *item,const QPoint &,int); + void setCalendar( int c ); + void populateCalPopup(); @@ -305,5 +307,6 @@ class KOListView : public KOEventView void addIncidence(Incidence *); - KOListViewItem *getItemForEvent(Event *event); + KOListViewItem *getItemForEvent(Incidence *event); private: + QPopupMenu* mCalPopup; KOListViewWhatsThis *mKOListViewWhatsThis; diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 65f0342..a4ea3d3 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -497,2 +497,6 @@ void KOPrefs::deleteCalendar( int num ) } +QString KOPrefs::calName( int calNum) const +{ + return (mDefCalColors[calNum-1])->mName; +} QColor KOPrefs::defaultColor( int calNum ) const diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 463fc33..5cc9bfa 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -101,2 +101,3 @@ class KOPrefs : public KPimPrefs QColor defaultColor( int ) const; + QString calName( int ) const; protected: diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 2243e28..3b7b183 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -78,2 +78,3 @@ public: virtual bool addCalendarFile( QString name, int id ) = 0; + virtual void setSyncEventsReadOnly() = 0; diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 336c3e8..8c4dde1 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -80,2 +80,12 @@ bool CalendarLocal::addCalendarFile( QString name, int id ) } +void CalendarLocal::setSyncEventsReadOnly() +{ + Event * ev; + ev = mEventList.first(); + while ( ev ) { + if ( ev->uid().left(15) == QString("last-syncEvent-") ) + ev->setReadOnly( true ); + ev = mEventList.next(); + } +} void CalendarLocal::addCalendar( Calendar* cal ) diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index 5bbe55f..0286b48 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -47,2 +47,3 @@ class CalendarLocal : public Calendar bool addCalendarFile( QString name, int id ); + void setSyncEventsReadOnly(); /** diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 2ddbb01..96039df 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -143,2 +143,4 @@ void IncidenceBase::setCalID( int id ) { + if ( mCalID > 0 ) + updated(); mCalID = id; |