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