3
#include <interfaces/interfaceinformationimp.h>
5
#include "%{APPNAMELC}iface.h"
6
#include "%{APPNAMELC}module.h"
8
%{APPNAME}Module::%{APPNAME}Module() {
9
Interface* iface = new %{APPNAME}Interface( 0 );
10
iface->setHardwareName( "vpn" );
11
iface->setInterfaceName( "Test VPN" );
12
m_interfaces.append( iface );
14
// If we set up VPN via pptp
15
// and networksettins was closed and now opened
16
// we need to hide the ppp device behind us
17
// One can do this by calling setHandledInterfaceNames
18
// setHandledInterfaceNames();
21
%{APPNAME}Module::~%{APPNAME}Module() {
22
m_interfaces.setAutoDelete( true );
30
bool %{APPNAME}Module::isOwner( Interface* iface ) {
31
/* check if it is our device */
32
return m_interfaces.find( iface ) != -1;
35
QWidget* %{APPNAME}Module::configure( Interface* ) {
36
/* We don't have any Config for now */
40
QWidget* %{APPNAME}Module::information( Interface* iface ) {
41
return new InterfaceInformationImp(0, "Interface info", iface );
44
QList<Interface> %{APPNAME}Module::getInterfaces() {
48
void %{APPNAME}Module::possibleNewInterfaces( QMap<QString, QString>& map) {
49
map.insert( QObject::tr("VPN PPTP"),
50
QObject::tr("Add new Point to Point Tunnel Protocol connection" ) );
54
Interface* %{APPNAME}Module::addNewInterface( const QString& ) {
55
/* check the str if we support more interfaces */
57
Interface* iface = new %{APPNAME}Interface( 0 );
58
iface->setModuleOwner( this );
61
// if we would support saving interfaces we could add
68
bool %{APPNAME}Module::remove( Interface* ) {
69
/* we do not support removing our interface */