-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,125 +1,126 @@ | |||
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: |