Merge branch 'mig5-453_catch_oserror_on_crunching_files'

This commit is contained in:
Micah Lee 2018-01-13 15:59:46 -08:00
commit fe2d72db5c
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -287,12 +287,16 @@ class OnionShareGui(QtWidgets.QMainWindow):
def _set_processed_size(x): def _set_processed_size(x):
if self._zip_progress_bar != None: if self._zip_progress_bar != None:
self._zip_progress_bar.update_processed_size_signal.emit(x) self._zip_progress_bar.update_processed_size_signal.emit(x)
web.set_file_info(self.file_selection.file_list.filenames, processed_size_callback=_set_processed_size) try:
self.app.cleanup_filenames.append(web.zip_filename) web.set_file_info(self.file_selection.file_list.filenames, processed_size_callback=_set_processed_size)
self.starting_server_step3.emit() self.app.cleanup_filenames.append(web.zip_filename)
self.starting_server_step3.emit()
# done # done
self.start_server_finished.emit() self.start_server_finished.emit()
except OSError as e:
self.starting_server_error.emit(e.strerror)
return
#self.status_bar.showMessage(strings._('gui_starting_server2', True)) #self.status_bar.showMessage(strings._('gui_starting_server2', True))
t = threading.Thread(target=finish_starting_server, kwargs={'self': self}) t = threading.Thread(target=finish_starting_server, kwargs={'self': self})
@ -339,6 +343,9 @@ class OnionShareGui(QtWidgets.QMainWindow):
Alert(error, QtWidgets.QMessageBox.Warning) Alert(error, QtWidgets.QMessageBox.Warning)
self.server_status.stop_server() self.server_status.stop_server()
if self._zip_progress_bar is not None:
self.status_bar.removeWidget(self._zip_progress_bar)
self._zip_progress_bar = None
self.status_bar.clearMessage() self.status_bar.clearMessage()
def stop_server(self): def stop_server(self):