mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Make it so windows remember if waiting has finished
This commit is contained in:
parent
7d361955f8
commit
b82ffa2cac
3 changed files with 12 additions and 2 deletions
|
@ -38,6 +38,9 @@ class GuiCommon(object):
|
|||
# Preload list of PDF viewers on computer
|
||||
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):
|
||||
if platform.system() == "Windows":
|
||||
path = self.global_common.get_resource_path("dangerzone.ico")
|
||||
|
|
|
@ -54,8 +54,12 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
self.content_widget.close_window.connect(self.close)
|
||||
|
||||
# Only use the waiting widget if we have a VM
|
||||
self.waiting_widget.show()
|
||||
self.content_widget.hide()
|
||||
if self.gui_common.is_waiting_finished:
|
||||
self.waiting_widget.hide()
|
||||
self.content_widget.show()
|
||||
else:
|
||||
self.waiting_widget.show()
|
||||
self.content_widget.hide()
|
||||
|
||||
# Layout
|
||||
layout = QtWidgets.QVBoxLayout()
|
||||
|
@ -70,6 +74,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
self.show()
|
||||
|
||||
def waiting_finished(self):
|
||||
self.gui_common.is_waiting_finished = True
|
||||
self.waiting_widget.hide()
|
||||
self.content_widget.show()
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ class Vm(QtCore.QObject):
|
|||
self.stop()
|
||||
|
||||
def start(self):
|
||||
print("Starting VM\n")
|
||||
|
||||
self.state = self.STATE_STARTING
|
||||
self.vm_state_change.emit(self.state)
|
||||
|
||||
|
|
Loading…
Reference in a new issue