mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-05 00:22:31 +02:00
TWK-989: Check for changed() when updating proxy settings
This commit is contained in:
parent
069c25ec95
commit
3109acc740
@ -270,9 +270,6 @@ SettingsDialog::saveSettings()
|
||||
s->applyChanges();
|
||||
s->sync();
|
||||
|
||||
if ( m_restartRequired )
|
||||
QMessageBox::information( 0, tr( "Information" ), tr( "Some changed settings will not take effect until Tomahawk is restarted" ) );
|
||||
|
||||
TomahawkUtils::NetworkProxyFactory* proxyFactory = TomahawkUtils::proxyFactory();
|
||||
if ( !m_advancedWidgetUi->enableProxyCheckBox->isChecked() )
|
||||
{
|
||||
@ -290,6 +287,9 @@ SettingsDialog::saveSettings()
|
||||
proxyFactory->setNoProxyHosts( s->proxyNoProxyHosts().split( ' ', QString::SkipEmptyParts ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_restartRequired || proxyFactory->changed() )
|
||||
QMessageBox::information( 0, tr( "Information" ), tr( "Some changed settings will not take effect until Tomahawk is restarted" ) );
|
||||
}
|
||||
|
||||
|
||||
@ -364,6 +364,7 @@ void
|
||||
SettingsDialog::toggleProxyEnabled()
|
||||
{
|
||||
m_advancedWidgetUi->proxyButton->setEnabled( m_advancedWidgetUi->enableProxyCheckBox->isChecked() );
|
||||
m_restartRequired = (TomahawkSettings::instance()->proxyType() == QNetworkProxy::Socks5Proxy) != m_advancedWidgetUi->proxyButton->isEnabled();
|
||||
}
|
||||
|
||||
|
||||
|
@ -467,6 +467,11 @@ NetworkProxyFactory::setNoProxyHosts( const QStringList& hosts )
|
||||
void
|
||||
NetworkProxyFactory::setProxy( const QNetworkProxy& proxy )
|
||||
{
|
||||
|
||||
m_proxyChanged = false;
|
||||
if( m_proxy != proxy )
|
||||
m_proxyChanged = true;
|
||||
|
||||
m_proxy = proxy;
|
||||
QFlags< QNetworkProxy::Capability > proxyCaps;
|
||||
proxyCaps |= QNetworkProxy::TunnelingCapability;
|
||||
|
@ -67,6 +67,7 @@ namespace TomahawkUtils
|
||||
public:
|
||||
NetworkProxyFactory()
|
||||
: m_proxy( QNetworkProxy::NoProxy )
|
||||
, m_proxyChanged( false )
|
||||
{}
|
||||
|
||||
NetworkProxyFactory( const NetworkProxyFactory &other );
|
||||
@ -81,10 +82,11 @@ namespace TomahawkUtils
|
||||
|
||||
virtual NetworkProxyFactory& operator=( const NetworkProxyFactory &rhs );
|
||||
virtual bool operator==( const NetworkProxyFactory &other ) const;
|
||||
|
||||
bool changed() const { return m_proxyChanged; }
|
||||
private:
|
||||
QStringList m_noProxyHosts;
|
||||
QNetworkProxy m_proxy;
|
||||
bool m_proxyChanged;
|
||||
};
|
||||
|
||||
DLLEXPORT bool headless();
|
||||
|
Loading…
x
Reference in New Issue
Block a user