-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index bfe95b0..8b6a5df 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -156,97 +156,97 @@ void MainWindow::makeMenu() | |||
156 | QPopupMenu *pop; | 156 | QPopupMenu *pop; |
157 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ | 157 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ |
158 | pop = s->popupMenu(); | 158 | pop = s->popupMenu(); |
159 | if (pop){ | 159 | if (pop){ |
160 | cfgMenu->insertItem( s->text(0), pop ); | 160 | cfgMenu->insertItem( s->text(0), pop ); |
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | 164 | ||
165 | //SEARCH | 165 | //SEARCH |
166 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); | 166 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); |
167 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); | 167 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); |
168 | // QWhatsThis::add( SearchAllAction, tr("Search everything...") ); | 168 | // QWhatsThis::add( SearchAllAction, tr("Search everything...") ); |
169 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); | 169 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); |
170 | SearchAllAction->addTo( searchMenu ); | 170 | SearchAllAction->addTo( searchMenu ); |
171 | searchMenu->insertItem( tr( "Options" ), searchOptions ); | 171 | searchMenu->insertItem( tr( "Options" ), searchOptions ); |
172 | 172 | ||
173 | //SEARCH OPTIONS | 173 | //SEARCH OPTIONS |
174 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); | 174 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); |
175 | //actionWholeWordsOnly->addTo( searchOptions ); | 175 | //actionWholeWordsOnly->addTo( searchOptions ); |
176 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); | 176 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); |
177 | actionCaseSensitiv->addTo( searchOptions ); | 177 | actionCaseSensitiv->addTo( searchOptions ); |
178 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); | 178 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); |
179 | actionWildcards->addTo( searchOptions ); | 179 | actionWildcards->addTo( searchOptions ); |
180 | 180 | ||
181 | //SEARCH BAR | 181 | //SEARCH BAR |
182 | LabelEnterText = new QLabel( searchBar, "Label" ); | 182 | LabelEnterText = new QLabel( searchBar, "Label" ); |
183 | LabelEnterText->setAutoMask( FALSE ); | 183 | LabelEnterText->setAutoMask( FALSE ); |
184 | LabelEnterText->setText( tr( "Search for: " ) ); | 184 | LabelEnterText->setText( tr( "Search for: " ) ); |
185 | 185 | ||
186 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 186 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
187 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 187 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
188 | QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); | 188 | QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); |
189 | searchEdit->setFocus(); | 189 | searchEdit->setFocus(); |
190 | searchBar->setHorizontalStretchable( TRUE ); | 190 | searchBar->setHorizontalStretchable( TRUE ); |
191 | searchBar->setStretchableWidget( searchEdit ); | 191 | searchBar->setStretchableWidget( searchEdit ); |
192 | 192 | ||
193 | //Search button | 193 | //Search button |
194 | SearchAllAction->addTo( searchBar ); | 194 | SearchAllAction->addTo( searchBar ); |
195 | 195 | ||
196 | //image ripped of off opie-login/loginwindow.cpp | 196 | //image ripped of off opie-login/loginwindow.cpp |
197 | QPixmap image1( ( const char** ) image1_data ); | 197 | QPixmap image1( ( const char** ) image1_data ); |
198 | 198 | ||
199 | //Clear text | 199 | //Clear text |
200 | ClearSearchText = new QToolButton( searchBar, "ClearSearchText"); | 200 | ClearSearchText = new QToolButton( searchBar, "ClearSearchText"); |
201 | ClearSearchText->setText( tr( "" ) ); | 201 | ClearSearchText->setText( tr( "" ) ); |
202 | ClearSearchText->setPixmap( image1 ); | 202 | ClearSearchText->setPixmap( image1 ); |
203 | 203 | ||
204 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ),this, SLOT( setSearch( const QString & ) ) ); | 204 | connect( searchEdit, SIGNAL( textChanged(const QString&) ),this, SLOT( setSearch(const QString&) ) ); |
205 | connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) ); | 205 | connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) ); |
206 | 206 | ||
207 | } | 207 | } |
208 | 208 | ||
209 | MainWindow::~MainWindow() | 209 | MainWindow::~MainWindow() |
210 | { | 210 | { |
211 | Config cfg( "osearch", Config::User ); | 211 | Config cfg( "osearch", Config::User ); |
212 | cfg.setGroup( "search_settings" ); | 212 | cfg.setGroup( "search_settings" ); |
213 | cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); | 213 | cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); |
214 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); | 214 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); |
215 | //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); | 215 | //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); |
216 | } | 216 | } |
217 | 217 | ||
218 | void MainWindow::setCurrent(QListViewItem *item) | 218 | void MainWindow::setCurrent(QListViewItem *item) |
219 | { | 219 | { |
220 | if (!item) return; | 220 | if (!item) return; |
221 | _currentItem = (OListViewItem*)item; | 221 | _currentItem = (OListViewItem*)item; |
222 | //_currentItem = dynamic_cast<OListViewItem*>(item); | 222 | //_currentItem = dynamic_cast<OListViewItem*>(item); |
223 | if (_currentItem->rtti() == OListViewItem::Result){ | 223 | if (_currentItem->rtti() == OListViewItem::Result){ |
224 | ResultItem *res = (ResultItem*)item; | 224 | ResultItem *res = (ResultItem*)item; |
225 | // ResultItem *res = dynamic_cast<ResultItem*>(item); | 225 | // ResultItem *res = dynamic_cast<ResultItem*>(item); |
226 | richEdit->setText( res->toRichText() ); | 226 | richEdit->setText( res->toRichText() ); |
227 | QIntDict<QString> acts = res->actions(); | 227 | QIntDict<QString> acts = res->actions(); |
228 | QButton *button; | 228 | QButton *button; |
229 | for (uint i = 0; i < acts.count(); i++){ | 229 | for (uint i = 0; i < acts.count(); i++){ |
230 | button = buttonMap[i]; | 230 | button = buttonMap[i]; |
231 | if (!button) { | 231 | if (!button) { |
232 | qWarning(" no button for %s", (*acts[i]).latin1() ); | 232 | qWarning(" no button for %s", (*acts[i]).latin1() ); |
233 | button = new QPushButton( buttonBox ); | 233 | button = new QPushButton( buttonBox ); |
234 | buttonMap.insert( i, button ); | 234 | buttonMap.insert( i, button ); |
235 | signalMapper->setMapping(button, i ); | 235 | signalMapper->setMapping(button, i ); |
236 | connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); | 236 | connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); |
237 | } | 237 | } |
238 | button->setText( *acts[i] ); | 238 | button->setText( *acts[i] ); |
239 | button->show(); | 239 | button->show(); |
240 | } | 240 | } |
241 | for (uint i = acts.count(); i < _buttonCount; i++){ | 241 | for (uint i = acts.count(); i < _buttonCount; i++){ |
242 | button = buttonMap[i]; | 242 | button = buttonMap[i]; |
243 | if (button) button->hide(); | 243 | if (button) button->hide(); |
244 | } | 244 | } |
245 | _buttonCount = acts.count(); | 245 | _buttonCount = acts.count(); |
246 | detailsFrame->show(); | 246 | detailsFrame->show(); |
247 | buttonBox->show(); | 247 | buttonBox->show(); |
248 | 248 | ||
249 | }else { | 249 | }else { |
250 | detailsFrame->hide(); | 250 | detailsFrame->hide(); |
251 | buttonBox->hide(); | 251 | buttonBox->hide(); |
252 | } | 252 | } |