author | zautrix <zautrix> | 2005-04-01 09:50:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-01 09:50:16 (UTC) |
commit | f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772 (patch) (side-by-side diff) | |
tree | 15edcb7a2b053eae5c5391191f71ba5c5c015211 /korganizer/searchdialog.cpp | |
parent | b76ad1e7e329051a47e28c9d132ce3fcd0b25c5c (diff) | |
download | kdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.zip kdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.tar.gz kdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.tar.bz2 |
fixes
-rw-r--r-- | korganizer/searchdialog.cpp | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 341a839..db60383 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -77,7 +77,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) layout->addWidget(incidenceGroup); mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); - mSearchEvent->setChecked(true); + //mSearchEvent->setChecked(true); mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); @@ -129,6 +129,49 @@ SearchDialog::~SearchDialog() { } +void SearchDialog::raiseAndSelect() +{ + + static int currentState = 0; + + if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) + currentState = 0; + int newState = 0; + if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { + newState = VIEW_J_VIEW; + } + else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { + newState = VIEW_T_VIEW; + } + else { + newState = VIEW_A_VIEW; + } + if ( newState != currentState ) { + if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { + if ( ! mSearchJournal->isChecked() ) { + mSearchJournal->setChecked( true ); + mSearchTodo->setChecked( false ); + mSearchEvent->setChecked( false ); + } + } + else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { + if ( ! mSearchTodo->isChecked() ) { + mSearchTodo->setChecked( true ); + mSearchJournal->setChecked( false ); + mSearchEvent->setChecked( false ); + } + } + else { + if ( ! mSearchEvent->isChecked() ) { + mSearchEvent->setChecked( true ); + mSearchJournal->setChecked( false ); + mSearchTodo->setChecked( false ); + } + } + } + currentState = newState; + raise(); +} void SearchDialog::setFocusToList() { listView->resetFocus(); @@ -201,7 +244,7 @@ void SearchDialog::updateConfig() } void SearchDialog::updateView() { - + //qDebug("SearchDialog::updateView() %d ", isVisible()); QRegExp re; re.setWildcard(true); // most people understand these better. re.setCaseSensitive(false); |