summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-18 09:21:06 (UTC)
committer zautrix <zautrix>2005-06-18 09:21:06 (UTC)
commit252c62bffc34f2c71002c71abea480807fa1455a (patch) (unidiff)
treeed84520d75b534bb6013fc45fdb93f1a39e6e2e0 /korganizer
parent39112dfe29d2108d54d37f25dc57dcd9299f1f93 (diff)
downloadkdepimpi-252c62bffc34f2c71002c71abea480807fa1455a.zip
kdepimpi-252c62bffc34f2c71002c71abea480807fa1455a.tar.gz
kdepimpi-252c62bffc34f2c71002c71abea480807fa1455a.tar.bz2
fixx
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kolistview.cpp11
-rw-r--r--korganizer/kolistview.h2
-rw-r--r--korganizer/searchdialog.cpp1
3 files changed, 14 insertions, 0 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 0b2f9a4..22d9ac0 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -226,48 +226,49 @@ bool ListItemVisitor::visit(Journal * j)
226 mItem->setText(4,"---"); 226 mItem->setText(4,"---");
227 mItem->setText(5,"---"); 227 mItem->setText(5,"---");
228 mItem->setText(6,"---"); 228 mItem->setText(6,"---");
229 mItem->setText(7,j->dtStartDateStr()); 229 mItem->setText(7,j->dtStartDateStr());
230 mItem->setText(8,"---"); 230 mItem->setText(8,"---");
231 mItem->setText(9,"---"); 231 mItem->setText(9,"---");
232 mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); 232 mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) );
233 mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); 233 mItem->setText(11, KOPrefs::instance()->calName( j->calID() ));
234 234
235 QString key; 235 QString key;
236 QDate d = j->dtStart().date(); 236 QDate d = j->dtStart().date();
237 key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 237 key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
238 mItem->setSortKey(1,key); 238 mItem->setSortKey(1,key);
239 mItem->setSortKey(7,key); 239 mItem->setSortKey(7,key);
240 240
241 return true; 241 return true;
242} 242}
243 243
244KOListView::KOListView(Calendar *calendar, QWidget *parent, 244KOListView::KOListView(Calendar *calendar, QWidget *parent,
245 const char *name) 245 const char *name)
246 : KOEventView(calendar, parent, name) 246 : KOEventView(calendar, parent, name)
247{ 247{
248 248
249 mActiveItem = 0; 249 mActiveItem = 0;
250 mForceShowCompletedTodos = false;
250 mListView = new KOListViewListView(this); 251 mListView = new KOListViewListView(this);
251 mListView->addColumn(i18n("Summary")); 252 mListView->addColumn(i18n("Summary"));
252 mListView->addColumn(i18n("Start Date")); 253 mListView->addColumn(i18n("Start Date"));
253 mListView->addColumn(i18n("Start Time")); 254 mListView->addColumn(i18n("Start Time"));
254 mListView->addColumn(i18n("End Date")); 255 mListView->addColumn(i18n("End Date"));
255 mListView->addColumn(i18n("End Time")); 256 mListView->addColumn(i18n("End Time"));
256 mListView->addColumn(i18n("Alarm")); // alarm set? 257 mListView->addColumn(i18n("Alarm")); // alarm set?
257 mListView->addColumn(i18n("Recurs")); // recurs? 258 mListView->addColumn(i18n("Recurs")); // recurs?
258 mListView->addColumn(i18n("Due Date")); 259 mListView->addColumn(i18n("Due Date"));
259 mListView->addColumn(i18n("Due Time")); 260 mListView->addColumn(i18n("Due Time"));
260 mListView->addColumn(i18n("Cancelled")); 261 mListView->addColumn(i18n("Cancelled"));
261 mListView->addColumn(i18n("Categories")); 262 mListView->addColumn(i18n("Categories"));
262 mListView->addColumn(i18n("Calendar")); 263 mListView->addColumn(i18n("Calendar"));
263 264
264 mListView->setColumnAlignment(0,AlignLeft); 265 mListView->setColumnAlignment(0,AlignLeft);
265 mListView->setColumnAlignment(1,AlignLeft); 266 mListView->setColumnAlignment(1,AlignLeft);
266 mListView->setColumnAlignment(2,AlignHCenter); 267 mListView->setColumnAlignment(2,AlignHCenter);
267 mListView->setColumnAlignment(3,AlignLeft); 268 mListView->setColumnAlignment(3,AlignLeft);
268 mListView->setColumnAlignment(4,AlignHCenter); 269 mListView->setColumnAlignment(4,AlignHCenter);
269 mListView->setColumnAlignment(5,AlignLeft); 270 mListView->setColumnAlignment(5,AlignLeft);
270 mListView->setColumnAlignment(6,AlignLeft); 271 mListView->setColumnAlignment(6,AlignLeft);
271 mListView->setColumnAlignment(7,AlignLeft); 272 mListView->setColumnAlignment(7,AlignLeft);
272 mListView->setColumnAlignment(8,AlignLeft); 273 mListView->setColumnAlignment(8,AlignLeft);
273 mListView->setColumnAlignment(9,AlignLeft); 274 mListView->setColumnAlignment(9,AlignLeft);
@@ -1026,53 +1027,63 @@ void KOListView::addEvents(QPtrList<Event> eventList)
1026 } 1027 }
1027} 1028}
1028 1029
1029void KOListView::addTodos(QPtrList<Todo> eventList) 1030void KOListView::addTodos(QPtrList<Todo> eventList)
1030{ 1031{
1031 Todo *ev; 1032 Todo *ev;
1032 for(ev = eventList.first(); ev; ev = eventList.next()) { 1033 for(ev = eventList.first(); ev; ev = eventList.next()) {
1033 addIncidence(ev); 1034 addIncidence(ev);
1034 } 1035 }
1035 if ( !mListView->currentItem() ){ 1036 if ( !mListView->currentItem() ){
1036 updateView(); 1037 updateView();
1037 } 1038 }
1038} 1039}
1039void KOListView::addJournals(QPtrList<Journal> eventList) 1040void KOListView::addJournals(QPtrList<Journal> eventList)
1040{ 1041{
1041 Journal *ev; 1042 Journal *ev;
1042 for(ev = eventList.first(); ev; ev = eventList.next()) { 1043 for(ev = eventList.first(); ev; ev = eventList.next()) {
1043 addIncidence(ev); 1044 addIncidence(ev);
1044 } 1045 }
1045 if ( !mListView->currentItem() ){ 1046 if ( !mListView->currentItem() ){
1046 updateView(); 1047 updateView();
1047 } 1048 }
1048} 1049}
1049 1050
1051void KOListView::showCompletedTodos()
1052{
1053 mForceShowCompletedTodos = true;
1054}
1050void KOListView::addIncidence(Incidence *incidence) 1055void KOListView::addIncidence(Incidence *incidence)
1051{ 1056{
1052 if ( mUidDict.find( incidence->uid() ) ) return; 1057 if ( mUidDict.find( incidence->uid() ) ) return;
1053 1058
1054 // mListView->setFont ( KOPrefs::instance()->mListViewFont ); 1059 // mListView->setFont ( KOPrefs::instance()->mListViewFont );
1060 if ( incidence->typeID() == todoID ) {
1061 if ( ! mForceShowCompletedTodos ) {
1062 if ( !KOPrefs::instance()->mShowCompletedTodo && ((Todo*)incidence)->isCompleted() )
1063 return;
1064 }
1065 }
1055 mUidDict.insert( incidence->uid(), incidence ); 1066 mUidDict.insert( incidence->uid(), incidence );
1056 KOListViewItem *item = new KOListViewItem( incidence, mListView ); 1067 KOListViewItem *item = new KOListViewItem( incidence, mListView );
1057 ListItemVisitor v(item, mStartDate ); 1068 ListItemVisitor v(item, mStartDate );
1058 if (incidence->accept(v)) { 1069 if (incidence->accept(v)) {
1059 return; 1070 return;
1060 } 1071 }
1061 else delete item; 1072 else delete item;
1062} 1073}
1063 1074
1064void KOListView::showEvents(QPtrList<Event> eventList) 1075void KOListView::showEvents(QPtrList<Event> eventList)
1065{ 1076{
1066 clear(); 1077 clear();
1067 1078
1068 addEvents(eventList); 1079 addEvents(eventList);
1069 1080
1070 // After new creation of list view no events are selected. 1081 // After new creation of list view no events are selected.
1071 emit incidenceSelected( 0 ); 1082 emit incidenceSelected( 0 );
1072} 1083}
1073int KOListView::count() 1084int KOListView::count()
1074{ 1085{
1075 return mListView->childCount(); 1086 return mListView->childCount();
1076} 1087}
1077 1088
1078void KOListView::changeEventDisplay(Event *event, int action) 1089void KOListView::changeEventDisplay(Event *event, int action)
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index d384af0..bcef0f0 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -242,80 +242,82 @@ class KOListView : public KOEventView
242 KOListView(Calendar *calendar, QWidget *parent = 0, 242 KOListView(Calendar *calendar, QWidget *parent = 0,
243 const char *name = 0); 243 const char *name = 0);
244 ~KOListView(); 244 ~KOListView();
245 245
246 virtual int maxDatesHint(); 246 virtual int maxDatesHint();
247 virtual int currentDateCount(); 247 virtual int currentDateCount();
248 virtual QPtrList<Incidence> selectedIncidences(); 248 virtual QPtrList<Incidence> selectedIncidences();
249 virtual DateList selectedDates(); 249 virtual DateList selectedDates();
250 250
251 void showDates(bool show); 251 void showDates(bool show);
252 Incidence* currentItem(); 252 Incidence* currentItem();
253 void addTodos(QPtrList<Todo> eventList); 253 void addTodos(QPtrList<Todo> eventList);
254 void addJournals(QPtrList<Journal> eventList); 254 void addJournals(QPtrList<Journal> eventList);
255 virtual void printPreview(CalPrinter *calPrinter, 255 virtual void printPreview(CalPrinter *calPrinter,
256 const QDate &, const QDate &); 256 const QDate &, const QDate &);
257 257
258 void readSettings(KConfig *config, QString setting = "KOListView Layout"); 258 void readSettings(KConfig *config, QString setting = "KOListView Layout");
259 void writeSettings(KConfig *config, QString setting = "KOListView Layout"); 259 void writeSettings(KConfig *config, QString setting = "KOListView Layout");
260 void updateList(); 260 void updateList();
261 void clearList(); 261 void clearList();
262 void setStartDate(const QDate &start); 262 void setStartDate(const QDate &start);
263 int count(); 263 int count();
264 QString getWhatsThisText(QPoint p); 264 QString getWhatsThisText(QPoint p);
265 QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); 265 QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false );
266 void showCompletedTodos();
266 signals: 267 signals:
267 void signalNewEvent(); 268 void signalNewEvent();
268 void beamIncidenceList(QPtrList<Incidence>); 269 void beamIncidenceList(QPtrList<Incidence>);
269 270
270 public slots: 271 public slots:
271 void hideAll(); 272 void hideAll();
272 void printList(); 273 void printList();
273 void resetFocus(); 274 void resetFocus();
274 virtual void updateView(); 275 virtual void updateView();
275 virtual void showDates(const QDate &start, const QDate &end); 276 virtual void showDates(const QDate &start, const QDate &end);
276 virtual void showEvents(QPtrList<Event> eventList); 277 virtual void showEvents(QPtrList<Event> eventList);
277 void clearSelection(); 278 void clearSelection();
278 void allSelection(); 279 void allSelection();
279 280
280 void clear(); 281 void clear();
281 void beamDone( Ir *ir ); 282 void beamDone( Ir *ir );
282 void showDates(); 283 void showDates();
283 void hideDates(); 284 void hideDates();
284 void deleteAll(); 285 void deleteAll();
285 void saveToFile(); 286 void saveToFile();
286 void saveToFileVCS(); 287 void saveToFileVCS();
287 void saveDescriptionToFile(); 288 void saveDescriptionToFile();
288 void beamSelected(); 289 void beamSelected();
289 void updateConfig(); 290 void updateConfig();
290 void addCat(); 291 void addCat();
291 void setCat(); 292 void setCat();
292 void setAlarm(); 293 void setAlarm();
293 void setCategories( bool removeOld ); 294 void setCategories( bool removeOld );
294 void changeEventDisplay(Event *, int); 295 void changeEventDisplay(Event *, int);
295 296
296 void defaultItemAction(QListViewItem *item); 297 void defaultItemAction(QListViewItem *item);
297 void popupMenu(QListViewItem *item,const QPoint &,int); 298 void popupMenu(QListViewItem *item,const QPoint &,int);
298 void setCalendar( int c ); 299 void setCalendar( int c );
299 void populateCalPopup(); 300 void populateCalPopup();
300 301
301 protected slots: 302 protected slots:
302 void processSelectionChange(QListViewItem *); 303 void processSelectionChange(QListViewItem *);
303 304
304 protected: 305 protected:
305 void writeToFile( bool iCal ); 306 void writeToFile( bool iCal );
306 void addEvents(QPtrList<Event> eventList); 307 void addEvents(QPtrList<Event> eventList);
307 void addIncidence(Incidence *); 308 void addIncidence(Incidence *);
308 KOListViewItem *getItemForEvent(Incidence *event); 309 KOListViewItem *getItemForEvent(Incidence *event);
309 310
310 private: 311 private:
312 bool mForceShowCompletedTodos;
311 QPopupMenu* mCalPopup; 313 QPopupMenu* mCalPopup;
312 KOListViewWhatsThis *mKOListViewWhatsThis; 314 KOListViewWhatsThis *mKOListViewWhatsThis;
313 KOListViewListView *mListView; 315 KOListViewListView *mListView;
314 KOEventPopupMenu *mPopupMenu; 316 KOEventPopupMenu *mPopupMenu;
315 KOListViewItem *mActiveItem; 317 KOListViewItem *mActiveItem;
316 QDict<Incidence> mUidDict; 318 QDict<Incidence> mUidDict;
317 QDate mStartDate; 319 QDate mStartDate;
318 void keyPressEvent ( QKeyEvent * ) ; 320 void keyPressEvent ( QKeyEvent * ) ;
319}; 321};
320 322
321#endif 323#endif
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index bba49f0..a8de297 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -117,48 +117,49 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
117 layout->addWidget(attendeeGroup ); 117 layout->addWidget(attendeeGroup );
118 new QLabel( i18n("Attendee:"),attendeeGroup ); 118 new QLabel( i18n("Attendee:"),attendeeGroup );
119 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); 119 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup );
120 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); 120 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup );
121 // Date range 121 // Date range
122 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), 122 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"),
123 // topFrame); 123 // topFrame);
124 // layout->addWidget(rangeGroup); 124 // layout->addWidget(rangeGroup);
125 125
126 QWidget *rangeWidget = new QWidget(topFrame); 126 QWidget *rangeWidget = new QWidget(topFrame);
127 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); 127 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint());
128 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); 128 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
129 mStartDate = new KDateEdit(rangeWidget); 129 mStartDate = new KDateEdit(rangeWidget);
130 rangeLayout->addWidget(mStartDate); 130 rangeLayout->addWidget(mStartDate);
131 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); 131 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget));
132 mEndDate = new KDateEdit(rangeWidget); 132 mEndDate = new KDateEdit(rangeWidget);
133 mEndDate->setDate(QDate::currentDate().addDays(365)); 133 mEndDate->setDate(QDate::currentDate().addDays(365));
134 rangeLayout->addWidget(mEndDate); 134 rangeLayout->addWidget(mEndDate);
135 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); 135 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
136 rangeLayout->addWidget( (QWidget*)wt ); 136 rangeLayout->addWidget( (QWidget*)wt );
137 layout->addWidget(rangeWidget); 137 layout->addWidget(rangeWidget);
138 // Results list view 138 // Results list view
139 listView = new KOListView(mCalendar,topFrame); 139 listView = new KOListView(mCalendar,topFrame);
140 layout->addWidget(listView); 140 layout->addWidget(listView);
141 listView->showCompletedTodos();
141 //layout->setStretchFactor( listView, 333 ); 142 //layout->setStretchFactor( listView, 333 );
142 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) ); 143 //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) );
143 //listView->setMaximumHeight( 50 ); 144 //listView->setMaximumHeight( 50 );
144 listView->readSettings(KOGlobals::config(),"SearchListView Layout"); 145 listView->readSettings(KOGlobals::config(),"SearchListView Layout");
145 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); 146 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
146 147
147 setCaption( i18n("KO/Pi Find: ")); 148 setCaption( i18n("KO/Pi Find: "));
148#ifdef DESKTOP_VERSION 149#ifdef DESKTOP_VERSION
149 OkButton = new QPushButton( i18n("Close"), this ); 150 OkButton = new QPushButton( i18n("Close"), this );
150 connect(OkButton,SIGNAL(clicked()),SLOT(hide())); 151 connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
151#endif 152#endif
152} 153}
153 154
154SearchDialog::~SearchDialog() 155SearchDialog::~SearchDialog()
155{ 156{
156 157
157} 158}
158void SearchDialog::slot_add( bool b ) 159void SearchDialog::slot_add( bool b )
159{ 160{
160 if ( b ) { 161 if ( b ) {
161 if ( mSubItems->isOn() ) mSubItems->toggle(); 162 if ( mSubItems->isOn() ) mSubItems->toggle();
162 if ( mRefineItems->isOn() ) mRefineItems->toggle(); 163 if ( mRefineItems->isOn() ) mRefineItems->toggle();
163 setCaption( i18n("Matching items will be added to list")); 164 setCaption( i18n("Matching items will be added to list"));
164 } else 165 } else