Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index a0b7b23..e15cc7e 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -33,2 +33,3 @@ | |||
33 | #include <qtextbrowser.h> | 33 | #include <qtextbrowser.h> |
34 | #include <qregexp.h> | ||
34 | 35 | ||
@@ -68,2 +69,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
68 | buttonGroupActions = new QHButtonGroup( this ); | 69 | buttonGroupActions = new QHButtonGroup( this ); |
70 | buttonGroupActions->hide(); | ||
69 | _buttonCount = 0; | 71 | _buttonCount = 0; |
@@ -72,14 +74,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
72 | buttonLayout = new QHBoxLayout( detailsFrame ); | 74 | buttonLayout = new QHBoxLayout( detailsFrame ); |
73 | buttonGroupActions->hide(); | 75 | detailsLayout->addLayout( buttonLayout ); |
74 | //buttonLayout->addWidget( buttonGroupActions, 0 ); | 76 | |
75 | |||
76 | detailsLayout->addLayout( buttonLayout ); | ||
77 | /* | ||
78 | QPushButton *buttonShow = new QPushButton( detailsFrame, "Show" ); | ||
79 | buttonShow->setText( tr("show") ); | ||
80 | QPushButton *buttonEdit = new QPushButton( detailsFrame, "Edit" ); | ||
81 | buttonEdit->setText( tr("edit") ); | ||
82 | buttonLayout->addWidget( buttonShow, 0 ); | ||
83 | buttonLayout->addWidget( buttonEdit, 0 ); | ||
84 | */ | ||
85 | mainLayout->addWidget( detailsFrame ); | 77 | mainLayout->addWidget( detailsFrame ); |
@@ -102,3 +94,2 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
102 | connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) ); | 94 | connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) ); |
103 | // connect(buttonEdit, SIGNAL(clicked()), SLOT( editItem() ) ); | ||
104 | 95 | ||
@@ -108,5 +99,6 @@ void MainWindow::makeMenu() | |||
108 | { | 99 | { |
109 | // QPEToolBar *toolBar = new QPEToolBar( this ); | 100 | QPEToolBar *toolBar = new QPEToolBar( this ); |
110 | // QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 101 | QPEToolBar *searchBar = new QPEToolBar(this); |
111 | // QPopupMenu *searchMenu = new QPopupMenu( menuBar ); | 102 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
103 | QPopupMenu *searchMenu = new QPopupMenu( menuBar ); | ||
112 | // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 104 | // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
@@ -115,4 +107,4 @@ void MainWindow::makeMenu() | |||
115 | setToolBarsMovable( false ); | 107 | setToolBarsMovable( false ); |
116 | // toolBar->setHorizontalStretchable( true ); | 108 | toolBar->setHorizontalStretchable( true ); |
117 | // menuBar->insertItem( tr( "Search" ), searchMenu ); | 109 | menuBar->insertItem( tr( "Search" ), searchMenu ); |
118 | // menuBar->insertItem( tr( "View" ), viewMenu ); | 110 | // menuBar->insertItem( tr( "View" ), viewMenu ); |
@@ -121,8 +113,13 @@ void MainWindow::makeMenu() | |||
121 | //SEARCH | 113 | //SEARCH |
122 | QPEToolBar *searchBar = new QPEToolBar(this); | 114 | QAction *action = new QAction( tr("Search all"),QString::null, 0, this, 0 ); |
123 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 115 | connect( action, SIGNAL(activated()), this, SLOT(searchAll()) ); |
124 | QLabel *label = new QLabel( tr("Search: "), searchBar ); | 116 | action->addTo( searchMenu ); |
125 | // label->setBackgroundMode( PaletteForeground ); | 117 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); |
126 | searchBar->setHorizontalStretchable( TRUE ); | 118 | actionCaseSensitiv->addTo( searchMenu ); |
119 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); | ||
120 | actionWildcards->addTo( searchMenu ); | ||
121 | |||
122 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | ||
127 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 123 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
124 | searchBar->setHorizontalStretchable( TRUE ); | ||
128 | searchBar->setStretchableWidget( searchEdit ); | 125 | searchBar->setStretchableWidget( searchEdit ); |
@@ -131,3 +128,2 @@ void MainWindow::makeMenu() | |||
131 | 128 | ||
132 | |||
133 | } | 129 | } |
@@ -190,6 +186,14 @@ void MainWindow::setSearch( const QString &key ) | |||
190 | { | 186 | { |
187 | QRegExp re( key, actionCaseSensitiv->isOn(), actionWildcards->isOn() ); | ||
191 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) | 188 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) |
192 | s->setSearch( key ); | 189 | s->setSearch( re ); |
193 | } | 190 | } |
194 | 191 | ||
192 | void MainWindow::searchAll() | ||
193 | { | ||
194 | bool openState; | ||
195 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ | ||
196 | s->doSearch(); | ||
197 | } | ||
198 | } | ||
195 | 199 | ||