author | andyq <andyq> | 2002-10-25 09:50:52 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-25 09:50:52 (UTC) |
commit | 2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1 (patch) (side-by-side diff) | |
tree | 4322eef1f6306763b3bc0332b6e57c05a24341d9 | |
parent | 4a2f6dd634aa277bca3818f090d691844e219f64 (diff) | |
download | opie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.zip opie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.tar.gz opie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.tar.bz2 |
Modified so that you can click on a package in the documents view and
the Local IPKGS view is shown and the selected package checked
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 9 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 1 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 31 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.h | 1 |
4 files changed, 40 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 206d11c..9f19dfa 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp @@ -23,8 +23,9 @@ #include "datamgr.h"
#include "networkpkgmgr.h"
#include "settingsimpl.h"
#include "helpwindow.h"
+#include "utils.h"
#include "global.h"
MainWindow :: MainWindow( QWidget *p, char *name )
: QMainWindow( p, name )
@@ -64,8 +65,16 @@ MainWindow :: ~MainWindow() {
delete networkPkgWindow;
}
+void MainWindow :: setDocument( const QString &doc )
+{
+ // Remove path from package
+ QString package = Utils::getPackageNameFromIpkFilename( doc );
+ cout << "Selecting package " << package << endl;
+ networkPkgWindow->selectLocalPackage( package );
+}
+
void MainWindow :: displaySettings()
{
SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true );
if ( dlg->showDlg( 0 ) )
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h index 2a182fc..a9e290c 100644 --- a/noncore/settings/aqpkg/mainwin.h +++ b/noncore/settings/aqpkg/mainwin.h @@ -39,8 +39,9 @@ private: QWidgetStack *stack;
NetworkPackageManager *networkPkgWindow;
public slots:
+ void setDocument( const QString &doc );
void displayHelp();
void displayAbout();
void displaySettings();
};
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 6874ded..a374266 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -59,10 +59,11 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget initGui(); setupConnections(); - progressDlg = 0; - timerId = startTimer( 100 ); + updateData(); +// progressDlg = 0; +// timerId = startTimer( 100 ); } NetworkPackageManager::~NetworkPackageManager() { @@ -105,8 +106,34 @@ void NetworkPackageManager :: updateData() serversList->setCurrentItem( activeItem ); serverSelected( 0 ); } +void NetworkPackageManager :: selectLocalPackage( const QString &pkg ) +{ + // First select local server + for ( int i = 0 ; i < serversList->count() ; ++i ) + { + if ( serversList->text( i ) == LOCAL_IPKGS ) + { + serversList->setCurrentItem( i ); + break; + } + } + serverSelected( 0 ); + + // Now set the check box of the selected package + for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); + item != 0 ; + item = (QCheckListItem *)item->nextSibling() ) + { + if ( item->text().startsWith( pkg ) ) + { + item->setOn( true ); + break; + } + } +} + void NetworkPackageManager :: initGui() { QLabel *l = new QLabel( "Servers", this ); diff --git a/noncore/settings/aqpkg/networkpkgmgr.h b/noncore/settings/aqpkg/networkpkgmgr.h index fba8155..3c437b4 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.h +++ b/noncore/settings/aqpkg/networkpkgmgr.h @@ -37,8 +37,9 @@ public: NetworkPackageManager( DataManager *dataManager, QWidget* parent=0, const char *name=0); /** destructor */ ~NetworkPackageManager(); + void selectLocalPackage( const QString &pkg ); void updateData(); private: DataManager *dataMgr; |