summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/mainwin.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp51
1 files changed, 44 insertions, 7 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index b00931e..5e03f11 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -21,6 +21,8 @@ using namespace std;
21#include <qmenubar.h> 21#include <qmenubar.h>
22#include <qpopupmenu.h>
23#include <qmessagebox.h> 22#include <qmessagebox.h>
23#include <qpopupmenu.h>
24#include <qtimer.h>
24 25
25#include "mainwin.h" 26#include "mainwin.h"
27#include "progresswidget.h"
26#include "datamgr.h" 28#include "datamgr.h"
@@ -68,8 +70,15 @@ MainWindow :: MainWindow( QWidget *p, char *name )
68 70
69 mgr = new DataManager(); 71 // Create UI widgets
70 mgr->loadServers();
71
72 stack = new QWidgetStack( this ); 72 stack = new QWidgetStack( this );
73 73
74 networkPkgWindow = new NetworkPackageManager( mgr, stack ); 74 progressWindow = new ProgressWidget( stack );
75 stack->addWidget( progressWindow, 2 );
76
77 networkPkgWindow = new NetworkPackageManager( stack );
78 connect( networkPkgWindow, SIGNAL( appRaiseMainWidget() ), this, SLOT( raiseMainWidget() ) );
79 connect( networkPkgWindow, SIGNAL( appRaiseProgressWidget() ), this, SLOT( raiseProgressWidget() ) );
80 connect( networkPkgWindow, SIGNAL( progressSetSteps( int ) ), progressWindow, SLOT( setSteps( int ) ) );
81 connect( networkPkgWindow, SIGNAL( progressSetMessage( const QString & ) ),
82 progressWindow, SLOT( setMessage( const QString & ) ) );
83 connect( networkPkgWindow, SIGNAL( progressUpdate( int ) ), progressWindow, SLOT( update( int ) ) );
75 stack->addWidget( networkPkgWindow, 1 ); 84 stack->addWidget( networkPkgWindow, 1 );
@@ -77,3 +86,7 @@ MainWindow :: MainWindow( QWidget *p, char *name )
77 setCentralWidget( stack ); 86 setCentralWidget( stack );
78 stack->raiseWidget( networkPkgWindow ); 87 stack->raiseWidget( progressWindow );
88
89 // Delayed call to finish initialization
90 QTimer::singleShot( 100, this, SLOT( init() ) );
91
79} 92}
@@ -82,3 +95,17 @@ MainWindow :: ~MainWindow()
82{ 95{
83 delete networkPkgWindow; 96 delete mgr;
97}
98
99void MainWindow :: init()
100{
101 stack->raiseWidget( progressWindow );
102 mgr = new DataManager();
103 connect( mgr, SIGNAL( progressSetSteps( int ) ), progressWindow, SLOT( setSteps( int ) ) );
104 connect( mgr, SIGNAL( progressSetMessage( const QString & ) ),
105 progressWindow, SLOT( setMessage( const QString & ) ) );
106 connect( mgr, SIGNAL( progressUpdate( int ) ), progressWindow, SLOT( update( int ) ) );
107 mgr->loadServers();
108 networkPkgWindow->setDataManager( mgr );
109 networkPkgWindow->updateData();
110 stack->raiseWidget( networkPkgWindow );
84} 111}
@@ -210 +237,11 @@ void MainWindow :: filterCategory()
210} 237}
238
239void MainWindow :: raiseMainWidget()
240{
241 stack->raiseWidget( networkPkgWindow );
242}
243
244void MainWindow :: raiseProgressWidget()
245{
246 stack->raiseWidget( progressWindow );
247}