summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/mainwindow/addconnectionimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindow/addconnectionimp.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp b/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp
new file mode 100644
index 0000000..f18d8d1
--- a/dev/null
+++ b/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp
@@ -0,0 +1,41 @@
1#include "addconnectionimp.h"
2#include <qlistview.h>
3#if QT_VERSION < 300
4#include <qlist.h>
5#else
6#include <qptrlist.h>
7#endif
8#include <qlabel.h>
9#include <qheader.h>
10
11/**
12 * Constructor
13 */
14AddConnectionImp::AddConnectionImp(QWidget *parent, const char *name, WFlags f):AddConnection(parent, name, f){
15 connect(registeredServicesList, SIGNAL(selectionChanged()), this, SLOT(changed()));
16 registeredServicesList->header()->hide();
17};
18
19/**
20 * The current item changed, update the discription.
21 */
22void AddConnectionImp::changed(){
23 QListViewItem *item = registeredServicesList->currentItem();
24 if(item)
25 help->setText(list[item->text(0)]);
26}
27
28/**
29 * Save a copy of newList for the discriptions and append them all to the view
30 * @param newList the new list of possible interfaces
31 */
32void AddConnectionImp::addConnections(const QMap<QString, QString> &newList){
33 list = newList;
34 QMap<QString, QString>::Iterator it;
35 for( it = list.begin(); it != list.end(); ++it )
36 QListViewItem *item = new QListViewItem(registeredServicesList, it.key());
37 registeredServicesList->setCurrentItem(registeredServicesList->firstChild());
38}
39
40// addserviceimp.cpp
41