Fix VPN plugin API

pull/1/head
Timothy Pearson 12 years ago
parent 475d08942f
commit 330644c862

@ -115,10 +115,10 @@ void VPNAuthenticationDialog::ok()
TQDialog::done(0); TQDialog::done(0);
} }
void VPNAuthenticationDialog::setPasswords(TQString name, TQString value) { void VPNAuthenticationDialog::setPasswords(TDENetworkSettingsMap secrets) {
if (value.length() > 0) { if (secrets.count() > 0) {
chkStorePasswordsPermanent->setChecked(true); chkStorePasswordsPermanent->setChecked(true);
_vpnAuthWidget->setPasswords(name, value); _vpnAuthWidget->setPasswords(secrets);
} }
} }

@ -49,7 +49,7 @@ class VPNAuthenticationDialog : public AuthenticationDialog
public: public:
VPNAuthenticationDialog(TDEVPNConnection* conn = NULL, TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); VPNAuthenticationDialog(TDEVPNConnection* conn = NULL, TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
~VPNAuthenticationDialog(); ~VPNAuthenticationDialog();
void setPasswords(TQString name, TQString value); void setPasswords(TDENetworkSettingsMap secrets);
virtual bool close(bool); virtual bool close(bool);
protected slots: protected slots:

@ -46,14 +46,19 @@ void VPNConfigWidget::setVPNData(TDENetworkSingleRouteConfigurationList& /*route
} }
TQMap<TQString, TQString> VPNConfigWidget::getVPNProperties() TDENetworkSettingsMap VPNConfigWidget::getVPNProperties()
{ {
return TQMap<TQString, TQString>(); return TDENetworkSettingsMap();
} }
TQStringList VPNConfigWidget::getVPNRoutes() TDENetworkSettingsMap VPNConfigWidget::getVPNSecrets()
{ {
return TQStringList(); return TDENetworkSettingsMap();
}
TDENetworkSingleRouteConfigurationList VPNConfigWidget::getVPNRoutes()
{
return TDENetworkSingleRouteConfigurationList();
} }
bool VPNConfigWidget::hasChanged() bool VPNConfigWidget::hasChanged()
@ -81,12 +86,12 @@ VPNAuthenticationWidget::~VPNAuthenticationWidget()
} }
TQMap<TQString, TQString> VPNAuthenticationWidget::getPasswords() TDENetworkSettingsMap VPNAuthenticationWidget::getPasswords()
{ {
return TQMap<TQString, TQString>(); return TDENetworkSettingsMap();
} }
void VPNAuthenticationWidget::setPasswords(TQString name, TQString value) void VPNAuthenticationWidget::setPasswords(TDENetworkSettingsMap secrets)
{ {
} }

@ -43,9 +43,10 @@ class VPNConfigWidget : public TQWidget
virtual ~VPNConfigWidget(); virtual ~VPNConfigWidget();
VPNConfigWidget(TQWidget* parent = NULL, const char* name = NULL); VPNConfigWidget(TQWidget* parent = NULL, const char* name = NULL);
virtual void setVPNData(TDENetworkSingleRouteConfigurationList&, TDENetworkSettingsMap&, TDENetworkSettingsMap&); virtual void setVPNData(TDENetworkSingleRouteConfigurationList&, TDENetworkSettingsMap&, TDENetworkSettingsMap&);
virtual TQMap<TQString, TQString> getVPNProperties(); virtual TDENetworkSettingsMap getVPNProperties();
virtual TQStringList getVPNRoutes(); virtual TDENetworkSettingsMap getVPNSecrets();
virtual TDENetworkSingleRouteConfigurationList getVPNRoutes();
virtual bool hasChanged(); virtual bool hasChanged();
virtual bool isValid(TQStringList&); virtual bool isValid(TQStringList&);
}; };
@ -59,8 +60,8 @@ class VPNAuthenticationWidget : public TQWidget
VPNAuthenticationWidget(TQWidget* parent = NULL, const char* name = NULL); VPNAuthenticationWidget(TQWidget* parent = NULL, const char* name = NULL);
virtual void setVPNData(TDENetworkSingleRouteConfigurationList&, TDENetworkSettingsMap&, TDENetworkSettingsMap&); virtual void setVPNData(TDENetworkSingleRouteConfigurationList&, TDENetworkSettingsMap&, TDENetworkSettingsMap&);
virtual TQMap<TQString, TQString> getPasswords(); virtual TDENetworkSettingsMap getPasswords();
virtual void setPasswords(TQString value, TQString data); virtual void setPasswords(TDENetworkSettingsMap secrets);
virtual bool needsUserInteraction(); virtual bool needsUserInteraction();
}; };

@ -50,13 +50,14 @@ class VPNCPlugin : public VPNPlugin
class VPNCConfig : public VPNConfigWidget class VPNCConfig : public VPNConfigWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
void setVPNData(const TQStringList& routes, const TQMap<TQString, TQString>& properties); void setVPNData(TDENetworkSingleRouteConfigurationList&, TDENetworkSettingsMap&, TDENetworkSettingsMap&);
TQMap<TQString, TQString> getVPNProperties(); TDENetworkSettingsMap getVPNProperties();
TDENetworkSettingsMap getVPNSecrets();
TQStringList getVPNRoutes(); TQStringList getVPNRoutes();
bool hasChanged(); bool hasChanged();
bool isValid(TQStringList& ); bool isValid(TQStringList&);
VPNCConfig(TQWidget* parent); VPNCConfig(TQWidget* parent);
~VPNCConfig(); ~VPNCConfig();
@ -75,12 +76,12 @@ class VPNCConfig : public VPNConfigWidget
class VPNCAuthentication : public VPNAuthenticationWidget class VPNCAuthentication : public VPNAuthenticationWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
VPNCAuthentication(TQWidget* parent = NULL, char* name = NULL); VPNCAuthentication(TQWidget* parent = NULL, char* name = NULL);
~VPNCAuthentication(); ~VPNCAuthentication();
TQMap<TQString, TQString> getPasswords(); TDENetworkSettingsMap getPasswords();
void setPasswords(TQString name, TQString value); void setPasswords(TDENetworkSettingsMap secrets);
private: private:
VPNCAuthenticationWidget* _vpncAuth; VPNCAuthenticationWidget* _vpncAuth;

Loading…
Cancel
Save