]> git.lyx.org Git - features.git/commitdiff
* src/MenuBackend.cpp (expandBranches): when there is no branch, just
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 31 May 2007 12:07:48 +0000 (12:07 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 31 May 2007 12:07:48 +0000 (12:07 +0000)
insert a no-op entry "No Branch in Document!". Makes the branch
feature more discorevable
(expandDocuments, expandFormats, expandFloatListInsert):
(expandCharStyleInsert, expandToc, expandBranches): fix message
when no document is open.

* lib/ui/stdmenus.inc: the insert>branch menu does not need to be
optional.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18591 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ui/stdmenus.inc
src/MenuBackend.cpp

index f84bb8d490fd74bfc6d0a5e78b7569bd020957e8..5c57214a9e418f19678d2eeeee84ec1893333493 100644 (file)
@@ -293,7 +293,7 @@ Menuset
                Submenu "List / TOC|i" "insert_toc"
                Submenu "Float|a" "insert_float"
                Submenu "Note|N" "insert_note"
-               OptSubmenu "Branch|B" "insert_branches"
+               Submenu "Branch|B" "insert_branches"
                Submenu "File|e" "insert_file"
                Item "Box" "box-insert Frameless"
                Separator
index bde9cc0a7b3262aa76bf9e933696476876c9995c..50c2d037cc9d4c7d2782c2762214d22f318faaa0 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;
        }
@@ -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,7 +700,7 @@ void expandToc(Menu & tomenu, Buffer const * buf)
 
        if (!buf) {
                tomenu.add(MenuItem(MenuItem::Command,
-                                   _("No Documents Open!"),
+                                   _("No Document Open!"),
                                    FuncRequest(LFUN_NOACTION)));
                return;
        }
@@ -808,10 +808,20 @@ void expandToolbars(Menu & tomenu)
 
 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();