]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.cpp
updated list of LyX translations
[lyx.git] / src / MenuBackend.cpp
index fde7ab56806231468691aa83c8a07329d009c139..7865786ff3ff326297b4c0c1e704c8a5aeead262 100644 (file)
@@ -460,7 +460,7 @@ void expandDocuments(Menu & tomenu)
        Strings const names = theBufferList().getFileNames();
 
        if (names.empty()) {
-               tomenu.add(MenuItem(MenuItem::Command, _("No Documents Open!"),
+               tomenu.add(MenuItem(MenuItem::Command, _("No Document Open!"),
                                    FuncRequest(LFUN_NOACTION)));
                return;
        }
@@ -486,7 +486,7 @@ void expandBookmarks(Menu & tomenu)
                        docstring const label = convert<docstring>(i) + ". "
                                + makeDisplayPath(bm.bookmark(i).filename.absFilename(), 20)
                                + char_type('|') + convert<docstring>(i);
-                       tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_BOOKMARK_GOTO, 
+                       tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_BOOKMARK_GOTO,
                                convert<docstring>(i))));
                }
        }
@@ -497,7 +497,7 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, Buffer const * buf)
 {
        if (!buf && kind != MenuItem::ImportFormats) {
                tomenu.add(MenuItem(MenuItem::Command,
-                                   _("No Documents Open!"),
+                                   _("No Document Open!"),
                                    FuncRequest(LFUN_NOACTION)));
                return;
        }
@@ -569,7 +569,7 @@ void expandFloatListInsert(Menu & tomenu, Buffer const * buf)
 {
        if (!buf) {
                tomenu.add(MenuItem(MenuItem::Command,
-                                   _("No Documents Open!"),
+                                   _("No Document Open!"),
                                    FuncRequest(LFUN_NOACTION)));
                return;
        }
@@ -591,7 +591,7 @@ void expandFloatInsert(Menu & tomenu, Buffer const * buf)
 {
        if (!buf) {
                tomenu.add(MenuItem(MenuItem::Command,
-                                   _("No Documents Open!"),
+                                   _("No Document Open!"),
                                    FuncRequest(LFUN_NOACTION)));
                return;
        }
@@ -614,7 +614,7 @@ void expandCharStyleInsert(Menu & tomenu, Buffer const * buf)
 {
        if (!buf) {
                tomenu.add(MenuItem(MenuItem::Command,
-                                   _("No Documents Open!"),
+                                   _("No Document Open!"),
                                    FuncRequest(LFUN_NOACTION)));
                return;
        }
@@ -700,11 +700,15 @@ void expandToc(Menu & tomenu, Buffer const * buf)
 
        if (!buf) {
                tomenu.add(MenuItem(MenuItem::Command,
-                                   _("No Documents Open!"),
+                                   _("No Document Open!"),
                                    FuncRequest(LFUN_NOACTION)));
                return;
        }
 
+       Buffer* cbuf = const_cast<Buffer*>(buf);
+       cbuf->tocBackend().update();
+       cbuf->structureChanged();
+
        // Add an entry for the master doc if this is a child doc
        Buffer const * const master = buf->getMasterBuffer();
        if (buf != master) {
@@ -789,29 +793,40 @@ void expandToolbars(Menu & tomenu)
 
        for (; cit != end; ++cit) {
                docstring label = _(cit->gui_name);
-               // frontends are not supposed to turn on/off toolbars, if they cannot
-               // update ToolbarBackend::flags. That is to say, ToolbarsBackend::flags
-               // should reflect the true state of toolbars.
-               // 
-               // menu is displayed as 
+               // frontends are not supposed to turn on/off toolbars,
+               // if they cannot update ToolbarBackend::flags. That
+               // is to say, ToolbarsBackend::flags should reflect
+               // the true state of toolbars.
+               //
+               // menu is displayed as
                //       on/off review
-               // and 
+               // and
                //              review (auto)
                // in the case of auto.
                if (cit->flags & ToolbarInfo::AUTO)
                        label += _(" (auto)");
                tomenu.add(MenuItem(MenuItem::Command, label,
-                                   FuncRequest(LFUN_TOOLBAR_TOGGLE_STATE, cit->name)));
+                                   FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name + " allowauto")));
        }
 }
 
 
 void expandBranches(Menu & tomenu, Buffer const * buf)
 {
-       if (!buf)
+       if (!buf) {
+               tomenu.add(MenuItem(MenuItem::Command,
+                                   _("No Document Open!"),
+                                   FuncRequest(LFUN_NOACTION)));
                return;
+       }
 
        BufferParams const & params = buf->getMasterBuffer()->params();
+       if (params.branchlist().empty()) {
+               tomenu.add(MenuItem(MenuItem::Command,
+                                   _("No Branch in Document!"),
+                                   FuncRequest(LFUN_NOACTION)));
+               return;
+       }
 
        BranchList::const_iterator cit = params.branchlist().begin();
        BranchList::const_iterator end = params.branchlist().end();