author | drw <drw> | 2003-01-04 19:52:22 (UTC) |
---|---|---|
committer | drw <drw> | 2003-01-04 19:52:22 (UTC) |
commit | 8b0f280e69a6c5b4c1caf4070085feaf0951380d (patch) (unidiff) | |
tree | ee99aba03491199a28b862afd439a591d9a3de88 /noncore/settings/aqpkg/mainwin.cpp | |
parent | d7474edcc4efccbf5d5fd4b8926739a597463242 (diff) | |
download | opie-8b0f280e69a6c5b4c1caf4070085feaf0951380d.zip opie-8b0f280e69a6c5b4c1caf4070085feaf0951380d.tar.gz opie-8b0f280e69a6c5b4c1caf4070085feaf0951380d.tar.bz2 |
Delay initial load of ipkg info so app displays quicker, and add progress display for longer operations (such as loading packages for large feeds).
Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 51 |
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 | |||
@@ -20,8 +20,10 @@ using namespace std; | |||
20 | 20 | ||
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" |
27 | #include "networkpkgmgr.h" | 29 | #include "networkpkgmgr.h" |
@@ -67,19 +69,44 @@ MainWindow :: MainWindow( QWidget *p, char *name ) | |||
67 | menu->insertItem( tr( "&Help" ), help ); | 69 | menu->insertItem( tr( "&Help" ), help ); |
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 ); |
76 | 85 | ||
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 | } |
80 | 93 | ||
81 | MainWindow :: ~MainWindow() | 94 | MainWindow :: ~MainWindow() |
82 | { | 95 | { |
83 | delete networkPkgWindow; | 96 | delete mgr; |
97 | } | ||
98 | |||
99 | void 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 | } |
85 | 112 | ||
@@ -209,2 +236,12 @@ void MainWindow :: filterCategory() | |||
209 | } | 236 | } |
210 | } | 237 | } |
238 | |||
239 | void MainWindow :: raiseMainWidget() | ||
240 | { | ||
241 | stack->raiseWidget( networkPkgWindow ); | ||
242 | } | ||
243 | |||
244 | void MainWindow :: raiseProgressWidget() | ||
245 | { | ||
246 | stack->raiseWidget( progressWindow ); | ||
247 | } | ||