summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-16 23:08:56 (UTC)
committer andyq <andyq>2002-10-16 23:08:56 (UTC)
commitb1d16660979fa8bb767fa0a6fe2d966e5633abdc (patch) (unidiff)
tree42390cc528f61bd44c0de7084d0fed8000bc10c4
parent593fe744126a398e2714070137b6f19e398d2c9d (diff)
downloadopie-b1d16660979fa8bb767fa0a6fe2d966e5633abdc.zip
opie-b1d16660979fa8bb767fa0a6fe2d966e5633abdc.tar.gz
opie-b1d16660979fa8bb767fa0a6fe2d966e5633abdc.tar.bz2
Handles commented servers nicely
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 318b26d..3ce7960 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -62,53 +62,59 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget
62 progressDlg = 0; 62 progressDlg = 0;
63 timerId = startTimer( 100 ); 63 timerId = startTimer( 100 );
64} 64}
65 65
66NetworkPackageManager::~NetworkPackageManager() 66NetworkPackageManager::~NetworkPackageManager()
67{ 67{
68} 68}
69 69
70void NetworkPackageManager :: timerEvent ( QTimerEvent * ) 70void NetworkPackageManager :: timerEvent ( QTimerEvent * )
71{ 71{
72 killTimer( timerId ); 72 killTimer( timerId );
73 73
74// showProgressDialog(); 74// showProgressDialog();
75 // Add server names to listbox 75 // Add server names to listbox
76 updateData(); 76 updateData();
77 77
78// progressDlg->hide(); 78// progressDlg->hide();
79} 79}
80 80
81void NetworkPackageManager :: updateData() 81void NetworkPackageManager :: updateData()
82{ 82{
83 serversList->clear(); 83 serversList->clear();
84 packagesList->clear(); 84 packagesList->clear();
85 85
86
86 vector<Server>::iterator it; 87 vector<Server>::iterator it;
87 int activeItem = -1; 88 int activeItem = -1;
88 int i; 89 int i;
89 for ( i = 0, it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it, ++i ) 90 for ( i = 0, it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it, ++i )
90 { 91 {
92 if ( !it->isServerActive() )
93 {
94 i--;
95 continue;
96 }
91 serversList->insertItem( it->getServerName() ); 97 serversList->insertItem( it->getServerName() );
92 if ( it->getServerName() == currentlySelectedServer ) 98 if ( it->getServerName() == currentlySelectedServer )
93 activeItem = i; 99 activeItem = i;
94 } 100 }
95 101
96 // set selected server to be active server 102 // set selected server to be active server
97 if ( activeItem != -1 ) 103 if ( activeItem != -1 )
98 serversList->setCurrentItem( activeItem ); 104 serversList->setCurrentItem( activeItem );
99 serverSelected( 0 ); 105 serverSelected( 0 );
100} 106}
101 107
102 108
103void NetworkPackageManager :: initGui() 109void NetworkPackageManager :: initGui()
104{ 110{
105 QLabel *l = new QLabel( "Servers", this ); 111 QLabel *l = new QLabel( "Servers", this );
106 serversList = new QComboBox( this ); 112 serversList = new QComboBox( this );
107 packagesList = new QListView( this ); 113 packagesList = new QListView( this );
108 update = new QPushButton( "Refresh List", this ); 114 update = new QPushButton( "Refresh List", this );
109 download = new QPushButton( "Download", this ); 115 download = new QPushButton( "Download", this );
110 upgrade = new QPushButton( "Upgrade", this ); 116 upgrade = new QPushButton( "Upgrade", this );
111 apply = new QPushButton( "Apply", this ); 117 apply = new QPushButton( "Apply", this );
112 118
113 QVBoxLayout *vbox = new QVBoxLayout( this, 0, -1, "VBox" ); 119 QVBoxLayout *vbox = new QVBoxLayout( this, 0, -1, "VBox" );
114 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1, "HBox1" ); 120 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1, "HBox1" );