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/translations/en/ui/menu.yml
7 7
import_online: Online...
8 8
export: "&Export this world..."
9 9
preferences: "&Preferences\tAlt+Enter"
10
console: Open the python console...
11 10
quit: "&Quit"
12 11
game: "&Game"
13 12
aliases: "&Aliases"
......
23 22
connection: "&Connection"
24 23
disconnect: "&Disconnect from this world"
25 24
reconnect: "&Reconnect to this world"
25
tools: "&Tools"
26
python_console: Open the python console...
26 27
help: "&Help"
27 28
help_index: "&Basic features"
28 29
new: "&What's new"
src/translations/es/ui/menu.yml
7 7
import_online: En línea...
8 8
export: "&Exportar este mundo..."
9 9
preferences: "&Preferencias\tAlt+Enter"
10
console: Abrir la consola Python...
11 10
quit: "&Salir"
12 11
game: "&Juego"
13 12
aliases: "&Abreviaturas"
......
23 22
connection: "&Conexión"
24 23
disconnect: "&Desconectar de este mundo"
25 24
reconnect: "&Volver a conectarse al mundo"
25
tools: "&Instrumentos"
26
python_console: Abrir la consola Python...
26 27
help: "Ay&uda"
27 28
help_index: "&Características básicas"
28 29
new: "&Qué hay de nuevo"
src/translations/fr/ui/menu.yml
7 7
import_online: En ligne...
8 8
export: "&Exporter cet univers..."
9 9
preferences: "&Options\tAlt+Enter"
10
console: Ouvrir la console Python...
11 10
quit: "&Quitter"
12 11
game: "&Jeu"
13 12
aliases: "&Alias"
......
23 22
connection: "&Connexion"
24 23
disconnect: "Se &déconnecter de cet univers"
25 24
reconnect: "Se &reconnecter à cet univers"
25
tools: "&Outils"
26
python_console: Ouvrir la console Python...
26 27
help: "&Aide"
27 28
help_index: "&Fonctionnalités basiques"
28 29
new: "&Quoi de neuf"
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