summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/mainwindow/addconnectionimp.cpp
authormickeyl <mickeyl>2004-07-06 18:34:54 (UTC)
committer mickeyl <mickeyl>2004-07-06 18:34:54 (UTC)
commitda843f0c0571fd3d67d797c8fa80e2672056af4b (patch) (unidiff)
tree441b591b9e59ece79275bf83157cd023c24c6005 /noncore/settings/networksettings/mainwindow/addconnectionimp.cpp
parent7cb107b4be2d07ac8849d2ea1e41ea0318017048 (diff)
downloadopie-da843f0c0571fd3d67d797c8fa80e2672056af4b.zip
opie-da843f0c0571fd3d67d797c8fa80e2672056af4b.tar.gz
opie-da843f0c0571fd3d67d797c8fa80e2672056af4b.tar.bz2
CLEANUP: make networksettings directory structure packaging-friendly
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