-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 @@ -25,4 +25,5 @@ #include "settingsimpl.h"
#include "helpwindow.h"
+#include "utils.h"
#include "global.h"
@@ -66,4 +67,12 @@ MainWindow :: ~MainWindow() }
+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()
{
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 @@ -41,4 +41,5 @@ private: public slots:
+ void setDocument( const QString &doc );
void displayHelp();
void displayAbout();
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 @@ -61,6 +61,7 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget setupConnections(); - progressDlg = 0; - timerId = startTimer( 100 ); + updateData(); +// progressDlg = 0; +// timerId = startTimer( 100 ); } @@ -107,4 +108,30 @@ void NetworkPackageManager :: updateData() } +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() 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 @@ -39,4 +39,5 @@ public: ~NetworkPackageManager(); + void selectLocalPackage( const QString &pkg ); void updateData(); |