summaryrefslogtreecommitdiff
path: root/core/pim/osearch
Side-by-side diff
Diffstat (limited to 'core/pim/osearch') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/doclnkitem.cpp6
-rw-r--r--core/pim/osearch/mainwindow.cpp7
2 files changed, 3 insertions, 10 deletions
diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp
index a1d0384..56eb26a 100644
--- a/core/pim/osearch/doclnkitem.cpp
+++ b/core/pim/osearch/doclnkitem.cpp
@@ -26,27 +26,27 @@ DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
setPixmap(0, _doc->pixmap() );
}
DocLnkItem::~DocLnkItem()
{
}
QString DocLnkItem::toRichText()
{
QString text;
text += "<b><h3>" + _doc->name() + "</b></h3><br>";
text += _doc->comment() + "<br>";
- text += "File: " + _doc->file() + "<br>";
- text += "Link: " + _doc->linkFile() + "<br>";
- text += "Mimetype: " + _doc->type() + "<br>";
+ text += QObject::tr("File: ") + _doc->file() + "<br>";
+ text += QObject::tr("Link: ") + _doc->linkFile() + "<br>";
+ text += QObject::tr("Mimetype: ") + _doc->type() + "<br>";
if ( _doc->type().contains( "text" ) ){
text += "<br><br><hr><br>";
QFile f(_doc->file());
if ( f.open(IO_ReadOnly) ) {
QTextStream t( &f );
while ( !t.eof() )
text += t.readLine() + "<br>";
}
f.close();
}
/* text += "<br><br>`";
text += _doc->exec();
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index adce926..2936b17 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -117,38 +117,35 @@ void MainWindow::makeMenu()
setToolBarsMovable( false );
toolBar->setHorizontalStretchable( true );
menuBar->insertItem( tr( "Search" ), searchMenu );
menuBar->insertItem( tr( "Settings" ), cfgMenu );
//SETTINGS MENU
cfgMenu->insertItem( tr( "Search" ), searchOptions );
QPopupMenu *pop;
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
pop = s->popupMenu();
if (pop){
- qDebug("inserting settings menu for %s",s->text(0).latin1());
cfgMenu->insertItem( s->text(0), pop );
- //connect( pop, SIGNAL( activated(int) ), SLOT( optionChanged(int) ) );
}
}
//SEARCH
SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 );
SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) );
connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
SearchAllAction->addTo( searchMenu );
searchMenu->insertItem( tr( "Options" ), searchOptions );
- //connect( searchOptions, SIGNAL( activated(int) ), SLOT( optionChanged(int) ) );
//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
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" );
@@ -174,36 +171,33 @@ 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 = buttonGroupActions->find( i );
- qDebug("action %i >%s<",i,acts[i]->latin1());
if (!button) {
- qDebug("BUTTON");
button = new QPushButton( detailsFrame );
buttonLayout->addWidget( button, 0 );
buttonGroupActions->insert( button, i);
}
button->setText( *acts[i] );
button->show();
}
for (uint i = acts.count(); i < _buttonCount; i++){
- qDebug("remove button %i of %i",i, _buttonCount);
button = buttonGroupActions->find( i );
if (button) button->hide();
}
_buttonCount = acts.count();
detailsFrame->show();
}else detailsFrame->hide();
popupTimer->start( 300, true );
}
void MainWindow::stopTimer(QListViewItem*)
{
popupTimer->stop();
@@ -255,15 +249,14 @@ void MainWindow::searchAll()
void MainWindow::slotAction( int act )
{
if (_currentItem->rtti() == OListViewItem::Result){
ResultItem *res = (ResultItem*)_currentItem;
// ResultItem *res = dynamic_cast<ResultItem*>(item);
res->action(act);
}
}
void MainWindow::optionChanged(int i)
{
- qDebug("optionChanged(%i)",i);
searchStringChanged();
}