author | tille <tille> | 2003-05-17 10:38:52 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-17 10:38:52 (UTC) |
commit | cdf3ec6993eebb80c96258c1bb217594ea442544 (patch) (side-by-side diff) | |
tree | e0323d8011928c11aecc747535fcf8ae521d70c3 | |
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...
-rw-r--r-- | core/pim/osearch/adresssearch.cpp | 5 | ||||
-rw-r--r-- | core/pim/osearch/applnksearch.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/datebooksearch.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/doclnksearch.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/eventitem.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 39 | ||||
-rw-r--r-- | core/pim/osearch/mainwindow.h | 22 | ||||
-rw-r--r-- | core/pim/osearch/searchgroup.h | 2 | ||||
-rw-r--r-- | core/pim/osearch/todosearch.cpp | 2 |
9 files changed, 46 insertions, 32 deletions
diff --git a/core/pim/osearch/adresssearch.cpp b/core/pim/osearch/adresssearch.cpp index 2cd545f..f117fe6 100644 --- a/core/pim/osearch/adresssearch.cpp +++ b/core/pim/osearch/adresssearch.cpp @@ -16,3 +16,3 @@ #include <qiconset.h> -#include <qwhatsthis.h> +//#include <qwhatsthis.h> #include <qpe/resource.h> @@ -28,2 +28,3 @@ AdressSearch::AdressSearch(QListView* parent, QString name): setPixmap( 0, is.pixmap( QIconSet::Small, true ) ); +// QWhatsThis::add( this, QObject::tr("Search the addressbook") ); /* QPixmap pix = Resource::loadPixmap( "addressbook/AddressBook" ); @@ -50,3 +51,3 @@ int AdressSearch::search() for (uint i = 0; i < results.count(); i++) { - new ContactItem( this, new OContact( results[i] )); + (void)new ContactItem( this, new OContact( results[i] )); } diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp index 403c719..b15275a 100644 --- a/core/pim/osearch/applnksearch.cpp +++ b/core/pim/osearch/applnksearch.cpp @@ -59,3 +59,3 @@ void AppLnkSearch::insertItem( void *rec ) { - new AppLnkItem( this, (AppLnk*)rec ); + (void)new AppLnkItem( this, (AppLnk*)rec ); _resultCount++; diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp index 5da7ae9..be2bf25 100644 --- a/core/pim/osearch/datebooksearch.cpp +++ b/core/pim/osearch/datebooksearch.cpp @@ -78,3 +78,3 @@ void DatebookSearch::insertItem( void *rec ) ) return; - new EventItem( this, ev ); + (void)new EventItem( this, ev ); _resultCount++; diff --git a/core/pim/osearch/doclnksearch.cpp b/core/pim/osearch/doclnksearch.cpp index 321d011..3428798 100644 --- a/core/pim/osearch/doclnksearch.cpp +++ b/core/pim/osearch/doclnksearch.cpp @@ -78,3 +78,3 @@ void DocLnkSearch::insertItem( void *rec ) { - new DocLnkItem( this, (DocLnk*)rec ); + (void)new DocLnkItem( this, (DocLnk*)rec ); _resultCount++; diff --git a/core/pim/osearch/eventitem.cpp b/core/pim/osearch/eventitem.cpp index 24ce8e8..3228093 100644 --- a/core/pim/osearch/eventitem.cpp +++ b/core/pim/osearch/eventitem.cpp @@ -18,2 +18,3 @@ #include <qpe/qcopenvelope_qws.h> +//#include <qwhatsthis.h> #include <opie/oevent.h> @@ -64,2 +65,3 @@ void EventItem::setIcon() icon = Resource::loadPixmap( "reset" ); +// QWhatsThis::add( icon, QObject::tr("Enter your search terms here") ); break; 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 @@ #include <qhbuttongroup.h> +#include <qhbox.h> #include <qpushbutton.h> @@ -25,2 +26,3 @@ #include <qlineedit.h> +#include <qsignalmapper.h> #include <qtextbrowser.h> @@ -73,11 +75,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : - buttonGroupActions = new QHButtonGroup( this ); - buttonGroupActions->hide(); - _buttonCount = 0; + buttonBox = new QHBox( mainFrame, "Button Box" ); - buttonLayout = new QHBoxLayout( detailsFrame ); - detailsLayout->addLayout( buttonLayout ); + _buttonCount = 0; mainLayout->addWidget( detailsFrame ); + mainLayout->addWidget( buttonBox ); detailsFrame->hide(); + buttonBox->hide(); @@ -98,3 +99,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); - connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) ); + + signalMapper = new QSignalMapper( this ); + + connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) ); @@ -185,7 +189,9 @@ void MainWindow::setCurrent(QListViewItem *item) for (uint i = 0; i < acts.count(); i++){ - button = buttonGroupActions->find( i ); + button = buttonMap[i]; if (!button) { - button = new QPushButton( detailsFrame ); - buttonLayout->addWidget( button, 0 ); - buttonGroupActions->insert( button, i); + qWarning(" no button for %s", (*acts[i]).latin1() ); + button = new QPushButton( buttonBox ); + buttonMap.insert( i, button ); + signalMapper->setMapping(button, i ); + connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); } @@ -195,3 +201,3 @@ void MainWindow::setCurrent(QListViewItem *item) for (uint i = acts.count(); i < _buttonCount; i++){ - button = buttonGroupActions->find( i ); + button = buttonMap[i]; if (button) button->hide(); @@ -200,3 +206,8 @@ void MainWindow::setCurrent(QListViewItem *item) detailsFrame->show(); - }else detailsFrame->hide(); + buttonBox->show(); + + }else { + detailsFrame->hide(); + buttonBox->hide(); + } popupTimer->start( 300, true ); @@ -255,3 +266,3 @@ void MainWindow::slotAction( int act ) { - if (_currentItem->rtti() == OListViewItem::Result){ + if ( _currentItem && _currentItem->rtti() == OListViewItem::Result){ ResultItem *res = (ResultItem*)_currentItem; @@ -262,3 +273,3 @@ void MainWindow::slotAction( int act ) -void MainWindow::optionChanged(int i) +void MainWindow::optionChanged(int ) { diff --git a/core/pim/osearch/mainwindow.h b/core/pim/osearch/mainwindow.h index cba11c5..1f5c4bb 100644 --- a/core/pim/osearch/mainwindow.h +++ b/core/pim/osearch/mainwindow.h @@ -15,18 +15,17 @@ #include <qmainwindow.h> -#include <qdialog.h> -#include <qaction.h> #include <qlist.h> -#include <qtimer.h> -#include <qpopupmenu.h> +#include <qmap.h> +class QAction; class QPEToolBar; +class QHBox; class QVBoxLayout; -class QHBoxLayout; class QTextView; class QFrame; -class QListViewItem; class OListView; class OListViewItem; -class QHButtonGroup; - +class QListViewItem; +class QPopupMenu; +class QSignalMapper; +class QTimer; class SearchGroup; @@ -54,4 +53,7 @@ protected slots: void optionChanged(int); - + private: + QHBox *buttonBox; + QMap<int, QButton*> buttonMap; + QSignalMapper* signalMapper; OListView *resultsList; @@ -60,3 +62,2 @@ private: QVBoxLayout *mainLayout; - QHBoxLayout *buttonLayout; QFrame *detailsFrame; @@ -67,3 +68,2 @@ private: QList<SearchGroup> searches; - QHButtonGroup *buttonGroupActions; QAction *SearchAllAction; diff --git a/core/pim/osearch/searchgroup.h b/core/pim/osearch/searchgroup.h index ad37d4e..de74efb 100644 --- a/core/pim/osearch/searchgroup.h +++ b/core/pim/osearch/searchgroup.h @@ -42,3 +42,3 @@ protected: QString _name; - bool loaded; + bool loaded : 1; int _resultCount; diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp index 08bbe93..5c1d7a5 100644 --- a/core/pim/osearch/todosearch.cpp +++ b/core/pim/osearch/todosearch.cpp @@ -68,3 +68,3 @@ void TodoSearch::insertItem( void *rec ) todo->isCompleted() ) return; - new TodoItem( this, todo ); + (void)new TodoItem( this, todo ); _resultCount++; |