From 749ca6312d74530bb4926a4f725e0295464c78c2 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 8 Feb 2018 11:32:34 +1100 Subject: [PATCH 01/25] Fix shutdown timer and insert larger messages as word-wrapped widgets into the Status Bar --- onionshare_gui/onionshare_gui.py | 33 +++++++++++++++++++++++++++----- onionshare_gui/server_status.py | 21 +------------------- share/locale/en.json | 2 +- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 7fdc3491..60788c36 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -139,6 +139,10 @@ class OnionShareGui(QtWidgets.QMainWindow): # Status bar, zip progress bar self._zip_progress_bar = None + # Status bar, other larger messages + self._close_on_timeout_label = None + self._closing_automatically_label = None + self._timeout_download_still_running_label = None # Persistent URL notification self.persistent_url_label = QtWidgets.QLabel(strings._('persistent_url_in_use', True)) @@ -315,6 +319,16 @@ class OnionShareGui(QtWidgets.QMainWindow): self.downloads_container.hide() self.downloads.reset_downloads() self.status_bar.clearMessage() + # Remove any other widgets from the statusBar + if self._close_on_timeout_label is not None: + self.status_bar.removeWidget(self._close_on_timeout_label) + self._close_on_timeout_label = None + if self._closing_automatically_label is not None: + self.status_bar.removeWidget(self._closing_automatically_label) + self._closing_automatically_label = None + if self._timeout_download_still_running_label is not None: + self.status_bar.removeWidget(self._timeout_download_still_running_label) + self._timeout_download_still_running_label = None # Reset web counters web.download_count = 0 @@ -396,7 +410,7 @@ class OnionShareGui(QtWidgets.QMainWindow): self.filesize_warning.setText(strings._("large_filesize", True)) self.filesize_warning.show() - if self.server_status.timer_enabled: + if self.settings.get('shutdown_timeout'): # Convert the date value to seconds between now and then now = QtCore.QDateTime.currentDateTime() self.timeout = now.secsTo(self.server_status.timeout) @@ -529,7 +543,10 @@ class OnionShareGui(QtWidgets.QMainWindow): # close on finish? if not web.get_stay_open(): self.server_status.stop_server() - self.status_bar.showMessage(strings._('closing_automatically', True)) + self._closing_automatically_label = QtWidgets.QLabel(strings._('closing_automatically', True)) + self._closing_automatically_label.setWordWrap(True) + self.status_bar.clearMessage() + self.status_bar.insertWidget(0, self._closing_automatically_label) else: if self.server_status.status == self.server_status.STATUS_STOPPED: self.downloads.cancel_download(event["data"]["id"]) @@ -544,16 +561,22 @@ class OnionShareGui(QtWidgets.QMainWindow): # If the auto-shutdown timer has stopped, stop the server if self.server_status.status == self.server_status.STATUS_STARTED: - if self.app.shutdown_timer and self.server_status.timer_enabled: + if self.app.shutdown_timer and self.settings.get('shutdown_timeout'): if self.timeout > 0: if not self.app.shutdown_timer.is_alive(): # If there were no attempts to download the share, or all downloads are done, we can stop if web.download_count == 0 or web.done: self.server_status.stop_server() - self.status_bar.showMessage(strings._('close_on_timeout', True)) + self._close_on_timeout_label = QtWidgets.QLabel(strings._('close_on_timeout', True)) + self._close_on_timeout_label.setWordWrap(True) + self.status_bar.clearMessage() + self.status_bar.insertWidget(0, self._close_on_timeout_label) # A download is probably still running - hold off on stopping the share else: - self.status_bar.showMessage(strings._('timeout_download_still_running', True)) + self._timeout_download_still_running_label = QtWidgets.QLabel(strings._('timeout_download_still_running', True)) + self._timeout_download_still_running_label.setWordWrap(True) + self.status_bar.clearMessage() + self.status_bar.insertWidget(0, self._timeout_download_still_running_label) def copy_url(self): """ diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 786deb64..adf064fb 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -47,9 +47,6 @@ class ServerStatus(QtWidgets.QWidget): self.settings = settings - # Helper boolean as this is used in a few places - self.timer_enabled = False - # Shutdown timeout layout self.shutdown_timeout_label = QtWidgets.QLabel(strings._('gui_settings_shutdown_timeout', True)) self.shutdown_timeout = QtWidgets.QDateTimeEdit() @@ -114,22 +111,6 @@ class ServerStatus(QtWidgets.QWidget): self.update() - def shutdown_timeout_toggled(self, checked): - """ - Shutdown timer option was toggled. If checked, show the timer settings. - """ - if checked: - self.timer_enabled = True - # Hide the checkbox, show the options - self.shutdown_timeout_label.show() - # Reset the default timer to 5 minutes into the future after toggling the option on - self.shutdown_timeout.setDateTime(QtCore.QDateTime.currentDateTime().addSecs(300)) - self.shutdown_timeout.show() - else: - self.timer_enabled = False - self.shutdown_timeout_label.hide() - self.shutdown_timeout.hide() - def shutdown_timeout_reset(self): """ Reset the timeout in the UI after stopping a share @@ -212,7 +193,7 @@ class ServerStatus(QtWidgets.QWidget): Toggle starting or stopping the server. """ if self.status == self.STATUS_STOPPED: - if self.timer_enabled: + if self.settings.get('shutdown_timeout'): # Get the timeout chosen, stripped of its seconds. This prevents confusion if the share stops at (say) 37 seconds past the minute chosen self.timeout = self.shutdown_timeout.dateTime().toPyDateTime().replace(second=0, microsecond=0) # If the timeout has actually passed already before the user hit Start, refuse to start the server. diff --git a/share/locale/en.json b/share/locale/en.json index 5473a88f..5e08e57c 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -15,7 +15,7 @@ "other_page_loaded": "Address loaded", "close_on_timeout": "Closing automatically because timeout was reached", "closing_automatically": "Closing automatically because download finished", - "timeout_download_still_running": "Waiting for download to complete before auto-stopping", + "timeout_download_still_running": "Waiting for download to complete before stopping", "large_filesize": "Warning: Sending large files could take hours", "error_tails_invalid_port": "Invalid value, port must be an integer", "error_tails_unknown_root": "Unknown error with Tails root process", From 4d68b1a3dda5f1eb77cb2bde5f0e712b9aeb8f42 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 8 Feb 2018 11:53:56 +1100 Subject: [PATCH 02/25] Friendlier datetime format for the shutdown timer --- onionshare_gui/server_status.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index adf064fb..79fb4d67 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -51,10 +51,11 @@ class ServerStatus(QtWidgets.QWidget): self.shutdown_timeout_label = QtWidgets.QLabel(strings._('gui_settings_shutdown_timeout', True)) self.shutdown_timeout = QtWidgets.QDateTimeEdit() # Set proposed timeout to be 5 minutes into the future + self.shutdown_timeout.setDisplayFormat("HH:mm A MMM d, yy") self.shutdown_timeout.setDateTime(QtCore.QDateTime.currentDateTime().addSecs(300)) # Onion services can take a little while to start, so reduce the risk of it expiring too soon by setting the minimum to 2 min from now self.shutdown_timeout.setMinimumDateTime(QtCore.QDateTime.currentDateTime().addSecs(120)) - self.shutdown_timeout.setCurrentSectionIndex(4) + self.shutdown_timeout.setCurrentSection(QtWidgets.QDateTimeEdit.MinuteSection) shutdown_timeout_layout = QtWidgets.QHBoxLayout() shutdown_timeout_layout.addWidget(self.shutdown_timeout_label) shutdown_timeout_layout.addWidget(self.shutdown_timeout) From 4751334ab1c46cdccdcb704f709222034001e43a Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 8 Feb 2018 12:03:40 +1100 Subject: [PATCH 03/25] Reduce the size of the closing messages so they only wrap 2 lines --- share/locale/en.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/locale/en.json b/share/locale/en.json index 5e08e57c..89d31c82 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -13,9 +13,9 @@ "no_available_port": "Could not start the Onion service as there was no available port.", "download_page_loaded": "Download page loaded", "other_page_loaded": "Address loaded", - "close_on_timeout": "Closing automatically because timeout was reached", - "closing_automatically": "Closing automatically because download finished", - "timeout_download_still_running": "Waiting for download to complete before stopping", + "close_on_timeout": "Stopped because timeout was reached", + "closing_automatically": "Stopped because download finished", + "timeout_download_still_running": "Waiting for download to complete", "large_filesize": "Warning: Sending large files could take hours", "error_tails_invalid_port": "Invalid value, port must be an integer", "error_tails_unknown_root": "Unknown error with Tails root process", From 3e5d51a858fff8a04d25ef183b301c6c6f239942 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 8 Feb 2018 12:25:30 +1100 Subject: [PATCH 04/25] Make status bar styling consistent --- onionshare_gui/onionshare_gui.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 60788c36..05e8b224 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -132,7 +132,17 @@ class OnionShareGui(QtWidgets.QMainWindow): # Status bar self.status_bar = QtWidgets.QStatusBar() self.status_bar.setSizeGripEnabled(False) - self.status_bar.setStyleSheet("QStatusBar::item { border: 0px; }") + statusBar_cssStyleData =""" + QStatusBar { + font-style: italic; + color: #666666; + } + + QStatusBar::item { + border: 0px; + }""" + + self.status_bar.setStyleSheet(statusBar_cssStyleData) self.status_bar.addPermanentWidget(self.server_status_indicator) self.status_bar.addPermanentWidget(self.settings_button) self.setStatusBar(self.status_bar) @@ -545,6 +555,7 @@ class OnionShareGui(QtWidgets.QMainWindow): self.server_status.stop_server() self._closing_automatically_label = QtWidgets.QLabel(strings._('closing_automatically', True)) self._closing_automatically_label.setWordWrap(True) + self._closing_automatically_label.setStyleSheet('QLabel { font-style: italic; color: #666666; padding: 2px; }') self.status_bar.clearMessage() self.status_bar.insertWidget(0, self._closing_automatically_label) else: @@ -568,12 +579,14 @@ class OnionShareGui(QtWidgets.QMainWindow): if web.download_count == 0 or web.done: self.server_status.stop_server() self._close_on_timeout_label = QtWidgets.QLabel(strings._('close_on_timeout', True)) + self._close_on_timeout_label.setStyleSheet('QLabel { font-style: italic; color: #666666; padding: 2px; }') self._close_on_timeout_label.setWordWrap(True) self.status_bar.clearMessage() self.status_bar.insertWidget(0, self._close_on_timeout_label) # A download is probably still running - hold off on stopping the share else: self._timeout_download_still_running_label = QtWidgets.QLabel(strings._('timeout_download_still_running', True)) + self._timeout_download_still_running_label.setStyleSheet('QLabel { font-style: italic; color: #666666; padding: 2px; }') self._timeout_download_still_running_label.setWordWrap(True) self.status_bar.clearMessage() self.status_bar.insertWidget(0, self._timeout_download_still_running_label) From d0f180fdc5bb2b498f6b7e45b5b27f839dfc321c Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 8 Feb 2018 16:02:00 +1100 Subject: [PATCH 05/25] set MinimumSize on the word-wrapped QLabels in the SettingsDialog, which prevents them getting squished when parent is resized smaller --- onionshare_gui/settings_dialog.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index d105ea42..ba9b26ed 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -86,12 +86,14 @@ class SettingsDialog(QtWidgets.QDialog): stealth_details.setWordWrap(True) stealth_details.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction) stealth_details.setOpenExternalLinks(True) + stealth_details.setMinimumSize(stealth_details.sizeHint()) self.stealth_checkbox = QtWidgets.QCheckBox() self.stealth_checkbox.setCheckState(QtCore.Qt.Unchecked) self.stealth_checkbox.setText(strings._("gui_settings_stealth_option", True)) hidservauth_details = QtWidgets.QLabel(strings._('gui_settings_stealth_hidservauth_string', True)) hidservauth_details.setWordWrap(True) + hidservauth_details.setMinimumSize(hidservauth_details.sizeHint()) hidservauth_details.hide() self.hidservauth_copy_button = QtWidgets.QPushButton(strings._('gui_copy_hidservauth', True)) From bc2417c65e2a51012b5fa0e441e2998d7c6c2a7f Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Fri, 9 Feb 2018 07:55:22 +1100 Subject: [PATCH 06/25] Set the URL label to explicitly mention when persistent. Remove older Persistence warning to save clutter. Add ToolTip to explain what Persistence means --- onionshare_gui/onionshare_gui.py | 10 ---------- onionshare_gui/server_status.py | 7 ++++++- share/locale/en.json | 3 ++- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 7fdc3491..75baf3d5 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -140,16 +140,10 @@ class OnionShareGui(QtWidgets.QMainWindow): # Status bar, zip progress bar self._zip_progress_bar = None - # Persistent URL notification - self.persistent_url_label = QtWidgets.QLabel(strings._('persistent_url_in_use', True)) - self.persistent_url_label.setStyleSheet('font-weight: bold; color: #333333;') - self.persistent_url_label.hide() - # Primary action layout primary_action_layout = QtWidgets.QVBoxLayout() primary_action_layout.addWidget(self.server_status) primary_action_layout.addWidget(self.filesize_warning) - primary_action_layout.addWidget(self.persistent_url_label) primary_action_layout.addWidget(self.downloads_container) self.primary_action = QtWidgets.QWidget() self.primary_action.setLayout(primary_action_layout) @@ -409,9 +403,6 @@ class OnionShareGui(QtWidgets.QMainWindow): self.stop_server() self.start_server_error(strings._('gui_server_started_after_timeout')) - if self.settings.get('save_private_key'): - self.persistent_url_label.show() - def start_server_error(self, error): """ If there's an error when trying to start the onion service @@ -443,7 +434,6 @@ class OnionShareGui(QtWidgets.QMainWindow): # Remove ephemeral service, but don't disconnect from Tor self.onion.cleanup(stop_tor=False) self.filesize_warning.hide() - self.persistent_url_label.hide() self.stop_server_finished.emit() self.set_server_active(False) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 786deb64..ec046fa6 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -145,10 +145,15 @@ class ServerStatus(QtWidgets.QWidget): if self.status == self.STATUS_STARTED: self.url_description.show() - if self.settings.get('close_after_first_download'): + if self.settings.get('save_private_key'): + self.url_label.setText(strings._('gui_url_label_persistent', True)) + self.url_label.setToolTip(strings._('gui_url_persistence_warning', True)) + elif self.settings.get('close_after_first_download'): self.url_label.setText(strings._('gui_url_label_one_time', True)) + self.url_label.setToolTip('') else: self.url_label.setText(strings._('gui_url_label', True)) + self.url_label.setToolTip('') self.url_label.show() self.url.setText('http://{0:s}/{1:s}'.format(self.app.onion_host, self.web.slug)) diff --git a/share/locale/en.json b/share/locale/en.json index 5473a88f..4644d21e 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -133,10 +133,11 @@ "gui_server_timeout_expired": "The chosen timeout has already expired.\nPlease update the timeout and then you may start sharing.", "share_via_onionshare": "Share via OnionShare", "gui_save_private_key_checkbox": "Use a persistent address\n(unchecking will delete any saved address)", - "persistent_url_in_use": "This share is using a persistent address", "gui_url_description": "Anyone with this link can download your files using Tor Browser:", "gui_url_label": "Your Download Address", + "gui_url_label_persistent": "Your Persistent Download Address (what's this?)", "gui_url_label_one_time": "Your One-Time Download Address", + "gui_url_persistence_warning": "Every share will have the same URL.

