diff options
-rw-r--r-- | desktop/onionshare/gui_common.py | 4 | ||||
-rw-r--r-- | desktop/onionshare/resources/locale/en.json | 1 | ||||
-rw-r--r-- | desktop/onionshare/tab/mode/chat_mode/__init__.py | 6 | ||||
-rw-r--r-- | desktop/onionshare/tab/mode/receive_mode/__init__.py | 12 |
4 files changed, 23 insertions, 0 deletions
diff --git a/desktop/onionshare/gui_common.py b/desktop/onionshare/gui_common.py index e3d712f5..fcbf47f7 100644 --- a/desktop/onionshare/gui_common.py +++ b/desktop/onionshare/gui_common.py @@ -471,6 +471,10 @@ class GuiCommon: QPushButton { padding: 5px 10px; }""", + "receive_options": """ + QCheckBox:disabled { + color: #666666; + }""", # Tor Settings dialogs "tor_settings_error": """ QLabel { diff --git a/desktop/onionshare/resources/locale/en.json b/desktop/onionshare/resources/locale/en.json index f25c30e2..375c4bc7 100644 --- a/desktop/onionshare/resources/locale/en.json +++ b/desktop/onionshare/resources/locale/en.json @@ -151,6 +151,7 @@ "history_requests_tooltip": "{} web requests", "error_cannot_create_data_dir": "Could not create OnionShare data folder: {}", "gui_receive_mode_warning": "Receive mode lets people upload files to your computer.<br><br><b>Some files can potentially take control of your computer if you open them. Only open things from people you trust, or if you know what you are doing.</b>", + "gui_chat_mode_explainer": "Chat mode lets you chat interactively with others, in Tor Browser.<br><br><b>Chat history is not stored in OnionShare. The chat history will disappear when you close Tor Browser.</b>", "gui_open_folder_error": "Could not open the folder with xdg-open. The file is here: {}", "gui_settings_language_label": "Language", "gui_settings_theme_label": "Theme", diff --git a/desktop/onionshare/tab/mode/chat_mode/__init__.py b/desktop/onionshare/tab/mode/chat_mode/__init__.py index 01f194b1..cb4f6911 100644 --- a/desktop/onionshare/tab/mode/chat_mode/__init__.py +++ b/desktop/onionshare/tab/mode/chat_mode/__init__.py @@ -80,6 +80,11 @@ class ChatMode(Mode): header_label = QtWidgets.QLabel(strings._("gui_new_tab_chat_button")) header_label.setStyleSheet(self.common.gui.css["mode_header_label"]) + # Chat mode explainer + chat_mode_explainer = QtWidgets.QLabel(strings._("gui_chat_mode_explainer")) + chat_mode_explainer.setMinimumHeight(80) + chat_mode_explainer.setWordWrap(True) + # Top bar top_bar_layout = QtWidgets.QHBoxLayout() # Add space at the top, same height as the toggle history bar in other modes @@ -89,6 +94,7 @@ class ChatMode(Mode): self.main_layout = QtWidgets.QVBoxLayout() self.main_layout.addLayout(top_bar_layout) self.main_layout.addWidget(header_label) + self.main_layout.addWidget(chat_mode_explainer) self.main_layout.addWidget(self.primary_action, stretch=1) self.main_layout.addWidget(self.server_status) self.main_layout.addWidget(MinimumSizeWidget(700, 0)) diff --git a/desktop/onionshare/tab/mode/receive_mode/__init__.py b/desktop/onionshare/tab/mode/receive_mode/__init__.py index 87f8fc5f..bfa85459 100644 --- a/desktop/onionshare/tab/mode/receive_mode/__init__.py +++ b/desktop/onionshare/tab/mode/receive_mode/__init__.py @@ -85,12 +85,14 @@ class ReceiveMode(Mode): self.disable_text_checkbox.setText( strings._("mode_settings_receive_disable_text_checkbox") ) + self.disable_text_checkbox.setStyleSheet(self.common.gui.css["receive_options"]) self.disable_files_checkbox = self.settings.get("receive", "disable_files") self.disable_files_checkbox = QtWidgets.QCheckBox() self.disable_files_checkbox.clicked.connect(self.disable_files_checkbox_clicked) self.disable_files_checkbox.setText( strings._("mode_settings_receive_disable_files_checkbox") ) + self.disable_files_checkbox.setStyleSheet(self.common.gui.css["receive_options"]) disable_layout = QtWidgets.QHBoxLayout() disable_layout.addWidget(self.disable_text_checkbox) disable_layout.addWidget(self.disable_files_checkbox) @@ -235,11 +237,21 @@ class ReceiveMode(Mode): self.settings.set( "receive", "disable_text", self.disable_text_checkbox.isChecked() ) + if self.disable_text_checkbox.isChecked(): + # Prevent also disabling files if text is disabled + self.disable_files_checkbox.setDisabled(True) + else: + self.disable_files_checkbox.setDisabled(False) def disable_files_checkbox_clicked(self): self.settings.set( "receive", "disable_files", self.disable_files_checkbox.isChecked() ) + if self.disable_files_checkbox.isChecked(): + # Prevent also disabling text if files is disabled + self.disable_text_checkbox.setDisabled(True) + else: + self.disable_text_checkbox.setDisabled(False) def webhook_url_checkbox_clicked(self): if self.webhook_url_checkbox.isChecked(): |