author | zautrix <zautrix> | 2005-06-14 09:10:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-14 09:10:19 (UTC) |
commit | bd2fd522c0ba5c5a7897df0941032a9af9842dfc (patch) (unidiff) | |
tree | d76d64810cbcde88f0b56d5924ac4dd52e9abe13 | |
parent | 1dccb9dd9ea32989ecec33c72a3ebd873dce048e (diff) | |
download | kdepimpi-bd2fd522c0ba5c5a7897df0941032a9af9842dfc.zip kdepimpi-bd2fd522c0ba5c5a7897df0941032a9af9842dfc.tar.gz kdepimpi-bd2fd522c0ba5c5a7897df0941032a9af9842dfc.tar.bz2 |
fixxeess
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 12 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 14 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 2 |
3 files changed, 23 insertions, 5 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index a11fab3..9b7f6ea 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,102 +1,114 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.6 ************ | 3 | ********** VERSION 2.1.6 ************ |
4 | 4 | ||
5 | This release is for testing only. | ||
6 | |||
5 | KO/Pi: | 7 | KO/Pi: |
6 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. | 8 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. |
7 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. | 9 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. |
8 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. | 10 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. |
9 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. | 11 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. |
10 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. | 12 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. |
11 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. | 13 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. |
12 | 14 | ||
15 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. | ||
16 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. | ||
17 | Now on every sync the set of calendars is synced which are enabled in the resource view. | ||
18 | |||
19 | A calendar is enabled in the resource view if the "eye" column is checked. | ||
20 | You can set a calendar to be the default for new items( "+" column ). | ||
21 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. | ||
22 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... | ||
23 | |||
24 | |||
13 | ********** VERSION 2.1.5 ************ | 25 | ********** VERSION 2.1.5 ************ |
14 | 26 | ||
15 | This is the new stable version. | 27 | This is the new stable version. |
16 | Bugfix: | 28 | Bugfix: |
17 | Fixed a problem with agenda popup on the desktop in KO/Pi. | 29 | Fixed a problem with agenda popup on the desktop in KO/Pi. |
18 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. | 30 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. |
19 | Added config option to not display completed todos in agenda view. | 31 | Added config option to not display completed todos in agenda view. |
20 | Addressee view is now using the formatted name, if defined. | 32 | Addressee view is now using the formatted name, if defined. |
21 | That makes it possible to display "lastname, firstname" in that view now. | 33 | That makes it possible to display "lastname, firstname" in that view now. |
22 | To set the formatted name for all contacts, please use menu: | 34 | To set the formatted name for all contacts, please use menu: |
23 | Edit->Change->Set formatted name. | 35 | Edit->Change->Set formatted name. |
24 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. | 36 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. |
25 | 37 | ||
26 | ********** VERSION 2.1.4 ************ | 38 | ********** VERSION 2.1.4 ************ |
27 | 39 | ||
28 | Fixed two more bugs in the KA/Pi CSV import dialog: | 40 | Fixed two more bugs in the KA/Pi CSV import dialog: |
29 | Made it possible to read multi-line fields and import it to the "Note" field. | 41 | Made it possible to read multi-line fields and import it to the "Note" field. |
30 | Fixed a problem in mapping custom fields, whatever a custem field is... | 42 | Fixed a problem in mapping custom fields, whatever a custem field is... |
31 | 43 | ||
32 | ********** VERSION 2.1.3 ************ | 44 | ********** VERSION 2.1.3 ************ |
33 | 45 | ||
34 | Changed the menu structure of the alarm applet: | 46 | Changed the menu structure of the alarm applet: |
35 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". | 47 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". |
36 | 48 | ||
37 | Fixed several problems in the KA/Pi CSV import dialog: | 49 | Fixed several problems in the KA/Pi CSV import dialog: |
38 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. | 50 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. |
39 | 51 | ||
40 | 52 | ||
41 | ********** VERSION 2.1.2 ************ | 53 | ********** VERSION 2.1.2 ************ |
42 | 54 | ||
43 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. | 55 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. |
44 | 56 | ||
45 | Fixed a problem when importing data from Outlook with mutiple categories set. | 57 | Fixed a problem when importing data from Outlook with mutiple categories set. |
46 | 58 | ||
47 | Changed display of days in datenavigator: | 59 | Changed display of days in datenavigator: |
48 | Birthdays are now blue, not dark green. | 60 | Birthdays are now blue, not dark green. |
49 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. | 61 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. |
50 | When journal view is shown, only holidays are shown and days with journals are blue. | 62 | When journal view is shown, only holidays are shown and days with journals are blue. |
51 | 63 | ||
52 | Added Backup options to global config: | 64 | Added Backup options to global config: |
53 | You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). | 65 | You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). |
54 | It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. | 66 | It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. |
55 | The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. | 67 | The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. |
56 | 68 | ||
57 | ********** VERSION 2.1.1 ************ | 69 | ********** VERSION 2.1.1 ************ |
58 | 70 | ||
59 | Stable release 2.1.1! | 71 | Stable release 2.1.1! |
60 | 72 | ||
61 | KO/Pi: | 73 | KO/Pi: |
62 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. | 74 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. |
63 | 75 | ||
64 | ********** VERSION 2.1.0 ************ | 76 | ********** VERSION 2.1.0 ************ |
65 | 77 | ||
66 | Stable release 2.1.0! | 78 | Stable release 2.1.0! |
67 | 79 | ||
68 | Summary of changes/fixes compared to version 2.0.6: | 80 | Summary of changes/fixes compared to version 2.0.6: |
69 | 81 | ||
70 | Many bugs of version 2.0.6 fixed. | 82 | Many bugs of version 2.0.6 fixed. |
71 | Most of them were small bugs, but some of them were important. | 83 | Most of them were small bugs, but some of them were important. |
72 | It is recommended to use version 2.1.0 and not version 2.0.6. | 84 | It is recommended to use version 2.1.0 and not version 2.0.6. |
73 | 85 | ||
74 | Important changes: | 86 | Important changes: |
75 | 87 | ||
76 | Added recurring todos to KO/Pi. | 88 | Added recurring todos to KO/Pi. |
77 | 89 | ||
78 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. | 90 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. |
79 | 91 | ||
80 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 92 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
81 | 93 | ||
82 | Datenavigator can now display many months. Very useful on the desktop. | 94 | Datenavigator can now display many months. Very useful on the desktop. |
83 | 95 | ||
84 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. | 96 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. |
85 | 97 | ||
86 | Made alarm sound working on Linux desktop. | 98 | Made alarm sound working on Linux desktop. |
87 | 99 | ||
88 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. | 100 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. |
89 | 101 | ||
90 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. | 102 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. |
91 | 103 | ||
92 | Many other usebility enhancements. | 104 | Many other usebility enhancements. |
93 | Special thanks to Ben for his suggestions! | 105 | Special thanks to Ben for his suggestions! |
94 | 106 | ||
95 | You can find the complete changelog | 107 | You can find the complete changelog |
96 | from version 1.7.7 to 2.1.0 | 108 | from version 1.7.7 to 2.1.0 |
97 | in the source package or on | 109 | in the source package or on |
98 | 110 | ||
99 | http://www.pi-sync.net/html/changelog.html | 111 | http://www.pi-sync.net/html/changelog.html |
100 | 112 | ||
101 | 113 | ||
102 | 114 | ||
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 9633b2c..3333ac2 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -1,406 +1,412 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | #include <qcombobox.h> | 25 | #include <qcombobox.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qdialog.h> | 29 | #include <qdialog.h> |
30 | 30 | ||
31 | 31 | ||
32 | #include <libkcal/calfilter.h> | 32 | #include <libkcal/calfilter.h> |
33 | 33 | ||
34 | #include "kofilterview.h" | 34 | #include "kofilterview.h" |
35 | #include "koprefs.h" | 35 | #include "koprefs.h" |
36 | #include <kiconloader.h> | 36 | #include <kiconloader.h> |
37 | #include <kglobal.h> | 37 | #include <kglobal.h> |
38 | #include <kcolorbutton.h> | 38 | #include <kcolorbutton.h> |
39 | #include <kmessagebox.h> | 39 | #include <kmessagebox.h> |
40 | 40 | ||
41 | 41 | ||
42 | #include <kurlrequester.h> | 42 | #include <kurlrequester.h> |
43 | #include <klineedit.h> | 43 | #include <klineedit.h> |
44 | 44 | ||
45 | class KONewCalPrefs : public QDialog | 45 | class KONewCalPrefs : public QDialog |
46 | { | 46 | { |
47 | public: | 47 | public: |
48 | KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : | 48 | KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : |
49 | QDialog( parent, name, true ) | 49 | QDialog( parent, name, true ) |
50 | { | 50 | { |
51 | setCaption( i18n("Add new Calendar") ); | 51 | setCaption( i18n("Add new Calendar") ); |
52 | QVBoxLayout* lay = new QVBoxLayout( this ); | 52 | QVBoxLayout* lay = new QVBoxLayout( this ); |
53 | lay->setSpacing( 3 ); | 53 | lay->setSpacing( 3 ); |
54 | lay->setMargin( 3 ); | 54 | lay->setMargin( 3 ); |
55 | QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); | 55 | QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); |
56 | lay->addWidget( lab ); | 56 | lay->addWidget( lab ); |
57 | nameE = new KLineEdit( this ); | 57 | nameE = new KLineEdit( this ); |
58 | lay->addWidget( nameE ); | 58 | lay->addWidget( nameE ); |
59 | lab = new QLabel( i18n("Local ical (*.ics) file:"), this ); | 59 | lab = new QLabel( i18n("Local ical (*.ics) file:"), this ); |
60 | lay->addWidget( lab ); | 60 | lay->addWidget( lab ); |
61 | url = new KURLRequester ( this ); | 61 | url = new KURLRequester ( this ); |
62 | lay->addWidget( url ); | 62 | lay->addWidget( url ); |
63 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 63 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
64 | lay->addWidget( ok ); | 64 | lay->addWidget( ok ); |
65 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 65 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
66 | lay->addWidget( cancel ); | 66 | lay->addWidget( cancel ); |
67 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 67 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
68 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 68 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
69 | //resize( 200, 200 ); | 69 | //resize( 200, 200 ); |
70 | } | 70 | } |
71 | 71 | ||
72 | QString calName() { return nameE->text(); } | 72 | QString calName() { return nameE->text(); } |
73 | QString calFileName() { return url->url(); } | 73 | QString calFileName() { return url->url(); } |
74 | private: | 74 | private: |
75 | KLineEdit* nameE; | 75 | KLineEdit* nameE; |
76 | KURLRequester *url; | 76 | KURLRequester *url; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, | 80 | KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, |
81 | const char* name,WFlags fl ) | 81 | const char* name,WFlags fl ) |
82 | : KOFilterView_base(parent,name,fl) | 82 | : KOFilterView_base(parent,name,fl) |
83 | { | 83 | { |
84 | mFilters = filterList; | 84 | mFilters = filterList; |
85 | 85 | ||
86 | connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); | 86 | connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); |
87 | connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); | 87 | connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); |
88 | connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters())); | 88 | connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters())); |
89 | } | 89 | } |
90 | 90 | ||
91 | KOFilterView::~KOFilterView() | 91 | KOFilterView::~KOFilterView() |
92 | { | 92 | { |
93 | // no need to delete child widgets, Qt does it all for us | 93 | // no need to delete child widgets, Qt does it all for us |
94 | } | 94 | } |
95 | 95 | ||
96 | bool KOFilterView::filtersEnabled() | 96 | bool KOFilterView::filtersEnabled() |
97 | { | 97 | { |
98 | return mEnabledCheck->isChecked(); | 98 | return mEnabledCheck->isChecked(); |
99 | } | 99 | } |
100 | 100 | ||
101 | void KOFilterView::setFiltersEnabled(bool set) | 101 | void KOFilterView::setFiltersEnabled(bool set) |
102 | { | 102 | { |
103 | mEnabledCheck->setChecked(set); | 103 | mEnabledCheck->setChecked(set); |
104 | emit filterChanged(); | 104 | emit filterChanged(); |
105 | } | 105 | } |
106 | 106 | ||
107 | 107 | ||
108 | void KOFilterView::updateFilters() | 108 | void KOFilterView::updateFilters() |
109 | { | 109 | { |
110 | mSelectionCombo->clear(); | 110 | mSelectionCombo->clear(); |
111 | 111 | ||
112 | CalFilter *filter = mFilters->first(); | 112 | CalFilter *filter = mFilters->first(); |
113 | while(filter) { | 113 | while(filter) { |
114 | mSelectionCombo->insertItem(filter->name()); | 114 | mSelectionCombo->insertItem(filter->name()); |
115 | filter = mFilters->next(); | 115 | filter = mFilters->next(); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | CalFilter *KOFilterView::selectedFilter() | 119 | CalFilter *KOFilterView::selectedFilter() |
120 | { | 120 | { |
121 | CalFilter *f = mFilters->at(mSelectionCombo->currentItem()); | 121 | CalFilter *f = mFilters->at(mSelectionCombo->currentItem()); |
122 | return f; | 122 | return f; |
123 | } | 123 | } |
124 | 124 | ||
125 | void KOFilterView::setSelectedFilter(QString filterName) | 125 | void KOFilterView::setSelectedFilter(QString filterName) |
126 | { | 126 | { |
127 | int filter_num = mSelectionCombo->count(); | 127 | int filter_num = mSelectionCombo->count(); |
128 | int i; | 128 | int i; |
129 | for (i=0;i<filter_num;i++) { | 129 | for (i=0;i<filter_num;i++) { |
130 | if (mSelectionCombo->text(i)==filterName) | 130 | if (mSelectionCombo->text(i)==filterName) |
131 | mSelectionCombo->setCurrentItem(i); | 131 | mSelectionCombo->setCurrentItem(i); |
132 | } | 132 | } |
133 | emit filterChanged(); | 133 | emit filterChanged(); |
134 | } | 134 | } |
135 | void KOFilterView::setSelectedFilter( int fil ) | 135 | void KOFilterView::setSelectedFilter( int fil ) |
136 | { | 136 | { |
137 | if ( fil >= mSelectionCombo->count() ) | 137 | if ( fil >= mSelectionCombo->count() ) |
138 | return; | 138 | return; |
139 | mSelectionCombo->setCurrentItem( fil ); | 139 | mSelectionCombo->setCurrentItem( fil ); |
140 | emit filterChanged(); | 140 | emit filterChanged(); |
141 | } | 141 | } |
142 | 142 | ||
143 | 143 | ||
144 | 144 | ||
145 | KOCalEditView::KOCalEditView(QWidget* parent, | 145 | KOCalEditView::KOCalEditView(QWidget* parent, |
146 | const char* name ) | 146 | const char* name ) |
147 | : QWidget(parent,name) | 147 | : QWidget(parent,name) |
148 | { | 148 | { |
149 | mw = 0; | 149 | mw = 0; |
150 | ml = new QVBoxLayout ( this ); | 150 | ml = new QVBoxLayout ( this ); |
151 | } | 151 | } |
152 | 152 | ||
153 | KOCalEditView::~KOCalEditView() | 153 | KOCalEditView::~KOCalEditView() |
154 | { | 154 | { |
155 | // no need to delete child widgets, Qt does it all for us | 155 | // no need to delete child widgets, Qt does it all for us |
156 | } | 156 | } |
157 | void KOCalEditView::selectCal(int id ,bool b) | 157 | void KOCalEditView::selectCal(int id ,bool b) |
158 | { | 158 | { |
159 | KOPrefs::instance()->getCalendar( id )->isEnabled = b; | 159 | KOPrefs::instance()->getCalendar( id )->isEnabled = b; |
160 | emit calendarEnabled ( id, b ); | 160 | emit calendarEnabled ( id, b ); |
161 | emit needsUpdate(); | 161 | emit needsUpdate(); |
162 | 162 | ||
163 | } | 163 | } |
164 | void KOCalEditView::selectStdCal( int id, bool b ) | 164 | void KOCalEditView::selectStdCal( int id, bool b ) |
165 | { | 165 | { |
166 | 166 | ||
167 | if ( !b ) { | 167 | if ( !b ) { |
168 | KOCalCheckButton* it = (KOCalCheckButton*) sender(); | 168 | KOCalCheckButton* it = (KOCalCheckButton*) sender(); |
169 | if ( it ) { | 169 | if ( it ) { |
170 | it->blockSignals( true ); | 170 | it->blockSignals( true ); |
171 | it->setChecked( true ); | 171 | it->setChecked( true ); |
172 | it->blockSignals( false ); | 172 | it->blockSignals( false ); |
173 | return; | 173 | return; |
174 | } | 174 | } |
175 | return; | 175 | return; |
176 | } | 176 | } |
177 | KOCalCheckButton* sen = (KOCalCheckButton*) sender(); | 177 | KOCalCheckButton* sen = (KOCalCheckButton*) sender(); |
178 | KOCalCheckButton* it = mStdandardB.first(); | 178 | KOCalCheckButton* it = mStdandardB.first(); |
179 | while ( it ) { | 179 | while ( it ) { |
180 | if ( it->isChecked() ) { | 180 | if ( it->isChecked() ) { |
181 | if ( it != sen ) { | 181 | if ( it != sen ) { |
182 | it->blockSignals( true ); | 182 | it->blockSignals( true ); |
183 | it->setChecked( false ); | 183 | it->setChecked( false ); |
184 | it->blockSignals( false ); | 184 | it->blockSignals( false ); |
185 | break; | 185 | break; |
186 | } | 186 | } |
187 | } | 187 | } |
188 | it = mStdandardB.next(); | 188 | it = mStdandardB.next(); |
189 | } | 189 | } |
190 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 190 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
191 | while ( kkf ) { | 191 | while ( kkf ) { |
192 | kkf->isStandard = false; | 192 | kkf->isStandard = false; |
193 | kkf = KOPrefs::instance()->mCalendars.next(); | 193 | kkf = KOPrefs::instance()->mCalendars.next(); |
194 | } | 194 | } |
195 | KOPrefs::instance()->getCalendar( id )->isStandard = true; | 195 | KOPrefs::instance()->getCalendar( id )->isStandard = true; |
196 | emit setCalendarDefault ( id ); | 196 | emit setCalendarDefault ( id ); |
197 | } | 197 | } |
198 | 198 | ||
199 | void KOCalEditView::selectCalAlarm(int id ,bool b ) | 199 | void KOCalEditView::selectCalAlarm(int id ,bool b ) |
200 | { | 200 | { |
201 | KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; | 201 | KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; |
202 | emit alarmEnabled ( id , b ); | 202 | emit alarmEnabled ( id , b ); |
203 | emit needsUpdate(); | 203 | emit needsUpdate(); |
204 | } | 204 | } |
205 | void KOCalEditView::selectReadOnly(int id ,bool b ) | 205 | void KOCalEditView::selectReadOnly(int id ,bool b ) |
206 | { | 206 | { |
207 | KOPrefs::instance()->getCalendar( id )->isReadOnly = b; | 207 | KOPrefs::instance()->getCalendar( id )->isReadOnly = b; |
208 | emit calendarReadonly ( id , b ); | 208 | emit calendarReadonly ( id , b ); |
209 | if ( KOPrefs::instance()->getCalendar( id )->isStandard && b && id > 1 ) { | ||
210 | KOPrefs::instance()->getCalendar( id )->isStandard = false; | ||
211 | KOPrefs::instance()->getCalendar( 1 )->isStandard = true; | ||
212 | emit setCalendarDefault ( 1 ); | ||
213 | } | ||
209 | emit needsUpdate(); | 214 | emit needsUpdate(); |
215 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | ||
210 | 216 | ||
211 | } | 217 | } |
212 | void KOCalEditView::setColor( const QColor& c, int id ) | 218 | void KOCalEditView::setColor( const QColor& c, int id ) |
213 | { | 219 | { |
214 | KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; | 220 | KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; |
215 | emit needsUpdate(); | 221 | emit needsUpdate(); |
216 | } | 222 | } |
217 | void KOCalEditView::deleteCal( int id ) | 223 | void KOCalEditView::deleteCal( int id ) |
218 | { | 224 | { |
219 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); | 225 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); |
220 | QString name = kkf->mName; | 226 | QString name = kkf->mName; |
221 | QString file = kkf->mFileName; | 227 | QString file = kkf->mFileName; |
222 | if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b><tr> Do you want to remove this calendar from KO/Pi? (The file is not removed, of course!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; | 228 | if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b><tr> Do you want to remove this calendar from KO/Pi? (The file is not removed, of course!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; |
223 | if ( kkf->isStandard ) | 229 | if ( kkf->isStandard ) |
224 | selectStdCal( 1, true ); | 230 | selectStdCal( 1, true ); |
225 | emit removeCalendar ( id ); | 231 | emit removeCalendar ( id ); |
226 | KOPrefs::instance()->mCalendars.remove ( kkf ); | 232 | KOPrefs::instance()->mCalendars.remove ( kkf ); |
227 | emit needsUpdate(); | 233 | emit needsUpdate(); |
228 | readConfig(); | 234 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
229 | } | 235 | } |
230 | void KOCalEditView::infoCal( int id ) | 236 | void KOCalEditView::infoCal( int id ) |
231 | { | 237 | { |
232 | QString name = KOPrefs::instance()->getCalendar( id )->mName; | 238 | QString name = KOPrefs::instance()->getCalendar( id )->mName; |
233 | QString file = KOPrefs::instance()->getCalendar( id )->mFileName; | 239 | QString file = KOPrefs::instance()->getCalendar( id )->mFileName; |
234 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { | 240 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { |
235 | if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { | 241 | if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { |
236 | emit calendarAdded( id ); | 242 | emit calendarAdded( id ); |
237 | readConfig(); | ||
238 | emit needsUpdate(); | 243 | emit needsUpdate(); |
244 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | ||
239 | } | 245 | } |
240 | } | 246 | } |
241 | else | 247 | else |
242 | KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); | 248 | KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); |
243 | } | 249 | } |
244 | void KOCalEditView::readConfig() | 250 | void KOCalEditView::readConfig() |
245 | { | 251 | { |
246 | 252 | ||
247 | mStdandardB.clear(); | 253 | mStdandardB.clear(); |
248 | mEnabledB.clear(); | 254 | mEnabledB.clear(); |
249 | mAlarmB.clear(); | 255 | mAlarmB.clear(); |
250 | mROB.clear(); | 256 | mROB.clear(); |
251 | 257 | ||
252 | if ( mw ) delete mw; | 258 | if ( mw ) delete mw; |
253 | mw = new QWidget ( this ); | 259 | mw = new QWidget ( this ); |
254 | ml->addWidget ( mw ); | 260 | ml->addWidget ( mw ); |
255 | 261 | ||
256 | mainLayout = new QGridLayout ( mw , 2, 8 ); | 262 | mainLayout = new QGridLayout ( mw , 2, 8 ); |
257 | //mainLayout->setSpacing( 3 ); | 263 | //mainLayout->setSpacing( 3 ); |
258 | QPushButton * addBut = new QPushButton ( mw ); | 264 | QPushButton * addBut = new QPushButton ( mw ); |
259 | mainLayout->addWidget( addBut,0,0 ); | 265 | mainLayout->addWidget( addBut,0,0 ); |
260 | addBut->setPixmap ( SmallIcon("plus")); | 266 | addBut->setPixmap ( SmallIcon("plus")); |
261 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); | 267 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); |
262 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 268 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
263 | 269 | ||
264 | addBut = new QPushButton ( mw ); | 270 | addBut = new QPushButton ( mw ); |
265 | mainLayout->addWidget( addBut,0,1 ); | 271 | mainLayout->addWidget( addBut,0,1 ); |
266 | addBut->setPixmap ( SmallIcon("eye")); | 272 | addBut->setPixmap ( SmallIcon("eye")); |
267 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); | 273 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); |
268 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 274 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
269 | 275 | ||
270 | QLabel* lab = new QLabel ( " "+i18n("Calendar")+" ", mw ); | 276 | QLabel* lab = new QLabel ( " "+i18n("Calendar")+" ", mw ); |
271 | mainLayout->addWidget( lab,0,2 ); | 277 | mainLayout->addWidget( lab,0,2 ); |
272 | 278 | ||
273 | addBut = new QPushButton ( mw ); | 279 | addBut = new QPushButton ( mw ); |
274 | mainLayout->addWidget( addBut,0,3 ); | 280 | mainLayout->addWidget( addBut,0,3 ); |
275 | addBut->setPixmap ( SmallIcon("bell")); | 281 | addBut->setPixmap ( SmallIcon("bell")); |
276 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); | 282 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); |
277 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 283 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
278 | 284 | ||
279 | addBut = new QPushButton ( mw ); | 285 | addBut = new QPushButton ( mw ); |
280 | mainLayout->addWidget( addBut,0,4 ); | 286 | mainLayout->addWidget( addBut,0,4 ); |
281 | addBut->setPixmap ( SmallIcon("pencil")); | 287 | addBut->setPixmap ( SmallIcon("pencil")); |
282 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); | 288 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); |
283 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 289 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
284 | 290 | ||
285 | lab = new QLabel ( i18n(" Color "), mw ); | 291 | lab = new QLabel ( i18n(" Color "), mw ); |
286 | mainLayout->addWidget( lab,0,5 ); | 292 | mainLayout->addWidget( lab,0,5 ); |
287 | #if 0 | 293 | #if 0 |
288 | addBut = new QPushButton ( mw ); | 294 | addBut = new QPushButton ( mw ); |
289 | mainLayout->addWidget( addBut,0,6 ); | 295 | mainLayout->addWidget( addBut,0,6 ); |
290 | addBut->setPixmap ( SmallIcon("minus")); | 296 | addBut->setPixmap ( SmallIcon("minus")); |
291 | connect(addBut,SIGNAL(clicked()),SLOT(deleteAll())); | 297 | connect(addBut,SIGNAL(clicked()),SLOT(deleteAll())); |
292 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 298 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
293 | #endif | 299 | #endif |
294 | 300 | ||
295 | 301 | ||
296 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 302 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
297 | int row = 1; | 303 | int row = 1; |
298 | while ( kkf ) { | 304 | while ( kkf ) { |
299 | 305 | ||
300 | KOCalCheckButton* cb = new KOCalCheckButton( mw ); | 306 | KOCalCheckButton* cb = new KOCalCheckButton( mw ); |
301 | mainLayout->addWidget( cb,row,0 );mStdandardB.append( cb ); | 307 | mainLayout->addWidget( cb,row,0 );mStdandardB.append( cb ); |
302 | cb->setChecked( kkf->isStandard ); | 308 | cb->setChecked( kkf->isStandard ); |
303 | cb->setNum( kkf->mCalNumber ); | 309 | cb->setNum( kkf->mCalNumber ); |
304 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); | 310 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); |
305 | if ( kkf->mErrorOnLoad ) | 311 | if ( kkf->mErrorOnLoad || kkf->isReadOnly ) |
306 | cb->setEnabled( false ); | 312 | cb->setEnabled( false ); |
307 | cb = new KOCalCheckButton( mw ); | 313 | cb = new KOCalCheckButton( mw ); |
308 | mainLayout->addWidget( cb,row,1 );mEnabledB.append( cb ); | 314 | mainLayout->addWidget( cb,row,1 );mEnabledB.append( cb ); |
309 | cb->setChecked( kkf->isEnabled ); | 315 | cb->setChecked( kkf->isEnabled ); |
310 | cb->setNum( kkf->mCalNumber ); | 316 | cb->setNum( kkf->mCalNumber ); |
311 | if ( kkf->mErrorOnLoad ) | 317 | if ( kkf->mErrorOnLoad ) |
312 | cb->setEnabled( false ); | 318 | cb->setEnabled( false ); |
313 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); | 319 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); |
314 | KOCalButton* name = new KOCalButton( mw ); | 320 | KOCalButton* name = new KOCalButton( mw ); |
315 | name->setNum( kkf->mCalNumber ); | 321 | name->setNum( kkf->mCalNumber ); |
316 | name->setText( kkf->mName ); | 322 | name->setText( kkf->mName ); |
317 | mainLayout->addWidget( name,row,2 ); | 323 | mainLayout->addWidget( name,row,2 ); |
318 | connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); | 324 | connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); |
319 | cb = new KOCalCheckButton( mw ); | 325 | cb = new KOCalCheckButton( mw ); |
320 | mainLayout->addWidget( cb,row,3 );mAlarmB.append( cb ); | 326 | mainLayout->addWidget( cb,row,3 );mAlarmB.append( cb ); |
321 | cb->setChecked( kkf->isAlarmEnabled ); | 327 | cb->setChecked( kkf->isAlarmEnabled ); |
322 | cb->setNum( kkf->mCalNumber ); | 328 | cb->setNum( kkf->mCalNumber ); |
323 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) ); | 329 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) ); |
324 | if ( kkf->mErrorOnLoad ) | 330 | if ( kkf->mErrorOnLoad ) |
325 | cb->setEnabled( false ); | 331 | cb->setEnabled( false ); |
326 | cb = new KOCalCheckButton( mw ); | 332 | cb = new KOCalCheckButton( mw ); |
327 | mainLayout->addWidget( cb,row,4 );mROB.append( cb ); | 333 | mainLayout->addWidget( cb,row,4 );mROB.append( cb ); |
328 | cb->setChecked( kkf->isReadOnly ); | 334 | cb->setChecked( kkf->isReadOnly ); |
329 | cb->setNum( kkf->mCalNumber ); | 335 | cb->setNum( kkf->mCalNumber ); |
330 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); | 336 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); |
331 | if ( kkf->mErrorOnLoad ) | 337 | if ( kkf->mErrorOnLoad ) |
332 | cb->setEnabled( false ); | 338 | cb->setEnabled( false ); |
333 | KColorButton *colb = new KColorButton( mw ); | 339 | KColorButton *colb = new KColorButton( mw ); |
334 | mainLayout->addWidget( colb,row,5 ); | 340 | mainLayout->addWidget( colb,row,5 ); |
335 | colb->setID( kkf->mCalNumber ); | 341 | colb->setID( kkf->mCalNumber ); |
336 | colb->setColor( kkf->mDefaultColor ); | 342 | colb->setColor( kkf->mDefaultColor ); |
337 | connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); | 343 | connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); |
338 | if ( row > 1) { | 344 | if ( row > 1) { |
339 | KOCalButton* calb = new KOCalButton( mw ); | 345 | KOCalButton* calb = new KOCalButton( mw ); |
340 | mainLayout->addWidget( calb,row,6 ); | 346 | mainLayout->addWidget( calb,row,6 ); |
341 | calb->setNum( kkf->mCalNumber ); | 347 | calb->setNum( kkf->mCalNumber ); |
342 | calb->setPixmap ( SmallIcon("minus")); | 348 | calb->setPixmap ( SmallIcon("minus")); |
343 | connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); | 349 | connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); |
344 | int hei = calb->sizeHint().height(); | 350 | int hei = calb->sizeHint().height(); |
345 | //calb->setMaximumSize( hei*9/10, hei*9/10 ); | 351 | //calb->setMaximumSize( hei*9/10, hei*9/10 ); |
346 | } | 352 | } |
347 | ++row; | 353 | ++row; |
348 | kkf = KOPrefs::instance()->mCalendars.next(); | 354 | kkf = KOPrefs::instance()->mCalendars.next(); |
349 | } | 355 | } |
350 | lab = new QLabel ( "", mw ); | 356 | lab = new QLabel ( "", mw ); |
351 | mainLayout->addWidget( lab,row,0 ); | 357 | mainLayout->addWidget( lab,row,0 ); |
352 | mw->show(); | 358 | mw->show(); |
353 | 359 | ||
354 | } | 360 | } |
355 | void KOCalEditView::addCal() | 361 | void KOCalEditView::addCal() |
356 | { | 362 | { |
357 | KONewCalPrefs prefs ( this ); | 363 | KONewCalPrefs prefs ( this ); |
358 | if ( ! prefs.exec() ) | 364 | if ( ! prefs.exec() ) |
359 | return; | 365 | return; |
360 | QString name = prefs.calName(); | 366 | QString name = prefs.calName(); |
361 | QString file = prefs.calFileName(); | 367 | QString file = prefs.calFileName(); |
362 | QFileInfo fi ( file ); | 368 | QFileInfo fi ( file ); |
363 | if (!fi.exists() ) { | 369 | if (!fi.exists() ) { |
364 | KMessageBox::information( this, i18n("File does not exist!\nNo calendar added!")); | 370 | KMessageBox::information( this, i18n("File does not exist!\nNo calendar added!")); |
365 | return; | 371 | return; |
366 | } | 372 | } |
367 | KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); | 373 | KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); |
368 | kkf->mName = name; | 374 | kkf->mName = name; |
369 | kkf->mFileName = file; | 375 | kkf->mFileName = file; |
370 | emit calendarAdded( kkf->mCalNumber ); | 376 | emit calendarAdded( kkf->mCalNumber ); |
371 | readConfig(); | ||
372 | emit needsUpdate(); | 377 | emit needsUpdate(); |
378 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | ||
373 | } | 379 | } |
374 | void KOCalEditView::enableAll() | 380 | void KOCalEditView::enableAll() |
375 | { | 381 | { |
376 | toggleList( mEnabledB ); | 382 | toggleList( mEnabledB ); |
377 | } | 383 | } |
378 | void KOCalEditView::enableAlarm() | 384 | void KOCalEditView::enableAlarm() |
379 | { | 385 | { |
380 | toggleList( mAlarmB ); | 386 | toggleList( mAlarmB ); |
381 | } | 387 | } |
382 | void KOCalEditView::disableRO() | 388 | void KOCalEditView::disableRO() |
383 | { | 389 | { |
384 | toggleList( mROB ); | 390 | toggleList( mROB ); |
385 | } | 391 | } |
386 | void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list ) | 392 | void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list ) |
387 | { | 393 | { |
388 | bool dis = false; | 394 | bool dis = false; |
389 | KOCalCheckButton* it = list.first(); | 395 | KOCalCheckButton* it = list.first(); |
390 | while ( it ) { | 396 | while ( it ) { |
391 | if ( !it->isChecked() ) { | 397 | if ( !it->isChecked() ) { |
392 | dis = true; | 398 | dis = true; |
393 | break; | 399 | break; |
394 | } | 400 | } |
395 | it = list.next(); | 401 | it = list.next(); |
396 | } | 402 | } |
397 | it = list.first(); | 403 | it = list.first(); |
398 | while ( it ) { | 404 | while ( it ) { |
399 | it->setChecked(dis); | 405 | it->setChecked(dis); |
400 | it = list.next(); | 406 | it = list.next(); |
401 | } | 407 | } |
402 | } | 408 | } |
403 | void KOCalEditView::deleteAll() | 409 | void KOCalEditView::deleteAll() |
404 | { | 410 | { |
405 | qDebug("delteAll"); | 411 | qDebug("delteAll"); |
406 | } | 412 | } |
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 4a0cd8a..1849e36 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -1,156 +1,156 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOFILTERVIEW_H | 23 | #ifndef KOFILTERVIEW_H |
24 | #define KOFILTERVIEW_H | 24 | #define KOFILTERVIEW_H |
25 | 25 | ||
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qcheckbox.h> | 27 | #include <qcheckbox.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <kconfig.h> | 29 | #include <kconfig.h> |
30 | #include "kofilterview_base.h" | 30 | #include "kofilterview_base.h" |
31 | 31 | ||
32 | #include <libkcal/calfilter.h> | 32 | #include <libkcal/calfilter.h> |
33 | 33 | ||
34 | class QGridLayout; | 34 | class QGridLayout; |
35 | 35 | ||
36 | using namespace KCal; | 36 | using namespace KCal; |
37 | class KOCalButton : public QPushButton | 37 | class KOCalButton : public QPushButton |
38 | { | 38 | { |
39 | Q_OBJECT | 39 | Q_OBJECT |
40 | public: | 40 | public: |
41 | KOCalButton( QWidget *parent=0, const char *name=0 ) : | 41 | KOCalButton( QWidget *parent=0, const char *name=0 ) : |
42 | QPushButton( parent, name) | 42 | QPushButton( parent, name) |
43 | { | 43 | { |
44 | connect( this, SIGNAL( clicked() ), | 44 | connect( this, SIGNAL( clicked() ), |
45 | SLOT( bottonClicked() )); | 45 | SLOT( bottonClicked() )); |
46 | mNumber = -1; | 46 | mNumber = -1; |
47 | } | 47 | } |
48 | void setNum ( int num ) {mNumber = num; } | 48 | void setNum ( int num ) {mNumber = num; } |
49 | signals: | 49 | signals: |
50 | void selectNum ( int ); | 50 | void selectNum ( int ); |
51 | private: | 51 | private: |
52 | int mNumber; | 52 | int mNumber; |
53 | void keyPressEvent ( QKeyEvent * e ) | 53 | void keyPressEvent ( QKeyEvent * e ) |
54 | { | 54 | { |
55 | e->ignore(); | 55 | e->ignore(); |
56 | } | 56 | } |
57 | 57 | ||
58 | private slots : | 58 | private slots : |
59 | void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } | 59 | void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } |
60 | }; | 60 | }; |
61 | class KOCalCheckButton : public QCheckBox | 61 | class KOCalCheckButton : public QCheckBox |
62 | { | 62 | { |
63 | Q_OBJECT | 63 | Q_OBJECT |
64 | public: | 64 | public: |
65 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : | 65 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : |
66 | QCheckBox( parent, name) | 66 | QCheckBox( parent, name) |
67 | { | 67 | { |
68 | connect( this, SIGNAL( toggled ( bool ) ), | 68 | connect( this, SIGNAL( toggled ( bool ) ), |
69 | SLOT( bottonClicked( bool ) )); | 69 | SLOT( bottonClicked( bool ) )); |
70 | mNumber = -1; | 70 | mNumber = -1; |
71 | //setMaximumWidth( 10 ); | 71 | //setMaximumWidth( 10 ); |
72 | 72 | ||
73 | } | 73 | } |
74 | void setNum ( int num ) {mNumber = num; } | 74 | void setNum ( int num ) {mNumber = num; } |
75 | signals: | 75 | signals: |
76 | void selectNum ( int, bool ); | 76 | void selectNum ( int, bool ); |
77 | private: | 77 | private: |
78 | int mNumber; | 78 | int mNumber; |
79 | void keyPressEvent ( QKeyEvent * e ) | 79 | void keyPressEvent ( QKeyEvent * e ) |
80 | { | 80 | { |
81 | e->ignore(); | 81 | e->ignore(); |
82 | } | 82 | } |
83 | 83 | ||
84 | private slots : | 84 | private slots : |
85 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } | 85 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } |
86 | }; | 86 | }; |
87 | 87 | ||
88 | 88 | ||
89 | 89 | ||
90 | class KOFilterView : public KOFilterView_base | 90 | class KOFilterView : public KOFilterView_base |
91 | { | 91 | { |
92 | Q_OBJECT | 92 | Q_OBJECT |
93 | public: | 93 | public: |
94 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); | 94 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); |
95 | ~KOFilterView(); | 95 | ~KOFilterView(); |
96 | 96 | ||
97 | void updateFilters(); | 97 | void updateFilters(); |
98 | 98 | ||
99 | bool filtersEnabled(); | 99 | bool filtersEnabled(); |
100 | void setFiltersEnabled(bool); | 100 | void setFiltersEnabled(bool); |
101 | CalFilter *selectedFilter(); | 101 | CalFilter *selectedFilter(); |
102 | void setSelectedFilter(QString); | 102 | void setSelectedFilter(QString); |
103 | void setSelectedFilter( int ); | 103 | void setSelectedFilter( int ); |
104 | 104 | ||
105 | signals: | 105 | signals: |
106 | void filterChanged(); | 106 | void filterChanged(); |
107 | void editFilters(); | 107 | void editFilters(); |
108 | 108 | ||
109 | private: | 109 | private: |
110 | QPtrList<CalFilter> *mFilters; | 110 | QPtrList<CalFilter> *mFilters; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | class KOCalEditView : public QWidget | 113 | class KOCalEditView : public QWidget |
114 | { | 114 | { |
115 | Q_OBJECT | 115 | Q_OBJECT |
116 | public: | 116 | public: |
117 | KOCalEditView( QWidget* parent=0,const char* name=0); | 117 | KOCalEditView( QWidget* parent=0,const char* name=0); |
118 | ~KOCalEditView(); | 118 | ~KOCalEditView(); |
119 | 119 | ||
120 | void readConfig(); | ||
121 | public slots: | 120 | public slots: |
122 | void addCal(); | 121 | void addCal(); |
123 | void enableAll(); | 122 | void enableAll(); |
124 | void enableAlarm(); | 123 | void enableAlarm(); |
125 | void disableRO(); | 124 | void disableRO(); |
126 | void deleteAll(); | 125 | void deleteAll(); |
127 | void selectStdCal(int,bool ); | 126 | void selectStdCal(int,bool ); |
128 | void selectCal(int,bool ); | 127 | void selectCal(int,bool ); |
129 | void selectCalAlarm(int,bool ); | 128 | void selectCalAlarm(int,bool ); |
130 | void selectReadOnly(int,bool ); | 129 | void selectReadOnly(int,bool ); |
131 | void setColor(const QColor &,int) ; | 130 | void setColor(const QColor &,int) ; |
132 | void deleteCal(int) ; | 131 | void deleteCal(int) ; |
133 | void infoCal(int) ; | 132 | void infoCal(int) ; |
133 | void readConfig(); | ||
134 | signals: | 134 | signals: |
135 | void alarmEnabled ( int cal, bool enable ); | 135 | void alarmEnabled ( int cal, bool enable ); |
136 | void calendarEnabled ( int cal, bool enable ); | 136 | void calendarEnabled ( int cal, bool enable ); |
137 | void calendarReadonly ( int cal, bool readonly ); | 137 | void calendarReadonly ( int cal, bool readonly ); |
138 | void setCalendarDefault ( int cal ); | 138 | void setCalendarDefault ( int cal ); |
139 | void removeCalendar ( int cal ); | 139 | void removeCalendar ( int cal ); |
140 | void calendarAdded( int ); | 140 | void calendarAdded( int ); |
141 | void needsUpdate(); | 141 | void needsUpdate(); |
142 | 142 | ||
143 | private: | 143 | private: |
144 | QVBoxLayout* ml; | 144 | QVBoxLayout* ml; |
145 | QWidget *mw; | 145 | QWidget *mw; |
146 | void toggleList ( QPtrList<KOCalCheckButton> ); | 146 | void toggleList ( QPtrList<KOCalCheckButton> ); |
147 | QPtrList<KOCalCheckButton> mStdandardB; | 147 | QPtrList<KOCalCheckButton> mStdandardB; |
148 | QPtrList<KOCalCheckButton> mEnabledB; | 148 | QPtrList<KOCalCheckButton> mEnabledB; |
149 | QPtrList<KOCalCheckButton> mAlarmB; | 149 | QPtrList<KOCalCheckButton> mAlarmB; |
150 | QPtrList<KOCalCheckButton> mROB; | 150 | QPtrList<KOCalCheckButton> mROB; |
151 | QGridLayout* mainLayout; | 151 | QGridLayout* mainLayout; |
152 | }; | 152 | }; |
153 | 153 | ||
154 | 154 | ||
155 | 155 | ||
156 | #endif // KOFILTERVIEW_H | 156 | #endif // KOFILTERVIEW_H |