summaryrefslogtreecommitdiff
Unidiff
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
@@ -21,12 +21,13 @@
21 21
22#include "mainwin.h" 22#include "mainwin.h"
23#include "datamgr.h" 23#include "datamgr.h"
24#include "networkpkgmgr.h" 24#include "networkpkgmgr.h"
25#include "settingsimpl.h" 25#include "settingsimpl.h"
26#include "helpwindow.h" 26#include "helpwindow.h"
27#include "utils.h"
27#include "global.h" 28#include "global.h"
28 29
29MainWindow :: MainWindow( QWidget *p, char *name ) 30MainWindow :: MainWindow( QWidget *p, char *name )
30 :QMainWindow( p, name ) 31 :QMainWindow( p, name )
31{ 32{
32#ifdef QWS 33#ifdef QWS
@@ -62,12 +63,20 @@ MainWindow :: MainWindow( QWidget *p, char *name )
62 63
63MainWindow :: ~MainWindow() 64MainWindow :: ~MainWindow()
64{ 65{
65 delete networkPkgWindow; 66 delete networkPkgWindow;
66} 67}
67 68
69void MainWindow :: setDocument( const QString &doc )
70{
71 // Remove path from package
72 QString package = Utils::getPackageNameFromIpkFilename( doc );
73 cout << "Selecting package " << package << endl;
74 networkPkgWindow->selectLocalPackage( package );
75}
76
68void MainWindow :: displaySettings() 77void MainWindow :: displaySettings()
69{ 78{
70 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); 79 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true );
71 if ( dlg->showDlg( 0 ) ) 80 if ( dlg->showDlg( 0 ) )
72 networkPkgWindow->updateData(); 81 networkPkgWindow->updateData();
73 delete dlg; 82 delete dlg;
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
@@ -37,11 +37,12 @@ private:
37 DataManager *mgr; 37 DataManager *mgr;
38 38
39 QWidgetStack *stack; 39 QWidgetStack *stack;
40 NetworkPackageManager *networkPkgWindow; 40 NetworkPackageManager *networkPkgWindow;
41 41
42public slots: 42public slots:
43 void setDocument( const QString &doc );
43 void displayHelp(); 44 void displayHelp();
44 void displayAbout(); 45 void displayAbout();
45 void displaySettings(); 46 void displaySettings();
46}; 47};
47#endif 48#endif
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
@@ -57,14 +57,15 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget
57#endif 57#endif
58 58
59 59
60 initGui(); 60 initGui();
61 setupConnections(); 61 setupConnections();
62 62
63 progressDlg = 0; 63 updateData();
64 timerId = startTimer( 100 ); 64// progressDlg = 0;
65// timerId = startTimer( 100 );
65} 66}
66 67
67NetworkPackageManager::~NetworkPackageManager() 68NetworkPackageManager::~NetworkPackageManager()
68{ 69{
69} 70}
70 71
@@ -103,12 +104,38 @@ void NetworkPackageManager :: updateData()
103 // set selected server to be active server 104 // set selected server to be active server
104 if ( activeItem != -1 ) 105 if ( activeItem != -1 )
105 serversList->setCurrentItem( activeItem ); 106 serversList->setCurrentItem( activeItem );
106 serverSelected( 0 ); 107 serverSelected( 0 );
107} 108}
108 109
110void NetworkPackageManager :: selectLocalPackage( const QString &pkg )
111{
112 // First select local server
113 for ( int i = 0 ; i < serversList->count() ; ++i )
114 {
115 if ( serversList->text( i ) == LOCAL_IPKGS )
116 {
117 serversList->setCurrentItem( i );
118 break;
119 }
120 }
121 serverSelected( 0 );
122
123 // Now set the check box of the selected package
124 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
125 item != 0 ;
126 item = (QCheckListItem *)item->nextSibling() )
127 {
128 if ( item->text().startsWith( pkg ) )
129 {
130 item->setOn( true );
131 break;
132 }
133 }
134}
135
109 136
110void NetworkPackageManager :: initGui() 137void NetworkPackageManager :: initGui()
111{ 138{
112 QLabel *l = new QLabel( "Servers", this ); 139 QLabel *l = new QLabel( "Servers", this );
113 serversList = new QComboBox( this ); 140 serversList = new QComboBox( this );
114 packagesList = new QListView( this ); 141 packagesList = new QListView( 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
@@ -35,12 +35,13 @@ class NetworkPackageManager : public QWidget
35public: 35public:
36 /** construtor */ 36 /** construtor */
37 NetworkPackageManager( DataManager *dataManager, QWidget* parent=0, const char *name=0); 37 NetworkPackageManager( DataManager *dataManager, QWidget* parent=0, const char *name=0);
38 /** destructor */ 38 /** destructor */
39 ~NetworkPackageManager(); 39 ~NetworkPackageManager();
40 40
41 void selectLocalPackage( const QString &pkg );
41 void updateData(); 42 void updateData();
42 43
43private: 44private:
44 DataManager *dataMgr; 45 DataManager *dataMgr;
45 46
46 QComboBox *serversList; 47 QComboBox *serversList;