00001 #include <qlistview.h> 00002 #include <qheader.h> 00003 #include <resources.h> 00004 #include "activatevpn.h" 00005 00006 class MyCheckListItem : public QCheckListItem { 00007 00008 public : 00009 00010 MyCheckListItem( NetworkSetup * N, QListView * V ); 00011 00012 NetworkSetup * NC; 00013 00014 }; 00015 00016 MyCheckListItem::MyCheckListItem( NetworkSetup * N, QListView * V ): 00017 QCheckListItem( V, N->name() ) { 00018 NC = N; 00019 } 00020 00021 ActivateVPN::ActivateVPN( const QString & I ) : 00022 ActivateVPNGUI( 0, 0, TRUE ), NSD() { 00023 00024 QCheckListItem * CI; 00025 VPN_LV->clear(); 00026 VPN_LV->header()->hide(); 00027 00028 // find all NetworkSetups that want to be triggered by this interface 00029 for( QDictIterator<NetworkSetup> it(NSResources->networkSetups()); 00030 it.current(); 00031 ++it ) { 00032 if( it.current()->triggeredBy( I ) ) { 00033 CI = new MyCheckListItem( it.current(), VPN_LV ); 00034 } 00035 } 00036 } 00037 00038 ActivateVPN::~ActivateVPN( void ) { 00039 } 00040 00041 void ActivateVPN::SLOT_ChangedVPNSetting( QListViewItem * I ) { 00042 00043 MyCheckListItem * MI = (MyCheckListItem *)I; 00044 00045 printf( "%s : %d\n", 00046 MI->text(0).latin1(), 00047 MI->isOn() ); 00048 }
1.4.2