Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 54ee115..c803ca0 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp @@ -81,25 +81,25 @@ void MainWindow::makeMenu() setToolBarsMovable( false ); toolBar->setHorizontalStretchable( true ); menuBar->insertItem( tr( "Package" ), srvMenu ); menuBar->insertItem( tr( "View" ), viewMenu ); menuBar->insertItem( tr( "Settings" ), cfgMenu ); // menuBar->insertItem( tr( "Sections" ), sectMenu ); QLabel *spacer = new QLabel( "", toolBar ); spacer->setBackgroundColor( toolBar->backgroundColor() ); toolBar->setStretchableWidget( spacer ); - runAction = new QAction( tr( "Commit" ), + runAction = new QAction( tr( "Apply" ), Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 ); connect( runAction, SIGNAL( activated() ), this, SLOT( runIpkg() ) ); runAction->addTo( toolBar ); runAction->addTo( srvMenu ); srvMenu->insertSeparator (); updateAction = new QAction( tr( "Update" ), Resource::loadIconSet( "oipkg/update" ), QString::null, 0, this, 0 ); @@ -162,54 +162,54 @@ void MainWindow::makeMenu() sectionAction->setOn( true ); sectionAction->addTo( viewMenu ); findBar = new QPEToolBar(this); addToolBar( findBar, "Search", QMainWindow::Top, TRUE ); label = new QLabel( tr("Filter: "), findBar ); label->setBackgroundColor( findBar->backgroundColor() ); findBar->setHorizontalStretchable( TRUE ); findEdit = new QLineEdit( findBar, "findEdit" ); findBar->setStretchableWidget( findEdit ); connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( displayList() ) ); -// a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); -// connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) ); -// a->addTo( findBar ); -// a->addTo( edit ); + a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); a->addTo( findBar ); findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); findAction->setToggleAction( true ); findAction->setOn( true ); findAction->addTo( viewMenu ); - } MainWindow::~MainWindow() { } void MainWindow::runIpkg() { ipkg->commit( packageList ); - updateList(); //to remove +// updateList(); //to remove } void MainWindow::updateList() { + QTimer *t = new QTimer( this ); + connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); + t->start( 0, false ); packageList.clear(); ipkg->update(); getList(); + t->stop(); } void MainWindow::getList() { packageList.update(); displayList(); } void MainWindow::filterList() { QString f = ""; if ( findAction->isOn() ) f = findEdit->text(); @@ -337,12 +337,21 @@ void MainWindow::sectionClose() void MainWindow::findShow(bool b) { if (b) findBar->show(); else findBar->hide(); findAction->setOn( b ); } void MainWindow::findClose() { findAction->setOn( false ); } +void MainWindow::rotateUpdateIcon() +{ + pvDebug(2, "MainWindow::rotateUpdateIcon"); + if ( updateIcon ) + updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); + else + updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); + updateIcon = !updateIcon; +} |