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'
This commit is contained in:
Miguel Jacq 2018-02-11 17:16:52 +11:00
parent ed179922d4
commit afc9568f30
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
4 changed files with 14 additions and 9 deletions

View file

@ -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

View file

@ -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):
"""

View file

@ -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; }'

View file

@ -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, {}"
}