* src/MenuBackend.cpp (expandBranches): when there is no branch, just

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
This commit is contained in:
Jean-Marc Lasgouttes 2007-05-31 12:07:48 +00:00
parent 4f387b58a1
commit 24fb9c5214
2 changed files with 18 additions and 8 deletions

View 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

View 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();