daboide Commit
Revision 582
Date: 2006-05-27 07:43:16 -0700 (Sat, 27 May 2006)
Author: ed

Changed:
U   trunk/Editor.py

Log:
Fixed the ordering of menus on GTK and Windows. 'Help' was appearing in the 
middle. Also cleaned up some missing localization calls.


Diff:
Modified: trunk/Editor.py
===================================================================
--- trunk/Editor.py     2006-05-24 23:10:13 UTC (rev 581)
+++ trunk/Editor.py     2006-05-27 14:43:16 UTC (rev 582)
@@ -251,7 +251,7 @@
                pnl.Sizer = dabo.ui.dSizer("v")
                self._lastPath = self.Application.getUserSetting("lastPath", 
os.getcwd())
                super(EditorForm, self).afterInit()
-               self.Caption = "Dabo Editor"
+               self.Caption = _("Dabo Editor")
                self.funcButton = dabo.ui.dImage(pnl, ScaleMode="Clip", 
Size=(22,22))
                self.funcButton.Picture = 
dabo.ui.imageFromData(funcButtonData())
                self.funcButton.bindEvent(dEvents.MouseLeftDown, 
self.onFuncButton)
@@ -345,8 +345,8 @@
        
        def onSetBmk(self, evt):
                """Need to ask the user for a name for this bookmark."""
-               nm = dabo.ui.getString(message="Name for this bookmark:", 
-                               caption="New Bookmark")
+               nm = dabo.ui.getString(message=_("Name for this bookmark:"), 
+                               caption=_("New Bookmark"))
                if not nm:
                        # User canceled
                        return
@@ -403,7 +403,7 @@
        def onDocumentationHint(self, evt):
                # Eventually, a separate IDE window can optionally display help 
contents
                # for the object. For now, just print the longdoc to the 
infolog.
-               dabo.infoLog.write("Documentation Hint received:\n\n%s" % 
evt.EventData["longDoc"])
+               dabo.infoLog.write(_("Documentation Hint received:\n\n%s") % 
evt.EventData["longDoc"])
 
 
        def onTitleChanged(self, evt):
@@ -412,14 +412,14 @@
 
        def fillMenu(self):
                mb = self.MenuBar
-               fileMenu = mb.getMenu("File")
+               fileMenu = mb.getMenu(_("File"))
                self.Application.onMenuOpenMRU(fileMenu)
                
-               editMenu = mb.getMenu("Edit")
-               mb.remove(mb.getMenuIndex("View"))
-#              viewMenu = dabo.ui.dMenu(Caption="&View")
+               editMenu = mb.getMenu(_("Edit"))
+               mb.remove(mb.getMenuIndex(_("View")))
+#              viewMenu = dabo.ui.dMenu(Caption=_("&View"))
 #              mb.insertMenu(2, viewMenu)
-               runMenu = dabo.ui.dMenu(Caption="&Run")
+               runMenu = dabo.ui.dMenu(Caption=_("&Run"))
                mb.insertMenu(3, runMenu)               
                dIcons = dabo.ui.dIcons
                                
@@ -467,7 +467,7 @@
                if self.Application.getUserSetting("visibleOutput", True):
                        runMenu.setCheck(_("Hide/Show Output"), 
unCheckOthers=False)
 
-               fontMenu = dabo.ui.dMenu(Caption="Font")
+               fontMenu = dabo.ui.dMenu(Caption=_("Fo&nt"))
                mb.insertMenu(4, fontMenu)
                fontMenu.append(_("Set Font Size"), bindfunc=self.onFontSize, 
                                help=_("Set Default Font Size"))
@@ -484,10 +484,16 @@
                        fontMenu.append(font, bindfunc=self.onFontSelection, 
                                        menutype="Check")
                
-               vp = mb.getMenuIndex("Font")
-               edtMenu = mb.insert(vp+1, "Editors")
-                               
+               vp = mb.getMenuIndex(_("Font"))
+               edtMenu = mb.insert(vp+1, _("E&ditors"))
                
+               # On non-Mac platforms, we may need to move the Help Menu
+               # to the end.
+               hlp = mb.getMenu(_("Help"))
+               if hlp:
+                       mb.remove(mb.getMenuIndex(_("Help")), False)
+                       mb.appendMenu(hlp)                              
+               
                # bind the hotkeys
                self.bindKey("alt+Left", self.onPrevPg)
                self.bindKey("alt+Right", self.onNextPg)
@@ -525,7 +531,7 @@
                """Currently this never fires under Windows."""
                mn = evt.menuObject
                prm = evt.prompt
-               if prm == "Editors":
+               if prm == _("Editors"):
                        mn.clear()
                        for pg in self.pgfEditor.Pages:
                                prmpt = pg.editor._title                        
        
@@ -536,7 +542,7 @@
                                mn.append(_("Open in New Window"), 
                                                bindfunc=self.onOpenInNew, 
                                                help=_("Open this document in a 
new window"))
-               elif prm == "Font":
+               elif prm == _("Font"):
                        mn.setCheck(self.CurrentEditor._fontFace)
 
        
@@ -571,7 +577,7 @@
 
 
        def onFileOpen(self, evt):
-               fileName = self.CurrentEditor.promptForFileName(prompt="Open", 
+               fileName = 
self.CurrentEditor.promptForFileName(prompt=_("Open"), 
                                path=self._lastPath)
                if fileName is not None:
                        self._lastPath = os.path.split(fileName)[0]
@@ -615,7 +621,7 @@
                                raise StandardError, e
                if target:
                        # Add to the MRU list
-                       self.Application.addToMRU("File", pth, 
self.onMRUSelection)
+                       self.Application.addToMRU(_("File"), pth, 
self.onMRUSelection)
                return target
                
 
@@ -730,7 +736,7 @@
        
        
        def onOutput(self, evt):
-               show = self.MenuBar.getMenu("Run").isItemChecked(_("Hide/Show 
Output"))
+               show = 
self.MenuBar.getMenu(_("Run")).isItemChecked(_("Hide/Show Output"))
                self.Application.setUserSetting("visibleOutput", show)
                for pg in self.pgfEditor.Pages:         
                        pg.showOutput(show)
@@ -856,9 +862,9 @@
 def main():
        files = sys.argv[1:]
        app = dabo.dApp()
-       app.setAppInfo("appName", "Dabo Editor")
-       app.setAppInfo("appShortName", "DaboEditor")
-       app._persistentMRUs = {"File" : onFileMRU}
+       app.setAppInfo("appName", _("Dabo Editor"))
+       app.setAppInfo("appShortName", _("DaboEditor"))
+       app._persistentMRUs = {_("File") : onFileMRU}
        app.MainFormClass = None
        app.setup()
 




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to