Make it so windows remember if waiting has finished

This commit is contained in:
Micah Lee 2021-08-06 13:10:56 -07:00
parent 7d361955f8
commit b82ffa2cac
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
3 changed files with 12 additions and 2 deletions

View file

@ -38,6 +38,9 @@ class GuiCommon(object):
# Preload list of PDF viewers on computer # Preload list of PDF viewers on computer
self.pdf_viewers = self._find_pdf_viewers() self.pdf_viewers = self._find_pdf_viewers()
# Are we done waiting (for VM to start, or container to install)
self.is_waiting_finished = False
def get_window_icon(self): def get_window_icon(self):
if platform.system() == "Windows": if platform.system() == "Windows":
path = self.global_common.get_resource_path("dangerzone.ico") path = self.global_common.get_resource_path("dangerzone.ico")

View file

@ -54,6 +54,10 @@ class MainWindow(QtWidgets.QMainWindow):
self.content_widget.close_window.connect(self.close) self.content_widget.close_window.connect(self.close)
# Only use the waiting widget if we have a VM # Only use the waiting widget if we have a VM
if self.gui_common.is_waiting_finished:
self.waiting_widget.hide()
self.content_widget.show()
else:
self.waiting_widget.show() self.waiting_widget.show()
self.content_widget.hide() self.content_widget.hide()
@ -70,6 +74,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.show() self.show()
def waiting_finished(self): def waiting_finished(self):
self.gui_common.is_waiting_finished = True
self.waiting_widget.hide() self.waiting_widget.hide()
self.content_widget.show() self.content_widget.show()

View file

@ -76,6 +76,8 @@ class Vm(QtCore.QObject):
self.stop() self.stop()
def start(self): def start(self):
print("Starting VM\n")
self.state = self.STATE_STARTING self.state = self.STATE_STARTING
self.vm_state_change.emit(self.state) self.vm_state_change.emit(self.state)