If you want to go back to using one-time URLs, turn off persistence in the Settings.", "gui_status_indicator_stopped": "Ready to Share", "gui_status_indicator_working": "Starting...", "gui_status_indicator_started": "Sharing" From 532d5d5cf0c1650b3bc931090ec269a23882c6dd Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 10 Feb 2018 10:59:01 -0800 Subject: [PATCH 07/25] Instead of disabling the settings button when share is active, hide it, and show it again when the share stops --- install/onionshare.nsi | 2 -- onionshare_gui/onionshare_gui.py | 5 ++--- share/images/settings_inactive.png | Bin 513 -> 0 bytes 3 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 share/images/settings_inactive.png diff --git a/install/onionshare.nsi b/install/onionshare.nsi index e5f989bb..151d36d4 100644 --- a/install/onionshare.nsi +++ b/install/onionshare.nsi @@ -209,7 +209,6 @@ Section "install" File "${BINPATH}\share\images\server_stopped.png" File "${BINPATH}\share\images\server_working.png" File "${BINPATH}\share\images\settings.png" - File "${BINPATH}\share\images\settings_inactive.png" SetOutPath "$INSTDIR\share\locale" File "${BINPATH}\share\locale\cs.json" @@ -388,7 +387,6 @@ FunctionEnd Delete "$INSTDIR\share\images\server_stopped.png" Delete "$INSTDIR\share\images\server_working.png" Delete "$INSTDIR\share\images\settings.png" - Delete "$INSTDIR\share\images\settings_inactive.png" Delete "$INSTDIR\share\license.txt" Delete "$INSTDIR\share\locale\cs.json" Delete "$INSTDIR\share\locale\de.json" diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 75baf3d5..05e01530 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -569,11 +569,10 @@ class OnionShareGui(QtWidgets.QMainWindow): """ Disable the Settings button while an OnionShare server is active. """ - self.settings_button.setEnabled(not active) if active: - self.settings_button.setIcon( QtGui.QIcon(common.get_resource_path('images/settings_inactive.png')) ) + self.settings_button.hide() else: - self.settings_button.setIcon( QtGui.QIcon(common.get_resource_path('images/settings.png')) ) + self.settings_button.show() # Disable settings menu action when server is active self.settingsAction.setEnabled(not active) diff --git a/share/images/settings_inactive.png b/share/images/settings_inactive.png deleted file mode 100644 index 1b35201b804dd4bd20d3272419403735d88c983b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 513 zcmV+c0{;DpP)K z;Kz6j_tlq>CO8tqefA{;k?WlT&%iQJ1IoZcLf&6s6Zit`18hzU#(HdUAc(-oij$nv88`-M|kg zsN@k?cg}yzYz!bUvnk*xVQVUqR-FD-fMUXrerJJE&k8P^*&`G-3N`((veg{^cpby}R+Vgu;0bUW?rGyj$G(JjSOI6ktl}3l00000NkvXXu0mjf Dza!DZ From fe24c543cc1709bca43d57356eb4298dcdf2fd36 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 10 Feb 2018 11:48:14 -0800 Subject: [PATCH 08/25] Added an info label to file selection, to show the total count and size --- onionshare_gui/file_selection.py | 37 ++++++++++++++++++++++++++------ onionshare_gui/onionshare_gui.py | 1 - share/locale/en.json | 3 ++- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py index d52fd017..317edc1a 100644 --- a/onionshare_gui/file_selection.py +++ b/onionshare_gui/file_selection.py @@ -207,15 +207,18 @@ class FileList(QtWidgets.QListWidget): icon = ip.icon(fileinfo) if os.path.isfile(filename): - size = common.human_readable_filesize(fileinfo.size()) + size_bytes = fileinfo.size() + size_readable = common.human_readable_filesize(size_bytes) else: - size = common.human_readable_filesize(common.dir_size(filename)) - item_name = '{0:s} ({1:s})'.format(basename, size) + size_bytes = common.dir_size(filename) + size_readable = common.human_readable_filesize(size_bytes) + item_name = '{0:s} ({1:s})'.format(basename, size_readable) # Create a new item item = QtWidgets.QListWidgetItem(item_name) - item.setToolTip(size) + item.setToolTip(size_readable) item.setIcon(icon) + item.size_bytes = size_bytes # Item's delete button def delete_item(): @@ -252,12 +255,17 @@ class FileSelection(QtWidgets.QVBoxLayout): super(FileSelection, self).__init__() self.server_on = False - # file list + # Info label + self.info_label = QtWidgets.QLabel() + self.info_label.setStyleSheet('QLabel { font-size: 12px; color: #666666; }') + + # File list self.file_list = FileList() self.file_list.currentItemChanged.connect(self.update) self.file_list.files_dropped.connect(self.update) + self.file_list.files_updated.connect(self.update) - # buttons + # Buttons self.add_button = QtWidgets.QPushButton(strings._('gui_add', True)) self.add_button.clicked.connect(self.add) self.delete_button = QtWidgets.QPushButton(strings._('gui_delete', True)) @@ -267,7 +275,8 @@ class FileSelection(QtWidgets.QVBoxLayout): button_layout.addWidget(self.add_button) button_layout.addWidget(self.delete_button) - # add the widgets + # Add the widgets + self.addWidget(self.info_label) self.addWidget(self.file_list) self.addLayout(button_layout) @@ -277,6 +286,20 @@ class FileSelection(QtWidgets.QVBoxLayout): """ Update the GUI elements based on the current state. """ + # Update the info label + file_count = self.file_list.count() + if file_count == 0: + self.info_label.hide() + else: + total_size_bytes = 0 + for index in range(self.file_list.count()): + item = self.file_list.item(index) + total_size_bytes += item.size_bytes + total_size_readable = common.human_readable_filesize(total_size_bytes) + + self.info_label.setText(strings._('gui_file_info', True).format(file_count, total_size_readable)) + self.info_label.show() + # All buttons should be hidden if the server is on if self.server_on: self.add_button.hide() diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 05e01530..5d0999b2 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -182,7 +182,6 @@ class OnionShareGui(QtWidgets.QMainWindow): self.check_for_updates() def update_primary_action(self): - common.log('OnionShareGui', 'update_primary_action') # Resize window self.adjustSize() diff --git a/share/locale/en.json b/share/locale/en.json index 4644d21e..2daff998 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -140,5 +140,6 @@ "gui_url_persistence_warning": "Every share will have the same URL.

If you want to go back to using one-time URLs, turn off persistence in the Settings.", "gui_status_indicator_stopped": "Ready to Share", "gui_status_indicator_working": "Starting...", - "gui_status_indicator_started": "Sharing" + "gui_status_indicator_started": "Sharing", + "gui_file_info": "{} Files, {}" } From 0d40d7c3b2f3bcf0af4e42d3ee278763dc4263f8 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 10 Feb 2018 12:19:55 -0800 Subject: [PATCH 09/25] Add onionshare favicon to index page --- share/html/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/html/index.html b/share/html/index.html index aa91174e..1d795908 100644 --- a/share/html/index.html +++ b/share/html/index.html @@ -2,6 +2,8 @@ OnionShare + + -

{{ filename }} ▼

-

{{ filesize_human }} (compressed)

-

This zip file contains the following contents:

+ +
+
+ +
+ +

OnionShare

+
+ - - + + + {% for info in file_info.dirs %} - - + + + {% endfor %} {% for info in file_info.files %} - - + + + {% endfor %}
TypeNameFilename Size
{{ info.basename }} + + {{ info.basename }} + {{ info.size_human }}
{{ info.basename }} + + {{ info.basename }} + {{ info.size_human }}
diff --git a/share/images/web_file.png b/share/images/web_file.png new file mode 100644 index 0000000000000000000000000000000000000000..1931aff0cb734d2182bbe14533f7dac1b1389987 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX1|+Qw)-3{3Y)RhkE)4%caKYZ?lYt_f1s;*b z3=DinK$vl=HlH+5kiEpy*OmPd6E_2o;Ga3Gw*iGZJY5_^JdVGeev#{d0*CAAwEen& z%L3l)6bwu&=6N6O_`SuPd2aBe`n)3&n$P#VnjFUOu$ke3LuA&0t=D4hlNwuHq8?~k z$n;Fya=_VQ&xZz2?mJgi-=b^3?EKbL4AQ5OB5c(23}j zTVDQ3lq3D6XjO0ALFI;Q<&E02uWgyOO4;{y{6Usa32b%@yX#_eWKL{4(;{%puth*e z^oGm1$W%s~(p6{MKj&zDSdw&(h0{XK`efD~)*FBB_U-4^xyP$<`qQI1*7>~K&h3m| zuF;iz*`%sh+pM(zEsuPBOmff)fk&D%M7S7YuSfplIwi4qQ{e9jS!+vew=A8q?0t36 z{bvjlo?GtuuFkMx)vF8JbblrvOxj!eR=g|Nd1}z-IoX|Cu6+$SS`)z4*}Q$iB}W2K31 literal 0 HcmV?d00001 From b41b89add8d607045a26149468bcdd691dc49a22 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 10 Feb 2018 18:15:44 -0800 Subject: [PATCH 14/25] Designed file list items to look better, prevent scrolling horizintally, and ensuring the delete button does not overlap the filename --- onionshare_gui/file_selection.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py index 317edc1a..72ab9c3b 100644 --- a/onionshare_gui/file_selection.py +++ b/onionshare_gui/file_selection.py @@ -212,14 +212,20 @@ class FileList(QtWidgets.QListWidget): else: size_bytes = common.dir_size(filename) size_readable = common.human_readable_filesize(size_bytes) - item_name = '{0:s} ({1:s})'.format(basename, size_readable) # Create a new item - item = QtWidgets.QListWidgetItem(item_name) - item.setToolTip(size_readable) + item = QtWidgets.QListWidgetItem() item.setIcon(icon) item.size_bytes = size_bytes + # Item's name and size labels + item_name = QtWidgets.QLabel(basename) + item_name.setWordWrap(False) + item_name.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed) + item_name.setStyleSheet('QLabel { color: #000000; font-size: 13px; }') + item_size = QtWidgets.QLabel(size_readable) + item_size.setStyleSheet('QLabel { color: #666666; font-size: 11px; }') + # Item's delete button def delete_item(): itemrow = self.row(item) @@ -232,16 +238,22 @@ class FileList(QtWidgets.QListWidget): item.item_button.setFlat(True) item.item_button.setIcon( QtGui.QIcon(common.get_resource_path('images/file_delete.png')) ) item.item_button.clicked.connect(delete_item) + item.item_button.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) - # Create an item widget to display on the item - item_widget_layout = QtWidgets.QHBoxLayout() - item_widget_layout.addStretch() - item_widget_layout.addWidget(item.item_button) - item_widget = QtWidgets.QWidget() - item_widget.setLayout(item_widget_layout) + # Create the item's widget and layouts + item_vlayout = QtWidgets.QVBoxLayout() + item_vlayout.addWidget(item_name) + item_vlayout.addWidget(item_size) + item_hlayout = QtWidgets.QHBoxLayout() + item_hlayout.addLayout(item_vlayout) + item_hlayout.addWidget(item.item_button) + widget = QtWidgets.QWidget() + widget.setLayout(item_hlayout) + + item.setSizeHint(widget.sizeHint()) self.addItem(item) - self.setItemWidget(item, item_widget) + self.setItemWidget(item, widget) self.files_updated.emit() From feeb1d75757bdb809b352bc4100274314aed8e6f Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 10 Feb 2018 18:25:31 -0800 Subject: [PATCH 15/25] Left-align the client-side file list --- share/html/index.html | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/share/html/index.html b/share/html/index.html index ad5f342d..3b4d5e70 100644 --- a/share/html/index.html +++ b/share/html/index.html @@ -89,8 +89,8 @@ margin-right: 0.5rem; } - table.file-list td:first-child, table.file-list td:last-child { - width: 50%; + table.file-list td:last-child { + width: 100%; } @@ -111,14 +111,12 @@ - {% for info in file_info.dirs %} - -
Filename Size
{{ info.basename }} @@ -129,7 +127,6 @@ {% endfor %} {% for info in file_info.files %}
{{ info.basename }} From dbe0210104163de0f28f0cadd8b89d20e666d71f Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 10 Feb 2018 18:36:38 -0800 Subject: [PATCH 16/25] Make the drop count adjust size based on its sizeHint --- onionshare_gui/file_selection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py index 72ab9c3b..b097e501 100644 --- a/onionshare_gui/file_selection.py +++ b/onionshare_gui/file_selection.py @@ -145,7 +145,8 @@ class FileList(QtWidgets.QListWidget): count = len(event.mimeData().urls()) self.drop_count.setText('+{}'.format(count)) - self.drop_count.setGeometry(self.width() - 60, self.height() - 40, 50, 30) + size_hint = self.drop_count.sizeHint() + self.drop_count.setGeometry(self.width() - size_hint.width() - 10, self.height() - size_hint.height() - 10, size_hint.width(), size_hint.height()) self.drop_count.show() event.accept() else: From 2fb8d1f836db234d41e5d131c1f62518db425d05 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 10 Feb 2018 21:27:45 -0800 Subject: [PATCH 17/25] Tweak css --- share/html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/html/index.html b/share/html/index.html index 3b4d5e70..b274d003 100644 --- a/share/html/index.html +++ b/share/html/index.html @@ -81,7 +81,7 @@ table.file-list td { white-space: nowrap; - padding: 0.5rem 10rem 0.5rem 0.5rem; + padding: 0.5rem 10rem 0.5rem 0.8rem; } table.file-list td img { From afc9568f30b45a838192f1654f06485c38fb28b7 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 11 Feb 2018 17:16:52 +1100 Subject: [PATCH 18/25] Adjust width of window to fit status bar messages, unwrapped, to avoid squishing widgets. Add pluralisation of filemanager total file(s) Use 'timer expired' rather than 'timeout reached' --- onionshare_gui/file_selection.py | 5 ++++- onionshare_gui/onionshare_gui.py | 12 ++++++------ onionshare_gui/server_status.py | 1 + share/locale/en.json | 5 +++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py index b097e501..ba3df69d 100644 --- a/onionshare_gui/file_selection.py +++ b/onionshare_gui/file_selection.py @@ -310,7 +310,10 @@ class FileSelection(QtWidgets.QVBoxLayout): total_size_bytes += item.size_bytes total_size_readable = common.human_readable_filesize(total_size_bytes) - self.info_label.setText(strings._('gui_file_info', True).format(file_count, total_size_readable)) + if file_count > 1: + self.info_label.setText(strings._('gui_file_info', True).format(file_count, total_size_readable)) + else: + self.info_label.setText(strings._('gui_file_info_single', True).format(file_count, total_size_readable)) self.info_label.show() # All buttons should be hidden if the server is on diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 946000e9..f52281de 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -56,7 +56,7 @@ class OnionShareGui(QtWidgets.QMainWindow): self.setWindowTitle('OnionShare') self.setWindowIcon(QtGui.QIcon(common.get_resource_path('images/logo.png'))) - self.setMinimumWidth(350) + self.setMinimumWidth(430) # Load settings self.config = config @@ -152,7 +152,6 @@ class OnionShareGui(QtWidgets.QMainWindow): self._zip_progress_bar = None # Status bar, sharing messages self.server_share_status_label = QtWidgets.QLabel('') - self.server_share_status_label.setWordWrap(True) self.server_share_status_label.setStyleSheet('QLabel { font-style: italic; color: #666666; padding: 2px; }') self.status_bar.insertWidget(0, self.server_share_status_label) @@ -198,15 +197,15 @@ class OnionShareGui(QtWidgets.QMainWindow): self.check_for_updates() def update_primary_action(self): - # Resize window - self.adjustSize() - # Show or hide primary action layout if self.file_selection.file_list.count() > 0: self.primary_action.show() else: self.primary_action.hide() + # Resize window + self.adjustSize() + def update_server_status_indicator(self): common.log('OnionShareGui', 'update_server_status_indicator') @@ -450,9 +449,10 @@ class OnionShareGui(QtWidgets.QMainWindow): # Remove ephemeral service, but don't disconnect from Tor self.onion.cleanup(stop_tor=False) self.filesize_warning.hide() - self.stop_server_finished.emit() + self.file_selection.file_list.adjustSize() self.set_server_active(False) + self.stop_server_finished.emit() def check_for_updates(self): """ diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 5b6fdd52..c292d207 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -81,6 +81,7 @@ class ServerStatus(QtWidgets.QWidget): self.url.setFont(url_font) self.url.setWordWrap(True) self.url.setMinimumHeight(60) + self.url.setMinimumSize(self.url.sizeHint()) self.url.setStyleSheet('QLabel { background-color: #ffffff; color: #000000; padding: 10px; border: 1px solid #666666; }') url_buttons_style = 'QPushButton { color: #3f7fcf; }' diff --git a/share/locale/en.json b/share/locale/en.json index aed92e06..3e3d06c3 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -13,7 +13,7 @@ "no_available_port": "Could not start the Onion service as there was no available port.", "download_page_loaded": "Download page loaded", "other_page_loaded": "Address loaded", - "close_on_timeout": "Stopped because timeout was reached", + "close_on_timeout": "Stopped because timer expired", "closing_automatically": "Stopped because download finished", "timeout_download_still_running": "Waiting for download to complete", "large_filesize": "Warning: Sending large files could take hours", @@ -141,5 +141,6 @@ "gui_status_indicator_stopped": "Ready to Share", "gui_status_indicator_working": "Starting...", "gui_status_indicator_started": "Sharing", - "gui_file_info": "{} Files, {}" + "gui_file_info": "{} Files, {}", + "gui_file_info_single": "{} File, {}" } From 14ece5080755986b706016a156a5adc5a3c76926 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 11 Feb 2018 17:32:45 +1100 Subject: [PATCH 19/25] Clear statusBar messages when the server button is clicked --- onionshare_gui/onionshare_gui.py | 1 + onionshare_gui/server_status.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 5d0999b2..f30bdd2f 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -90,6 +90,7 @@ class OnionShareGui(QtWidgets.QMainWindow): self.starting_server_step2.connect(self.start_server_step2) self.starting_server_step3.connect(self.start_server_step3) self.starting_server_error.connect(self.start_server_error) + self.server_status.button_clicked.connect(self.clear_message) # Filesize warning self.filesize_warning = QtWidgets.QLabel() diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index ec046fa6..6f84f751 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -29,6 +29,7 @@ class ServerStatus(QtWidgets.QWidget): """ server_started = QtCore.pyqtSignal() server_stopped = QtCore.pyqtSignal() + button_clicked = QtCore.pyqtSignal() url_copied = QtCore.pyqtSignal() hidservauth_copied = QtCore.pyqtSignal() @@ -229,6 +230,7 @@ class ServerStatus(QtWidgets.QWidget): self.start_server() elif self.status == self.STATUS_STARTED: self.stop_server() + self.button_clicked.emit() def start_server(self): """ From 5e4a4f66131d3a1c16ad91d6ba2c6240be3f09ac Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 11 Feb 2018 17:42:07 +1100 Subject: [PATCH 20/25] Move the copy URL/HidServAuth notifications to desktop notifications instead of statusbar --- onionshare_gui/onionshare_gui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 5d0999b2..372bf719 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -367,7 +367,6 @@ class OnionShareGui(QtWidgets.QMainWindow): self.starting_server_error.emit(e.strerror) return - #self.status_bar.showMessage(strings._('gui_starting_server2', True)) t = threading.Thread(target=finish_starting_server, kwargs={'self': self}) t.daemon = True t.start() @@ -549,14 +548,16 @@ class OnionShareGui(QtWidgets.QMainWindow): When the URL gets copied to the clipboard, display this in the status bar. """ common.log('OnionShareGui', 'copy_url') - self.status_bar.showMessage(strings._('gui_copied_url', True), 2000) + if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): + self.status_bar.showMessage(strings._('gui_copied_url', True), 2000) def copy_hidservauth(self): """ When the stealth onion service HidServAuth gets copied to the clipboard, display this in the status bar. """ common.log('OnionShareGui', 'copy_hidservauth') - self.status_bar.showMessage(strings._('gui_copied_hidservauth', True), 2000) + if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): + self.status_bar.showMessage(strings._('gui_copied_hidservauth', True), 2000) def clear_message(self): """ From b8cf692cd8d9555a6a0c9a25d867555f7fea02fa Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 11 Feb 2018 17:52:14 +1100 Subject: [PATCH 21/25] actually show those messages in the system tray, not still in the statusbar, and with the mandatory titles --- onionshare_gui/onionshare_gui.py | 4 ++-- share/locale/en.json | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 372bf719..8494c33f 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -549,7 +549,7 @@ class OnionShareGui(QtWidgets.QMainWindow): """ common.log('OnionShareGui', 'copy_url') if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): - self.status_bar.showMessage(strings._('gui_copied_url', True), 2000) + self.systemTray.showMessage(strings._('gui_copied_url_title', True), strings._('gui_copied_url', True)) def copy_hidservauth(self): """ @@ -557,7 +557,7 @@ class OnionShareGui(QtWidgets.QMainWindow): """ common.log('OnionShareGui', 'copy_hidservauth') if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): - self.status_bar.showMessage(strings._('gui_copied_hidservauth', True), 2000) + self.systemTray.showMessage(strings._('gui_copied_hidservauth_title', True), strings._('gui_copied_hidservauth', True)) def clear_message(self): """ diff --git a/share/locale/en.json b/share/locale/en.json index 2daff998..2d1590da 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -44,8 +44,10 @@ "gui_copy_hidservauth": "Copy HidServAuth", "gui_downloads": "Downloads:", "gui_canceled": "Canceled", - "gui_copied_url": "Copied address to clipboard", - "gui_copied_hidservauth": "Copied HidServAuth line to clipboard", + "gui_copied_url_title": "Copied Onion address", + "gui_copied_url": "The Onion address has been copied to clipboard", + "gui_copied_hidservauth_title": "Copied HidServAuth", + "gui_copied_hidservauth": "The HidServAuth line has been copied to clipboard", "gui_starting_server1": "Starting Tor onion service...", "gui_starting_server2": "Crunching files...", "gui_please_wait": "Please wait...", From 779ca765530944863b40d8dc5a0ec78e37d2827c Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 11 Feb 2018 18:32:18 +1100 Subject: [PATCH 22/25] Set URL label tooltips --- install/onionshare.nsi | 2 ++ onionshare_gui/server_status.py | 17 ++++++++++------- share/images/info.png | Bin 0 -> 435 bytes share/locale/en.json | 9 +++++---- 4 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 share/images/info.png diff --git a/install/onionshare.nsi b/install/onionshare.nsi index 55ecdbcb..0a9e6cf2 100644 --- a/install/onionshare.nsi +++ b/install/onionshare.nsi @@ -203,6 +203,7 @@ Section "install" SetOutPath "$INSTDIR\share\images" File "${BINPATH}\share\images\favicon.ico" File "${BINPATH}\share\images\file_delete.png" + File "${BINPATH}\share\images\info.png" File "${BINPATH}\share\images\logo.png" File "${BINPATH}\share\images\logo_transparent.png" File "${BINPATH}\share\images\logo_grayscale.png" @@ -384,6 +385,7 @@ FunctionEnd Delete "$INSTDIR\share\html\index.html" Delete "$INSTDIR\share\images\favicon.ico" Delete "$INSTDIR\share\images\file_delete.png" + Delete "$INSTDIR\share\images\info.png" Delete "$INSTDIR\share\images\logo.png" Delete "$INSTDIR\share\images\logo_transparent.png" Delete "$INSTDIR\share\images\logo_grayscale.png" diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index ec046fa6..3dc29c9a 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -145,15 +145,18 @@ class ServerStatus(QtWidgets.QWidget): if self.status == self.STATUS_STARTED: self.url_description.show() + info_image = common.get_resource_path('images/info.png') + self.url_label.setText(strings._('gui_url_label', True).format(info_image)) + # Show a Tool Tip explaining the lifecycle of this URL if self.settings.get('save_private_key'): - self.url_label.setText(strings._('gui_url_label_persistent', True)) - self.url_label.setToolTip(strings._('gui_url_persistence_warning', True)) - elif self.settings.get('close_after_first_download'): - self.url_label.setText(strings._('gui_url_label_one_time', True)) - self.url_label.setToolTip('') + if self.settings.get('close_after_first_download'): + self.url_label.setToolTip(strings._('gui_url_label_onetime_and_persistent', True)) + else: + self.url_label.setToolTip(strings._('gui_url_label_persistent', True)) + if self.settings.get('close_after_first_download'): + self.url_label.setToolTip(strings._('gui_url_label_onetime', True)) else: - self.url_label.setText(strings._('gui_url_label', True)) - self.url_label.setToolTip('') + self.url_label.setToolTip(strings._('gui_url_label_stay_open', True)) self.url_label.show() self.url.setText('http://{0:s}/{1:s}'.format(self.app.onion_host, self.web.slug)) diff --git a/share/images/info.png b/share/images/info.png new file mode 100644 index 0000000000000000000000000000000000000000..4be4e65e25a9de5a72ab547ea0cb0a88ccb51d49 GIT binary patch literal 435 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$0wn*`OvwRKEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8ZEE?e4UhtqZsbPuAQPYE0nReaf zHmT@qc)%3H6z;6QpqPFu(@jE>tkQj= z+fpZ;+B-ieOkj@mj*rW(m8Lz5n*8|6fu;Gv>-B7QeR`wE;kL|9*S6wN`^t#|E*E9m z%f99$>2>Wi)Bh&RnaewAN&l^+yqYERzB~gY<1iI9cv$SF6?+x zru*Z*sy5>{^Sh@6%cptHh$g5TZds;>#PL1_n=8KbLh*2~7ZLaFgNy literal 0 HcmV?d00001 diff --git a/share/locale/en.json b/share/locale/en.json index 2daff998..5f7f364d 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -134,10 +134,11 @@ "share_via_onionshare": "Share via OnionShare", "gui_save_private_key_checkbox": "Use a persistent address\n(unchecking will delete any saved address)", "gui_url_description": "Anyone with this link can download your files using Tor Browser:", - "gui_url_label": "Your Download Address", - "gui_url_label_persistent": "Your Persistent Download Address (what's this?)", - "gui_url_label_one_time": "Your One-Time Download Address", - "gui_url_persistence_warning": "Every share will have the same URL.

