diff --git a/desktop/src/onionshare/auto_connect.py b/desktop/src/onionshare/auto_connect.py index f4378372..550a0611 100644 --- a/desktop/src/onionshare/auto_connect.py +++ b/desktop/src/onionshare/auto_connect.py @@ -49,12 +49,12 @@ class AutoConnect(QtWidgets.QWidget): QtGui.QPixmap.fromImage( QtGui.QImage( GuiCommon.get_resource_path( - "images/{}_logo_text.png".format(common.gui.color_mode) + "images/{}_logo_text_bg.png".format(common.gui.color_mode) ) ) ) ) - self.image_label.setFixedSize(180, 40) + self.image_label.setFixedSize(322, 65) image_layout = QtWidgets.QVBoxLayout() image_layout.addWidget(self.image_label) self.image = QtWidgets.QWidget() @@ -101,7 +101,7 @@ class AutoConnect(QtWidgets.QWidget): content_layout.addWidget(cta_widget) content_layout.addStretch() content_layout.setAlignment(QtCore.Qt.AlignCenter) - content_widget = QtWidgets.QWidgets() + content_widget = QtWidgets.QWidget() content_widget.setLayout(content_layout) self.layout = QtWidgets.QHBoxLayout() diff --git a/desktop/src/onionshare/main_window.py b/desktop/src/onionshare/main_window.py index 22f813ad..ac100694 100644 --- a/desktop/src/onionshare/main_window.py +++ b/desktop/src/onionshare/main_window.py @@ -165,7 +165,9 @@ class MainWindow(QtWidgets.QMainWindow): # Auto connect OnionShare? auto_connect = AutoConnect(self.common, self) if not auto_connect.auto_connect_enabled: - auto_connect.configure_button.clicked.connect(self.open_tor_settings) + auto_connect.configure_button.clicked.connect( + lambda: self.open_tor_settings("autoconnect") + ) auto_connect.connect_button.clicked.connect(self.start_onionshare) self.setCentralWidget(auto_connect) self.show() @@ -259,12 +261,12 @@ class MainWindow(QtWidgets.QMainWindow): # Wait 1ms for the event loop to finish closing the TorConnectionDialog QtCore.QTimer.singleShot(1, self.open_tor_settings) - def open_tor_settings(self): + def open_tor_settings(self, openner=None): """ Open the TorSettingsDialog. """ self.common.log("MainWindow", "open_tor_settings") - d = TorSettingsDialog(self.common) + d = TorSettingsDialog(self.common, openner) d.settings_saved.connect(self.settings_have_changed) d.exec_() diff --git a/desktop/src/onionshare/resources/images/light_logo_text_bg.png b/desktop/src/onionshare/resources/images/light_logo_text_bg.png new file mode 100644 index 00000000..72156b50 Binary files /dev/null and b/desktop/src/onionshare/resources/images/light_logo_text_bg.png differ diff --git a/desktop/src/onionshare/tor_settings_dialog.py b/desktop/src/onionshare/tor_settings_dialog.py index 6737ae4b..cd993ecc 100644 --- a/desktop/src/onionshare/tor_settings_dialog.py +++ b/desktop/src/onionshare/tor_settings_dialog.py @@ -42,10 +42,11 @@ class TorSettingsDialog(QtWidgets.QDialog): settings_saved = QtCore.Signal() - def __init__(self, common): + def __init__(self, common, openner=None): super(TorSettingsDialog, self).__init__() self.common = common + self.openner = openner self.common.log("TorSettingsDialog", "__init__") @@ -692,7 +693,7 @@ class TorSettingsDialog(QtWidgets.QDialog): self.settings_saved.emit() self.close() - def cancel_clicked(self): + def cancel_clicked(self, openner): """ Cancel button clicked. """ @@ -700,6 +701,7 @@ class TorSettingsDialog(QtWidgets.QDialog): if ( not self.common.gui.local_only and not self.common.gui.onion.is_authenticated() + and not (self.openner and self.openner == "autoconnect") ): Alert( self.common, @@ -831,17 +833,18 @@ class TorSettingsDialog(QtWidgets.QDialog): return settings - def closeEvent(self, e): + def closeEvent(self, e, openner=None): self.common.log("TorSettingsDialog", "closeEvent") # On close, if Tor isn't connected, then quit OnionShare altogether - if not self.common.gui.local_only: - if not self.common.gui.onion.is_authenticated(): - self.common.log( - "TorSettingsDialog", - "closeEvent", - "Closing while not connected to Tor", - ) + if not (self.openner and self.openner == "autoconnect"): + if not self.common.gui.local_only: + if not self.common.gui.onion.is_authenticated(): + self.common.log( + "TorSettingsDialog", + "closeEvent", + "Closing while not connected to Tor", + ) - # Wait 1ms for the event loop to finish, then quit - QtCore.QTimer.singleShot(1, self.common.gui.qtapp.quit) + # Wait 1ms for the event loop to finish, then quit + QtCore.QTimer.singleShot(1, self.common.gui.qtapp.quit)