summaryrefslogtreecommitdiff
path: root/core/pim/osearch/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/mainwindow.cpp2
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()
QPopupMenu *pop;
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
pop = s->popupMenu();
if (pop){
cfgMenu->insertItem( s->text(0), pop );
}
}
//SEARCH
SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 );
SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) );
// QWhatsThis::add( SearchAllAction, tr("Search everything...") );
connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
SearchAllAction->addTo( searchMenu );
searchMenu->insertItem( tr( "Options" ), searchOptions );
//SEARCH OPTIONS
//actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true );
//actionWholeWordsOnly->addTo( searchOptions );
actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true );
actionCaseSensitiv->addTo( searchOptions );
actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true );
actionWildcards->addTo( searchOptions );
//SEARCH BAR
LabelEnterText = new QLabel( searchBar, "Label" );
LabelEnterText->setAutoMask( FALSE );
LabelEnterText->setText( tr( "Search for: " ) );
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" );
QWhatsThis::add( searchEdit, tr("Enter your search terms here") );
searchEdit->setFocus();
searchBar->setHorizontalStretchable( TRUE );
searchBar->setStretchableWidget( searchEdit );
//Search button
SearchAllAction->addTo( searchBar );
//image ripped of off opie-login/loginwindow.cpp
QPixmap image1( ( const char** ) image1_data );
//Clear text
ClearSearchText = new QToolButton( searchBar, "ClearSearchText");
ClearSearchText->setText( tr( "" ) );
ClearSearchText->setPixmap( image1 );
- connect( searchEdit, SIGNAL( textChanged( const QString & ) ),this, SLOT( setSearch( const QString & ) ) );
+ connect( searchEdit, SIGNAL( textChanged(const QString&) ),this, SLOT( setSearch(const QString&) ) );
connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) );
}
MainWindow::~MainWindow()
{
Config cfg( "osearch", Config::User );
cfg.setGroup( "search_settings" );
cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() );
cfg.writeEntry( "wildcards", actionWildcards->isOn() );
//cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() );
}
void MainWindow::setCurrent(QListViewItem *item)
{
if (!item) return;
_currentItem = (OListViewItem*)item;
// _currentItem = dynamic_cast<OListViewItem*>(item);
if (_currentItem->rtti() == OListViewItem::Result){
ResultItem *res = (ResultItem*)item;
// ResultItem *res = dynamic_cast<ResultItem*>(item);
richEdit->setText( res->toRichText() );
QIntDict<QString> acts = res->actions();
QButton *button;
for (uint i = 0; i < acts.count(); i++){
button = buttonMap[i];
if (!button) {
qWarning(" no button for %s", (*acts[i]).latin1() );
button = new QPushButton( buttonBox );
buttonMap.insert( i, button );
signalMapper->setMapping(button, i );
connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) );
}
button->setText( *acts[i] );
button->show();
}
for (uint i = acts.count(); i < _buttonCount; i++){
button = buttonMap[i];
if (button) button->hide();
}
_buttonCount = acts.count();
detailsFrame->show();
buttonBox->show();
}else {
detailsFrame->hide();
buttonBox->hide();
}