summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index cf94628..e8e2982 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -49,99 +49,100 @@ extern int compareVersions( const char *v1, const char *v2 );
NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget *parent, const char *name)
: QWidget(parent, name)
{
dataMgr = dataManager;
#ifdef QWS
// read download directory from config file
Config cfg( "aqpkg" );
cfg.setGroup( "settings" );
currentlySelectedServer = cfg.readEntry( "selectedServer", "local" );
showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" );
#endif
showUninstalledPkgs = false;
showInstalledPkgs = false;
showUpgradedPkgs = false;
categoryFilterEnabled = false;
initGui();
setupConnections();
updateData();
}
NetworkPackageManager::~NetworkPackageManager()
{
}
void NetworkPackageManager :: timerEvent ( QTimerEvent * )
{
killTimer( timerId );
// Add server names to listbox
updateData();
}
void NetworkPackageManager :: updateData()
{
serversList->clear();
packagesList->clear();
vector<Server>::iterator it;
int activeItem = -1;
int i;
for ( i = 0, it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it, ++i )
{
- cout << "Adding " << it->getServerName() << " to combobox" << endl;
+// cout << "Adding " << it->getServerName() << " to combobox" << endl;
if ( !it->isServerActive() )
{
+ cout << it->getServerName() << " is not active" << endl;
i--;
continue;
}
serversList->insertItem( it->getServerName() );
if ( it->getServerName() == currentlySelectedServer )
activeItem = i;
}
// set selected server to be active server
if ( activeItem != -1 )
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 );
serversList = new QComboBox( this );
packagesList = new QListView( this );
update = new QPushButton( "Refresh Lists", this );
download = new QPushButton( "Download", this );