Project

Profile

Help

Revision f78b61ef

Added by Vincent Le Goff about 2 years ago

Add the tool menu and place the Python console in it

View differences:

src/ui/window.py
119 119
        fileMenu = wx.Menu()
120 120
        gameMenu = wx.Menu()
121 121
        connectionMenu = wx.Menu()
122
        toolsMenu = wx.Menu()
122 123
        helpMenu = wx.Menu()
123 124

  
124 125
        ## File menu
......
158 159
        self.Bind(wx.EVT_MENU, self.OnPreferences, preferences)
159 160
        fileMenu.AppendItem(preferences)
160 161

  
161
        # Console
162
        console = wx.MenuItem(fileMenu, -1, t("ui.menu.console"))
163
        self.Bind(wx.EVT_MENU, self.OnConsole, console)
164
        fileMenu.AppendItem(console)
165

  
166 162
        # Quit
167 163
        quit = wx.MenuItem(fileMenu, -1, t("ui.menu.quit"))
168 164
        self.Bind(wx.EVT_MENU, self.OnQuit, quit)
......
227 223
        self.Bind(wx.EVT_MENU, self.OnReconnect, reconnect)
228 224
        connectionMenu.AppendItem(reconnect)
229 225

  
226
        ## Tools menu
227
        # Python console
228
        pyconsole = wx.MenuItem(toolsMenu, -1, t("ui.menu.python_console"))
229
        self.Bind(wx.EVT_MENU, self.OnPythonConsole, pyconsole)
230
        toolsMenu.AppendItem(pyconsole)
231

  
230 232
        ## Help menu
231 233
        # Basics
232 234
        basics = wx.MenuItem(helpMenu, -1, t("ui.menu.help_index"))
......
246 248
        menubar.Append(fileMenu, t("ui.menu.file"))
247 249
        menubar.Append(gameMenu, t("ui.menu.game"))
248 250
        menubar.Append(connectionMenu, t("ui.menu.connection"))
251
        menubar.Append(toolsMenu, t("ui.menu.tools"))
249 252
        menubar.Append(helpMenu, t("ui.menu.help"))
250 253

  
251 254
        self.SetMenuBar(menubar)
......
359 362
        dialog.ShowModal()
360 363
        dialog.Destroy()
361 364

  
362
    def OnConsole(self, e):
363
        """Open the console dialog box."""
365
    def OnPythonConsole(self, e):
366
        """Open the Python console dialog box."""
364 367
        dialog = ConsoleDialog(self.engine, self.world, self.panel)
365 368
        dialog.ShowModal()
366 369

  

Also available in: Unified diff