-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 6 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 2 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 9 | ||||
-rw-r--r-- | korganizer/searchdialog.h | 4 |
4 files changed, 18 insertions, 3 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index e2c8e6e..f606124 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp @@ -249,38 +249,44 @@ void KOEventViewerDialog::showIncidence() } } void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) { switch ( e->key() ) { case Qt::Key_A : case Qt::Key_L : showIncidence(); break; case Qt::Key_E : case Qt::Key_R : editIncidence(); break; case Qt::Key_C: case Qt::Key_Escape: + sendSignalViewerClosed = true; close(); break; case Qt::Key_I: +#ifndef DESKTOP_VERSION + sendSignalViewerClosed = true; + close(); +#else sendSignalViewerClosed = true; slotViewerClosed(); //accept(); +#endif break; default: KDialogBase::keyPressEvent ( e ); break; } } void KOEventViewerDialog::hideEvent ( QHideEvent * e ) { KDialogBase::hideEvent ( e ); QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); } void KOEventViewerDialog::slotViewerClosed() { if ( sendSignalViewerClosed ) { diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 6acee75..710a9f9 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -1070,34 +1070,34 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) ensureItemVisible ( cn ); } else QListView::keyPressEvent ( e ) ; e->accept(); break; case Qt::Key_I: { QListViewItem* cn; cn = currentItem(); if ( cn ) { KOListViewItem* ci = (KOListViewItem*)( cn ); if ( ci ){ //emit showIncidence( ci->data()); cn = cn->nextSibling(); if ( cn ) { setCurrentItem ( cn ); ensureItemVisible ( cn ); - emit showIncidence( ci->data()); } + emit showIncidence( ci->data()); } } e->accept(); } break; case Qt::Key_Return: case Qt::Key_Enter: { QListViewItem* cn; cn = currentItem(); if ( cn ) { KOListViewItem* ci = (KOListViewItem*)( cn ); if ( ci ){ if ( e->state() == ShiftButton ) ci->setSelected( false ); else diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index cef59a2..678e1bd 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -13,64 +13,66 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qlayout.h> #include <qcheckbox.h> #include <qgroupbox.h> #include <qlabel.h> +#include <qlistview.h> #include <qwhatsthis.h> #include <qlineedit.h> #include <qpushbutton.h> #include <klocale.h> #include <kmessagebox.h> #include <libkdepim/kdateedit.h> #include "koglobals.h" #include "koprefs.h" +#include "klineedit.h" #include "calendarview.h" #include "koviewmanager.h" #include "searchdialog.h" SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) : QVBox( 0 ) { mCalendar = calendar; 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); + searchEdit = new KLineEdit(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 & ))); connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); // Subjects to search // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), // topFrame); QHBox *incidenceGroup = new QHBox( topFrame ); layout->addWidget(incidenceGroup); @@ -101,44 +103,49 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); mStartDate = new KDateEdit(rangeWidget); rangeLayout->addWidget(mStartDate); rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); mEndDate = new KDateEdit(rangeWidget); mEndDate->setDate(QDate::currentDate().addDays(365)); rangeLayout->addWidget(mEndDate); QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); rangeLayout->addWidget( (QWidget*)wt ); layout->addWidget(rangeWidget); // Results list view listView = new KOListView(mCalendar,topFrame); layout->addWidget(listView); listView->readSettings(KOGlobals::config(),"SearchListView Layout"); + connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); setCaption( i18n("KO/Pi Find: ")); #ifdef DESKTOP_VERSION OkButton = new QPushButton( i18n("Close"), this ); connect(OkButton,SIGNAL(clicked()),SLOT(hide())); #endif } SearchDialog::~SearchDialog() { } +void SearchDialog::setFocusToList() +{ + listView->resetFocus(); +} void SearchDialog::accept() { doSearch(); } void SearchDialog::updateList() { //listView->updateList(); if ( isVisible() ) { updateView(); //qDebug("SearchDialog::updated "); } else { listView->clear(); //qDebug("SearchDialog::cleared "); } diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h index f4aad9e..b730ed5 100644 --- a/korganizer/searchdialog.h +++ b/korganizer/searchdialog.h @@ -23,70 +23,72 @@ */ #ifndef SEARCHDIALOG_H #define SEARCHDIALOG_H #include <qregexp.h> #include <kdialogbase.h> #include <qvbox.h> #include <libkcal/calendar.h> #include "kolistview.h" class KDateEdit; class QCheckBox; class QLineEdit; +class KLineEdit; class QLabel; class CalendarView; using namespace KCal; class SearchDialog : public QVBox { Q_OBJECT public: SearchDialog(Calendar *calendar,CalendarView *parent=0); virtual ~SearchDialog(); KOListView *listview(){ return listView;} void updateView(); public slots: void changeEventDisplay(Event *, int) { updateView(); } void updateConfig(); void updateList(); protected slots: + void setFocusToList(); void accept(); void doSearch(); void searchTextChanged( const QString &_text ); signals: void showEventSignal(Event *); void editEventSignal(Event *); void deleteEventSignal(Event *); private: void search(const QRegExp &); Calendar *mCalendar; QPtrList<Event> mMatchedEvents; QPtrList<Todo> mMatchedTodos; QPtrList<Journal> mMatchedJournals; QLabel *searchLabel; - QLineEdit *searchEdit; + KLineEdit *searchEdit; KOListView *listView; KDateEdit *mStartDate; KDateEdit *mEndDate; QCheckBox *mSummaryCheck; QCheckBox *mDescriptionCheck; QCheckBox *mCategoryCheck; QCheckBox *mSearchEvent; QCheckBox *mSearchTodo; QCheckBox *mSearchJournal; QCheckBox *mSearchAName; QCheckBox *mSearchAEmail; void keyPressEvent ( QKeyEvent *e) ; }; #endif |