diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_cdma_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_cdma_widget.cpp index 8255eaf..7e95fd3 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_cdma_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_cdma_widget.cpp @@ -33,7 +33,7 @@ #include #include -// knm headers +// tdenm headers #include "tdenetman-connection_setting_cdma_widget.h" // ui headers @@ -44,6 +44,8 @@ using namespace ConnectionSettings; CDMAWidgetImpl::CDMAWidgetImpl(TDENetworkConnection* conn, TQWidget* parent, const char* name, WFlags fl) : WidgetInterface(parent, name, fl) { + _parentdialog = dynamic_cast(parent); + _cdmasetting = dynamic_cast(conn); TQVBoxLayout* layout = new TQVBoxLayout(this, 1, 1); @@ -87,6 +89,8 @@ CDMAWidgetImpl::dirty() _cdmasetting->cdmaConfig.providerDataNumber = _mainWid->mNumber->text(); _cdmasetting->cdmaConfig.valid = true; _cdmasetting->cdmaConfig.secretsValid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_cdma_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_cdma_widget.h index 3ce30fc..110b079 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_cdma_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_cdma_widget.h @@ -34,7 +34,8 @@ #include #include -// knm headers +// tdenm headers +#include "tdenetman-connection_settings_dialog.h" #include "tdenetman-connection_setting_widget_interface.h" //class VPNService; @@ -58,9 +59,10 @@ class CDMAWidgetImpl : public WidgetInterface void Init(); //VPNConfigWidget* getVPNConfigWidget(VPNService* service); - TDEModemConnection* _cdmasetting; ConnectionSettingCdmaWidget* _mainWid; + + ConnectionSettingsDialogImpl* _parentdialog; }; } diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_gsm_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_gsm_widget.cpp index 131f4c0..f373b04 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_gsm_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_gsm_widget.cpp @@ -34,7 +34,7 @@ #include #include -// knm headers +// tdenm headers #include "tdenetman-connection_setting_gsm_widget.h" #include "connection_setting_gsm.h" @@ -44,6 +44,8 @@ using namespace ConnectionSettings; GSMWidgetImpl::GSMWidgetImpl(TDENetworkConnection* conn, TQWidget* parent, const char* name, WFlags fl) : WidgetInterface(parent, name, fl) { + _parentdialog = dynamic_cast(parent); + _gsmsetting = dynamic_cast(conn); TQVBoxLayout* layout = new TQVBoxLayout(this, 1, 1); @@ -104,6 +106,8 @@ GSMWidgetImpl::dirty() _gsmsetting->gsmConfig.valid = true; _gsmsetting->gsmConfig.secretsValid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_gsm_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_gsm_widget.h index 639e4fa..221336e 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_gsm_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_gsm_widget.h @@ -34,7 +34,8 @@ #include #include -// knm headers +// tdenm headers +#include "tdenetman-connection_settings_dialog.h" #include "tdenetman-connection_setting_widget_interface.h" //class VPNService; @@ -65,6 +66,8 @@ class GSMWidgetImpl : public WidgetInterface TDEModemConnection* _gsmsetting; ConnectionSettingGsmWidget* _mainWid; + + ConnectionSettingsDialogImpl* _parentdialog; }; } diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_info_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_info_widget.cpp index fed5d15..e9962ee 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_info_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_info_widget.cpp @@ -29,7 +29,7 @@ #include #include -// knm headers +// tdenm headers #include "tdenetman-connection_setting_info_widget.h" using namespace ConnectionSettings; @@ -38,7 +38,7 @@ InfoWidgetImpl::InfoWidgetImpl(TDENetworkConnection* conn, TQWidget* parent, con : WidgetInterface(parent, name, fl) { _infosetting = conn; - + _parentdialog = dynamic_cast(parent); TQVBoxLayout* layout = new TQVBoxLayout(this, 1, 1); _mainWid = new ConnectionSettingInfoWidget(this); @@ -65,12 +65,14 @@ void InfoWidgetImpl::slotNameChanged(const TQString& name) { _infosetting->friendlyName = name; + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void InfoWidgetImpl::slotAutoconnectChanged(bool autoconnect) { _infosetting->autoConnect = autoconnect; + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } #include "tdenetman-connection_setting_info_widget.moc" diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_info_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_info_widget.h index 3ffe23a..2ddb6e5 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_info_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_info_widget.h @@ -35,8 +35,9 @@ #include #include -// knm headers +// tdenm headers #include "connection_setting_info.h" +#include "tdenetman-connection_settings_dialog.h" #include "tdenetman-connection_setting_widget_interface.h" namespace ConnectionSettings @@ -61,6 +62,7 @@ class InfoWidgetImpl : public WidgetInterface void Init(); TDENetworkConnection* _infosetting; + ConnectionSettingsDialogImpl* _parentdialog; ConnectionSettingInfoWidget* _mainWid; }; diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ipv4_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ipv4_widget.cpp index f36efaa..03db7b4 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ipv4_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ipv4_widget.cpp @@ -39,6 +39,7 @@ IPv4WidgetImpl::IPv4WidgetImpl(TDENetworkConnection* conn, TQWidget* parent, con : WidgetInterface(parent, name, fl) { _ipv4_setting = conn; + _parentdialog = dynamic_cast(parent); TQVBoxLayout* layout = new TQVBoxLayout(this, 1, 1); _mainWid = new ConnectionSettingIPv4Widget(this); @@ -116,6 +117,8 @@ IPv4WidgetImpl::slotDNSAddressesChanged(const TQString& adr) } } _ipv4_setting->ipConfig.resolvers = hosts; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } @@ -134,6 +137,8 @@ IPv4WidgetImpl::slotDNSSearchChanged(const TQString& search) } } _ipv4_setting->ipConfig.searchDomains = domains; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -147,6 +152,8 @@ IPv4WidgetImpl::slotIPConfigEnabled(bool enabled) { _ipv4_setting->ipConfig.connectionFlags |= TDENetworkIPConfigurationFlags::IPV4DHCPIP; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -186,6 +193,8 @@ IPv4WidgetImpl::slotIPAddressChanged(const TQString& ip) } } } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -196,6 +205,8 @@ IPv4WidgetImpl::slotNetmaskChanged(const TQString& ip) mask.fromString(ip); addrs[0].networkMask = mask; _ipv4_setting->ipConfig.ipConfigurations = addrs; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -204,6 +215,8 @@ IPv4WidgetImpl::slotGatewayChanged(const TQString& ip) TDENetworkSingleIPConfigurationList addrs = _ipv4_setting->ipConfig.ipConfigurations; addrs[0].gateway = TQHostAddress(ip); _ipv4_setting->ipConfig.ipConfigurations = addrs; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } #include "tdenetman-connection_setting_ipv4_widget.moc" diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ipv4_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ipv4_widget.h index 1abec3a..0b2e48f 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ipv4_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ipv4_widget.h @@ -33,6 +33,7 @@ #include "connection_setting_ipv4.h" // tdenetman headers +#include "tdenetman-connection_settings_dialog.h" #include "tdenetman-connection_setting_widget_interface.h" namespace ConnectionSettings @@ -60,6 +61,7 @@ namespace ConnectionSettings void Init(); TDENetworkConnection* _ipv4_setting; + ConnectionSettingsDialogImpl* _parentdialog; ConnectionSettingIPv4Widget* _mainWid; }; diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ppp_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ppp_widget.cpp index a4d0a65..3ab971e 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ppp_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ppp_widget.cpp @@ -36,7 +36,7 @@ #include #include -// knm headers +// tdenm headers #include "tdenetman-connection_setting_ppp_widget.h" #include "connection_setting_ppp.h" @@ -45,6 +45,8 @@ using namespace ConnectionSettings; PPPWidgetImpl::PPPWidgetImpl(TDENetworkConnection* conn, TQWidget* parent, const char* name, WFlags fl) : WidgetInterface(parent, name, fl) { + _parentdialog = dynamic_cast(parent); + _pppsetting = conn; TQVBoxLayout* layout = new TQVBoxLayout(this, 1, 1); @@ -138,6 +140,8 @@ PPPWidgetImpl::dirty() _pppsetting->pppConfig.lcpEchoPingInterval = _mainWid->mLcpEchoInterval->value(); _pppsetting->pppConfig.valid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } #include "tdenetman-connection_setting_ppp_widget.moc" diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ppp_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ppp_widget.h index 9772b1d..71ccc67 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ppp_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_ppp_widget.h @@ -34,7 +34,8 @@ #include #include -// knm headers +// tdenm headers +#include "tdenetman-connection_settings_dialog.h" #include "tdenetman-connection_setting_widget_interface.h" //class VPNService; @@ -61,6 +62,8 @@ class PPPWidgetImpl : public WidgetInterface TDENetworkConnection* _pppsetting; ConnectionSettingPppWidget* _mainWid; + + ConnectionSettingsDialogImpl* _parentdialog; }; } diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_serial_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_serial_widget.cpp index daa5f62..0f9d7a6 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_serial_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_serial_widget.cpp @@ -35,7 +35,7 @@ #include #include -// knm headers +// tdenm headers #include "tdenetman-connection_setting_serial_widget.h" #include "connection_setting_serial.h" @@ -45,6 +45,8 @@ using namespace ConnectionSettings; SerialWidgetImpl::SerialWidgetImpl(TDENetworkConnection* conn, TQWidget* parent, const char* name, WFlags fl) : WidgetInterface(parent, name, fl) { + _parentdialog = dynamic_cast(parent); + _serialsetting = conn; TQVBoxLayout* layout = new TQVBoxLayout(this, 1, 1); @@ -93,6 +95,8 @@ SerialWidgetImpl::dirty() _serialsetting->serialConfig.txDelay = _mainWid->mSendDelay->value(); _serialsetting->serialConfig.valid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_serial_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_serial_widget.h index 4dad72d..93e23fd 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_serial_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_serial_widget.h @@ -34,8 +34,9 @@ #include #include -// knm headers +// tdenm headers #include "tdenetman-connection_setting_widget_interface.h" +#include "tdenetman-connection_settings_dialog.h" //class VPNService; class ConnectionSettingSerialWidget; @@ -64,6 +65,8 @@ class SerialWidgetImpl : public WidgetInterface TDENetworkConnection* _serialsetting; ConnectionSettingSerialWidget* _mainWid; + + ConnectionSettingsDialogImpl* _parentdialog; }; } diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp index 5b1faff..06509ec 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp @@ -23,7 +23,7 @@ * **************************************************************************/ -// qt headers +// tqt headers #include #include #include @@ -34,7 +34,7 @@ #include #include -// knm headers +// tdenm headers #include "tdenetman-connection.h" #include "tdenetman-connection_setting_vpn.h" #include "tdenetman-connection_setting_vpn_widget.h" diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.h index 780148a..ad9cfde 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.h @@ -26,14 +26,14 @@ #define KNETWORKMANAGER_CONNECTION_SETTING_VPN_WIDGET_H -// qt headers +// tqt headers #include #include -// knm headers +// tdenm headers #include "connection_setting_vpn.h" #include "tdenetman-connection_setting_widget_interface.h" -#include "tdenetman-device.h" +#include "tdenetman-connection_settings_dialog.h" class VPNService; class VPNConfigWidget; @@ -63,6 +63,8 @@ class VPNWidgetImpl : public WidgetInterface ConnectionSettingVPNWidget* _mainWid; TQMap _mapServiceCombo; TQMap _mapServiceWidget; + + ConnectionSettingsDialogImpl* _parentdialog; }; } diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp index 654d1f8..1e1500f 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp @@ -62,11 +62,13 @@ using namespace ConnectionSettings; /* class WirelessSecurityWEPImpl */ -WirelessSecurityWEPImpl::WirelessSecurityWEPImpl(TDEWiFiConnection* sec, TQWidget* parent, const char* name, WFlags fl) +WirelessSecurityWEPImpl::WirelessSecurityWEPImpl(TDEWiFiConnection* sec, TQWidget* parent, ConnectionSettingsDialogImpl* connsettings, const char* name, WFlags fl) : ConnectionSettingWirelessSecurityWEP(parent, name, fl) , _security_setting(sec) , _wepKeyType( WEPKEY_TYPE_HEX ) { + _parentdialog = connsettings; + cboAuthentication->insertItem(i18n("Open System"), 0); cboAuthentication->insertItem(i18n("Shared Key"), 1); if (_security_setting->securitySettings.authType == TDENetworkWiFiAuthType::Open) { @@ -75,11 +77,22 @@ WirelessSecurityWEPImpl::WirelessSecurityWEPImpl(TDEWiFiConnection* sec, TQWidge else if (_security_setting->securitySettings.authType == TDENetworkWiFiAuthType::Shared) { cboAuthentication->setCurrentItem(1); } + else { + // Set up defaults + _security_setting->securitySettings.authType = TDENetworkWiFiAuthType::Open; + cboAuthentication->setCurrentItem(0); + } cbKeyType->insertItem(i18n("WEP 40/128-bit ASCII"), WEPKEY_TYPE_ASCII); cbKeyType->insertItem(i18n("WEP 40/128-bit Hexadecimal"), WEPKEY_TYPE_HEX); cbKeyType->insertItem(i18n("WEP 128-bit passphrase"), WEPKEY_TYPE_PASSPHRASE); - cbKeyType->setCurrentItem(_wepKeyType ); + cbKeyType->setCurrentItem( _wepKeyType ); + + if (_security_setting->securitySettings.authType == TDENetworkWiFiAuthType::Other) { + // Set up defaults + _security_setting->securitySettings.wepKeyType = TDENetworkWepKeyType::Hexadecimal; + cbKeyType->setCurrentItem(WEPKEY_TYPE_HEX); + } txtWEPKey0->setText(_security_setting->securitySettings.wepKey0); txtWEPKey1->setText(_security_setting->securitySettings.wepKey1); @@ -126,37 +139,64 @@ void WirelessSecurityWEPImpl::slotAuthAlgChanged(int index) else if (index == 1) { _security_setting->securitySettings.authType = TDENetworkWiFiAuthType::Shared; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotKeyTypeChanged(int index) { _wepKeyType = (WEPKEY_TYPE)index; + if (index == WEPKEY_TYPE_ASCII) { + _security_setting->securitySettings.wepKeyType = TDENetworkWepKeyType::Ascii; + } + else if (index == WEPKEY_TYPE_HEX) { + _security_setting->securitySettings.wepKeyType = TDENetworkWepKeyType::Hexadecimal; + } + else if (index == WEPKEY_TYPE_PASSPHRASE) { + _security_setting->securitySettings.wepKeyType = TDENetworkWepKeyType::Passphrase; + } + _security_setting->securitySettings.secretsValid = true; + // update all WEP-Keys here due to the new key_type + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotWepKey0Changed(const TQString &key) { TQCString hashed = getHashedWEPKey(key, _wepKeyType); _security_setting->securitySettings.wepKey0 = hashed; + _security_setting->securitySettings.secretsValid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotWepKey1Changed(const TQString &key) { TQCString hashed = getHashedWEPKey(key, _wepKeyType); _security_setting->securitySettings.wepKey1 = hashed; + _security_setting->securitySettings.secretsValid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotWepKey2Changed(const TQString &key) { TQCString hashed = getHashedWEPKey(key, _wepKeyType); _security_setting->securitySettings.wepKey2 = hashed; + _security_setting->securitySettings.secretsValid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotWepKey3Changed(const TQString& key) { TQCString hashed = getHashedWEPKey(key, _wepKeyType); _security_setting->securitySettings.wepKey3 = hashed; + _security_setting->securitySettings.secretsValid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotWepIdx0Checked(bool check) @@ -164,6 +204,8 @@ void WirelessSecurityWEPImpl::slotWepIdx0Checked(bool check) if (check) { _security_setting->securitySettings.wepKeyIndex = 0; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotWepIdx1Checked(bool check) @@ -171,6 +213,8 @@ void WirelessSecurityWEPImpl::slotWepIdx1Checked(bool check) if (check) { _security_setting->securitySettings.wepKeyIndex = 1; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotWepIdx2Checked(bool check) @@ -178,6 +222,8 @@ void WirelessSecurityWEPImpl::slotWepIdx2Checked(bool check) if (check) { _security_setting->securitySettings.wepKeyIndex = 2; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWEPImpl::slotWepIdx3Checked(bool check) @@ -185,6 +231,8 @@ void WirelessSecurityWEPImpl::slotWepIdx3Checked(bool check) if (check) { _security_setting->securitySettings.wepKeyIndex = 3; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } TQCString @@ -201,7 +249,7 @@ WirelessSecurityWEPImpl::getHashedWEPKey(TQString key, WEPKEY_TYPE type) const return hashed; break; case WEPKEY_TYPE_PASSPHRASE: - return getWEP128PassphraseHash(TQCString(key)); + return TQCString(key); break; } return hashed; @@ -253,10 +301,12 @@ WirelessSecurityWEPImpl::String2Hex(TQByteArray bytes, int final_len) const /* class WirelessSecurityWEPEncryptionImpl */ -WirelessSecurityWEPEncryptionImpl::WirelessSecurityWEPEncryptionImpl(TDEWiFiConnection* security_setting, TQWidget* parent, const char* name, WFlags fl) +WirelessSecurityWEPEncryptionImpl::WirelessSecurityWEPEncryptionImpl(TDEWiFiConnection* security_setting, TQWidget* parent, ConnectionSettingsDialogImpl* connsettings, const char* name, WFlags fl) : ConnectionSettingWirelessSecurityWEPEncryption(parent, name, fl) , _security_setting(security_setting) { + _parentdialog = connsettings; + cboEncryption->insertItem(i18n("None")); cboEncryption->insertItem(i18n("Dynamic WEP")); } @@ -265,10 +315,12 @@ WirelessSecurityWEPEncryptionImpl::WirelessSecurityWEPEncryptionImpl(TDEWiFiConn /* class WirelessSecurityWPAVersionImpl */ -WirelessSecurityWPAVersionImpl::WirelessSecurityWPAVersionImpl(TDEWiFiConnection* security_setting, TQWidget* parent, const char* name, WFlags fl) +WirelessSecurityWPAVersionImpl::WirelessSecurityWPAVersionImpl(TDEWiFiConnection* security_setting, TQWidget* parent, ConnectionSettingsDialogImpl* connsettings, const char* name, WFlags fl) : ConnectionSettingWirelessSecurityWPAVersion(parent, name, fl) , _security_setting(security_setting) { + _parentdialog = connsettings; + cbWPA->setChecked(_security_setting->securitySettings.wpaVersion & TDENetworkWiFiWPAVersionFlags::WPA); cbRSN->setChecked(_security_setting->securitySettings.wpaVersion & TDENetworkWiFiWPAVersionFlags::RSN); @@ -296,27 +348,35 @@ WirelessSecurityWPAVersionImpl::slotAuto(bool on) } _security_setting->securitySettings.wpaVersion = proto; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWPAVersionImpl::slotWPA1(bool on) { SET_FLAG_IF_TRUE_CLEAR_IF_FALSE(_security_setting->securitySettings.wpaVersion, TDENetworkWiFiWPAVersionFlags::WPA, on); + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityWPAVersionImpl::slotWPA2(bool on) { SET_FLAG_IF_TRUE_CLEAR_IF_FALSE(_security_setting->securitySettings.wpaVersion, TDENetworkWiFiWPAVersionFlags::RSN, on); + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } /* class WirelessSecurityWPACipherImpl */ -WirelessSecurityWPACipherImpl::WirelessSecurityWPACipherImpl(TDEWiFiConnection* security_setting, TQWidget* parent, const char* name, WFlags fl) +WirelessSecurityWPACipherImpl::WirelessSecurityWPACipherImpl(TDEWiFiConnection* security_setting, TQWidget* parent, ConnectionSettingsDialogImpl* connsettings, const char* name, WFlags fl) : ConnectionSettingWirelessSecurityWPACipher(parent, name, fl) , _security_setting(security_setting) { + _parentdialog = connsettings; + connect(grpUseCipher, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotCipherChangedAuto(bool))); connect(chkGroupCipherTKIP, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotGroupCipherChangedTKIP(bool))); @@ -334,7 +394,6 @@ WirelessSecurityWPACipherImpl::WirelessSecurityWPACipherImpl(TDEWiFiConnection* chkGroupCipherTKIP->setChecked(_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP)); chkGroupCipherWEP40->setChecked(_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP40)); chkGroupCipherWEP104->setChecked(_security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any) || _security_setting->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP104)); - } void @@ -377,8 +436,9 @@ WirelessSecurityWPACipherImpl::slotCipherChangedAuto(bool checked) cipher.append(TDENetworkWiFiConnectionCipher::CipherCCMP); } _security_setting->securitySettings.allowedPairWiseCiphers = cipher; - } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -390,6 +450,8 @@ WirelessSecurityWPACipherImpl::slotGroupCipherChangedTKIP(bool checked) else { _security_setting->securitySettings.allowedGroupWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherTKIP); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -401,6 +463,8 @@ WirelessSecurityWPACipherImpl::slotGroupCipherChangedCCMP(bool checked) else { _security_setting->securitySettings.allowedGroupWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherCCMP); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -412,6 +476,8 @@ WirelessSecurityWPACipherImpl::slotGroupCipherChangedWEP40(bool checked) else { _security_setting->securitySettings.allowedPairWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherWEP40); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -423,6 +489,8 @@ WirelessSecurityWPACipherImpl::slotGroupCipherChangedWEP104(bool checked) else { _security_setting->securitySettings.allowedPairWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherWEP104); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -434,6 +502,8 @@ WirelessSecurityWPACipherImpl::slotPairwiseCipherChangedTKIP(bool checked) else { _security_setting->securitySettings.allowedPairWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherTKIP); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -445,16 +515,20 @@ WirelessSecurityWPACipherImpl::slotPairwiseCipherChangedCCMP(bool checked) else { _security_setting->securitySettings.allowedPairWiseCiphers.remove(TDENetworkWiFiConnectionCipher::CipherCCMP); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } /* class WirelessSecurityWPAPSK */ -WirelessSecurityWPAPSKImpl::WirelessSecurityWPAPSKImpl(TDEWiFiConnection* security_setting, TDEWiFiConnection* wireless_setting, TQWidget* parent, const char* name, WFlags fl) +WirelessSecurityWPAPSKImpl::WirelessSecurityWPAPSKImpl(TDEWiFiConnection* security_setting, TDEWiFiConnection* wireless_setting, TQWidget* parent, ConnectionSettingsDialogImpl* connsettings, const char* name, WFlags fl) : ConnectionSettingWirelessSecurityWPAPSK(parent, name, fl) , _security_setting(security_setting) , _wireless_setting(wireless_setting) { + _parentdialog = connsettings; + if (_security_setting->securitySettings.secretsValid) { txtPSK->setText(_security_setting->securitySettings.psk); } @@ -469,6 +543,8 @@ WirelessSecurityWPAPSKImpl::slotPSKChanged(const TQString& psk) _security_setting->securitySettings.psk = psk; _security_setting->securitySettings.secretsValid = true; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } TQCString @@ -491,11 +567,13 @@ WirelessSecurityWPAPSKImpl::String2Hex(TQByteArray bytes, int final_len) const /* class WirelessSecurityEAPImpl */ -WirelessSecurityEAPImpl::WirelessSecurityEAPImpl(TDEWiFiConnection* security_setting, WirelessSecurityPhase2Impl* phase2_widget, TQWidget* parent, const char* name, WFlags fl) +WirelessSecurityEAPImpl::WirelessSecurityEAPImpl(TDEWiFiConnection* security_setting, WirelessSecurityPhase2Impl* phase2_widget, TQWidget* parent, ConnectionSettingsDialogImpl* connsettings, const char* name, WFlags fl) : ConnectionSettingWirelessSecurityEAP(parent, name, fl) , _security_setting(security_setting) , _phase2_widget(phase2_widget) { + _parentdialog = connsettings; + // insert all EAP-Methods int index = 0; cboMethod->insertItem(i18n("None"), index); @@ -550,6 +628,8 @@ void WirelessSecurityEAPImpl::slotUseSystemCaCertChanged(bool on) { _security_setting->eapConfig.forceSystemCaCertificates = on; kURLCACert->setEnabled(!on); + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityEAPImpl::slotMethodChanged(int index) @@ -559,31 +639,41 @@ void WirelessSecurityEAPImpl::slotMethodChanged(int index) _security_setting->eapConfig.type = eap; _phase2_widget->setAllowedPhase2Methods(_security_setting->eapConfig.allowedPhase2EAPMethods); + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityEAPImpl::slotIdentityChanged(const TQString& identity) { _security_setting->eapConfig.userName = identity; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityEAPImpl::slotAnonIdentityChanged(const TQString& identity) { _security_setting->eapConfig.anonymousUserName = identity; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void WirelessSecurityEAPImpl::slotPasswordChanged(const TQString& pwd) { _security_setting->eapConfig.password = TQString(txtPassword->password()); _security_setting->eapConfig.secretsValid = true; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } /* class WirelessSecurityPhase2Impl */ -WirelessSecurityPhase2Impl::WirelessSecurityPhase2Impl(TDEWiFiConnection* security_setting, TQWidget* parent, const char* name, WFlags fl) +WirelessSecurityPhase2Impl::WirelessSecurityPhase2Impl(TDEWiFiConnection* security_setting, TQWidget* parent, ConnectionSettingsDialogImpl* connsettings, const char* name, WFlags fl) : ConnectionSettingWirelessSecurityPhase2(parent, name, fl) , _security_setting(security_setting) { + _parentdialog = connsettings; + _allowed_methods.append(TDENetworkIEEE8021xType::None); updateMethodComboBox(); @@ -680,6 +770,8 @@ void WirelessSecurityPhase2Impl::slotPhase2MethodChanged(int index) // new method choosen TDENetworkIEEE8021xType::TDENetworkIEEE8021xType eap = _eapIndexMap[index]; _security_setting->eapConfig.phase2EAPAuthMethod = eap; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } /* @@ -689,6 +781,7 @@ void WirelessSecurityPhase2Impl::slotPhase2MethodChanged(int index) WirelessSecurityWidgetImpl::WirelessSecurityWidgetImpl(TDENetworkConnection* conn, bool new_conn, TQWidget* parent, const char* name, WFlags fl) : WidgetInterface(parent, name, fl) { + _parentdialog = dynamic_cast(parent); _security_setting = dynamic_cast (conn); _wireless_setting = dynamic_cast (conn); _ieee8021x_setting = dynamic_cast (conn); @@ -705,13 +798,13 @@ void WirelessSecurityWidgetImpl::slotInit() { // create all security widgets... - TQWidget* wep = new WirelessSecurityWEPImpl(_security_setting, _mainWid->groupUseEncryption); - TQWidget* phase2 = new WirelessSecurityPhase2Impl(_ieee8021x_setting, _mainWid->groupUseEncryption); - TQWidget* eap = new WirelessSecurityEAPImpl(_ieee8021x_setting, (WirelessSecurityPhase2Impl*)phase2, _mainWid->groupUseEncryption); - TQWidget* wpaversion = new WirelessSecurityWPAVersionImpl(_security_setting, _mainWid->groupUseEncryption); - TQWidget* wpacipher = new WirelessSecurityWPACipherImpl(_security_setting, _mainWid->groupUseEncryption); - TQWidget* wpapsk = new WirelessSecurityWPAPSKImpl(_security_setting, _wireless_setting, _mainWid->groupUseEncryption); - TQWidget* wepencryption = new WirelessSecurityWEPEncryptionImpl(_security_setting, _mainWid->groupUseEncryption); + TQWidget* wep = new WirelessSecurityWEPImpl(_security_setting, _mainWid->groupUseEncryption, _parentdialog); + TQWidget* phase2 = new WirelessSecurityPhase2Impl(_ieee8021x_setting, _mainWid->groupUseEncryption, _parentdialog); + TQWidget* eap = new WirelessSecurityEAPImpl(_ieee8021x_setting, (WirelessSecurityPhase2Impl*)phase2, _mainWid->groupUseEncryption, _parentdialog); + TQWidget* wpaversion = new WirelessSecurityWPAVersionImpl(_security_setting, _mainWid->groupUseEncryption, _parentdialog); + TQWidget* wpacipher = new WirelessSecurityWPACipherImpl(_security_setting, _mainWid->groupUseEncryption, _parentdialog); + TQWidget* wpapsk = new WirelessSecurityWPAPSKImpl(_security_setting, _wireless_setting, _mainWid->groupUseEncryption, _parentdialog); + TQWidget* wepencryption = new WirelessSecurityWEPEncryptionImpl(_security_setting, _mainWid->groupUseEncryption, _parentdialog); wep->setHidden(true); eap->setHidden(true); @@ -903,6 +996,8 @@ void WirelessSecurityWidgetImpl::slotUseEncryptionToggled(bool on) { _wireless_setting->securityRequired = on; + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -933,6 +1028,8 @@ WirelessSecurityWidgetImpl::slotComboSecurityActivated(int index) // should not happen, something is broken... break; } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -993,6 +1090,8 @@ WirelessSecurityWidgetImpl::slotExtraSettingsToggled(bool on) _mainWid->groupUseEncryption->layout()->remove(*it); (*it)->hide(); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.h index fb6313d..8f5a857 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.h @@ -41,6 +41,7 @@ /* tdenetman headers */ #include "qbidirectionalmap.h" +#include "tdenetman-connection_settings_dialog.h" #include "tdenetman-connection_setting_widget_interface.h" namespace ConnectionSettings @@ -62,7 +63,7 @@ namespace ConnectionSettings , WEPKEY_TYPE_PASSPHRASE }; - WirelessSecurityWEPImpl(TDEWiFiConnection* security, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0); + WirelessSecurityWEPImpl(TDEWiFiConnection* security, TQWidget* parent = 0, ConnectionSettingsDialogImpl* connsettings = 0, const char* name = 0, WFlags fl = 0); TQCString getHashedWEPKey(TQString key, WEPKEY_TYPE type) const; TQCString getWEP128PassphraseHash(TQCString input) const; TQCString String2Hex(TQByteArray bytes, int final_len) const; @@ -78,9 +79,12 @@ namespace ConnectionSettings void slotWepIdx1Checked(bool); void slotWepIdx2Checked(bool); void slotWepIdx3Checked(bool); + private: TDEWiFiConnection* _security_setting; WEPKEY_TYPE _wepKeyType; + + ConnectionSettingsDialogImpl* _parentdialog; }; class WirelessSecurityWEPEncryptionImpl : public ConnectionSettingWirelessSecurityWEPEncryption @@ -88,9 +92,12 @@ namespace ConnectionSettings Q_OBJECT public: - WirelessSecurityWEPEncryptionImpl(TDEWiFiConnection* security_setting, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0); + WirelessSecurityWEPEncryptionImpl(TDEWiFiConnection* security_setting, TQWidget* parent = 0, ConnectionSettingsDialogImpl* connsettings = 0, const char* name = 0, WFlags fl = 0); + private: TDEWiFiConnection* _security_setting; + + ConnectionSettingsDialogImpl* _parentdialog; }; class WirelessSecurityWPAVersionImpl : public ConnectionSettingWirelessSecurityWPAVersion @@ -98,7 +105,7 @@ namespace ConnectionSettings Q_OBJECT public: - WirelessSecurityWPAVersionImpl(TDEWiFiConnection* security_setting, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0); + WirelessSecurityWPAVersionImpl(TDEWiFiConnection* security_setting, TQWidget* parent = 0, ConnectionSettingsDialogImpl* connsettings = 0, const char* name = 0, WFlags fl = 0); public slots: void slotAuto(bool); @@ -108,6 +115,8 @@ namespace ConnectionSettings private: TDEWiFiConnection* _security_setting; + ConnectionSettingsDialogImpl* _parentdialog; + }; class WirelessSecurityWPACipherImpl : public ConnectionSettingWirelessSecurityWPACipher @@ -123,7 +132,7 @@ namespace ConnectionSettings , WPA_CIPHER_LAST }; public: - WirelessSecurityWPACipherImpl(TDEWiFiConnection* security_setting, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0); + WirelessSecurityWPACipherImpl(TDEWiFiConnection* security_setting, TQWidget* parent = 0, ConnectionSettingsDialogImpl* connsettings = 0, const char* name = 0, WFlags fl = 0); public slots: void slotCipherChangedAuto(bool); @@ -136,6 +145,8 @@ namespace ConnectionSettings private: TDEWiFiConnection* _security_setting; + + ConnectionSettingsDialogImpl* _parentdialog; }; class WirelessSecurityWPAPSKImpl : public ConnectionSettingWirelessSecurityWPAPSK @@ -143,7 +154,7 @@ namespace ConnectionSettings Q_OBJECT public: - WirelessSecurityWPAPSKImpl(TDEWiFiConnection* security_setting, TDEWiFiConnection* wireless_setting, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0); + WirelessSecurityWPAPSKImpl(TDEWiFiConnection* security_setting, TDEWiFiConnection* wireless_setting, TQWidget* parent = 0, ConnectionSettingsDialogImpl* connsettings = 0, const char* name = 0, WFlags fl = 0); TQCString String2Hex(TQByteArray bytes, int final_len) const; public slots: @@ -152,6 +163,8 @@ namespace ConnectionSettings private: TDEWiFiConnection* _security_setting; TDEWiFiConnection* _wireless_setting; + + ConnectionSettingsDialogImpl* _parentdialog; }; class WirelessSecurityEAPImpl : public ConnectionSettingWirelessSecurityEAP @@ -159,7 +172,7 @@ namespace ConnectionSettings Q_OBJECT public: - WirelessSecurityEAPImpl(TDEWiFiConnection* security_setting, WirelessSecurityPhase2Impl* phase2_widget, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0); + WirelessSecurityEAPImpl(TDEWiFiConnection* security_setting, WirelessSecurityPhase2Impl* phase2_widget, TQWidget* parent = 0, ConnectionSettingsDialogImpl* connsettings = 0, const char* name = 0, WFlags fl = 0); public slots: void slotMethodChanged(int index); @@ -172,6 +185,8 @@ namespace ConnectionSettings TDEWiFiConnection* _security_setting; TQBiDirectionalMap _eapIndexMap; WirelessSecurityPhase2Impl* _phase2_widget; + + ConnectionSettingsDialogImpl* _parentdialog; }; class WirelessSecurityPhase2Impl : public ConnectionSettingWirelessSecurityPhase2 @@ -179,7 +194,7 @@ namespace ConnectionSettings Q_OBJECT public: - WirelessSecurityPhase2Impl(TDEWiFiConnection* security_setting, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0); + WirelessSecurityPhase2Impl(TDEWiFiConnection* security_setting, TQWidget* parent = 0, ConnectionSettingsDialogImpl* connsettings = 0, const char* name = 0, WFlags fl = 0); public slots: void setAllowedPhase2Methods(const TQValueList&); void slotPhase2MethodChanged(int index); @@ -189,6 +204,8 @@ namespace ConnectionSettings TDEWiFiConnection* _security_setting; TQBiDirectionalMap _eapIndexMap; TQValueList _allowed_methods; + + ConnectionSettingsDialogImpl* _parentdialog; }; class WirelessSecurityWidgetImpl : public WidgetInterface @@ -234,6 +251,8 @@ namespace ConnectionSettings ConnectionSettingWirelessSecurityWidget* _mainWid; bool _new_conn; TQMap _securityComboMap; + + ConnectionSettingsDialogImpl* _parentdialog; }; } diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp index 0b88c83..80f4f5b 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp @@ -72,6 +72,8 @@ class NetworkListViewItem : public KListViewItem WirelessWidgetImpl::WirelessWidgetImpl(TDENetworkConnection* conn, bool new_conn, TQByteArray preselect_ssid, TQWidget* parent, const char* name, WFlags fl) : WidgetInterface(parent, name, fl) { + _parentdialog = dynamic_cast(parent); + _wireless_setting = dynamic_cast(conn); _info_setting = dynamic_cast(conn); _security_setting = dynamic_cast(conn); @@ -153,6 +155,8 @@ void WirelessWidgetImpl::slotEssidChanged(TQListViewItem* item) // update the textbox to match the selected essid _mainWid->txtEssid->setText(net_item->_net.getDisplaySsid()); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -165,6 +169,8 @@ WirelessWidgetImpl::slotEssidDoubleClicked(TQListViewItem* item, const TQPoint& // essid selected with double click -> goto the next setting emit next(); } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } @@ -182,6 +188,8 @@ WirelessWidgetImpl::slotEssidChanged(const TQString& new_essid) essid.resize(essid.size() - 1); updateEssid(essid); + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } void @@ -197,6 +205,8 @@ WirelessWidgetImpl::updateEssid(const TQByteArray& essid) _info_setting->friendlyName = "<" + i18n("hidden") + ">"; } } + + if (_parentdialog) _parentdialog->slotEnableButtons(); // Update lockouts } TQByteArray WirelessWidgetImpl::byteArrayFromHexString(const TQCString& str) diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.h index 843c419..b0b8ff0 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.h @@ -31,6 +31,7 @@ #include #include "tdenetman-connection_setting_widget_interface.h" +#include "tdenetman-connection_settings_dialog.h" #include "connection_setting_wireless.h" class KListViewSearchLineWidget; @@ -70,6 +71,8 @@ namespace ConnectionSettings KListViewSearchLineWidget* _searchLine; bool _new_conn; TQByteArray _preselect_ssid; + + ConnectionSettingsDialogImpl* _parentdialog; }; } #endif /* KNETWORKMANAGER_CONNECTION_SETTING_WIRELESS_WIDGET_H*/ diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_settings_dialog.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_settings_dialog.cpp index e0af90b..7b98819 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_settings_dialog.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_settings_dialog.cpp @@ -32,17 +32,14 @@ #include #include -// kde headers +// tde headers #include #include #include #include +#include -// TQt DBus headers -#include -#include - -// knm headers +// tdenm headers #include "tdenetman-connection_setting_widget_interface.h" #include "tdenetman-connection_settings_dialog.h" #include "tdenetman-connection_setting_cdma_widget.h" @@ -95,10 +92,10 @@ ConnectionSettingsDialogImpl::createWidgetsForWireless(TDENetworkConnection* con TQValueList ret; // widgetlist for wireless connection - ret.append(new ConnectionSettings::WirelessWidgetImpl(conn, new_conn)); - ret.append(new ConnectionSettings::WirelessSecurityWidgetImpl(conn, new_conn)); - ret.append(new ConnectionSettings::IPv4WidgetImpl(conn)); - ret.append(new ConnectionSettings::InfoWidgetImpl(conn)); + ret.append(new ConnectionSettings::WirelessWidgetImpl(conn, new_conn, TQByteArray(), this)); + ret.append(new ConnectionSettings::WirelessSecurityWidgetImpl(conn, new_conn, this)); + ret.append(new ConnectionSettings::IPv4WidgetImpl(conn, this)); + ret.append(new ConnectionSettings::InfoWidgetImpl(conn, this)); if (ret.isEmpty()) { @@ -114,20 +111,11 @@ ConnectionSettingsDialogImpl::createWidgetsForWirelessKnownESSID(TDENetworkConne { TQValueList ret; -// // Set ESSID -// TDEWiFiConnection* _wireless_setting = dynamic_cast(conn); -// _wireless_setting->SSID = essid; -// // The connection has no name yet -> just take the essid for it -// _wireless_setting->friendlyName = TQString(essid); -// if (_wireless_setting->friendlyName == "") { -// _wireless_setting->friendlyName = "<" + i18n("hidden") + ">"; -// } - // widgetlist for wireless connection - ret.append(new ConnectionSettings::WirelessWidgetImpl(conn, new_conn, essid)); - ret.append(new ConnectionSettings::WirelessSecurityWidgetImpl(conn, new_conn)); - ret.append(new ConnectionSettings::IPv4WidgetImpl(conn)); - ret.append(new ConnectionSettings::InfoWidgetImpl(conn)); + ret.append(new ConnectionSettings::WirelessWidgetImpl(conn, new_conn, essid, this)); + ret.append(new ConnectionSettings::WirelessSecurityWidgetImpl(conn, new_conn, this)); + ret.append(new ConnectionSettings::IPv4WidgetImpl(conn, this)); + ret.append(new ConnectionSettings::InfoWidgetImpl(conn, this)); if (ret.isEmpty()) { @@ -144,8 +132,8 @@ ConnectionSettingsDialogImpl::createWidgetsForWired(TDENetworkConnection* conn, TQValueList ret; // widgetlist for wired connection - ret.append(new ConnectionSettings::IPv4WidgetImpl(conn)); - ret.append(new ConnectionSettings::InfoWidgetImpl(conn)); + ret.append(new ConnectionSettings::IPv4WidgetImpl(conn, this)); + ret.append(new ConnectionSettings::InfoWidgetImpl(conn, this)); return ret; } @@ -156,8 +144,8 @@ ConnectionSettingsDialogImpl::createWidgetsForVPN(TDENetworkConnection* conn, bo TQValueList ret; // widgetlist for wired connection -// ret.append(new ConnectionSettings::VPNWidgetImpl(conn, new_conn)); - ret.append(new ConnectionSettings::InfoWidgetImpl(conn)); +// ret.append(new ConnectionSettings::VPNWidgetImpl(conn, new_conn, this)); + ret.append(new ConnectionSettings::InfoWidgetImpl(conn, this)); return ret; } @@ -168,11 +156,11 @@ ConnectionSettingsDialogImpl::createWidgetsForCDMA(TDENetworkConnection* conn, b TQValueList ret; // widgetlist for wired connection - ret.append(new ConnectionSettings::CDMAWidgetImpl(conn)); - ret.append(new ConnectionSettings::SerialWidgetImpl(conn)); - ret.append(new ConnectionSettings::PPPWidgetImpl(conn)); - ret.append(new ConnectionSettings::IPv4WidgetImpl(conn)); - ret.append(new ConnectionSettings::InfoWidgetImpl(conn)); + ret.append(new ConnectionSettings::CDMAWidgetImpl(conn, this)); + ret.append(new ConnectionSettings::SerialWidgetImpl(conn, this)); + ret.append(new ConnectionSettings::PPPWidgetImpl(conn, this)); + ret.append(new ConnectionSettings::IPv4WidgetImpl(conn, this)); + ret.append(new ConnectionSettings::InfoWidgetImpl(conn, this)); return ret; } @@ -183,11 +171,11 @@ ConnectionSettingsDialogImpl::createWidgetsForGSM(TDENetworkConnection* conn, bo TQValueList ret; // widgetlist for wired connection - ret.append(new ConnectionSettings::GSMWidgetImpl(conn)); - ret.append(new ConnectionSettings::PPPWidgetImpl(conn)); - ret.append(new ConnectionSettings::SerialWidgetImpl(conn)); - ret.append(new ConnectionSettings::IPv4WidgetImpl(conn)); - ret.append(new ConnectionSettings::InfoWidgetImpl(conn)); + ret.append(new ConnectionSettings::GSMWidgetImpl(conn, this)); + ret.append(new ConnectionSettings::PPPWidgetImpl(conn, this)); + ret.append(new ConnectionSettings::SerialWidgetImpl(conn, this)); + ret.append(new ConnectionSettings::IPv4WidgetImpl(conn, this)); + ret.append(new ConnectionSettings::InfoWidgetImpl(conn, this)); return ret; } @@ -358,16 +346,18 @@ ConnectionSettingsDialogImpl::slotNext() // let the widget know about it being the active one widget = dynamic_cast(wstackSettings->widget(*current)); - if (widget) + if (widget) { deactivateWidget(widget); + } // next widget current++; // let the widget know about it being the active one widget = dynamic_cast(wstackSettings->widget(*current)); - if (widget) + if (widget) { activateWidget(widget); + } } slotEnableButtons(); } @@ -382,16 +372,18 @@ ConnectionSettingsDialogImpl::slotBack() // let the widget know about it being the active one widget = dynamic_cast(wstackSettings->widget(*current)); - if (widget) + if (widget) { deactivateWidget(widget); + } // one back current--; // let the widget know about it being the active one widget = dynamic_cast(wstackSettings->widget(*current)); - if (widget) + if (widget) { activateWidget(widget); + } } slotEnableButtons(); } @@ -451,7 +443,16 @@ ConnectionSettingsDialogImpl::slotEnableButtons() */ if (_conn) { TDEGlobalNetworkManager* nm = KGlobal::networkManager(); - btnConnect->setEnabled(nm->verifyConnectionSettings(_conn)); + TDENetworkErrorStringMap errorStringMap; + TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags errorFlags; + bool ret; + ret = nm->verifyConnectionSettings(_conn, &errorFlags, &errorStringMap); + btnConnect->setEnabled(ret); + if (!ret) { + // FIXME + // Check the error flags and the current dialog type to determine if an error message is warranted + // KMessageBox::error(this, errorString, i18n("Invalid Settings Detected")); + } pbSave->setEnabled(nm->verifyConnectionSettings(_conn)); } } diff --git a/tdenetworkmanager/src/tdenetman-cellular_device_tray.cpp b/tdenetworkmanager/src/tdenetman-cellular_device_tray.cpp index 30dd26a..e43275b 100644 --- a/tdenetworkmanager/src/tdenetman-cellular_device_tray.cpp +++ b/tdenetworkmanager/src/tdenetman-cellular_device_tray.cpp @@ -30,7 +30,7 @@ #include #include -// KNM includes +// TDENM includes #include "tdenetman-cellular_device_tray.h" #include "tdenetman-menuitem.h" #include "tdenetman-menu_subhead.h" @@ -51,7 +51,6 @@ class CellularDeviceTrayPrivate void CellularDeviceTray::newConnection() { TDEGlobalNetworkManager* nm = KGlobal::networkManager(); - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); // create an appropriate connection @@ -75,7 +74,6 @@ void CellularDeviceTray::newConnection() void CellularDeviceTray::addMenuItems(KPopupMenu* menu) { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); // device title @@ -123,6 +121,7 @@ void CellularDeviceTray::addMenuItems(KPopupMenu* menu) CellularDeviceTray::CellularDeviceTray (TQString dev, KSystemTray * parent, const char * name) : DeviceTrayComponent (dev, parent, name) { + hwdevices = KGlobal::hardwareDevices(); d = new CellularDeviceTrayPrivate(); d->dev = dev; diff --git a/tdenetworkmanager/src/tdenetman-cellular_device_tray.h b/tdenetworkmanager/src/tdenetman-cellular_device_tray.h index 28de864..e5aa4cf 100644 --- a/tdenetworkmanager/src/tdenetman-cellular_device_tray.h +++ b/tdenetworkmanager/src/tdenetman-cellular_device_tray.h @@ -50,6 +50,7 @@ class CellularDeviceTray : public DeviceTrayComponent private: CellularDeviceTrayPrivate* d; + TDEHardwareDevices* hwdevices; }; #endif /* KNETWORKMANAGER_CELLULAR_DEVICE_TRAY_H */ diff --git a/tdenetworkmanager/src/tdenetman-connection_editor.cpp b/tdenetworkmanager/src/tdenetman-connection_editor.cpp index 6ea466f..906e158 100644 --- a/tdenetworkmanager/src/tdenetman-connection_editor.cpp +++ b/tdenetworkmanager/src/tdenetman-connection_editor.cpp @@ -191,9 +191,6 @@ void ConnectionEditorImpl::slotEditCurrentConnection() ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, false, TQByteArray(), this, "connect_something", false, TQt::WDestructiveClose); dlg->show(); - - // save all connections (if not done already) - nm->saveConnection(conn); } diff --git a/tdenetworkmanager/src/tdenetman-tray.cpp b/tdenetworkmanager/src/tdenetman-tray.cpp index 4f1e2bc..19af694 100644 --- a/tdenetworkmanager/src/tdenetman-tray.cpp +++ b/tdenetworkmanager/src/tdenetman-tray.cpp @@ -669,13 +669,13 @@ void Tray::updateActiveConnection(TDENetworkConnectionStatus::TDENetworkConnecti void Tray::slotDeviceAddedNotify(TDENetworkDevice* dev) { kdDebug() << "Tray::slotDeviceAddedNotify" << endl; - KNotifyClient::event( winId(), "knm-nm-device-added", i18n("New network device %1 found").arg(dev->deviceNode()) ); + KNotifyClient::event( winId(), "tdenm-nm-device-added", i18n("New network device %1 found").arg(dev->deviceNode()) ); } void Tray::slotDeviceRemovedNotify(TDENetworkDevice* dev) { kdDebug() << "Tray::slotDeviceRemovedNotify" << endl; - KNotifyClient::event( winId(), "knm-nm-device-removed", i18n("Network device %1 removed").arg(dev->deviceNode()) ); + KNotifyClient::event( winId(), "tdenm-nm-device-removed", i18n("Network device %1 removed").arg(dev->deviceNode()) ); } void Tray::slotStateChangedNotify(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags newState, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags prevState) @@ -684,16 +684,16 @@ void Tray::slotStateChangedNotify(TDENetworkGlobalManagerFlags::TDENetworkGlobal // change tray icon according to NM's state if (nm_state & TDENetworkGlobalManagerFlags::EstablishingLink) { - KNotifyClient::event( winId(), "knm-nm-connecting", i18n("NetworkManager is connecting") ); + KNotifyClient::event( winId(), "tdenm-nm-connecting", i18n("NetworkManager is connecting") ); } else if (nm_state & TDENetworkGlobalManagerFlags::Disconnected) { - KNotifyClient::event( winId(), "knm-nm-disconnected", i18n("NetworkManager is now disconnected") ); + KNotifyClient::event( winId(), "tdenm-nm-disconnected", i18n("NetworkManager is now disconnected") ); } else if (nm_state & TDENetworkGlobalManagerFlags::Connected) { - KNotifyClient::event( winId(), "knm-nm-connected", i18n("NetworkManager is now connected") ); + KNotifyClient::event( winId(), "tdenm-nm-connected", i18n("NetworkManager is now connected") ); } else if (nm_state & TDENetworkGlobalManagerFlags::Sleeping) { - KNotifyClient::event( winId(), "knm-nm-sleeping", i18n("TDENetworkManager Offline") ); + KNotifyClient::event( winId(), "tdenm-nm-sleeping", i18n("TDENetworkManager Offline") ); } else if (nm_state & TDENetworkGlobalManagerFlags::Unknown) { // diff --git a/tdenetworkmanager/src/tdenetman-wired_device_tray.cpp b/tdenetworkmanager/src/tdenetman-wired_device_tray.cpp index 79415b9..8855cd2 100644 --- a/tdenetworkmanager/src/tdenetman-wired_device_tray.cpp +++ b/tdenetworkmanager/src/tdenetman-wired_device_tray.cpp @@ -44,7 +44,7 @@ #include -// KNM includes +// TDENM includes #include "tdenetman-wired_device_tray.h" #include "tdenetman-menuitem.h" #include "tdenetman-menu_subhead.h" @@ -78,7 +78,6 @@ void WiredDeviceTray::newConnection() void WiredDeviceTray::addMenuItems(KPopupMenu* menu) { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); // device title @@ -141,6 +140,7 @@ void WiredDeviceTray::addMenuItems(KPopupMenu* menu) WiredDeviceTray::WiredDeviceTray (TQString dev, KSystemTray * parent, const char * name ) : DeviceTrayComponent (dev, parent, name) { + hwdevices = KGlobal::hardwareDevices(); d = new WiredDeviceTrayPrivate(); d->dev = dev; diff --git a/tdenetworkmanager/src/tdenetman-wired_device_tray.h b/tdenetworkmanager/src/tdenetman-wired_device_tray.h index 6200f91..53d8ad1 100644 --- a/tdenetworkmanager/src/tdenetman-wired_device_tray.h +++ b/tdenetworkmanager/src/tdenetman-wired_device_tray.h @@ -52,6 +52,7 @@ class WiredDeviceTray : public DeviceTrayComponent private: WiredDeviceTrayPrivate* d; + TDEHardwareDevices* hwdevices; }; #endif /* KNETWORKMANAGER_WIRED_DEVICE_TRAY_H */ diff --git a/tdenetworkmanager/src/tdenetman-wireless_device_tray.cpp b/tdenetworkmanager/src/tdenetman-wireless_device_tray.cpp index 98954bc..b9a4623 100644 --- a/tdenetworkmanager/src/tdenetman-wireless_device_tray.cpp +++ b/tdenetworkmanager/src/tdenetman-wireless_device_tray.cpp @@ -42,7 +42,7 @@ #include #include -// KNM includes +// TDENM includes #include "tdenetman-wireless_device_tray.h" #include "tdenetman-wireless_menuitem.h" #include "tdenetman-wireless_network.h" @@ -64,7 +64,6 @@ class WirelessDeviceTrayPrivate TQStringList WirelessDeviceTray::getToolTipText() { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); TQStringList tooltip = DeviceTrayComponent::getToolTipText(); @@ -139,7 +138,6 @@ TDEWiFiConnection* WirelessDeviceTray::findMatchingConnection(const WirelessNetw void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu) { TDEGlobalNetworkManager* nm = KGlobal::networkManager(); - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); printf("Updating wireless network list\n\r"); @@ -251,7 +249,6 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu) void WirelessDeviceTray::addMenuItems(KPopupMenu* menu) { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); // get the currently active connection @@ -302,7 +299,6 @@ void WirelessDeviceTray::setPixmapForStates(TDENetworkConnectionStatus::TDENetwo void WirelessDeviceTray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString hwAddress) { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); if (dev->macAddress() != hwAddress) { @@ -342,7 +338,6 @@ void WirelessDeviceTray::slotCheckActiveAccessPoint() // the active AP changed, if a connection is already active we have roamed // thus add the bssid to the list of seen bssids - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); // get the currently active connection @@ -372,7 +367,6 @@ void WirelessDeviceTray::slotCheckActiveAccessPoint() void WirelessDeviceTray::apPropertyChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event) { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); if (event == TDENetworkAPEventType::SignalStrengthChanged) { @@ -404,18 +398,17 @@ void WirelessDeviceTray::apPropertyChanged(TDEMACAddress BSSID, TDENetworkAPEven void WirelessDeviceTray::slotAccessPointAdded(TDENetworkWiFiAPInfo* ap) { - KNotifyClient::event( tray()->winId(), "knm-nm-network-found", i18n("TDENetworkManager New Wireless Network Found") ); + KNotifyClient::event( tray()->winId(), "tdenm-nm-network-found", i18n("TDENetworkManager New Wireless Network Found") ); } void WirelessDeviceTray::slotAccessPointRemoved(TDEMACAddress) { - KNotifyClient::event( tray()->winId(), "knm-nm-network-gone", i18n("TDENetworkManager Wireless Network Disappeared") ); + KNotifyClient::event( tray()->winId(), "tdenm-nm-network-gone", i18n("TDENetworkManager Wireless Network Disappeared") ); } void WirelessDeviceTray::tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEvent event, TQString) { if (event == TDEHardwareEvent::HardwareListModified) { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); TDENetworkConnectionManager* deviceConnMan = dev->connectionManager(); @@ -428,7 +421,6 @@ void WirelessDeviceTray::tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEv } void WirelessDeviceTray::tdeAccessPointStatusChangedHandler(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event) { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->dev)); TDENetworkConnectionManager* deviceConnMan = dev->connectionManager(); @@ -452,11 +444,10 @@ void WirelessDeviceTray::tdeAccessPointStatusChangedHandler(TDEMACAddress BSSID, WirelessDeviceTray::WirelessDeviceTray (TQString dev, KSystemTray * parent, const char * name) : DeviceTrayComponent (dev, parent, name) { + hwdevices = KGlobal::hardwareDevices(); d = new WirelessDeviceTrayPrivate(); d->dev = dev; - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); - // we want other icons for wireless devices setPixmapForState(TDENetworkConnectionStatus::Invalid, "wireless_off"); setPixmapForState(TDENetworkConnectionStatus::LinkUnavailable, "wireless_off"); diff --git a/tdenetworkmanager/src/tdenetman-wireless_device_tray.h b/tdenetworkmanager/src/tdenetman-wireless_device_tray.h index c4d639f..ee50a78 100644 --- a/tdenetworkmanager/src/tdenetman-wireless_device_tray.h +++ b/tdenetworkmanager/src/tdenetman-wireless_device_tray.h @@ -27,7 +27,7 @@ #ifndef KNETWORKMANAGER_WIRELESS_DEVICE_TRAY_H #define KNETWORKMANAGER_WIRELESS_DEVICE_TRAY_H -// KNM includes +// TDENM includes #include "tdenetman.h" #include "devicetraycomponent.h" #include "tdenetman-wireless_network.h" @@ -78,6 +78,7 @@ class WirelessDeviceTray : public DeviceTrayComponent TQMap newWirelessPopupSSIDMap; WirelessDeviceTrayPrivate* d; + TDEHardwareDevices* hwdevices; }; diff --git a/tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp b/tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp index 40f28bd..f41483a 100644 --- a/tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp +++ b/tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp @@ -53,7 +53,6 @@ using namespace ConnectionSettings; void WirelessNetworkItem::slotActivate() { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(_dev)); TDEGlobalNetworkManager* nm = KGlobal::networkManager(); @@ -189,6 +188,8 @@ WirelessNetworkItem::WirelessNetworkItem (TQWidget* p, TQString dev, WirelessNet WirelessNetworkItem::WirelessNetworkItem (TQWidget* p, TQString dev, WirelessNetwork& net, bool adhoc) : NetworkMenuItem(dev, NULL, 0, 0 ), TQCustomMenuItem () { + hwdevices = KGlobal::hardwareDevices(); + parent = p; _adhoc = adhoc; _net = net; diff --git a/tdenetworkmanager/src/tdenetman-wireless_menuitem.h b/tdenetworkmanager/src/tdenetman-wireless_menuitem.h index ea9b6a6..6bb5ef4 100644 --- a/tdenetworkmanager/src/tdenetman-wireless_menuitem.h +++ b/tdenetworkmanager/src/tdenetman-wireless_menuitem.h @@ -49,17 +49,17 @@ class WirelessNetworkItem : public NetworkMenuItem, public TQCustomMenuItem { Q_OBJECT - - public: - WirelessNetworkItem (TQWidget*, TQString dev, WirelessNetwork& net, TQString conn, bool adhoc); - WirelessNetworkItem (TQWidget*, TQString dev, WirelessNetwork& net, bool adhoc); - ~WirelessNetworkItem (); - - TQWidget* parent; - TQProgressBar* pbarStrength; - void paint (TQPainter*, const TQColorGroup&, bool, bool, int, int, int, int); - TQSize sizeHint (); + public: + WirelessNetworkItem (TQWidget*, TQString dev, WirelessNetwork& net, TQString conn, bool adhoc); + WirelessNetworkItem (TQWidget*, TQString dev, WirelessNetwork& net, bool adhoc); + ~WirelessNetworkItem (); + + TQWidget* parent; + TQProgressBar* pbarStrength; + + void paint (TQPainter*, const TQColorGroup&, bool, bool, int, int, int, int); + TQSize sizeHint (); public slots: void slotActivate(); @@ -67,21 +67,23 @@ class WirelessNetworkItem : public NetworkMenuItem, public TQCustomMenuItem private: TQString getDisplayText(); - bool _adhoc; + bool _adhoc; WirelessNetwork _net; TQString _dev; TQString _conn; - - /* menu item */ - int _width; - int _height; - int _border; - - /* elements */ - int _textHeight; - int _widgetHeight; - - int _space; + + /* menu item */ + int _width; + int _height; + int _border; + + /* elements */ + int _textHeight; + int _widgetHeight; + + int _space; + + TDEHardwareDevices* hwdevices; }; #endif /* KNETWORKMANAGER_WIRELESSMENUITEM_H */ diff --git a/tdenetworkmanager/src/tdenetman-wireless_network.cpp b/tdenetworkmanager/src/tdenetman-wireless_network.cpp index 5e6770b..91ccffd 100644 --- a/tdenetworkmanager/src/tdenetman-wireless_network.cpp +++ b/tdenetworkmanager/src/tdenetman-wireless_network.cpp @@ -53,11 +53,13 @@ class WirelessNetworkPrivate WirelessNetwork::WirelessNetwork(const WirelessNetwork& other) { + hwdevices = KGlobal::hardwareDevices(); d = new WirelessNetworkPrivate(*other.d); } WirelessNetwork::WirelessNetwork(TQ_UINT32 match) { + hwdevices = KGlobal::hardwareDevices(); d = new WirelessNetworkPrivate(); // which attributes have to match @@ -80,7 +82,6 @@ WirelessNetwork& WirelessNetwork::operator= (const WirelessNetwork& other) bool WirelessNetwork::contains(const TDEMACAddress ap) { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDEGlobalNetworkManager* nm = KGlobal::networkManager(); TDENetworkDevice* dev = dynamic_cast(hwdevices->findByUniqueID(d->aps[ap])); @@ -118,7 +119,6 @@ bool WirelessNetwork::addAP(const TDEMACAddress ap, const TQString dev) const TQByteArray WirelessNetwork::getSsid() const { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDEGlobalNetworkManager* nm = KGlobal::networkManager(); if ( !d->aps.isEmpty() ) { @@ -146,7 +146,6 @@ const TQByteArray WirelessNetwork::getSsid() const TQString WirelessNetwork::getDisplaySsid() const { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDEGlobalNetworkManager* nm = KGlobal::networkManager(); if (!d->aps.isEmpty()) { @@ -174,7 +173,6 @@ TQString WirelessNetwork::getDisplaySsid() const TDENetworkWiFiAPFlags::TDENetworkWiFiAPFlags WirelessNetwork::getFlags() const { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDEGlobalNetworkManager* nm = KGlobal::networkManager(); TDENetworkWiFiAPFlags::TDENetworkWiFiAPFlags flags = TDENetworkWiFiAPFlags::None; @@ -199,7 +197,6 @@ TDENetworkWiFiAPFlags::TDENetworkWiFiAPFlags WirelessNetwork::getFlags() const TDENetworkWiFiAPFlags::TDENetworkWiFiAPFlags WirelessNetwork::getWpaFlags() const { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDEGlobalNetworkManager* nm = KGlobal::networkManager(); TDENetworkWiFiAPFlags::TDENetworkWiFiAPFlags flags = TDENetworkWiFiAPFlags::None; @@ -224,7 +221,6 @@ TDENetworkWiFiAPFlags::TDENetworkWiFiAPFlags WirelessNetwork::getWpaFlags() cons TDENetworkWiFiAPFlags::TDENetworkWiFiAPFlags WirelessNetwork::getRsnFlags() const { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDEGlobalNetworkManager* nm = KGlobal::networkManager(); TDENetworkWiFiAPFlags::TDENetworkWiFiAPFlags flags = TDENetworkWiFiAPFlags::None; @@ -254,7 +250,6 @@ bool WirelessNetwork::isEncrypted() const TQ_UINT8 WirelessNetwork::getStrength() const { - TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); TDEGlobalNetworkManager* nm = KGlobal::networkManager(); TQ_UINT8 strength = 0; diff --git a/tdenetworkmanager/src/tdenetman-wireless_network.h b/tdenetworkmanager/src/tdenetman-wireless_network.h index 473dbb6..8aec5cc 100644 --- a/tdenetworkmanager/src/tdenetman-wireless_network.h +++ b/tdenetworkmanager/src/tdenetman-wireless_network.h @@ -86,7 +86,8 @@ class WirelessNetwork bool operator==(const WirelessNetwork&); private: - WirelessNetworkPrivate * d; + WirelessNetworkPrivate * d; + TDEHardwareDevices* hwdevices; }; #endif /* KNETWORKMANAGER_WIRELESS_NETWORK_H */