diff options
author | Micah Lee <micah@micahflee.com> | 2019-01-20 11:46:20 -0800 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2019-01-20 11:46:20 -0800 |
commit | 6e3b103ef51fb5faa891cd90c7ffd8bbfca16d54 (patch) | |
tree | 2c8761d10b690103f35cda70b7146f38ff87f235 /onionshare_gui | |
parent | 66297303e109a3c5168c80fe06d494b357c844d9 (diff) | |
download | onionshare-6e3b103ef51fb5faa891cd90c7ffd8bbfca16d54.tar.gz onionshare-6e3b103ef51fb5faa891cd90c7ffd8bbfca16d54.zip |
Rename receive mode "downloads_dir" to the OnionShare "data_dir"
Diffstat (limited to 'onionshare_gui')
-rw-r--r-- | onionshare_gui/onionshare_gui.py | 4 | ||||
-rw-r--r-- | onionshare_gui/settings_dialog.py | 36 |
2 files changed, 20 insertions, 20 deletions
diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 3d5f5f0a..710a1d84 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -393,8 +393,8 @@ class OnionShareGui(QtWidgets.QMainWindow): elif event["type"] == Web.REQUEST_UPLOAD_FINISHED: mode.handle_request_upload_finished(event) - if event["type"] == Web.REQUEST_ERROR_DOWNLOADS_DIR_CANNOT_CREATE: - Alert(self.common, strings._('error_cannot_create_downloads_dir').format(event["data"]["receive_mode_dir"])) + if event["type"] == Web.REQUEST_ERROR_DATA_DIR_CANNOT_CREATE: + Alert(self.common, strings._('error_cannot_create_data_dir').format(event["data"]["receive_mode_dir"])) if event["type"] == Web.REQUEST_OTHER: if event["path"] != '/favicon.ico' and event["path"] != "/{}/shutdown".format(mode.web.shutdown_slug): diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index b933c30f..aa94b551 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -187,16 +187,16 @@ class SettingsDialog(QtWidgets.QDialog): sharing_group = QtWidgets.QGroupBox(strings._("gui_settings_sharing_label")) sharing_group.setLayout(sharing_group_layout) - # Downloads dir - downloads_label = QtWidgets.QLabel(strings._('gui_settings_downloads_label')); - self.downloads_dir_lineedit = QtWidgets.QLineEdit() - self.downloads_dir_lineedit.setReadOnly(True) - downloads_button = QtWidgets.QPushButton(strings._('gui_settings_downloads_button')) - downloads_button.clicked.connect(self.downloads_button_clicked) + # OnionShare data dir + data_dir_label = QtWidgets.QLabel(strings._('gui_settings_data_dir_label')); + self.data_dir_lineedit = QtWidgets.QLineEdit() + self.data_dir_lineedit.setReadOnly(True) + data_dir_button = QtWidgets.QPushButton(strings._('gui_settings_data_dir_browse_button')) + data_dir_button.clicked.connect(self.data_dir_button_clicked) downloads_layout = QtWidgets.QHBoxLayout() - downloads_layout.addWidget(downloads_label) - downloads_layout.addWidget(self.downloads_dir_lineedit) - downloads_layout.addWidget(downloads_button) + downloads_layout.addWidget(data_dir_label) + downloads_layout.addWidget(self.data_dir_lineedit) + downloads_layout.addWidget(data_dir_button) # Receiving options layout receiving_group_layout = QtWidgets.QVBoxLayout() @@ -508,8 +508,8 @@ class SettingsDialog(QtWidgets.QDialog): if use_legacy_v2_onions or save_private_key: self.use_legacy_v2_onions_checkbox.setCheckState(QtCore.Qt.Checked) - downloads_dir = self.old_settings.get('downloads_dir') - self.downloads_dir_lineedit.setText(downloads_dir) + data_dir = self.old_settings.get('data_dir') + self.data_dir_lineedit.setText(data_dir) public_mode = self.old_settings.get('public_mode') if public_mode: @@ -747,17 +747,17 @@ class SettingsDialog(QtWidgets.QDialog): if not self.save_private_key_checkbox.isChecked(): self.use_legacy_v2_onions_checkbox.setEnabled(True) - def downloads_button_clicked(self): + def data_dir_button_clicked(self): """ - Browse for a new downloads directory + Browse for a new OnionShare data directory """ - downloads_dir = self.downloads_dir_lineedit.text() + data_dir = self.data_dir_lineedit.text() selected_dir = QtWidgets.QFileDialog.getExistingDirectory(self, - strings._('gui_settings_downloads_label'), downloads_dir) + strings._('gui_settings_data_dir_label'), data_dir) if selected_dir: - self.common.log('SettingsDialog', 'downloads_button_clicked', 'selected dir: {}'.format(selected_dir)) - self.downloads_dir_lineedit.setText(selected_dir) + self.common.log('SettingsDialog', 'data_dir_button_clicked', 'selected dir: {}'.format(selected_dir)) + self.data_dir_lineedit.setText(selected_dir) def test_tor_clicked(self): """ @@ -981,7 +981,7 @@ class SettingsDialog(QtWidgets.QDialog): # Also unset the HidServAuth if we are removing our reusable private key settings.set('hidservauth_string', '') - settings.set('downloads_dir', self.downloads_dir_lineedit.text()) + settings.set('data_dir', self.data_dir_lineedit.text()) settings.set('public_mode', self.public_mode_checkbox.isChecked()) settings.set('use_stealth', self.stealth_checkbox.isChecked()) # Always unset the HidServAuth if Stealth mode is unset |