summaryrefslogtreecommitdiffabout
path: root/korganizer/kofilterview.h
authorzautrix <zautrix>2005-06-15 20:45:30 (UTC)
committer zautrix <zautrix>2005-06-15 20:45:30 (UTC)
commite74483434835ad799b1a6880ae4576aacb14624a (patch) (unidiff)
tree2a060544e0f6b026d773032d65ab079d75879afd /korganizer/kofilterview.h
parente17a686fcfab42a71f25e9f0a4c3a395ec41a7b1 (diff)
downloadkdepimpi-e74483434835ad799b1a6880ae4576aacb14624a.zip
kdepimpi-e74483434835ad799b1a6880ae4576aacb14624a.tar.gz
kdepimpi-e74483434835ad799b1a6880ae4576aacb14624a.tar.bz2
fixes
Diffstat (limited to 'korganizer/kofilterview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kofilterview.h59
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
@@ -25,6 +25,8 @@
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>
@@ -32,9 +34,66 @@
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
35class QGridLayout; 42class QGridLayout;
36 43
37using namespace KCal; 44using namespace KCal;
45
46class 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
78public slots:
79void 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
92public:
93 KLineEdit* nameE;
94 KURLRequester *url;
95};
96
38class KOCalButton : public QPushButton 97class KOCalButton : public QPushButton
39{ 98{
40 Q_OBJECT 99 Q_OBJECT