Make OnionShareGui use the proper web object

This commit is contained in:
Micah Lee 2018-04-26 10:59:38 -07:00
parent 9e9f65572b
commit ff55d7df75
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -52,7 +52,6 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.local_only = local_only self.local_only = local_only
self.mode = self.MODE_SHARE self.mode = self.MODE_SHARE
self.web = None
self.setWindowTitle('OnionShare') self.setWindowTitle('OnionShare')
self.setWindowIcon(QtGui.QIcon(self.common.get_resource_path('images/logo.png'))) self.setWindowIcon(QtGui.QIcon(self.common.get_resource_path('images/logo.png')))
@ -374,14 +373,18 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.share_mode.handle_tor_broke() self.share_mode.handle_tor_broke()
# If we have a web object, process events from it # Process events from the web object
if self.web: if self.mode == self.MODE_SHARE:
web = self.share_mode.web
else:
web = self.receive_mode.web
events = [] events = []
done = False done = False
while not done: while not done:
try: try:
r = self.web.q.get(False) r = web.q.get(False)
events.append(r) events.append(r)
except queue.Empty: except queue.Empty:
done = True done = True
@ -403,7 +406,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.share_mode.handle_request_canceled(event) self.share_mode.handle_request_canceled(event)
elif event["path"] != '/favicon.ico': elif event["path"] != '/favicon.ico':
self.status_bar.showMessage('[#{0:d}] {1:s}: {2:s}'.format(self.web.error404_count, strings._('other_page_loaded', True), event["path"])) self.status_bar.showMessage('[#{0:d}] {1:s}: {2:s}'.format(web.error404_count, strings._('other_page_loaded', True), event["path"]))
if self.mode == self.MODE_SHARE: if self.mode == self.MODE_SHARE:
self.share_mode.timer_callback() self.share_mode.timer_callback()