[Pkg-privacy-commits] [onionshare] 184/256: Disable settings while an OnionShare server is active
Ulrike Uhlig
ulrike at moszumanska.debian.org
Fri May 26 12:53:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
ulrike pushed a commit to branch master
in repository onionshare.
commit eb708973c85ad1a687b85e726685005d9edb93df
Author: Micah Lee <micah at micahflee.com>
Date: Tue May 16 15:41:35 2017 -0700
Disable settings while an OnionShare server is active
---
onionshare_gui/onionshare_gui.py | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py
index 6471aa4..6345911 100644
--- a/onionshare_gui/onionshare_gui.py
+++ b/onionshare_gui/onionshare_gui.py
@@ -118,12 +118,12 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.status_bar.setSizeGripEnabled(False)
version_label = QtWidgets.QLabel('v{0:s}'.format(common.get_version()))
version_label.setStyleSheet('color: #666666')
- settings_button = QtWidgets.QPushButton()
- settings_button.setDefault(False)
- settings_button.setIcon( QtGui.QIcon(common.get_resource_path('images/settings.png')) )
- settings_button.clicked.connect(self.open_settings)
+ self.settings_button = QtWidgets.QPushButton()
+ self.settings_button.setDefault(False)
+ self.settings_button.setIcon( QtGui.QIcon(common.get_resource_path('images/settings.png')) )
+ self.settings_button.clicked.connect(self.open_settings)
self.status_bar.addPermanentWidget(version_label)
- self.status_bar.addPermanentWidget(settings_button)
+ self.status_bar.addPermanentWidget(self.settings_button)
self.setStatusBar(self.status_bar)
# Status bar, zip progress bar
@@ -148,6 +148,9 @@ class OnionShareGui(QtWidgets.QMainWindow):
# Always start with focus on file selection
self.file_selection.setFocus()
+ # The server isn't active yet
+ self.set_server_active(False)
+
def _tor_connection_canceled(self):
"""
If the user cancels before Tor finishes connecting, ask if they want to
@@ -194,6 +197,8 @@ class OnionShareGui(QtWidgets.QMainWindow):
"""
common.log('OnionShareGui', 'start_server')
+ self.set_server_active(True)
+
# First, load settings and configure
settings = Settings()
settings.load()
@@ -280,6 +285,8 @@ class OnionShareGui(QtWidgets.QMainWindow):
"""
common.log('OnionShareGui', 'start_server_error')
+ self.set_server_active(False)
+
Alert(error, QtWidgets.QMessageBox.Warning)
self.server_status.stop_server()
self.status_bar.clearMessage()
@@ -296,6 +303,8 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.filesize_warning.hide()
self.stop_server_finished.emit()
+ self.set_server_active(False)
+
@staticmethod
def _compute_total_size(filenames):
total_size = 0
@@ -378,6 +387,12 @@ class OnionShareGui(QtWidgets.QMainWindow):
"""
self.status_bar.clearMessage()
+ def set_server_active(self, active):
+ """
+ Disable the Settings button while an OnionShare server is active.
+ """
+ self.settings_button.setEnabled(not active)
+
def closeEvent(self, e):
common.log('OnionShareGui', 'closeEvent')
try:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git
More information about the Pkg-privacy-commits
mailing list