diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index ad16731c..54f54582 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -39,7 +39,7 @@ class ServerStatus(QtWidgets.QWidget): STATUS_WORKING = 1 STATUS_STARTED = 2 - def __init__(self, common, qtapp, app, web, file_selection=None): + def __init__(self, common, qtapp, app, web, share_mode, file_selection=None): super(ServerStatus, self).__init__() self.common = common @@ -51,7 +51,9 @@ class ServerStatus(QtWidgets.QWidget): self.web = web # Only used in share mode - self.file_selection = file_selection + self.share_mode = share_mode + if self.share_mode: + self.file_selection = file_selection # Shutdown timeout layout self.shutdown_timeout_label = QtWidgets.QLabel(strings._('gui_settings_shutdown_timeout', True)) @@ -73,7 +75,6 @@ class ServerStatus(QtWidgets.QWidget): self.shutdown_timeout_container.setLayout(shutdown_timeout_container_layout) self.shutdown_timeout_container.hide() - # Server layout self.server_button = QtWidgets.QPushButton() self.server_button.clicked.connect(self.server_button_clicked) @@ -175,7 +176,7 @@ class ServerStatus(QtWidgets.QWidget): button_working_style = 'QPushButton { background-color: #4c8211; color: #ffffff; padding: 10px; border: 0; border-radius: 5px; font-style: italic; }' button_started_style = 'QPushButton { background-color: #d0011b; color: #ffffff; padding: 10px; border: 0; border-radius: 5px; }' - if self.file_selection and self.file_selection.get_num_files() == 0: + if self.share_mode and self.file_selection.get_num_files() == 0: self.server_button.hide() else: self.server_button.show() @@ -183,17 +184,27 @@ class ServerStatus(QtWidgets.QWidget): if self.status == self.STATUS_STOPPED: self.server_button.setStyleSheet(button_stopped_style) self.server_button.setEnabled(True) - self.server_button.setText(strings._('gui_start_server', True)) + if self.share_mode: + self.server_button.setText(strings._('gui_share_start_server', True)) + else: + self.server_button.setText(strings._('gui_receive_start_server', True)) self.server_button.setToolTip('') if self.common.settings.get('shutdown_timeout'): self.shutdown_timeout_container.show() elif self.status == self.STATUS_STARTED: self.server_button.setStyleSheet(button_started_style) self.server_button.setEnabled(True) - self.server_button.setText(strings._('gui_stop_server', True)) + if self.share_mode: + self.server_button.setText(strings._('gui_share_stop_server', True)) + else: + self.server_button.setText(strings._('gui_share_stop_server', True)) if self.common.settings.get('shutdown_timeout'): self.shutdown_timeout_container.hide() - self.server_button.setToolTip(strings._('gui_stop_server_shutdown_timeout_tooltip', True).format(self.timeout)) + if self.share_mode: + self.server_button.setToolTip(strings._('gui_share_stop_server_shutdown_timeout_tooltip', True).format(self.timeout)) + else: + self.server_button.setToolTip(strings._('gui_receive_stop_server_shutdown_timeout_tooltip', True).format(self.timeout)) + elif self.status == self.STATUS_WORKING: self.server_button.setStyleSheet(button_working_style) self.server_button.setEnabled(True) diff --git a/onionshare_gui/share_mode/__init__.py b/onionshare_gui/share_mode/__init__.py index 754bf097..2a13682f 100644 --- a/onionshare_gui/share_mode/__init__.py +++ b/onionshare_gui/share_mode/__init__.py @@ -158,7 +158,7 @@ class ShareMode(QtWidgets.QWidget): if self.timeout > 0: now = QtCore.QDateTime.currentDateTime() seconds_remaining = now.secsTo(self.server_status.timeout) - self.server_status.server_button.setText(strings._('gui_stop_server_shutdown_timeout', True).format(seconds_remaining)) + self.server_status.server_button.setText(strings._('gui_share_stop_server_shutdown_timeout', True).format(seconds_remaining)) 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 self.web.download_count == 0 or self.web.done: diff --git a/share/locale/cs.json b/share/locale/cs.json index 53525ea3..5c40bcdc 100644 --- a/share/locale/cs.json +++ b/share/locale/cs.json @@ -25,8 +25,8 @@ "gui_add": "Přidat", "gui_delete": "Smazat", "gui_choose_items": "Vybrat", - "gui_start_server": "Spustit sdílení", - "gui_stop_server": "Zastavit sdílení", + "gui_share_start_server": "Spustit sdílení", + "gui_share_stop_server": "Zastavit sdílení", "gui_copy_url": "Kopírovat URL", "gui_copy_hidservauth": "Kopírovat HidServAuth", "gui_downloads": "Stahování:", diff --git a/share/locale/da.json b/share/locale/da.json index af0789b9..be4b462f 100644 --- a/share/locale/da.json +++ b/share/locale/da.json @@ -38,8 +38,8 @@ "gui_add": "Tilføj", "gui_delete": "Slet", "gui_choose_items": "Vælg", - "gui_start_server": "Start deling", - "gui_stop_server": "Stop deling", + "gui_share_start_server": "Start deling", + "gui_share_stop_server": "Stop deling", "gui_copy_url": "Kopiér URL", "gui_copy_hidservauth": "Kopiér HidServAuth", "gui_downloads": "Downloads:", diff --git a/share/locale/de.json b/share/locale/de.json index 7347e031..8e87b89b 100644 --- a/share/locale/de.json +++ b/share/locale/de.json @@ -25,8 +25,8 @@ "gui_add": "Hinzufügen", "gui_delete": "Löschen", "gui_choose_items": "Auswählen", - "gui_start_server": "Server starten", - "gui_stop_server": "Server anhalten", + "gui_share_start_server": "Server starten", + "gui_share_stop_server": "Server anhalten", "gui_copy_url": "URL kopieren", "gui_downloads": "Downloads:", "gui_copied_url": "URL wurde in die Zwischenablage kopiert", diff --git a/share/locale/en.json b/share/locale/en.json index 71322735..b59ec25f 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -41,10 +41,14 @@ "gui_add": "Add", "gui_delete": "Delete", "gui_choose_items": "Choose", - "gui_start_server": "Start Sharing", - "gui_stop_server": "Stop Sharing", - "gui_stop_server_shutdown_timeout": "Stop Sharing ({}s remaining)", - "gui_stop_server_shutdown_timeout_tooltip": "Share will expire automatically at {}", + "gui_share_start_server": "Start Sharing", + "gui_share_stop_server": "Stop Sharing", + "gui_share_stop_server_shutdown_timeout": "Stop Sharing ({}s remaining)", + "gui_share_stop_server_shutdown_timeout_tooltip": "Share will expire automatically at {}", + "gui_receive_start_server": "Start Receive Mode", + "gui_receive_stop_server": "Stop Receive Mode", + "gui_receive_stop_server_shutdown_timeout": "Stop Receive Mode ({}s remaining)", + "gui_receive_stop_server_shutdown_timeout_tooltip": "Receive mode will expire automatically at {}", "gui_copy_url": "Copy Address", "gui_copy_hidservauth": "Copy HidServAuth", "gui_downloads": "Download History", diff --git a/share/locale/eo.json b/share/locale/eo.json index 8060f815..fb037a87 100644 --- a/share/locale/eo.json +++ b/share/locale/eo.json @@ -25,8 +25,8 @@ "gui_add": "Aldoni", "gui_delete": "Forviŝi", "gui_choose_items": "Elekti", - "gui_start_server": "Komenci kundividon", - "gui_stop_server": "Ĉesigi kundividon", + "gui_share_start_server": "Komenci kundividon", + "gui_share_stop_server": "Ĉesigi kundividon", "gui_copy_url": "Kopii URL", "gui_copy_hidservauth": "Kopii HidServAuth", "gui_downloads": "Elŝutoj:", diff --git a/share/locale/es.json b/share/locale/es.json index 5d9f8dcd..412fb501 100644 --- a/share/locale/es.json +++ b/share/locale/es.json @@ -24,8 +24,8 @@ "gui_add": "Añadir", "gui_delete": "Eliminar", "gui_choose_items": "Elegir", - "gui_start_server": "Encender el Servidor", - "gui_stop_server": "Detener el Servidor", + "gui_share_start_server": "Encender el Servidor", + "gui_share_stop_server": "Detener el Servidor", "gui_copy_url": "Copiar URL", "gui_downloads": "Descargas:", "gui_copied_url": "Se copió la URL en el portapapeles" diff --git a/share/locale/fi.json b/share/locale/fi.json index 25fda84b..00768528 100644 --- a/share/locale/fi.json +++ b/share/locale/fi.json @@ -26,8 +26,8 @@ "gui_add": "Lisää", "gui_delete": "Poista", "gui_choose_items": "Valitse", - "gui_start_server": "Käynnistä palvelin", - "gui_stop_server": "Pysäytä palvelin", + "gui_share_start_server": "Käynnistä palvelin", + "gui_share_stop_server": "Pysäytä palvelin", "gui_copy_url": "Kopioi URL-osoite", "gui_downloads": "Lataukset:", "gui_canceled": "Peruutettu", diff --git a/share/locale/fr.json b/share/locale/fr.json index a661cd26..6ec20b3b 100644 --- a/share/locale/fr.json +++ b/share/locale/fr.json @@ -29,8 +29,8 @@ "gui_add": "Ajouter", "gui_delete": "Supprimer", "gui_choose_items": "Sélectionnez", - "gui_start_server": "Démarrer le serveur", - "gui_stop_server": "Arrêter le serveur", + "gui_share_start_server": "Démarrer le serveur", + "gui_share_stop_server": "Arrêter le serveur", "gui_copy_url": "Copier URL", "gui_copy_hidservauth": "Copier HidServAuth", "gui_downloads": "Téléchargements :", diff --git a/share/locale/it.json b/share/locale/it.json index 75532c34..7ad38169 100644 --- a/share/locale/it.json +++ b/share/locale/it.json @@ -26,8 +26,8 @@ "gui_add": "Aggiungi", "gui_delete": "Cancella", "gui_choose_items": "Scegli", - "gui_start_server": "Inizia la condivisione", - "gui_stop_server": "Ferma la condivisione", + "gui_share_start_server": "Inizia la condivisione", + "gui_share_stop_server": "Ferma la condivisione", "gui_copy_url": "Copia lo URL", "gui_downloads": "Downloads:", "gui_canceled": "Cancellati", diff --git a/share/locale/nl.json b/share/locale/nl.json index 3af1e0d8..4c5cfe76 100644 --- a/share/locale/nl.json +++ b/share/locale/nl.json @@ -38,8 +38,6 @@ "gui_add": "Toevoegen", "gui_delete": "Verwijder", "gui_choose_items": "Kies", - "gui_start_server": "Start server", - "gui_stop_server": "Stop server", "gui_copy_url": "Kopieer URL", "gui_copy_hidservauth": "Kopieer HidServAuth", "gui_downloads": "Downloads:", diff --git a/share/locale/tr.json b/share/locale/tr.json index bd74f5f2..d8097909 100644 --- a/share/locale/tr.json +++ b/share/locale/tr.json @@ -26,8 +26,8 @@ "gui_add": "Ekle", "gui_delete": "Sil", "gui_choose_items": "Seç", - "gui_start_server": "Paylaşımı Başlat", - "gui_stop_server": "Paylaşımı Durdur", + "gui_share_start_server": "Paylaşımı Başlat", + "gui_share_stop_server": "Paylaşımı Durdur", "gui_copy_url": "URL Kopyala", "gui_downloads": "İndirilenler:", "gui_canceled": "İptal edilen",