>>>>> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:


>> It would make sense if the Branch menu contained a disabled "No
>> branch defined" menu entry.

Abdelrazak> Is this possible with current architecture?

Yes, like this (shall I use the plural and Upcase, like in the first
message?).

JMarc

Index: lib/ui/stdmenus.inc
===================================================================
--- lib/ui/stdmenus.inc	(révision 18552)
+++ lib/ui/stdmenus.inc	(copie de travail)
@@ -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: src/MenuBackend.cpp
===================================================================
--- src/MenuBackend.cpp	(révision 18552)
+++ src/MenuBackend.cpp	(copie de travail)
@@ -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 Documents 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();

Reply via email to