Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 233eae6..7df1d6b 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp @@ -40,21 +40,22 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : setCaption( tr("Package Manager") ); settings = new PackageManagerSettings(this,0,TRUE); listViewPackages = new PackageListView( this,"listViewPackages",settings ); setCentralWidget( listViewPackages ); listViewPackages->addList( tr("feeds"), &packageListServers ); listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); - listViewPackages->addList( tr("documents"), &packageListDocLnk ); +//listViewPackages->addList( tr("documents"), &packageListDocLnk ); ipkg = new PmIpkg( settings, this ); packageListServers.setSettings( settings ); packageListSearch.setSettings( settings ); packageListDocLnk.setSettings( settings ); pvDebug(9,"packageListServers.update"); packageListServers.update(); pvDebug(9,"packageListDocLnk.update"); - packageListDocLnk.update(); + pvDebug(0,"no UPDATE of DocLnk"); +// packageListDocLnk.update(); pvDebug(9,"makeMenu"); makeMenu(); makeChannel(); //opie is hardcoded default ;) // pvDebug(9,"section->setCurrentItem"); // for (int i=0;i<section->count();i++) @@ -79,20 +80,20 @@ void MainWindow::makeMenu() QPEToolBar *toolBar = new QPEToolBar( this ); QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); QPopupMenu *srvMenu = new QPopupMenu( menuBar ); QPopupMenu *viewMenu = new QPopupMenu( menuBar ); QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); - // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); + QPopupMenu *helpMenu = new QPopupMenu( menuBar ); 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 ); + menuBar->insertItem( tr( "Help" ), helpMenu ); QLabel *spacer; // spacer = new QLabel( "", toolBar ); // spacer->setBackgroundColor( toolBar->backgroundColor() ); // toolBar->setStretchableWidget( spacer ); @@ -102,13 +103,13 @@ void MainWindow::makeMenu() QString::null, 0, this, 0 ); connect( runAction, SIGNAL( activated() ), this, SLOT( runIpkg() ) ); runAction->addTo( toolBar ); runAction->addTo( srvMenu ); - srvMenu->insertSeparator (); + srvMenu->insertSeparator(); updateAction = new QAction( tr( "Update" ), Resource::loadIconSet( "oipkg/update" ), QString::null, 0, this, 0 ); connect( updateAction, SIGNAL( activated() ), this , SLOT( updateList() ) ); @@ -226,12 +227,49 @@ void MainWindow::makeMenu() connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); a->addTo( destBar ); destBar->setStretchableWidget( CheckBoxLink ); destAction->setToggleAction( true ); // destAction->addTo( viewMenu ); +// helpMenu + helpMenu->insertSeparator(); + a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + helpMenu->insertSeparator(); + a = new QAction( tr( "Install" ), + Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + a = new QAction( tr( "Remove" ), + Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + helpMenu->insertSeparator(); + a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + helpMenu->insertSeparator(); + a = new QAction( tr( "New version, installed" ), + Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + a = new QAction( tr( "New version, not installed" ), + Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + a = new QAction( tr( "Old version, installed" ), + Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + a = new QAction( tr( "Old version, not installed" ), + Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + a = new QAction( tr( "Old version, new version installed" ), + Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); + a = new QAction( tr( "New version, old version installed" ), + Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 ); + a->addTo( helpMenu ); +// a = new QAction( tr( "" ), +// Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 ); +// a->addTo( helpMenu ); + // configure the menus Config cfg( "oipkg", Config::User ); cfg.setGroup( "gui" ); findShow( cfg.readBoolEntry( "findBar", true ) ); searchShow( cfg.readBoolEntry( "searchBar", true ) ); @@ -251,13 +289,13 @@ MainWindow::~MainWindow() } void MainWindow::runIpkg() { packageListServers.allPackages(); ipkg->loadList( &packageListSearch ); - ipkg->loadList( &packageListDocLnk ); +//ipkg->loadList( &packageListDocLnk ); ipkg->loadList( &packageListServers ); ipkg->commit(); ipkg->clearLists(); // ##### If we looked in the list of files, we could send out accurate // ##### messages. But we don't bother yet, and just do an "all". QCopEnvelope e("QPE/System", "linkChanged(QString)"); @@ -267,17 +305,18 @@ void MainWindow::runIpkg() } void MainWindow::updateList() { packageListServers.clear(); packageListSearch.clear(); - packageListDocLnk.clear(); + +// packageListDocLnk.clear(); ipkg->update(); packageListServers.update(); packageListSearch.update(); - packageListDocLnk.update(); +// packageListDocLnk.update(); } void MainWindow::filterList() { QString f = ""; if ( findAction->isOn() ) f = findEdit->text(); |