Diffstat (limited to 'noncore/settings/networksettings/addconnectionimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/addconnectionimp.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/addconnectionimp.cpp b/noncore/settings/networksettings/addconnectionimp.cpp new file mode 100644 index 0000000..ee7bd97 --- a/dev/null +++ b/noncore/settings/networksettings/addconnectionimp.cpp @@ -0,0 +1,38 @@ +#include "addconnectionimp.h" +#include <qlistview.h> +#include <qlist.h> +#include <qlabel.h> +#include <qheader.h> + +/** + * Constructor + */ +AddConnectionImp::AddConnectionImp(QWidget *parent=0, const char *name=0, WFlags f=0):AddConnection(parent, name, f){ + connect(registeredServicesList, SIGNAL(selectionChanged()), this, SLOT(changed())); + registeredServicesList->header()->hide(); +}; + +/** + * The current item changed, update the discription. + */ +void AddConnectionImp::changed(){ + QListViewItem *item = registeredServicesList->currentItem(); + if(item){ + help->setText(list[item->text(0)]); + } +} + +/** + * Save a copy of newList for the discriptions and append them all to the view + * @param newList the new list of possible interfaces + */ +void AddConnectionImp::addConnections(QMap<QString, QString> newList){ + list = newList; + QMap<QString, QString>::Iterator it; + for( it = list.begin(); it != list.end(); ++it ) + QListViewItem *item = new QListViewItem(registeredServicesList, it.key()); + registeredServicesList->setCurrentItem(registeredServicesList->firstChild()); +} + +// addserviceimp.cpp + |