mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 02:12:36 +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
|
# 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")
|
||||||
|
|
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue