-rw-r--r-- | korganizer/searchdialog.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index ef2fc1c..7b3b543 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -65,41 +65,46 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | |||
65 | connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); | 65 | connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); |
66 | subLayout->addWidget(OkButton); | 66 | subLayout->addWidget(OkButton); |
67 | searchEdit = new KLineEdit(topFrame); | 67 | searchEdit = new KLineEdit(topFrame); |
68 | subLayout->addWidget(searchEdit); | 68 | subLayout->addWidget(searchEdit); |
69 | 69 | ||
70 | mAddItems = new QCheckBox(i18n("Add items"),topFrame); | 70 | mAddItems = new QCheckBox(i18n("Add items"),topFrame); |
71 | subLayout->addWidget(mAddItems); | 71 | subLayout->addWidget(mAddItems); |
72 | 72 | ||
73 | QPushButton *togButton = new QPushButton( "", topFrame ); | ||
74 | subLayout->addWidget(togButton); | ||
75 | connect(togButton,SIGNAL(clicked()),SLOT(toggleCheckboxes())); | ||
76 | togButton->setPixmap(SmallIcon("1updownarrow")); | ||
77 | togButton->setMinimumWidth( togButton->sizeHint().height() ); | ||
73 | searchEdit->setText("*"); // Find all events by default | 78 | searchEdit->setText("*"); // Find all events by default |
74 | searchEdit->setFocus(); | 79 | searchEdit->setFocus(); |
75 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); | 80 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); |
76 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); | 81 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); |
77 | // Subjects to search | 82 | // Subjects to search |
78 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), | 83 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), |
79 | // topFrame); | 84 | // topFrame); |
80 | 85 | ||
81 | QHBox *incidenceGroup = new QHBox( topFrame ); | 86 | incidenceGroup = new QHBox( topFrame ); |
82 | layout->addWidget(incidenceGroup); | 87 | layout->addWidget(incidenceGroup); |
83 | 88 | ||
84 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); | 89 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); |
85 | //mSearchEvent->setChecked(true); | 90 | //mSearchEvent->setChecked(true); |
86 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); | 91 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); |
87 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); | 92 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); |
88 | 93 | ||
89 | QHBox *subjectGroup = new QHBox( topFrame ); | 94 | subjectGroup = new QHBox( topFrame ); |
90 | layout->addWidget(subjectGroup); | 95 | layout->addWidget(subjectGroup); |
91 | 96 | ||
92 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); | 97 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); |
93 | mSummaryCheck->setChecked(true); | 98 | mSummaryCheck->setChecked(true); |
94 | mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); | 99 | mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); |
95 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); | 100 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); |
96 | 101 | ||
97 | QHBox *attendeeGroup = new QHBox( topFrame ); | 102 | attendeeGroup = new QHBox( topFrame ); |
98 | layout->addWidget(attendeeGroup ); | 103 | layout->addWidget(attendeeGroup ); |
99 | new QLabel( i18n("Attendee:"),attendeeGroup ); | 104 | new QLabel( i18n("Attendee:"),attendeeGroup ); |
100 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); | 105 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); |
101 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); | 106 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); |
102 | // Date range | 107 | // Date range |
103 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), | 108 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), |
104 | // topFrame); | 109 | // topFrame); |
105 | // layout->addWidget(rangeGroup); | 110 | // layout->addWidget(rangeGroup); |
@@ -131,16 +136,28 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | |||
131 | connect(OkButton,SIGNAL(clicked()),SLOT(hide())); | 136 | connect(OkButton,SIGNAL(clicked()),SLOT(hide())); |
132 | #endif | 137 | #endif |
133 | } | 138 | } |
134 | 139 | ||
135 | SearchDialog::~SearchDialog() | 140 | SearchDialog::~SearchDialog() |
136 | { | 141 | { |
137 | 142 | ||
138 | } | 143 | } |
144 | void SearchDialog::toggleCheckboxes() | ||
145 | { | ||
146 | if ( incidenceGroup->isVisible() ) { | ||
147 | incidenceGroup->hide() ; | ||
148 | subjectGroup->hide() ; | ||
149 | attendeeGroup->hide() ; | ||
150 | } else { | ||
151 | incidenceGroup->show() ; | ||
152 | subjectGroup->show() ; | ||
153 | attendeeGroup->show() ; | ||
154 | } | ||
155 | } | ||
139 | void SearchDialog::raiseAndSelect() | 156 | void SearchDialog::raiseAndSelect() |
140 | { | 157 | { |
141 | 158 | ||
142 | static int currentState = 0; | 159 | static int currentState = 0; |
143 | 160 | ||
144 | if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) | 161 | if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) |
145 | currentState = 0; | 162 | currentState = 0; |
146 | int newState = 0; | 163 | int newState = 0; |