summaryrefslogtreecommitdiffabout
path: root/korganizer/searchdialog.cpp
authorzautrix <zautrix>2005-02-22 01:14:35 (UTC)
committer zautrix <zautrix>2005-02-22 01:14:35 (UTC)
commitdf40d77f7407326221ba2848163c4f61b7bb1d2f (patch) (side-by-side diff)
tree1b46bf666f7371189ba421080f4dcd66dc9037f2 /korganizer/searchdialog.cpp
parentce261d6197d319d67f7b275813449f36ce42a730 (diff)
downloadkdepimpi-df40d77f7407326221ba2848163c4f61b7bb1d2f.zip
kdepimpi-df40d77f7407326221ba2848163c4f61b7bb1d2f.tar.gz
kdepimpi-df40d77f7407326221ba2848163c4f61b7bb1d2f.tar.bz2
next
Diffstat (limited to 'korganizer/searchdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp72
1 files changed, 38 insertions, 34 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 3fd9740..aa1b244 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -26,6 +26,7 @@
#include <qcheckbox.h>
#include <qgroupbox.h>
#include <qlabel.h>
+#include <qwhatsthis.h>
#include <qlineedit.h>
#include <qpushbutton.h>
@@ -42,23 +43,26 @@
#include "searchdialog.h"
SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
- : KDialogBase(Plain,i18n("KO/Pi Find "),User1|Close,User1,parent,0,false,false,
- i18n("&Find"))
+ : QVBox( 0 )
+
{
mCalendar = calendar;
- QFrame *topFrame = plainPage();
- QVBoxLayout *layout = new QVBoxLayout(topFrame,0,spacingHint());
+ QFrame *topFrame = new QFrame( this ) ;//plainPage();
+ QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint());
// Search expression
QHBoxLayout *subLayout = new QHBoxLayout();
layout->addLayout(subLayout);
-
searchLabel = new QLabel(topFrame);
searchLabel->setText(i18n("Search for:"));
subLayout->addWidget(searchLabel);
searchEdit = new QLineEdit(topFrame);
subLayout->addWidget(searchEdit);
+ QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame );
+ //OkButton->setDefault( true );
+ connect(OkButton,SIGNAL(clicked()),SLOT(doSearch()));
+ subLayout->addWidget(OkButton);
searchEdit->setText("*"); // Find all events by default
searchEdit->setFocus();
connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
@@ -67,8 +71,6 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
// QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
// topFrame);
-
-
QHBox *incidenceGroup = new QHBox( topFrame );
layout->addWidget(incidenceGroup);
@@ -96,8 +98,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
// layout->addWidget(rangeGroup);
QWidget *rangeWidget = new QWidget(topFrame);
- QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,spacingHint());
-
+ QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint());
rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
mStartDate = new KDateEdit(rangeWidget);
rangeLayout->addWidget(mStartDate);
@@ -105,33 +106,19 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
mEndDate = new KDateEdit(rangeWidget);
mEndDate->setDate(QDate::currentDate().addDays(365));
rangeLayout->addWidget(mEndDate);
-
- // mInclusiveCheck = new QCheckBox(i18n("Events have to be completely included"), topFrame);
- //mInclusiveCheck->setChecked(false);
+ QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
+ rangeLayout->addWidget( (QWidget*)wt );
layout->addWidget(rangeWidget);
- //layout->addWidget(mInclusiveCheck);
- // Subjects to search
-
-
// Results list view
listView = new KOListView(mCalendar,topFrame);
- //listView->showDates();
-
-
layout->addWidget(listView);
- // if ( KOPrefs::instance()->mCompactDialogs ) {
- // KOGlobals::fitDialogToScreen( this, true );
- // }
-
listView->readSettings(KOGlobals::config(),"SearchListView Layout");
- connect(this,SIGNAL(user1Clicked()),SLOT(doSearch()));
- QPushButton *CloseButton = findButton( Close );
- //connect(CloseButton,SIGNAL(clicked()),listView, SLOT(clear()));
-#ifndef DESKTOP_VERSION
- setCaption(i18n("Click OK to search ->"));
- hideButtons();
+ setCaption( i18n("KO/Pi Find: "));
+#ifdef DESKTOP_VERSION
+ OkButton = new QPushButton( i18n("Close"), this );
+ connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
#endif
}
@@ -158,7 +145,9 @@ void SearchDialog::updateList()
}
void SearchDialog::searchTextChanged( const QString &_text )
{
+#if 0
enableButton( KDialogBase::User1, !_text.isEmpty() );
+#endif
}
void SearchDialog::doSearch()
@@ -390,12 +379,27 @@ void SearchDialog::search(const QRegExp &re)
}
}
-/*
+
void SearchDialog::keyPressEvent ( QKeyEvent *e)
{
-
- e->ignore();
-
+ switch ( e->key() ) {
+ case Qt::Key_Escape:
+ hide();
+ break;
+ case Qt::Key_F:
+ if ( e->state() == Qt::ControlButton ) {
+ qDebug("full ");
+
+ }
+ break;
+ case Qt::Key_Return:
+ case Qt::Key_Enter:
+ doSearch();
+ break;
+
+ default:
+ e->ignore();
+ }
}
-*/
+
//mMatchedJournals;