If you want to go back to using one-time URLs, turn off persistence in the Settings.", + "gui_url_label": "Your Download Address ", + "gui_url_label_persistent": "Every share will have the same URL.

If you want to go back to using one-time URLs, turn off persistence in the Settings.", + "gui_url_label_stay_open": "This URL will exist until you stop the share", + "gui_url_label_onetime": "This URL will only exist until the share is stopped or when the first download occurs.", + "gui_url_label_onetime_and_persistent": "This share will stop when first download occurs, but every future share will have the same URL.

If you want to go back to using one-time URLs, turn off persistence in the Settings.", "gui_status_indicator_stopped": "Ready to Share", "gui_status_indicator_working": "Starting...", "gui_status_indicator_started": "Sharing", From e20e8d5181f772b77aa05ec94663fdbce5d850de Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 13 Feb 2018 17:20:10 -0800 Subject: [PATCH 23/25] Switch to 12 hour clock --- onionshare_gui/server_status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index c292d207..a2701e6a 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -51,7 +51,7 @@ class ServerStatus(QtWidgets.QWidget): self.shutdown_timeout_label = QtWidgets.QLabel(strings._('gui_settings_shutdown_timeout', True)) self.shutdown_timeout = QtWidgets.QDateTimeEdit() # Set proposed timeout to be 5 minutes into the future - self.shutdown_timeout.setDisplayFormat("HH:mm A MMM d, yy") + self.shutdown_timeout.setDisplayFormat("hh:mm A MMM d, yy") self.shutdown_timeout.setDateTime(QtCore.QDateTime.currentDateTime().addSecs(300)) # Onion services can take a little while to start, so reduce the risk of it expiring too soon by setting the minimum to 2 min from now self.shutdown_timeout.setMinimumDateTime(QtCore.QDateTime.currentDateTime().addSecs(120)) From 24b025419a34bc89cf61f500989ccf6b5e026ef0 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 13 Feb 2018 17:50:10 -0800 Subject: [PATCH 24/25] Fix bug where persistent tooltips were not displaying --- onionshare_gui/server_status.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 654c4c28..1bd18e2f 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -137,10 +137,11 @@ class ServerStatus(QtWidgets.QWidget): self.url_label.setToolTip(strings._('gui_url_label_onetime_and_persistent', True)) else: self.url_label.setToolTip(strings._('gui_url_label_persistent', True)) - if self.settings.get('close_after_first_download'): - self.url_label.setToolTip(strings._('gui_url_label_onetime', True)) else: - self.url_label.setToolTip(strings._('gui_url_label_stay_open', True)) + if self.settings.get('close_after_first_download'): + self.url_label.setToolTip(strings._('gui_url_label_onetime', True)) + else: + self.url_label.setToolTip(strings._('gui_url_label_stay_open', True)) self.url_label.show() self.url.setText('http://{0:s}/{1:s}'.format(self.app.onion_host, self.web.slug)) From 8db921dfc24eb5276bca9b2465053e57c47cfd99 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 13 Feb 2018 17:58:51 -0800 Subject: [PATCH 25/25] Update tooltip strings, and also copy to clipboard strings --- share/locale/en.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/share/locale/en.json b/share/locale/en.json index 76c36e0f..cda00fcb 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -44,8 +44,8 @@ "gui_copy_hidservauth": "Copy HidServAuth", "gui_downloads": "Downloads:", "gui_canceled": "Canceled", - "gui_copied_url_title": "Copied Onion address", - "gui_copied_url": "The Onion address has been copied to clipboard", + "gui_copied_url_title": "Copied OnionShare address", + "gui_copied_url": "The OnionShare address has been copied to clipboard", "gui_copied_hidservauth_title": "Copied HidServAuth", "gui_copied_hidservauth": "The HidServAuth line has been copied to clipboard", "gui_starting_server1": "Starting Tor onion service...", @@ -137,10 +137,10 @@ "gui_save_private_key_checkbox": "Use a persistent address\n(unchecking will delete any saved address)", "gui_url_description": "Anyone with this link can download your files using Tor Browser:", "gui_url_label": "Your Download Address ", - "gui_url_label_persistent": "Every share will have the same URL.

If you want to go back to using one-time URLs, turn off persistence in the Settings.", - "gui_url_label_stay_open": "This URL will exist until you stop the share", - "gui_url_label_onetime": "This URL will only exist until the share is stopped or when the first download occurs.", - "gui_url_label_onetime_and_persistent": "This share will stop when first download occurs, but every future share will have the same URL.

If you want to go back to using one-time URLs, turn off persistence in the Settings.", + "gui_url_label_persistent": "This share will not stop automatically

Every share will have the same address (to use one-time addresses, disable persistence in the Settings)", + "gui_url_label_stay_open": "This share will not stop automatically", + "gui_url_label_onetime": "This share will stop after the first download", + "gui_url_label_onetime_and_persistent": "This share will stop after the first download

Every share will have the same address (to use one-time addresses, disable persistence in the Settings)", "gui_status_indicator_stopped": "Ready to Share", "gui_status_indicator_working": "Starting...", "gui_status_indicator_started": "Sharing",