def ShowDisconnectNotice(self, notice=None):
     notice = notice or localization.GetByLabel(
         'UI/Shared/GenericConnectionLost')
     msgbox = form.MessageBox.Open(windowID='DisconnectNotice',
                                   parent=uicore.desktop,
                                   idx=0)
     msgbox.MakeUnResizeable()
     msgbox.MakeUnpinable()
     msgbox.MakeUnKillable()
     canReboot = appUtils.CanReboot()
     okLabel = localization.GetByLabel(
         'UI/Commands/CmdRestart'
     ) if canReboot else localization.GetByLabel('UI/Commands/CmdQuit')
     buttons = uiconst.OKCANCEL if canReboot else uiconst.OK
     cancelLabel = localization.GetByLabel(
         'UI/Commands/CmdQuit') if canReboot else None
     msgbox.Execute(notice,
                    localization.GetByLabel('UI/Shared/ConnectionLost'),
                    buttons,
                    uiconst.INFO,
                    None,
                    okLabel=okLabel,
                    cancelLabel=cancelLabel)
     uicore.layer.hint.display = False
     blackOut = uiprimitives.Fill(parent=uicore.layer.modal,
                                  color=(0, 0, 0, 0),
                                  idx=1)
     uicore.animations.MorphScalar(blackOut,
                                   'opacity',
                                   startVal=0,
                                   endVal=0.75,
                                   duration=1.0)
     modalResult = msgbox.ShowModal()
     if canReboot and modalResult == uiconst.ID_OK:
         appUtils.Reboot('connection lost')
     else:
         bluepy.Terminate('User requesting close after client disconnect')
 def ClearSettings(self):
     if eve.Message('AskClearSettingsReboot', {},
                    uiconst.YESNO) == uiconst.ID_YES:
         prefs.resetsettings = 1
         appUtils.Reboot('clear settings')
 def ClearCacheFiles(self):
     if eve.Message('AskClearCacheReboot', {},
                    uiconst.YESNO) == uiconst.ID_YES:
         prefs.clearcache = 1
         appUtils.Reboot('clear cache')