-rw-r--r-- | korganizer/kofilterview.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 5495d60..b57a6e9 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -1,75 +1,76 @@ | |||
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 <qradiobutton.h> | ||
28 | #include <qlayout.h> | 29 | #include <qlayout.h> |
29 | #include <qlabel.h> | 30 | #include <qlabel.h> |
30 | #include <qdialog.h> | 31 | #include <qdialog.h> |
31 | #include <qscrollview.h> | 32 | #include <qscrollview.h> |
32 | #include <qpushbutton.h> | 33 | #include <qpushbutton.h> |
33 | #include <kconfig.h> | 34 | #include <kconfig.h> |
34 | #include "kofilterview_base.h" | 35 | #include "kofilterview_base.h" |
35 | 36 | ||
36 | #include <libkcal/calfilter.h> | 37 | #include <libkcal/calfilter.h> |
37 | 38 | ||
38 | #include <kurlrequester.h> | 39 | #include <kurlrequester.h> |
39 | #include <klineedit.h> | 40 | #include <klineedit.h> |
40 | #include <kglobal.h> | 41 | #include <kglobal.h> |
41 | #include <kmessagebox.h> | 42 | #include <kmessagebox.h> |
42 | 43 | ||
43 | class QGridLayout; | 44 | class QGridLayout; |
44 | 45 | ||
45 | using namespace KCal; | 46 | using namespace KCal; |
46 | 47 | ||
47 | class KONewCalPrefs : public QDialog | 48 | class KONewCalPrefs : public QDialog |
48 | { | 49 | { |
49 | Q_OBJECT | 50 | Q_OBJECT |
50 | public: | 51 | public: |
51 | KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : | 52 | KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : |
52 | QDialog( parent, name, true ) | 53 | QDialog( parent, name, true ) |
53 | { | 54 | { |
54 | setCaption( i18n("Add new Calendar") ); | 55 | setCaption( i18n("Add new Calendar") ); |
55 | QVBoxLayout* lay = new QVBoxLayout( this ); | 56 | QVBoxLayout* lay = new QVBoxLayout( this ); |
56 | lay->setSpacing( 3 ); | 57 | lay->setSpacing( 3 ); |
57 | lay->setMargin( 3 ); | 58 | lay->setMargin( 3 ); |
58 | QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); | 59 | QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); |
59 | lay->addWidget( lab ); | 60 | lay->addWidget( lab ); |
60 | nameE = new KLineEdit( this ); | 61 | nameE = new KLineEdit( this ); |
61 | lay->addWidget( nameE ); | 62 | lay->addWidget( nameE ); |
62 | lab = new QLabel( i18n("<b>Local ical (*.ics) file:</b>"), this ); | 63 | lab = new QLabel( i18n("<b>Local ical (*.ics) file:</b>"), this ); |
63 | lay->addWidget( lab ); | 64 | lay->addWidget( lab ); |
64 | url = new KURLRequester ( this ); | 65 | url = new KURLRequester ( this ); |
65 | lay->addWidget( url ); | 66 | lay->addWidget( url ); |
66 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 67 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
67 | lay->addWidget( ok ); | 68 | lay->addWidget( ok ); |
68 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 69 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
69 | lay->addWidget( cancel ); | 70 | lay->addWidget( cancel ); |
70 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) ); | 71 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) ); |
71 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 72 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
72 | setMinimumWidth( 220 ); | 73 | setMinimumWidth( 220 ); |
73 | resize(sizeHint() ); | 74 | resize(sizeHint() ); |
74 | } | 75 | } |
75 | 76 | ||
@@ -103,116 +104,145 @@ class KOCalButton : public QPushButton | |||
103 | QPushButton( parent, name) | 104 | QPushButton( parent, name) |
104 | { | 105 | { |
105 | connect( this, SIGNAL( clicked() ), | 106 | connect( this, SIGNAL( clicked() ), |
106 | SLOT( bottonClicked() )); | 107 | SLOT( bottonClicked() )); |
107 | mNumber = -1; | 108 | mNumber = -1; |
108 | setFocusPolicy(NoFocus); | 109 | setFocusPolicy(NoFocus); |
109 | } | 110 | } |
110 | void setNum ( int num ) {mNumber = num; } | 111 | void setNum ( int num ) {mNumber = num; } |
111 | signals: | 112 | signals: |
112 | void selectNum ( int ); | 113 | void selectNum ( int ); |
113 | private: | 114 | private: |
114 | int mNumber; | 115 | int mNumber; |
115 | void keyPressEvent ( QKeyEvent * e ) | 116 | void keyPressEvent ( QKeyEvent * e ) |
116 | { | 117 | { |
117 | e->ignore(); | 118 | e->ignore(); |
118 | } | 119 | } |
119 | 120 | ||
120 | private slots : | 121 | private slots : |
121 | void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } | 122 | void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } |
122 | }; | 123 | }; |
123 | class KOCalCheckButton : public QCheckBox | 124 | class KOCalCheckButton : public QCheckBox |
124 | { | 125 | { |
125 | Q_OBJECT | 126 | Q_OBJECT |
126 | public: | 127 | public: |
127 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : | 128 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : |
128 | QCheckBox( parent, name) | 129 | QCheckBox( parent, name) |
129 | { | 130 | { |
130 | connect( this, SIGNAL( toggled ( bool ) ), | 131 | connect( this, SIGNAL( toggled ( bool ) ), |
131 | SLOT( bottonClicked( bool ) )); | 132 | SLOT( bottonClicked( bool ) )); |
132 | mNumber = -1; | 133 | mNumber = -1; |
133 | setFocusPolicy(NoFocus); | 134 | setFocusPolicy(NoFocus); |
134 | //setMaximumWidth( 10 ); | 135 | //setMaximumWidth( 10 ); |
135 | 136 | ||
136 | } | 137 | } |
137 | void setNum ( int num ) {mNumber = num; } | 138 | void setNum ( int num ) {mNumber = num; } |
138 | signals: | 139 | signals: |
139 | void selectNum ( int, bool ); | 140 | void selectNum ( int, bool ); |
140 | private: | 141 | private: |
141 | int mNumber; | 142 | int mNumber; |
142 | void keyPressEvent ( QKeyEvent * e ) | 143 | void keyPressEvent ( QKeyEvent * e ) |
143 | { | 144 | { |
144 | e->ignore(); | 145 | e->ignore(); |
145 | } | 146 | } |
146 | 147 | ||
147 | private slots : | 148 | private slots : |
148 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } | 149 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } |
149 | }; | 150 | }; |
150 | 151 | ||
152 | class KOCalRadioButton : public QRadioButton | ||
153 | { | ||
154 | Q_OBJECT | ||
155 | public: | ||
156 | KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : | ||
157 | QRadioButton( parent, name) | ||
158 | { | ||
159 | connect( this, SIGNAL( toggled ( bool ) ), | ||
160 | SLOT( bottonClicked( bool ) )); | ||
161 | mNumber = -1; | ||
162 | setFocusPolicy(NoFocus); | ||
163 | //setMaximumWidth( 10 ); | ||
164 | |||
165 | } | ||
166 | void setNum ( int num ) {mNumber = num; } | ||
167 | signals: | ||
168 | void selectNum ( int, bool ); | ||
169 | private: | ||
170 | int mNumber; | ||
171 | void keyPressEvent ( QKeyEvent * e ) | ||
172 | { | ||
173 | e->ignore(); | ||
174 | } | ||
175 | |||
176 | private slots : | ||
177 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } | ||
178 | }; | ||
179 | |||
151 | 180 | ||
152 | 181 | ||
153 | class KOFilterView : public KOFilterView_base | 182 | class KOFilterView : public KOFilterView_base |
154 | { | 183 | { |
155 | Q_OBJECT | 184 | Q_OBJECT |
156 | public: | 185 | public: |
157 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); | 186 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); |
158 | ~KOFilterView(); | 187 | ~KOFilterView(); |
159 | 188 | ||
160 | void updateFilters(); | 189 | void updateFilters(); |
161 | 190 | ||
162 | bool filtersEnabled(); | 191 | bool filtersEnabled(); |
163 | void setFiltersEnabled(bool); | 192 | void setFiltersEnabled(bool); |
164 | CalFilter *selectedFilter(); | 193 | CalFilter *selectedFilter(); |
165 | void setSelectedFilter(QString); | 194 | void setSelectedFilter(QString); |
166 | void setSelectedFilter( int ); | 195 | void setSelectedFilter( int ); |
167 | 196 | ||
168 | signals: | 197 | signals: |
169 | void filterChanged(); | 198 | void filterChanged(); |
170 | void editFilters(); | 199 | void editFilters(); |
171 | 200 | ||
172 | private: | 201 | private: |
173 | QPtrList<CalFilter> *mFilters; | 202 | QPtrList<CalFilter> *mFilters; |
174 | }; | 203 | }; |
175 | 204 | ||
176 | class KOCalEditView : public QScrollView | 205 | class KOCalEditView : public QScrollView |
177 | { | 206 | { |
178 | Q_OBJECT | 207 | Q_OBJECT |
179 | public: | 208 | public: |
180 | KOCalEditView( QWidget* parent=0,const char* name=0); | 209 | KOCalEditView( QWidget* parent=0,const char* name=0); |
181 | ~KOCalEditView(); | 210 | ~KOCalEditView(); |
182 | 211 | ||
183 | public slots: | 212 | public slots: |
184 | void addCal(); | 213 | void addCal(); |
185 | void enableAll(); | 214 | void enableAll(); |
186 | void enableAlarm(); | 215 | void enableAlarm(); |
187 | void disableRO(); | 216 | void disableRO(); |
188 | void deleteAll(); | 217 | void deleteAll(); |
189 | void selectStdCal(int,bool ); | 218 | void selectStdCal(int,bool ); |
190 | void selectCal(int,bool ); | 219 | void selectCal(int,bool ); |
191 | void selectCalAlarm(int,bool ); | 220 | void selectCalAlarm(int,bool ); |
192 | void selectReadOnly(int,bool ); | 221 | void selectReadOnly(int,bool ); |
193 | void setColor(const QColor &,int) ; | 222 | void setColor(const QColor &,int) ; |
194 | void deleteCal(int) ; | 223 | void deleteCal(int) ; |
195 | void infoCal(int) ; | 224 | void infoCal(int) ; |
196 | void readConfig(); | 225 | void readConfig(); |
226 | void defaultInfo(); | ||
197 | signals: | 227 | signals: |
198 | void alarmEnabled ( int cal, bool enable ); | 228 | void alarmEnabled ( int cal, bool enable ); |
199 | void calendarEnabled ( int cal, bool enable ); | 229 | void calendarEnabled ( int cal, bool enable ); |
200 | void calendarReadonly ( int cal, bool readonly ); | 230 | void calendarReadonly ( int cal, bool readonly ); |
201 | void setCalendarDefault ( int cal ); | 231 | void setCalendarDefault ( int cal ); |
202 | void removeCalendar ( int cal ); | 232 | void removeCalendar ( int cal ); |
203 | void calendarAdded( int ); | 233 | void calendarAdded( int ); |
204 | void needsUpdate(); | 234 | void needsUpdate(); |
205 | 235 | ||
206 | private: | 236 | private: |
207 | QWidget *mw; | 237 | QWidget *mw; |
208 | void toggleList ( QPtrList<KOCalCheckButton> ); | 238 | void toggleList ( QPtrList<KOCalCheckButton> ); |
209 | QPtrList<KOCalCheckButton> mStdandardB; | 239 | QPtrList<KOCalRadioButton> mStdandardB; |
210 | QPtrList<KOCalCheckButton> mEnabledB; | 240 | QPtrList<KOCalCheckButton> mEnabledB; |
211 | QPtrList<KOCalCheckButton> mAlarmB; | 241 | QPtrList<KOCalCheckButton> mAlarmB; |
212 | QPtrList<KOCalCheckButton> mROB; | 242 | QPtrList<KOCalCheckButton> mROB; |
213 | QGridLayout* mainLayout; | 243 | QGridLayout* mainLayout; |
214 | }; | 244 | }; |
215 | 245 | ||
216 | 246 | ||
217 | 247 | ||
218 | #endif // KOFILTERVIEW_H | 248 | #endif // KOFILTERVIEW_H |