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 | |||
@@ -87,13 +87,13 @@ void MainWindow::makeMenu() | |||
87 | 87 | ||
88 | QLabel *spacer = new QLabel( "", toolBar ); | 88 | QLabel *spacer = new QLabel( "", toolBar ); |
89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); | 89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); |
90 | toolBar->setStretchableWidget( spacer ); | 90 | toolBar->setStretchableWidget( spacer ); |
91 | 91 | ||
92 | 92 | ||
93 | runAction = new QAction( tr( "Commit" ), | 93 | runAction = new QAction( tr( "Apply" ), |
94 | Resource::loadPixmap( "oipkg/install" ), | 94 | Resource::loadPixmap( "oipkg/install" ), |
95 | QString::null, 0, this, 0 ); | 95 | QString::null, 0, this, 0 ); |
96 | connect( runAction, SIGNAL( activated() ), | 96 | connect( runAction, SIGNAL( activated() ), |
97 | this, SLOT( runIpkg() ) ); | 97 | this, SLOT( runIpkg() ) ); |
98 | runAction->addTo( toolBar ); | 98 | runAction->addTo( toolBar ); |
99 | runAction->addTo( srvMenu ); | 99 | runAction->addTo( srvMenu ); |
@@ -168,42 +168,42 @@ void MainWindow::makeMenu() | |||
168 | label->setBackgroundColor( findBar->backgroundColor() ); | 168 | label->setBackgroundColor( findBar->backgroundColor() ); |
169 | findBar->setHorizontalStretchable( TRUE ); | 169 | findBar->setHorizontalStretchable( TRUE ); |
170 | findEdit = new QLineEdit( findBar, "findEdit" ); | 170 | findEdit = new QLineEdit( findBar, "findEdit" ); |
171 | findBar->setStretchableWidget( findEdit ); | 171 | findBar->setStretchableWidget( findEdit ); |
172 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 172 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
173 | this, SLOT( displayList() ) ); | 173 | this, SLOT( displayList() ) ); |
174 | //a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); | 174 | |
175 | // connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) ); | ||
176 | // a->addTo( findBar ); | ||
177 | // a->addTo( edit ); | ||
178 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 175 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
179 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 176 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
180 | a->addTo( findBar ); | 177 | a->addTo( findBar ); |
181 | findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); | 178 | findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); |
182 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 179 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
183 | findAction->setToggleAction( true ); | 180 | findAction->setToggleAction( true ); |
184 | findAction->setOn( true ); | 181 | findAction->setOn( true ); |
185 | findAction->addTo( viewMenu ); | 182 | findAction->addTo( viewMenu ); |
186 | |||
187 | } | 183 | } |
188 | 184 | ||
189 | MainWindow::~MainWindow() | 185 | MainWindow::~MainWindow() |
190 | { | 186 | { |
191 | } | 187 | } |
192 | 188 | ||
193 | void MainWindow::runIpkg() | 189 | void MainWindow::runIpkg() |
194 | { | 190 | { |
195 | ipkg->commit( packageList ); | 191 | ipkg->commit( packageList ); |
196 | updateList(); //to remove | 192 | // updateList(); //to remove |
197 | } | 193 | } |
198 | 194 | ||
199 | void MainWindow::updateList() | 195 | void MainWindow::updateList() |
200 | { | 196 | { |
197 | QTimer *t = new QTimer( this ); | ||
198 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); | ||
199 | t->start( 0, false ); | ||
201 | packageList.clear(); | 200 | packageList.clear(); |
202 | ipkg->update(); | 201 | ipkg->update(); |
203 | getList(); | 202 | getList(); |
203 | t->stop(); | ||
204 | } | 204 | } |
205 | 205 | ||
206 | void MainWindow::getList() | 206 | void MainWindow::getList() |
207 | { | 207 | { |
208 | packageList.update(); | 208 | packageList.update(); |
209 | displayList(); | 209 | displayList(); |
@@ -343,6 +343,15 @@ void MainWindow::findShow(bool b) | |||
343 | 343 | ||
344 | void MainWindow::findClose() | 344 | void MainWindow::findClose() |
345 | { | 345 | { |
346 | findAction->setOn( false ); | 346 | findAction->setOn( false ); |
347 | } | 347 | } |
348 | 348 | ||
349 | void MainWindow::rotateUpdateIcon() | ||
350 | { | ||
351 | pvDebug(2, "MainWindow::rotateUpdateIcon"); | ||
352 | if ( updateIcon ) | ||
353 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); | ||
354 | else | ||
355 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); | ||
356 | updateIcon = !updateIcon; | ||
357 | } | ||