summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp9
-rw-r--r--noncore/settings/aqpkg/mainwin.h1
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp31
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.h1
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;