Exemplo n.º 1
0
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title)

        self.status_bar = StatusBar(self)
        self.SetStatusBar(self.status_bar)

        self.buildMenu()

        self.about_info     = None
        self.connect_dialog = None
        self.prefs_editor   = None
        self.worlds_list    = None

        h = 600
        w = 800
        if prefs.get('save_window_size'):
            if prefs.get('window_width'):  w = int(prefs.get('window_width'))
            if prefs.get('window_height'): h = int(prefs.get('window_height'))
        self.SetSize((w, h))

        self.tabs = wx.Notebook(self)

        self.addEvents()

        if prefs.get('autoconnect_last_world') == 'True':
            world = worlds.get(prefs.get('last_world'))
            if world:
                self.openWorld(world)
Exemplo n.º 2
0
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title)

        self.status_bar = StatusBar(self)
        self.SetStatusBar(self.status_bar)

        self.about_info = None
        self.connect_dialog = None
        self.prefs_editor = None
        self.worlds_list = None
        self.shortlist = []

        self.buildMenu()

        h = 600
        w = 800
        if prefs.get('save_window_size'):
            if prefs.get('window_width'): w = int(prefs.get('window_width'))
            if prefs.get('window_height'): h = int(prefs.get('window_height'))
        self.SetSize((w, h))

        self.tabs = MOONotebook(self)

        self.addEvents()

        if prefs.get('autoconnect_last_world'):
            world = worlds.get(prefs.get('last_world'))
            if world:
                self.openWorld(world)
            else:
                wx.CallAfter(self.showWorldsList)
        else:
            wx.CallAfter(self.showWorldsList)
Exemplo n.º 3
0
    def on_new(self, evt):
        if self.new_world_name_dialog.ShowModal() == wx.ID_CANCEL:
            return
        worldname = self.new_world_name_dialog.GetValue()

        if worlds.get(worldname) == None:
            worlds[worldname] = World({"name": worldname})
            new_world = self.world_picker.Append(worldname)
            self.world_picker.SetSelection(
                self.world_picker.FindString(worldname))
            self.fill_thyself()
        else:
            wx.MessageDialog(self,
                             "The world \"" + worldname + "\" already exists.",
                             "Error", wx.OK | wx.ICON_ERROR).ShowModal()
            self.on_new(evt)
Exemplo n.º 4
0
 def connect_to_shortlist(self, worldname, evt):
     world = worlds.get(worldname, None)
     if not world: return
     self.openWorld(world)
Exemplo n.º 5
0
 def connect_to_shortlist(self, worldname, evt):
     world = worlds.get(worldname, None)
     if not world: return
     self.openWorld(world)