def PrevSession(self): """Moves to the previous session in the list of active sessions.""" sessions.SetSession(sessions.GetSessionIndex() - 1) output.AnnounceSession() if hasattr(sessions.current_session, 'announce_session_mute'): sessions.current_session.announce_session_mute(True)
def NewSession(self): """Allows you to create a new session.""" dlg = modal_dialog(core.gui.SessionManager.NewSessionDialog, parent=application.main_frame) kind = dlg.sessions.GetStringSelection() name = dlg.name.GetValue() if not name: output.speak(_("Please enter a name for this session.")) return self.NewSession() try: new = sessions.SpawnSession(kind=kind, name=name) except: output.speak(_("Unable to spawn new %s session.") % kind, True) application.main_frame.Show(False) return sessions.SetSession(new) output.AnnounceSession() application.main_frame.Show(False)
def onSwitch(self, evt): evt.Skip() sessions.SetSession(self.sessions.GetFocusedItem())