summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/activatevpn.cpp
blob: 35a881ba5bf2b249484efd48e6a73fa7112d178c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <qlistview.h>
#include <qheader.h>
#include <resources.h>
#include "activatevpn.h"

class MyCheckListItem : public QCheckListItem {

public :

      MyCheckListItem( NetworkSetup * N, QListView * V );

      NetworkSetup * NC;

};

MyCheckListItem::MyCheckListItem( NetworkSetup * N, QListView * V ):
                QCheckListItem( V, N->name() ) {
      NC = N;
}

ActivateVPN::ActivateVPN( const QString & I ) :
                  ActivateVPNGUI( 0, 0, TRUE ), NSD() {

    QCheckListItem * CI;
    VPN_LV->clear();
    VPN_LV->header()->hide();

    // find all NetworkSetups that want to be triggered by this interface
    for( QDictIterator<NetworkSetup> it(NSResources->networkSetups());
         it.current();
         ++it ) {
      if( it.current()->triggeredBy( I ) ) {
        CI = new MyCheckListItem( it.current(), VPN_LV );
      }
    }
}

ActivateVPN::~ActivateVPN( void ) {
}

void ActivateVPN::SLOT_ChangedVPNSetting( QListViewItem * I ) {

      MyCheckListItem * MI = (MyCheckListItem *)I;

      printf( "%s : %d\n", 
          MI->text(0).latin1(),
          MI->isOn() );
}