Skip to content

Commit

Permalink
Disabled the proxy input fields when None is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Maran committed Oct 9, 2012
1 parent 3ce5eef commit c1fa13d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/gui_qt.py
Expand Up @@ -1406,6 +1406,19 @@ def set_protocol(protocol):
proxy_port.setFixedWidth(50)
proxy_mode.addItems(['NONE', 'SOCKS4', 'SOCKS5', 'HTTP'])

def check_for_disable(index = False):
if proxy_mode.currentText() != 'NONE':
proxy_host.setEnabled(True)
proxy_port.setEnabled(True)
else:
proxy_host.setEnabled(False)
proxy_port.setEnabled(False)

check_for_disable()

proxy_mode.connect(proxy_mode, SIGNAL('currentIndexChanged(int)'), check_for_disable)


proxy_config = interface.proxy if interface.proxy else { "mode":"none", "host":"localhost", "port":"8080"}
proxy_mode.setCurrentIndex(proxy_mode.findText(str(proxy_config.get("mode").upper())))
proxy_host.setText(proxy_config.get("host"))
Expand Down

2 comments on commit c1fa13d

@ecdsa
Copy link
Member

@ecdsa ecdsa commented on c1fa13d Oct 10, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, it works for me. I would also disable the whole proxy setting when the --proxy option is used (see forum thread)

@maran
Copy link
Contributor

@maran maran commented on c1fa13d Oct 10, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I read it, I will add that in as well. :)

Please sign in to comment.