Fix a few bugs that I missed when merging in develop

This commit is contained in:
Micah Lee 2018-04-22 17:46:14 -07:00
parent 8c89a05fd9
commit 91536ea571
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
4 changed files with 11 additions and 11 deletions

View File

@ -446,11 +446,11 @@ class Onion(object):
if self.settings.get('private_key'): if self.settings.get('private_key'):
key_type = "RSA1024" key_type = "RSA1024"
key_content = self.settings.get('private_key') key_content = self.settings.get('private_key')
self.common.log('Onion', 'Starting a hidden service with a saved private key') self.common.log('Onion', 'start_onion_service', 'Starting a hidden service with a saved private key')
else: else:
key_type = "NEW" key_type = "NEW"
key_content = "RSA1024" key_content = "RSA1024"
self.common.log('Onion', 'Starting a hidden service with a new private key') self.common.log('Onion', 'start_onion_service', 'Starting a hidden service with a new private key')
try: try:
if basic_auth != None: if basic_auth != None:

View File

@ -110,7 +110,7 @@ def main():
app = OnionShare(common, onion, local_only, stay_open, shutdown_timeout) app = OnionShare(common, onion, local_only, stay_open, shutdown_timeout)
# Launch the gui # Launch the gui
gui = OnionShareGui(onion, qtapp, app, filenames, config, local_only) gui = OnionShareGui(common, web, onion, qtapp, app, filenames, config, local_only)
# Clean up when app quits # Clean up when app quits
def shutdown(): def shutdown():

View File

@ -107,7 +107,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.filesize_warning.hide() self.filesize_warning.hide()
# Downloads # Downloads
self.downloads = Downloads() self.downloads = Downloads(self.common)
self.new_download = False self.new_download = False
self.downloads_in_progress = 0 self.downloads_in_progress = 0
self.downloads_completed = 0 self.downloads_completed = 0
@ -118,7 +118,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.info_label.setStyleSheet('QLabel { font-size: 12px; color: #666666; }') self.info_label.setStyleSheet('QLabel { font-size: 12px; color: #666666; }')
self.info_show_downloads = QtWidgets.QToolButton() self.info_show_downloads = QtWidgets.QToolButton()
self.info_show_downloads.setIcon(QtGui.QIcon(common.get_resource_path('images/download_window_gray.png'))) self.info_show_downloads.setIcon(QtGui.QIcon(self.common.get_resource_path('images/download_window_gray.png')))
self.info_show_downloads.setCheckable(True) self.info_show_downloads.setCheckable(True)
self.info_show_downloads.toggled.connect(self.downloads_toggled) self.info_show_downloads.toggled.connect(self.downloads_toggled)
self.info_show_downloads.setToolTip(strings._('gui_downloads_window_tooltip', True)) self.info_show_downloads.setToolTip(strings._('gui_downloads_window_tooltip', True))
@ -655,7 +655,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
""" """
When the 'Show/hide downloads' button is toggled, show or hide the downloads window. When the 'Show/hide downloads' button is toggled, show or hide the downloads window.
""" """
common.log('OnionShareGui', 'toggle_downloads') self.common.log('OnionShareGui', 'toggle_downloads')
if checked: if checked:
self.downloads.downloads_container.show() self.downloads.downloads_container.show()
else: else:
@ -701,7 +701,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
""" """
self.update_downloads_completed(0) self.update_downloads_completed(0)
self.update_downloads_in_progress(0) self.update_downloads_in_progress(0)
self.info_show_downloads.setIcon(QtGui.QIcon(common.get_resource_path('images/download_window_gray.png'))) self.info_show_downloads.setIcon(QtGui.QIcon(self.common.get_resource_path('images/download_window_gray.png')))
self.downloads.no_downloads_label.show() self.downloads.no_downloads_label.show()
self.downloads.downloads_container.resize(self.downloads.downloads_container.sizeHint()) self.downloads.downloads_container.resize(self.downloads.downloads_container.sizeHint())

View File

@ -683,7 +683,7 @@ class SettingsDialog(QtWidgets.QDialog):
reboot_onion = False reboot_onion = False
if not self.local_only: if not self.local_only:
if self.onion.is_authenticated(): if self.onion.is_authenticated():
common.log('SettingsDialog', 'save_clicked', 'Connected to Tor') self.common.log('SettingsDialog', 'save_clicked', 'Connected to Tor')
def changed(s1, s2, keys): def changed(s1, s2, keys):
""" """
Compare the Settings objects s1 and s2 and return true if any values Compare the Settings objects s1 and s2 and return true if any values
@ -705,20 +705,20 @@ class SettingsDialog(QtWidgets.QDialog):
reboot_onion = True reboot_onion = True
else: else:
common.log('SettingsDialog', 'save_clicked', 'Not connected to Tor') self.common.log('SettingsDialog', 'save_clicked', 'Not connected to Tor')
# Tor isn't connected, so try connecting # Tor isn't connected, so try connecting
reboot_onion = True reboot_onion = True
# Do we need to reinitialize Tor? # Do we need to reinitialize Tor?
if reboot_onion: if reboot_onion:
# Reinitialize the Onion object # Reinitialize the Onion object
common.log('SettingsDialog', 'save_clicked', 'rebooting the Onion') self.common.log('SettingsDialog', 'save_clicked', 'rebooting the Onion')
self.onion.cleanup() self.onion.cleanup()
tor_con = TorConnectionDialog(self.qtapp, settings, self.onion) tor_con = TorConnectionDialog(self.qtapp, settings, self.onion)
tor_con.start() tor_con.start()
common.log('SettingsDialog', 'save_clicked', 'Onion done rebooting, connected to Tor: {}'.format(self.onion.connected_to_tor)) self.common.log('SettingsDialog', 'save_clicked', 'Onion done rebooting, connected to Tor: {}'.format(self.onion.connected_to_tor))
if self.onion.is_authenticated() and not tor_con.wasCanceled(): if self.onion.is_authenticated() and not tor_con.wasCanceled():
self.settings_saved.emit() self.settings_saved.emit()