mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 21:45:24 +00:00
backport r28934.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@29045 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1851f0f0f7
commit
9ee1ec0b62
@ -1035,16 +1035,17 @@ void MenuDefinition::expandBranches(Buffer const * buf)
|
||||
return;
|
||||
}
|
||||
|
||||
BufferParams const & params = buf->masterBuffer()->params();
|
||||
if (params.branchlist().empty()) {
|
||||
BufferParams const & master_params = buf->masterBuffer()->params();
|
||||
BufferParams const & params = buf->params();
|
||||
if (params.branchlist().empty() && master_params.branchlist().empty() ) {
|
||||
add(MenuItem(MenuItem::Command,
|
||||
qt_("No Branch in Document!"),
|
||||
FuncRequest(LFUN_NOACTION)));
|
||||
return;
|
||||
}
|
||||
|
||||
BranchList::const_iterator cit = params.branchlist().begin();
|
||||
BranchList::const_iterator end = params.branchlist().end();
|
||||
BranchList::const_iterator cit = master_params.branchlist().begin();
|
||||
BranchList::const_iterator end = master_params.branchlist().end();
|
||||
|
||||
for (int ii = 1; cit != end; ++cit, ++ii) {
|
||||
docstring label = cit->branch();
|
||||
@ -1056,6 +1057,32 @@ void MenuDefinition::expandBranches(Buffer const * buf)
|
||||
FuncRequest(LFUN_BRANCH_INSERT,
|
||||
cit->branch())));
|
||||
}
|
||||
|
||||
if (buf == buf->masterBuffer())
|
||||
return;
|
||||
|
||||
MenuDefinition child_branches;
|
||||
|
||||
BranchList::const_iterator ccit = params.branchlist().begin();
|
||||
BranchList::const_iterator cend = params.branchlist().end();
|
||||
|
||||
for (int ii = 1; ccit != cend; ++ccit, ++ii) {
|
||||
docstring label = ccit->branch();
|
||||
if (ii < 10) {
|
||||
label = convert<docstring>(ii) + ". " + label
|
||||
+ char_type('|') + convert<docstring>(ii);
|
||||
}
|
||||
child_branches.addWithStatusCheck(MenuItem(MenuItem::Command,
|
||||
toqstr(label),
|
||||
FuncRequest(LFUN_BRANCH_INSERT,
|
||||
ccit->branch())));
|
||||
}
|
||||
|
||||
if (!child_branches.empty()) {
|
||||
MenuItem item(MenuItem::Submenu, qt_("Child Document"));
|
||||
item.setSubmenu(child_branches);
|
||||
add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -84,6 +84,10 @@ docstring InsetBranch::toolTip(BufferView const &, int, int) const
|
||||
docstring const InsetBranch::buttonLabel(BufferView const & bv) const
|
||||
{
|
||||
docstring s = _("Branch: ") + params_.branch;
|
||||
Buffer const & realbuffer = *buffer().masterBuffer();
|
||||
BranchList const & branchlist = realbuffer.params().branchlist();
|
||||
if (!branchlist.find(params_.branch))
|
||||
s = _("Branch (child only): ") + params_.branch;
|
||||
if (!params_.branch.empty()) {
|
||||
// FIXME UNICODE
|
||||
ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
|
||||
|
@ -196,6 +196,8 @@ What's new
|
||||
|
||||
- Add Listings Settings to the Edit menu.
|
||||
|
||||
- Add child-exclusive branches to the Insert>Branch submenu (bug 5851).
|
||||
|
||||
|
||||
* DOCUMENTATION AND LOCALIZATION
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user