summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-15 18:23:08 (UTC)
committer zautrix <zautrix>2005-06-15 18:23:08 (UTC)
commitccfe3f97afd65c75ee6c7c931cb3694919a4e29b (patch) (unidiff)
tree117d3467ef1d9678f31dea1b506390707f88d94a
parentcba0ac17d3d505805be6aa4b4fea6f63473a1e00 (diff)
downloadkdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.zip
kdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.tar.gz
kdepimpi-ccfe3f97afd65c75ee6c7c931cb3694919a4e29b.tar.bz2
fixess
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp9
-rw-r--r--korganizer/koagendaview.cpp2
-rw-r--r--korganizer/kolistview.cpp68
-rw-r--r--korganizer/kolistview.h5
-rw-r--r--korganizer/koprefs.cpp4
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--libkcal/calendar.h1
-rw-r--r--libkcal/calendarlocal.cpp10
-rw-r--r--libkcal/calendarlocal.h1
-rw-r--r--libkcal/incidencebase.cpp2
10 files changed, 87 insertions, 16 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 377a66f..2012e92 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1834,12 +1834,5 @@ bool CalendarView::importQtopia( const QString &categories,
1834void CalendarView::setSyncEventsReadOnly() 1834void CalendarView::setSyncEventsReadOnly()
1835{ 1835{
1836 Event * ev; 1836 mCalendar->setSyncEventsReadOnly();
1837 QPtrList<Event> eL = mCalendar->rawEvents();
1838 ev = eL.first();
1839 while ( ev ) {
1840 if ( ev->uid().left(15) == QString("last-syncEvent-") )
1841 ev->setReadOnly( true );
1842 ev = eL.next();
1843 }
1844} 1837}
1845 1838
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index b2b136a..93ff55e 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -663,5 +663,5 @@ void KOAgendaView::createDayLabels()
663 // It would remove some flickering and gain speed (since this is called by 663 // It would remove some flickering and gain speed (since this is called by
664 // each updateView() call) 664 // each updateView() call)
665 665
666 int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; 666 int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2;
667 mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); 667 mDayLabelsFrame->setMaximumWidth( mUpcomingWidth );
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 1f3b4c6..c705c73 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -68,7 +68,4 @@
68#include "koeventviewer.h" 68#include "koeventviewer.h"
69 69
70
71
72
73class KOListViewWhatsThis :public QWhatsThis 70class KOListViewWhatsThis :public QWhatsThis
74{ 71{
@@ -141,4 +138,5 @@ bool ListItemVisitor::visit(Event *e)
141 mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); 138 mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No"));
142 mItem->setText(10,e->categoriesStr()); 139 mItem->setText(10,e->categoriesStr());
140 mItem->setText(11, KOPrefs::instance()->calName( e->calID() ));
143 141
144 QString key; 142 QString key;
@@ -190,4 +188,5 @@ bool ListItemVisitor::visit(Todo *t)
190 mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); 188 mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No"));
191 mItem->setText(10,t->categoriesStr()); 189 mItem->setText(10,t->categoriesStr());
190 mItem->setText(11, KOPrefs::instance()->calName( t->calID() ));
192 191
193 QString key; 192 QString key;
@@ -225,4 +224,5 @@ bool ListItemVisitor::visit(Journal * j)
225 mItem->setText(9,"---"); 224 mItem->setText(9,"---");
226 mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); 225 mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) );
226 mItem->setText(11, KOPrefs::instance()->calName( j->calID() ));
227 227
228 QString key; 228 QString key;
@@ -252,4 +252,5 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
252 mListView->addColumn(i18n("Cancelled")); 252 mListView->addColumn(i18n("Cancelled"));
253 mListView->addColumn(i18n("Categories")); 253 mListView->addColumn(i18n("Categories"));
254 mListView->addColumn(i18n("Calendar"));
254 255
255 mListView->setColumnAlignment(0,AlignLeft); 256 mListView->setColumnAlignment(0,AlignLeft);
@@ -264,9 +265,9 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
264 mListView->setColumnAlignment(9,AlignLeft); 265 mListView->setColumnAlignment(9,AlignLeft);
265 mListView->setColumnAlignment(10,AlignLeft); 266 mListView->setColumnAlignment(10,AlignLeft);
266 mListView->setColumnWidthMode(10, QListView::Manual); 267 mListView->setColumnAlignment(11,AlignLeft);
267 mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); 268 mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this);
268 269
269 int iii = 0; 270 int iii = 0;
270 for ( iii = 0; iii< 10 ; ++iii ) 271 for ( iii = 0; iii< 12 ; ++iii )
271 mListView->setColumnWidthMode( iii, QListView::Manual ); 272 mListView->setColumnWidthMode( iii, QListView::Manual );
272 273
@@ -296,4 +297,11 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
296 mPopupMenu->insertSeparator(); 297 mPopupMenu->insertSeparator();
297#endif 298#endif
299 mCalPopup = new QPopupMenu ( this );
300 mPopupMenu->insertItem( i18n("Set Calendar"), mCalPopup );
301
302 QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this,
303 SLOT( populateCalPopup() ));
304 QObject::connect(mCalPopup,SIGNAL(activated( int )),this,
305 SLOT( setCalendar( int ) ));
298 QPopupMenu * exportPO = new QPopupMenu ( this ); 306 QPopupMenu * exportPO = new QPopupMenu ( this );
299 mPopupMenu->insertItem( i18n("Export selected"), exportPO ); 307 mPopupMenu->insertItem( i18n("Export selected"), exportPO );
@@ -317,4 +325,5 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
317 325
318 326
327
319#ifndef DESKTOP_VERSION 328#ifndef DESKTOP_VERSION
320 mPopupMenu->insertSeparator(); 329 mPopupMenu->insertSeparator();
@@ -372,4 +381,51 @@ QString KOListView::getWhatsThisText(QPoint p)
372} 381}
373 382
383void KOListView::setCalendar( int c )
384{
385 int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"),
386 i18n("This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!").arg( KOPrefs::instance()->calName( c ) ),
387 i18n("Continue"), i18n("Cancel"), 0,
388 0, 1 );
389 if ( result != 0 ) {
390 return;
391 }
392
393 QPtrList<Incidence> delSel = getSelectedIncidences() ;
394 int icount = delSel.count();
395 if ( icount ) {
396 Incidence *incidence = delSel.first();
397 while ( incidence ) {
398 incidence->setCalID( c );
399 KOListViewItem * item = getItemForEvent( incidence );
400 if ( item ) {
401 ListItemVisitor v(item, mStartDate );
402 incidence->accept(v);
403 }
404 incidence = delSel.next();
405 }
406 }
407 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
408 KopiCalendarFile * cal = calendars.first();
409 while ( cal ) {
410 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
411 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
412 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
413 if ( cal->isStandard )
414 mCalendar->setDefaultCalendar( cal->mCalNumber );
415 cal = calendars.next();
416 }
417 mCalendar->setSyncEventsReadOnly();
418 mCalendar->reInitAlarmSettings();
419
420}
421void KOListView::populateCalPopup()
422{
423 mCalPopup->clear();
424 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
425 while ( kkf ) {
426 mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
427 kkf = KOPrefs::instance()->mCalendars.next();
428 }
429}
374void KOListView::updateList() 430void KOListView::updateList()
375{ 431{
@@ -1040,5 +1096,5 @@ void KOListView::changeEventDisplay(Event *event, int action)
1040} 1096}
1041 1097
1042KOListViewItem *KOListView::getItemForEvent(Event *event) 1098KOListViewItem *KOListView::getItemForEvent(Incidence *event)
1043{ 1099{
1044 KOListViewItem *item = (KOListViewItem *)mListView->firstChild(); 1100 KOListViewItem *item = (KOListViewItem *)mListView->firstChild();
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index 9da5497..d384af0 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -296,4 +296,6 @@ class KOListView : public KOEventView
296 void defaultItemAction(QListViewItem *item); 296 void defaultItemAction(QListViewItem *item);
297 void popupMenu(QListViewItem *item,const QPoint &,int); 297 void popupMenu(QListViewItem *item,const QPoint &,int);
298 void setCalendar( int c );
299 void populateCalPopup();
298 300
299 protected slots: 301 protected slots:
@@ -304,7 +306,8 @@ class KOListView : public KOEventView
304 void addEvents(QPtrList<Event> eventList); 306 void addEvents(QPtrList<Event> eventList);
305 void addIncidence(Incidence *); 307 void addIncidence(Incidence *);
306 KOListViewItem *getItemForEvent(Event *event); 308 KOListViewItem *getItemForEvent(Incidence *event);
307 309
308 private: 310 private:
311 QPopupMenu* mCalPopup;
309 KOListViewWhatsThis *mKOListViewWhatsThis; 312 KOListViewWhatsThis *mKOListViewWhatsThis;
310 KOListViewListView *mListView; 313 KOListViewListView *mListView;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 65f0342..a4ea3d3 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -496,4 +496,8 @@ void KOPrefs::deleteCalendar( int num )
496 } 496 }
497} 497}
498QString KOPrefs::calName( int calNum) const
499{
500 return (mDefCalColors[calNum-1])->mName;
501}
498QColor KOPrefs::defaultColor( int calNum ) const 502QColor KOPrefs::defaultColor( int calNum ) const
499{ 503{
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 463fc33..5cc9bfa 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -100,4 +100,5 @@ class KOPrefs : public KPimPrefs
100 void deleteCalendar( int ); 100 void deleteCalendar( int );
101 QColor defaultColor( int ) const; 101 QColor defaultColor( int ) const;
102 QString calName( int ) const;
102 protected: 103 protected:
103 void setTimeZoneIdDefault(); 104 void setTimeZoneIdDefault();
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 2243e28..3b7b183 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -77,4 +77,5 @@ public:
77 virtual void addCalendar( Calendar* ) = 0; 77 virtual void addCalendar( Calendar* ) = 0;
78 virtual bool addCalendarFile( QString name, int id ) = 0; 78 virtual bool addCalendarFile( QString name, int id ) = 0;
79 virtual void setSyncEventsReadOnly() = 0;
79 80
80 /** 81 /**
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 336c3e8..8c4dde1 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -79,4 +79,14 @@ bool CalendarLocal::addCalendarFile( QString name, int id )
79 return false; 79 return false;
80} 80}
81void CalendarLocal::setSyncEventsReadOnly()
82{
83 Event * ev;
84 ev = mEventList.first();
85 while ( ev ) {
86 if ( ev->uid().left(15) == QString("last-syncEvent-") )
87 ev->setReadOnly( true );
88 ev = mEventList.next();
89 }
90}
81void CalendarLocal::addCalendar( Calendar* cal ) 91void CalendarLocal::addCalendar( Calendar* cal )
82{ 92{
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index 5bbe55f..0286b48 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -46,4 +46,5 @@ class CalendarLocal : public Calendar
46 void addCalendar( Calendar* ); 46 void addCalendar( Calendar* );
47 bool addCalendarFile( QString name, int id ); 47 bool addCalendarFile( QString name, int id );
48 void setSyncEventsReadOnly();
48 /** 49 /**
49 Loads a calendar on disk in vCalendar or iCalendar format into the current 50 Loads a calendar on disk in vCalendar or iCalendar format into the current
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 2ddbb01..96039df 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -142,4 +142,6 @@ QDateTime IncidenceBase::getEvenTime( QDateTime dt )
142void IncidenceBase::setCalID( int id ) 142void IncidenceBase::setCalID( int id )
143{ 143{
144 if ( mCalID > 0 )
145 updated();
144 mCalID = id; 146 mCalID = id;
145} 147}