-rw-r--r-- | korganizer/calendarview.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index d0de233..c0f3be7 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -103,32 +103,33 @@ | |||
103 | #include "kofilterview.h" | 103 | #include "kofilterview.h" |
104 | #include "koglobals.h" | 104 | #include "koglobals.h" |
105 | #include "koviewmanager.h" | 105 | #include "koviewmanager.h" |
106 | #include "koagendaview.h" | 106 | #include "koagendaview.h" |
107 | #include "kodialogmanager.h" | 107 | #include "kodialogmanager.h" |
108 | #include "outgoingdialog.h" | 108 | #include "outgoingdialog.h" |
109 | #include "incomingdialog.h" | 109 | #include "incomingdialog.h" |
110 | #include "datenavigatorcontainer.h" | 110 | #include "datenavigatorcontainer.h" |
111 | #include "statusdialog.h" | 111 | #include "statusdialog.h" |
112 | #include "kdatenavigator.h" | 112 | #include "kdatenavigator.h" |
113 | #include "kotodoview.h" | 113 | #include "kotodoview.h" |
114 | #include "datenavigator.h" | 114 | #include "datenavigator.h" |
115 | #include "resourceview.h" | 115 | #include "resourceview.h" |
116 | #include "navigatorbar.h" | 116 | #include "navigatorbar.h" |
117 | #include "searchdialog.h" | 117 | #include "searchdialog.h" |
118 | #include "mainwindow.h" | 118 | #include "mainwindow.h" |
119 | #include "categoryeditdialog.h" | ||
119 | 120 | ||
120 | #include "calendarview.h" | 121 | #include "calendarview.h" |
121 | #ifndef DESKTOP_VERSION | 122 | #ifndef DESKTOP_VERSION |
122 | #include <qtopia/alarmserver.h> | 123 | #include <qtopia/alarmserver.h> |
123 | #endif | 124 | #endif |
124 | #ifndef _WIN32_ | 125 | #ifndef _WIN32_ |
125 | #include <stdlib.h> | 126 | #include <stdlib.h> |
126 | #include <stdio.h> | 127 | #include <stdio.h> |
127 | #include <unistd.h> | 128 | #include <unistd.h> |
128 | #else | 129 | #else |
129 | #include <qprocess.h> | 130 | #include <qprocess.h> |
130 | #endif | 131 | #endif |
131 | 132 | ||
132 | #ifdef DESKTOP_VERSION | 133 | #ifdef DESKTOP_VERSION |
133 | #include <kabc/stdaddressbook.h> | 134 | #include <kabc/stdaddressbook.h> |
134 | #endif | 135 | #endif |
@@ -300,41 +301,41 @@ class KOBeamPrefs : public QDialog | |||
300 | 301 | ||
301 | bool beamVcal() { return vcal->isChecked(); } | 302 | bool beamVcal() { return vcal->isChecked(); } |
302 | bool beamLocal() { return local->isChecked(); } | 303 | bool beamLocal() { return local->isChecked(); } |
303 | private: | 304 | private: |
304 | QRadioButton* vcal, *ical, *local, *tz; | 305 | QRadioButton* vcal, *ical, *local, *tz; |
305 | }; | 306 | }; |
306 | class KOCatPrefs : public QDialog | 307 | class KOCatPrefs : public QDialog |
307 | { | 308 | { |
308 | public: | 309 | public: |
309 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : | 310 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : |
310 | QDialog( parent, name, true ) | 311 | QDialog( parent, name, true ) |
311 | { | 312 | { |
312 | setCaption( i18n("Manage new Categories") ); | 313 | setCaption( i18n("Manage new Categories") ); |
313 | QVBoxLayout* lay = new QVBoxLayout( this ); | 314 | QVBoxLayout* lay = new QVBoxLayout( this ); |
314 | lay->setSpacing( 3 ); | 315 | lay->setSpacing( 3 ); |
315 | lay->setMargin( 3 ); | 316 | lay->setMargin( 3 ); |
316 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); | 317 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:"), this ); |
317 | lay->addWidget( lab ); | 318 | lay->addWidget( lab ); |
318 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); | 319 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); |
319 | lay->addWidget( format ); | 320 | lay->addWidget( format ); |
320 | format->setExclusive ( true ) ; | 321 | format->setExclusive ( true ) ; |
321 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); | 322 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); |
322 | new QRadioButton(i18n("Remove from Events/Todos"), format ); | 323 | new QRadioButton(i18n("Remove from Events/Todos"), format ); |
323 | addCatBut->setChecked( true ); | 324 | addCatBut->setChecked( true ); |
324 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 325 | QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); |
325 | lay->addWidget( ok ); | 326 | lay->addWidget( ok ); |
326 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 327 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
327 | lay->addWidget( cancel ); | 328 | lay->addWidget( cancel ); |
328 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 329 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
329 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 330 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
330 | resize( 200, 200 ); | 331 | resize( 200, 200 ); |
331 | } | 332 | } |
332 | 333 | ||
333 | bool addCat() { return addCatBut->isChecked(); } | 334 | bool addCat() { return addCatBut->isChecked(); } |
334 | private: | 335 | private: |
335 | QRadioButton* addCatBut; | 336 | QRadioButton* addCatBut; |
336 | }; | 337 | }; |
337 | 338 | ||
338 | 339 | ||
339 | 340 | ||
340 | CalendarView::CalendarView( CalendarResources *calendar, | 341 | CalendarView::CalendarView( CalendarResources *calendar, |
@@ -2805,32 +2806,38 @@ int CalendarView::addCategories() | |||
2805 | while ( inc ) { | 2806 | while ( inc ) { |
2806 | catIncList = inc->categories() ; | 2807 | catIncList = inc->categories() ; |
2807 | for( i = 0; i< catIncList.count(); ++i ) { | 2808 | for( i = 0; i< catIncList.count(); ++i ) { |
2808 | if ( !catList.contains (catIncList[i])) { | 2809 | if ( !catList.contains (catIncList[i])) { |
2809 | catList.append( catIncList[i] ); | 2810 | catList.append( catIncList[i] ); |
2810 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2811 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2811 | ++count; | 2812 | ++count; |
2812 | } | 2813 | } |
2813 | } | 2814 | } |
2814 | inc = incList.next(); | 2815 | inc = incList.next(); |
2815 | } | 2816 | } |
2816 | catList.sort(); | 2817 | catList.sort(); |
2817 | KOPrefs::instance()->mCustomCategories = catList; | 2818 | KOPrefs::instance()->mCustomCategories = catList; |
2818 | return count; | 2819 | return count; |
2819 | } | 2820 | } |
2820 | 2821 | ||
2822 | void CalendarView::editCategories() | ||
2823 | { | ||
2824 | qDebug("CalendarView::editCategories() "); | ||
2825 | KPIM::CategoryEditDialog ced (KOPrefs::instance(),this ); | ||
2826 | ced.exec(); | ||
2827 | } | ||
2821 | void CalendarView::manageCategories() | 2828 | void CalendarView::manageCategories() |
2822 | { | 2829 | { |
2823 | KOCatPrefs* cp = new KOCatPrefs(); | 2830 | KOCatPrefs* cp = new KOCatPrefs(); |
2824 | cp->show(); | 2831 | cp->show(); |
2825 | int w =cp->sizeHint().width() ; | 2832 | int w =cp->sizeHint().width() ; |
2826 | int h = cp->sizeHint().height() ; | 2833 | int h = cp->sizeHint().height() ; |
2827 | int dw = QApplication::desktop()->width(); | 2834 | int dw = QApplication::desktop()->width(); |
2828 | int dh = QApplication::desktop()->height(); | 2835 | int dh = QApplication::desktop()->height(); |
2829 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2836 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2830 | if ( !cp->exec() ) { | 2837 | if ( !cp->exec() ) { |
2831 | delete cp; | 2838 | delete cp; |
2832 | return; | 2839 | return; |
2833 | } | 2840 | } |
2834 | int count = 0; | 2841 | int count = 0; |
2835 | if ( cp->addCat() ) { | 2842 | if ( cp->addCat() ) { |
2836 | count = addCategories(); | 2843 | count = addCategories(); |