~ubuntu-branches/ubuntu/lucid/kchmviewer/lucid

« back to all changes in this revision

Viewing changes to src/kchmsearchwindow.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jose Luis Tallon
  • Date: 2006-06-08 20:08:39 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20060608200839-8b7jodug8yvtj126
Tags: upstream-2.5
ImportĀ upstreamĀ versionĀ 2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "kchmmainwindow.h"
25
25
#include "kchmconfig.h"
 
26
#include "kchmlistitemtooltip.h"
26
27
#include "xchmfile.h"
27
28
 
28
29
//#define DEBUG_SEARCH(A)       qDebug A
33
34
{
34
35
        QVBoxLayout * layout = new QVBoxLayout (this);
35
36
        layout->setMargin (5);
36
 
        layout->addWidget (new QLabel (tr("Type in word(s) to search for:"), this));
 
37
        layout->addWidget (new QLabel (i18n( "Type in word(s) to search for:"), this));
37
38
        
38
39
        m_searchQuery = new QComboBox (TRUE, this);
39
40
        m_searchQuery->setFocus();
48
49
        hlayout->addWidget ( m_helpButton );
49
50
        
50
51
        m_searchList = new KQListView (this);
51
 
        m_searchList->addColumn( "Title" );
52
 
        m_searchList->addColumn( "Location" );
 
52
        m_searchList->addColumn( i18n( "Title" ) );
 
53
        m_searchList->addColumn( i18n( "Location" ) );
53
54
        m_searchList->setShowToolTips(true);
54
55
 
55
56
        connect( m_helpButton, SIGNAL( clicked () ), this, SLOT( onHelpClicked() ) );
57
58
        connect( m_searchList, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ), this, SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) );
58
59
 
59
60
        m_matchSimilarWords = new QCheckBox (this);
60
 
        m_matchSimilarWords->setText (tr("Match similar words"));
 
61
        m_matchSimilarWords->setText( i18n( "Match similar words") );
61
62
 
62
63
        layout->addSpacing (10);
63
64
        layout->addWidget (m_searchList);
64
65
        layout->addWidget (m_matchSimilarWords);
 
66
        
 
67
        new KCHMListItemTooltip( m_searchList );
65
68
}
66
69
 
67
70
void KCHMSearchWindow::invalidate( )
90
93
                                new KCMSearchTreeViewItem (m_searchList, results[i].title, results[i].url, results[i].url);
91
94
                        }
92
95
 
93
 
                        ::mainWindow->showInStatusBar( tr("Search returned %1 results") . arg(results.size()) );
 
96
                                ::mainWindow->showInStatusBar( i18n( "Search returned %1 result(s)" ) . arg(results.size()) );
94
97
                }
95
98
                else
96
 
                        ::mainWindow->showInStatusBar( tr("Search returned no results") );
 
99
                        ::mainWindow->showInStatusBar( i18n( "Search returned no results") );
97
100
        }
98
101
        else
99
 
                ::mainWindow->showInStatusBar( tr("Search failed") );
 
102
                ::mainWindow->showInStatusBar( i18n( "Search failed") );
100
103
}
101
104
 
102
105
void KCHMSearchWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int)
105
108
                return;
106
109
        
107
110
        KCMSearchTreeViewItem * treeitem = (KCMSearchTreeViewItem *) item;
108
 
        ::mainWindow->openPage(treeitem->getUrl(), false);
 
111
        ::mainWindow->openPage( treeitem->getUrl(), OPF_ADD2HISTORY );
109
112
}
110
113
 
111
114
void KCHMSearchWindow::restoreSettings( const KCHMSettings::search_saved_settings_t & settings )
391
394
 
392
395
void KCHMSearchWindow::onHelpClicked( )
393
396
{
394
 
        QMessageBox::information ( this, tr("How to use search"), tr("The search query can contain a few prefixes.\nA set of words inside the quote marks mean that you are searching for exact phrase.\nA word with minus sign means that it should be absent in the search result.\nA word with plus mark or without any mark means that it must be present in the search result.\n\nNote that only letters and digits are indexed.\nYou cannot search for symbols other than underscope, and these symbols will be removed from the search query.\nFor example, search for 'C' will give the same result as searching for 'C++'.") );
 
397
        QMessageBox::information ( this, 
 
398
                i18n( "How to use search"), 
 
399
                i18n( "The search query can contain a few prefixes.\nA set of words inside the quote marks mean that you are searching for exact phrase.\nA word with minus sign means that it should be absent in the search result.\nA word with plus mark or without any mark means that it must be present in the search result.\n\nNote that only letters and digits are indexed.\nYou cannot search for symbols other than underscope, and these symbols will be removed from the search query.\nFor example, search for 'C' will give the same result as searching for 'C++'.") );
395
400
}
 
401
 
 
402
#include "kchmsearchwindow.moc"