]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.C
proper support for "List of XXX" insets; fix error when there is a list of algorithms...
[lyx.git] / src / MenuBackend.C
index 71542cc9544150bc045a41df88b2c185255f269a..b852d14c3c304ae190128e0c4d217c46dc181077 100644 (file)
@@ -314,6 +314,14 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                case MenuItem::ViewFormats:
                case MenuItem::UpdateFormats:
                case MenuItem::ExportFormats: {
+
+                       if (!buf && cit->kind() != MenuItem::ImportFormats) {
+                               tomenu.add(MenuItem(MenuItem::Command,
+                                                   _("No Documents Open!"),
+                                                   LFUN_NOACTION));
+                               continue;
+                       }                               
+                       
                        typedef vector<Format const *> Formats;
 
                        Formats formats;
@@ -369,9 +377,9 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                                int const action =  lyxaction
                                        .getPseudoAction(LFUN_FLOAT_LIST,
                                                         cit->second.type());
-                               string const label = cit->second.name() + _(" List");
                                tomenu.add(MenuItem(MenuItem::Command,
-                                                   label, action));
+                                                   _(cit->second.listName()),
+                                                   action));
                        }
                }
                break;
@@ -385,7 +393,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                                int const action = lyxaction
                                        .getPseudoAction(LFUN_INSET_FLOAT,
                                                         cit->second.type());
-                               string const label = cit->second.name();
+                               string const label = _(cit->second.name());
                                tomenu.add(MenuItem(MenuItem::Command,
                                                    label, action));
 
@@ -393,7 +401,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                                int const action2 = lyxaction
                                        .getPseudoAction(LFUN_INSET_WIDE_FLOAT,
                                                         cit->second.type());
-                               string const label2 = _("Wide ") + label;
+                               string const label2 = label + _(" (wide)");
                                tomenu.add(MenuItem(MenuItem::Command,
                                                    label2, action2));
                        }
@@ -492,7 +500,7 @@ void MenuBackend::defaults()
        Menu file("file");
        file
                .add(MenuItem(MenuItem::Command, _("New...|N"), "buffer-new"))
-               .add(MenuItem(MenuItem::Command, _("Open...|O"), "buffer-open"))
+               .add(MenuItem(MenuItem::Command, _("Open...|O"), "file-open"))
                .add(MenuItem(MenuItem::Submenu, _("Import|I"), "import"))
                .add(MenuItem(MenuItem::Command, _("Quit|Q"), "lyx-quit"))
                .add(MenuItem(MenuItem::Separator))