From e74483434835ad799b1a6880ae4576aacb14624a Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 15 Jun 2005 20:45:30 +0000 Subject: fixes --- (limited to 'korganizer/kofilterview.h') 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 @@ #include #include +#include +#include #include #include #include @@ -32,9 +34,66 @@ #include +#include +#include +#include +#include + class QGridLayout; using namespace KCal; + +class KONewCalPrefs : public QDialog +{ + Q_OBJECT + public: + KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : + QDialog( parent, name, true ) + { + setCaption( i18n("Add new Calendar") ); + QVBoxLayout* lay = new QVBoxLayout( this ); + lay->setSpacing( 3 ); + lay->setMargin( 3 ); + QLabel * lab = new QLabel( i18n("Name of new calendar:"), this ); + lay->addWidget( lab ); + nameE = new KLineEdit( this ); + lay->addWidget( nameE ); + lab = new QLabel( i18n("Local ical (*.ics) file:"), this ); + lay->addWidget( lab ); + url = new KURLRequester ( this ); + lay->addWidget( url ); + QPushButton * ok = new QPushButton( i18n("OK"), this ); + lay->addWidget( ok ); + QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); + lay->addWidget( cancel ); + connect ( ok,SIGNAL(clicked() ),this , SLOT ( checkValid() ) ); + connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); + setMinimumWidth( 220 ); + resize(sizeHint() ); + } + + QString calName() { return nameE->text(); } + QString calFileName() { return url->url(); } + +public slots: +void checkValid() { + if ( nameE->text().isEmpty() ) { + KMessageBox::information( this, i18n("Sorry, the calendar name is empty!") ); + nameE->setText( "LPQJ_"+ QString::number( QTime::currentTime().msec () )); + return; + } + if ( url->url().isEmpty() ) { + KMessageBox::information( this, i18n("Sorry, the file name is empty!") ); + return; + } + accept(); +} + +public: + KLineEdit* nameE; + KURLRequester *url; +}; + class KOCalButton : public QPushButton { Q_OBJECT -- cgit v0.9.0.2