author | tille <tille> | 2003-05-17 10:38:52 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-17 10:38:52 (UTC) |
commit | cdf3ec6993eebb80c96258c1bb217594ea442544 (patch) (unidiff) | |
tree | e0323d8011928c11aecc747535fcf8ae521d70c3 /core/pim/osearch/mainwindow.cpp | |
parent | f6c30fa4d0e97b0256a7b40554f70b5c08895d80 (diff) | |
download | opie-cdf3ec6993eebb80c96258c1bb217594ea442544.zip opie-cdf3ec6993eebb80c96258c1bb217594ea442544.tar.gz opie-cdf3ec6993eebb80c96258c1bb217594ea442544.tar.bz2 |
(layout) fixes from zecke (for 0.99)
and some minor things...
Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index c6934db..aa52061 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -21,2 +21,3 @@ | |||
21 | #include <qhbuttongroup.h> | 21 | #include <qhbuttongroup.h> |
22 | #include <qhbox.h> | ||
22 | #include <qpushbutton.h> | 23 | #include <qpushbutton.h> |
@@ -25,2 +26,3 @@ | |||
25 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | #include <qsignalmapper.h> | ||
26 | #include <qtextbrowser.h> | 28 | #include <qtextbrowser.h> |
@@ -73,11 +75,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
73 | 75 | ||
74 | buttonGroupActions = new QHButtonGroup( this ); | 76 | buttonBox = new QHBox( mainFrame, "Button Box" ); |
75 | buttonGroupActions->hide(); | ||
76 | _buttonCount = 0; | ||
77 | 77 | ||
78 | buttonLayout = new QHBoxLayout( detailsFrame ); | 78 | _buttonCount = 0; |
79 | detailsLayout->addLayout( buttonLayout ); | ||
80 | 79 | ||
81 | mainLayout->addWidget( detailsFrame ); | 80 | mainLayout->addWidget( detailsFrame ); |
81 | mainLayout->addWidget( buttonBox ); | ||
82 | detailsFrame->hide(); | 82 | detailsFrame->hide(); |
83 | buttonBox->hide(); | ||
83 | 84 | ||
@@ -98,3 +99,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
98 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); | 99 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); |
99 | connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) ); | 100 | |
101 | signalMapper = new QSignalMapper( this ); | ||
102 | |||
103 | connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) ); | ||
100 | 104 | ||
@@ -185,7 +189,9 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
185 | for (uint i = 0; i < acts.count(); i++){ | 189 | for (uint i = 0; i < acts.count(); i++){ |
186 | button = buttonGroupActions->find( i ); | 190 | button = buttonMap[i]; |
187 | if (!button) { | 191 | if (!button) { |
188 | button = new QPushButton( detailsFrame ); | 192 | qWarning(" no button for %s", (*acts[i]).latin1() ); |
189 | buttonLayout->addWidget( button, 0 ); | 193 | button = new QPushButton( buttonBox ); |
190 | buttonGroupActions->insert( button, i); | 194 | buttonMap.insert( i, button ); |
195 | signalMapper->setMapping(button, i ); | ||
196 | connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); | ||
191 | } | 197 | } |
@@ -195,3 +201,3 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
195 | for (uint i = acts.count(); i < _buttonCount; i++){ | 201 | for (uint i = acts.count(); i < _buttonCount; i++){ |
196 | button = buttonGroupActions->find( i ); | 202 | button = buttonMap[i]; |
197 | if (button) button->hide(); | 203 | if (button) button->hide(); |
@@ -200,3 +206,8 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
200 | detailsFrame->show(); | 206 | detailsFrame->show(); |
201 | }else detailsFrame->hide(); | 207 | buttonBox->show(); |
208 | |||
209 | }else { | ||
210 | detailsFrame->hide(); | ||
211 | buttonBox->hide(); | ||
212 | } | ||
202 | popupTimer->start( 300, true ); | 213 | popupTimer->start( 300, true ); |
@@ -255,3 +266,3 @@ void MainWindow::slotAction( int act ) | |||
255 | { | 266 | { |
256 | if (_currentItem->rtti() == OListViewItem::Result){ | 267 | if ( _currentItem && _currentItem->rtti() == OListViewItem::Result){ |
257 | ResultItem *res = (ResultItem*)_currentItem; | 268 | ResultItem *res = (ResultItem*)_currentItem; |
@@ -262,3 +273,3 @@ void MainWindow::slotAction( int act ) | |||
262 | 273 | ||
263 | void MainWindow::optionChanged(int i) | 274 | void MainWindow::optionChanged(int ) |
264 | { | 275 | { |