Fix stopping content server message not being dismissable

This commit is contained in:
Kovid Goyal 2015-08-12 11:48:53 +05:30
parent 33f926a8d6
commit 60e8690e6e
2 changed files with 5 additions and 7 deletions

View File

@ -235,12 +235,11 @@ class ConnectShareAction(InterfaceAction):
_('Stopping server, this could take upto a minute, please wait...'), _('Stopping server, this could take upto a minute, please wait...'),
show_copy_button=False) show_copy_button=False)
QTimer.singleShot(1000, self.check_exited) QTimer.singleShot(1000, self.check_exited)
self.stopping_msg.exec_()
def check_exited(self): def check_exited(self):
if self.gui.content_server.is_running: if getattr(self.gui.content_server, 'is_running', False):
QTimer.singleShot(20, self.check_exited) QTimer.singleShot(50, self.check_exited)
if not self.stopping_msg.isVisible():
self.stopping_msg.exec_()
return return
self.gui.content_server = None self.gui.content_server = None
self.stopping_msg.accept() self.stopping_msg.accept()

View File

@ -85,12 +85,11 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
_('Stopping server, this could take upto a minute, please wait...'), _('Stopping server, this could take upto a minute, please wait...'),
show_copy_button=False) show_copy_button=False)
QTimer.singleShot(500, self.check_exited) QTimer.singleShot(500, self.check_exited)
self.stopping_msg.exec_()
def check_exited(self): def check_exited(self):
if self.gui.content_server.is_running: if getattr(self.gui.content_server, 'is_running', False):
QTimer.singleShot(20, self.check_exited) QTimer.singleShot(20, self.check_exited)
if not self.stopping_msg.isVisible():
self.stopping_msg.exec_()
return return
self.gui.content_server = None self.gui.content_server = None