summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index b485a03..cb2b4cd 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -42,39 +42,46 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
connect( table->section, SIGNAL( activated(int) ),
this, SLOT( sectionChanged() ) );
connect( table->subsection, SIGNAL(activated(int) ),
this, SLOT( subSectionChanged() ) );
connect( table->ListViewPackages, SIGNAL( clicked( QListViewItem* ) ),
this, SLOT( setCurrent( QListViewItem* ) ) );
settings = new PackageManagerSettings(this,0,TRUE);
ipkg = new PmIpkg( settings, this );
packageList.setSettings( settings );
- newList();
+ getList();
setSections();
setSubSections();
displayList();
}
void MainWindow::makeMenu()
{
QPEToolBar *toolBar = new QPEToolBar( this );
QPEMenuBar *menuBar = new QPEMenuBar( toolBar );
QPopupMenu *srvMenu = new QPopupMenu( menuBar );
QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
// QPopupMenu *sectMenu = new QPopupMenu( menuBar );
+//#define TOOLBAR
+#ifdef TOOLBAR
+ QPEToolBar *secBar = new QPEToolBar( this );
+ QComboBox *sections = new QComboBox( false, this );
+ secBar->addTo( sections );
+#endif
+
contextMenu = new QPopupMenu( this );
setToolBarsMovable( false );
toolBar->setHorizontalStretchable( true );
menuBar->insertItem( tr( "Package" ), srvMenu );
menuBar->insertItem( tr( "Settings" ), cfgMenu );
// menuBar->insertItem( tr( "Sections" ), sectMenu );
toolBar->setStretchableWidget (srvMenu);
runAction = new QAction( tr( "Run" ),
@@ -125,37 +132,38 @@ void MainWindow::makeMenu()
SLOT( showSettingsDst() ) );
cfgact->addTo( cfgMenu );
}
MainWindow::~MainWindow()
{
}
void MainWindow::runIpkg()
{
ipkg->commit( packageList );
- ipkg->runIpkg("update");
- packageList.update();
+ updateList();
}
void MainWindow::updateList()
{
- ipkg->runIpkg("update");
- packageList.update();
+ // todo: packageList.clear();
+ ipkg->update();
+ getList();
}
-void MainWindow::newList()
+void MainWindow::getList()
{
packageList.update();
+ displayList();
}
void MainWindow::filterList()
{
packageList.filterPackages();
}
void MainWindow::displayList()
{
table->ListViewPackages->clear();
Package *pack = packageList.first();
while( pack )
@@ -208,35 +216,35 @@ void MainWindow::setSections()
}
void MainWindow::setSubSections()
{
table->subsection->clear();
table->subsection->insertStringList( packageList.getSubSections() );
}
void MainWindow::showSettings()
{
if ( settings->showDialog( 0 ) )
- newList();
+ getList();
}
void MainWindow::showSettingsSrv()
{
if ( settings->showDialog( 1 ) )
- newList();
+ getList();
}
void MainWindow::showSettingsDst()
{
if ( settings->showDialog( 2 ) )
- newList();
+ getList();
}
void MainWindow::showDetails()
{
if ( activePackage ) return;
if ( details )
{
details = new PackageDetails( this );
connect( details->install, SIGNAL(clicked()), SLOT( toggleActivePackage() ) );
connect( details->remove, SIGNAL(clicked()), SLOT( toggleActivePackage() ) );
connect( details->ignore, SIGNAL(clicked()), details, SLOT(close()));