author | tille <tille> | 2003-05-16 19:36:33 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-16 19:36:33 (UTC) |
commit | 87051a7ba4834aed152bc09aad7f4935c9729ccb (patch) (unidiff) | |
tree | 85c2b2274efede684b1914a4e4a1b2c87bddf6b3 /core/pim/osearch/mainwindow.cpp | |
parent | 1ac65aca5d1219e537238330501bc441dd2a3324 (diff) | |
download | opie-87051a7ba4834aed152bc09aad7f4935c9729ccb.zip opie-87051a7ba4834aed152bc09aad7f4935c9729ccb.tar.gz opie-87051a7ba4834aed152bc09aad7f4935c9729ccb.tar.bz2 |
and some whatsthis
Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index 2936b17..c6934db 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -1,80 +1,82 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
11 | 11 | ||
12 | 12 | ||
13 | #include "mainwindow.h" | ||
14 | 13 | ||
15 | #include <qpe/qpemenubar.h> | ||
16 | #include <qpe/qpemessagebox.h> | ||
17 | #include <qpe/resource.h> | ||
18 | #include <qpe/config.h> | ||
19 | #include <qpe/qpetoolbar.h> | ||
20 | #include <qpe/qpeapplication.h> | ||
21 | #include <qpe/config.h> | ||
22 | #include <qpe/global.h> | ||
23 | #include <opie/owait.h> | ||
24 | #include <qaction.h> | 14 | #include <qaction.h> |
25 | #include <qmessagebox.h> | 15 | #include <qmessagebox.h> |
26 | #include <qpopupmenu.h> | 16 | #include <qpopupmenu.h> |
27 | #include <qtoolbutton.h> | 17 | #include <qtoolbutton.h> |
28 | #include <qstring.h> | 18 | #include <qstring.h> |
29 | #include <qlabel.h> | 19 | #include <qlabel.h> |
30 | #include <qfile.h> | 20 | #include <qfile.h> |
31 | #include <qhbuttongroup.h> | 21 | #include <qhbuttongroup.h> |
32 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
33 | #include <qintdict.h> | 23 | #include <qintdict.h> |
34 | #include <qlayout.h> | 24 | #include <qlayout.h> |
35 | #include <qlineedit.h> | 25 | #include <qlineedit.h> |
36 | #include <qtextbrowser.h> | 26 | #include <qtextbrowser.h> |
37 | #include <qregexp.h> | 27 | #include <qregexp.h> |
28 | #include <qwhatsthis.h> | ||
29 | #include <qpe/qpemenubar.h> | ||
30 | #include <qpe/qpemessagebox.h> | ||
31 | #include <qpe/resource.h> | ||
32 | #include <qpe/config.h> | ||
33 | #include <qpe/qpetoolbar.h> | ||
34 | #include <qpe/qpeapplication.h> | ||
35 | #include <qpe/config.h> | ||
36 | #include <qpe/global.h> | ||
37 | #include <opie/owait.h> | ||
38 | 38 | ||
39 | #include "olistview.h" | 39 | #include "olistview.h" |
40 | #include "olistviewitem.h" | 40 | #include "olistviewitem.h" |
41 | #include "resultitem.h" | 41 | #include "resultitem.h" |
42 | #include "adresssearch.h" | 42 | #include "adresssearch.h" |
43 | #include "todosearch.h" | 43 | #include "todosearch.h" |
44 | #include "datebooksearch.h" | 44 | #include "datebooksearch.h" |
45 | #include "applnksearch.h" | 45 | #include "applnksearch.h" |
46 | #include "doclnksearch.h" | 46 | #include "doclnksearch.h" |
47 | #include "mainwindow.h" | ||
47 | 48 | ||
48 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 49 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
49 | QMainWindow( parent, name, f ), _currentItem(0) | 50 | QMainWindow( parent, name, f ), _currentItem(0) |
50 | { | 51 | { |
51 | setCaption( tr("OSearch") ); | 52 | setCaption( tr("OSearch") ); |
52 | 53 | ||
53 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 54 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
54 | 55 | ||
55 | QFrame *mainFrame = new QFrame( this, "mainFrame" ); | 56 | QFrame *mainFrame = new QFrame( this, "mainFrame" ); |
56 | mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 57 | mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
57 | 58 | ||
58 | mainLayout = new QVBoxLayout( mainFrame ); | 59 | mainLayout = new QVBoxLayout( mainFrame ); |
59 | mainLayout->setSpacing( 0 ); | 60 | mainLayout->setSpacing( 0 ); |
60 | mainLayout->setMargin( 0 ); | 61 | mainLayout->setMargin( 0 ); |
61 | 62 | ||
62 | resultsList = new OListView( mainFrame ); | 63 | resultsList = new OListView( mainFrame ); |
63 | resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 64 | resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
64 | mainLayout->addWidget( resultsList ); | 65 | mainLayout->addWidget( resultsList ); |
65 | 66 | ||
66 | detailsFrame = new QFrame( mainFrame, "detailsFrame" ); | 67 | detailsFrame = new QFrame( mainFrame, "detailsFrame" ); |
67 | QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); | 68 | QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); |
68 | richEdit = new QTextView( detailsFrame ); | 69 | richEdit = new QTextView( detailsFrame ); |
70 | QWhatsThis::add( richEdit, tr("The details of the current result") ); | ||
69 | richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 71 | richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
70 | detailsLayout->addWidget( richEdit ); | 72 | detailsLayout->addWidget( richEdit ); |
71 | 73 | ||
72 | buttonGroupActions = new QHButtonGroup( this ); | 74 | buttonGroupActions = new QHButtonGroup( this ); |
73 | buttonGroupActions->hide(); | 75 | buttonGroupActions->hide(); |
74 | _buttonCount = 0; | 76 | _buttonCount = 0; |
75 | 77 | ||
76 | buttonLayout = new QHBoxLayout( detailsFrame ); | 78 | buttonLayout = new QHBoxLayout( detailsFrame ); |
77 | detailsLayout->addLayout( buttonLayout ); | 79 | detailsLayout->addLayout( buttonLayout ); |
78 | 80 | ||
79 | mainLayout->addWidget( detailsFrame ); | 81 | mainLayout->addWidget( detailsFrame ); |
80 | detailsFrame->hide(); | 82 | detailsFrame->hide(); |
@@ -125,39 +127,41 @@ void MainWindow::makeMenu() | |||
125 | QPopupMenu *pop; | 127 | QPopupMenu *pop; |
126 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ | 128 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ |
127 | pop = s->popupMenu(); | 129 | pop = s->popupMenu(); |
128 | if (pop){ | 130 | if (pop){ |
129 | cfgMenu->insertItem( s->text(0), pop ); | 131 | cfgMenu->insertItem( s->text(0), pop ); |
130 | } | 132 | } |
131 | } | 133 | } |
132 | 134 | ||
133 | 135 | ||
134 | //SEARCH | 136 | //SEARCH |
135 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); | 137 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); |
136 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); | 138 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); |
139 | // QWhatsThis::add( SearchAllAction, tr("Search everything...") ); | ||
137 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); | 140 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); |
138 | SearchAllAction->addTo( searchMenu ); | 141 | SearchAllAction->addTo( searchMenu ); |
139 | searchMenu->insertItem( tr( "Options" ), searchOptions ); | 142 | searchMenu->insertItem( tr( "Options" ), searchOptions ); |
140 | 143 | ||
141 | //SEARCH OPTIONS | 144 | //SEARCH OPTIONS |
142 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); | 145 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); |
143 | //actionWholeWordsOnly->addTo( searchOptions ); | 146 | //actionWholeWordsOnly->addTo( searchOptions ); |
144 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); | 147 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); |
145 | actionCaseSensitiv->addTo( searchOptions ); | 148 | actionCaseSensitiv->addTo( searchOptions ); |
146 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); | 149 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); |
147 | actionWildcards->addTo( searchOptions ); | 150 | actionWildcards->addTo( searchOptions ); |
148 | 151 | ||
149 | //SEARCH BAR | 152 | //SEARCH BAR |
150 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 153 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
151 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 154 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
155 | QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); | ||
152 | searchEdit->setFocus(); | 156 | searchEdit->setFocus(); |
153 | searchBar->setHorizontalStretchable( TRUE ); | 157 | searchBar->setHorizontalStretchable( TRUE ); |
154 | searchBar->setStretchableWidget( searchEdit ); | 158 | searchBar->setStretchableWidget( searchEdit ); |
155 | SearchAllAction->addTo( searchBar ); | 159 | SearchAllAction->addTo( searchBar ); |
156 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 160 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
157 | this, SLOT( setSearch( const QString & ) ) ); | 161 | this, SLOT( setSearch( const QString & ) ) ); |
158 | 162 | ||
159 | } | 163 | } |
160 | 164 | ||
161 | MainWindow::~MainWindow() | 165 | MainWindow::~MainWindow() |
162 | { | 166 | { |
163 | Config cfg( "osearch", Config::User ); | 167 | Config cfg( "osearch", Config::User ); |