Diffstat (limited to 'noncore/net/wellenreiter/gui/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index b67376c..b2d3a71 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp @@ -37,23 +37,33 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n mw = new Wellenreiter( this ); mw->setConfigWindow( cw ); setCentralWidget( mw ); // setup icon sets - searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); + #ifdef QWS + searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); + #else + startStopIconSet = new QIconSet(); + startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/SearchIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off ); + startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/CancelIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); + #endif // setup tool buttons startStopButton = new QToolButton( 0 ); startStopButton->setAutoRaise( true ); + #ifdef QWS startStopButton->setOnIconSet( *cancelIconSet ); startStopButton->setOffIconSet( *searchIconSet ); + #else + startStopButton->setIconSet( *startStopIconSet ); + #endif startStopButton->setToggleButton( true ); connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) ); startStopButton->setEnabled( false ); QToolButton* c = new QToolButton( 0 ); c->setAutoRaise( true ); @@ -86,15 +96,21 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n mb->setItemEnabled( id, false ); id = mb->insertItem( "&View", view ); mb->setItemEnabled( id, false ); id = mb->insertItem( "&Sniffer", sniffer ); mb->setItemEnabled( id, false ); + #ifdef QWS mb->insertItem( startStopButton ); mb->insertItem( c ); mb->insertItem( d ); + #else // Qt3 changed the insertion order. It's now totally random :( + mb->insertItem( d ); + mb->insertItem( c ); + mb->insertItem( startStopButton ); + #endif // setup status bar (for now only on X11) #ifndef QWS statusBar()->message( "Ready." ); #endif @@ -102,13 +118,15 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n }; void WellenreiterMainWindow::showConfigure() { qDebug( "show configure..." ); cw->setCaption( tr( "Configure" ) ); + #ifdef QWS cw->showMaximized(); + #endif int result = cw->exec(); if ( result ) { // check configuration from config window @@ -125,16 +143,19 @@ void WellenreiterMainWindow::showConfigure() } } WellenreiterMainWindow::~WellenreiterMainWindow() { - delete searchIconSet; delete infoIconSet; delete settingsIconSet; + #ifdef QWS + delete searchIconSet; delete cancelIconSet; - + #else + delete startStopIconSet; + #endif }; |