]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.C
redraw fix 1.
[lyx.git] / src / MenuBackend.C
index 356b550d60c4bb31fd0f9377a171a9c949d9d512..e3c76877775b27f266dbec01c1f82b9ed7499639 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;
@@ -345,6 +353,15 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                                if ((*fit)->dummy())
                                        continue;
                                string label = (*fit)->prettyname();
+                               // we need to hide the default graphic export
+                               // formats from the external menu, because we
+                               // need them only for the internal lyx-view and
+                               // external latex run
+                               if (label == "EPS" ||
+                                   label == "XPM" ||
+                                   label == "PNG")
+                                       continue;
+
                                if (cit->kind() == MenuItem::ImportFormats)
                                        if ((*fit)->name() == "text")
                                                label = _("Ascii text as lines");
@@ -369,9 +386,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;
@@ -393,7 +410,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));
                        }