Split out customization of Mode into _custom() functions, and implement those customizations in ShareMode

This commit is contained in:
Micah Lee 2018-04-25 22:59:26 -07:00
parent 4a1995ef55
commit 4c6b379889
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
5 changed files with 254 additions and 161 deletions

View file

@ -39,22 +39,18 @@ class ServerStatus(QtWidgets.QWidget):
STATUS_WORKING = 1
STATUS_STARTED = 2
def __init__(self, common, qtapp, app, web, share_mode, file_selection=None):
def __init__(self, common, qtapp, app, web, file_selection=None):
super(ServerStatus, self).__init__()
self.common = common
self.status = self.STATUS_STOPPED
self.share_mode = False # Gets changed in in self.set_share_mode
self.qtapp = qtapp
self.app = app
self.web = web
# Only used in share mode
self.share_mode = share_mode
if self.share_mode:
self.file_selection = file_selection
# Shutdown timeout layout
self.shutdown_timeout_label = QtWidgets.QLabel(strings._('gui_settings_shutdown_timeout', True))
self.shutdown_timeout = QtWidgets.QDateTimeEdit()
@ -118,6 +114,13 @@ class ServerStatus(QtWidgets.QWidget):
self.setLayout(layout)
self.update()
def set_share_mode(self, file_selection):
"""
The server status is in share mode.
"""
self.share_mode = True
self.file_selection = file_selection
def shutdown_timeout_reset(self):
"""