author | zautrix <zautrix> | 2005-06-15 20:45:30 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-15 20:45:30 (UTC) |
commit | e74483434835ad799b1a6880ae4576aacb14624a (patch) (unidiff) | |
tree | 2a060544e0f6b026d773032d65ab079d75879afd /korganizer/kofilterview.h | |
parent | e17a686fcfab42a71f25e9f0a4c3a395ec41a7b1 (diff) | |
download | kdepimpi-e74483434835ad799b1a6880ae4576aacb14624a.zip kdepimpi-e74483434835ad799b1a6880ae4576aacb14624a.tar.gz kdepimpi-e74483434835ad799b1a6880ae4576aacb14624a.tar.bz2 |
fixes
-rw-r--r-- | korganizer/kofilterview.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 3ab316f..945947a 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -16,34 +16,93 @@ | |||
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> | ||
29 | #include <qlabel.h> | ||
28 | #include <qscrollview.h> | 30 | #include <qscrollview.h> |
29 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
30 | #include <kconfig.h> | 32 | #include <kconfig.h> |
31 | #include "kofilterview_base.h" | 33 | #include "kofilterview_base.h" |
32 | 34 | ||
33 | #include <libkcal/calfilter.h> | 35 | #include <libkcal/calfilter.h> |
34 | 36 | ||
37 | #include <kurlrequester.h> | ||
38 | #include <klineedit.h> | ||
39 | #include <kglobal.h> | ||
40 | #include <kmessagebox.h> | ||
41 | |||
35 | class QGridLayout; | 42 | class QGridLayout; |
36 | 43 | ||
37 | using namespace KCal; | 44 | using namespace KCal; |
45 | |||
46 | class KONewCalPrefs : public QDialog | ||
47 | { | ||
48 | Q_OBJECT | ||
49 | public: | ||
50 | KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : | ||
51 | QDialog( parent, name, true ) | ||
52 | { | ||
53 | setCaption( i18n("Add new Calendar") ); | ||
54 | QVBoxLayout* lay = new QVBoxLayout( this ); | ||
55 | lay->setSpacing( 3 ); | ||
56 | lay->setMargin( 3 ); | ||
57 | QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); | ||
58 | lay->addWidget( lab ); | ||
59 | nameE = new KLineEdit( this ); | ||
60 | lay->addWidget( nameE ); | ||
61 | lab = new QLabel( i18n("<b>Local ical (*.ics) file:</b>"), this ); | ||
62 | lay->addWidget( lab ); | ||
63 | url = new KURLRequester ( this ); | ||
64 | lay->addWidget( url ); | ||
65 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | ||
66 | lay->addWidget( ok ); | ||
67 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | ||
68 | lay->addWidget( cancel ); | ||
69 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) ); | ||
70 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | ||
71 | setMinimumWidth( 220 ); | ||
72 | resize(sizeHint() ); | ||
73 | } | ||
74 | |||
75 | QString calName() { return nameE->text(); } | ||
76 | QString calFileName() { return url->url(); } | ||
77 | |||
78 | public slots: | ||
79 | void checkValid() { | ||
80 | if ( nameE->text().isEmpty() ) { | ||
81 | KMessageBox::information( this, i18n("Sorry, the calendar name is empty!") ); | ||
82 | nameE->setText( "LPQJ_"+ QString::number( QTime::currentTime().msec () )); | ||
83 | return; | ||
84 | } | ||
85 | if ( url->url().isEmpty() ) { | ||
86 | KMessageBox::information( this, i18n("Sorry, the file name is empty!") ); | ||
87 | return; | ||
88 | } | ||
89 | accept(); | ||
90 | } | ||
91 | |||
92 | public: | ||
93 | KLineEdit* nameE; | ||
94 | KURLRequester *url; | ||
95 | }; | ||
96 | |||
38 | class KOCalButton : public QPushButton | 97 | class KOCalButton : public QPushButton |
39 | { | 98 | { |
40 | Q_OBJECT | 99 | Q_OBJECT |
41 | public: | 100 | public: |
42 | KOCalButton( QWidget *parent=0, const char *name=0 ) : | 101 | KOCalButton( QWidget *parent=0, const char *name=0 ) : |
43 | QPushButton( parent, name) | 102 | QPushButton( parent, name) |
44 | { | 103 | { |
45 | connect( this, SIGNAL( clicked() ), | 104 | connect( this, SIGNAL( clicked() ), |
46 | SLOT( bottonClicked() )); | 105 | SLOT( bottonClicked() )); |
47 | mNumber = -1; | 106 | mNumber = -1; |
48 | setFocusPolicy(NoFocus); | 107 | setFocusPolicy(NoFocus); |
49 | } | 108 | } |