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