From 4b6a8023987aad556e62401e1d88fca425fd110d Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Fri, 10 Apr 2009 00:42:24 +0000 Subject: [PATCH] Add context menus to the Toc for labels(settings), branches, graphics, citations, figures, tables. This is now possible because we can dispatch all the necessary LFUNs to the insets. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29177 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ui/stdcontext.inc | 46 +++++++++++++++++++++++++++++++++ src/frontends/qt4/TocWidget.cpp | 13 +++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 41540037b5..ceb8fdf7a1 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -420,6 +420,52 @@ Menuset Menu "context-toc-label" Item "Copy Label as Reference|C" "copy-label-as-reference" Item "Insert Reference at Cursor Position|I" "insert-label-as-reference" + Separator + Item "Settings...|S" "inset-settings" + End + +# +# Toc Branches context menu +# + + Menu "context-toc-branch" + Item "Activate Branch|A" "branch-activate" + Item "Deactivate Branch|e" "branch-deactivate" + Item "Settings...|S" "inset-settings" + End + +# +# Toc Graphics context menu +# + + Menu "context-toc-graphics" + Item "Settings...|S" "inset-settings" + Separator + Item "Edit externally...|x" "inset-edit" + End + +# +# Toc Citation context menu +# + + Menu "context-toc-citation" + Item "Settings...|S" "inset-settings" + End + +# +# Toc Figures context menu +# + + Menu "context-toc-figure" + Item "Settings...|S" "inset-settings" + End + +# +# Toc Tables context menu +# + + Menu "context-toc-table" + Item "Settings...|S" "inset-settings" End End diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index 02f95eefa7..3387722d52 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -103,9 +103,20 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd) DocIterator const & dit = item.dit(); Inset * inset = 0; - if (current_type_ == "label") + if (current_type_ == "label" + || current_type_ == "graphics" + || current_type_ == "citation") inset = dit.nextInset(); + else if (current_type_ == "branch") + inset = &dit.inset(); + + else if (current_type_ == "table" || current_type_ == "figure") { + DocIterator tmp_dit(dit); + tmp_dit.pop_back(); + inset = &tmp_dit.inset(); + } + FuncRequest tmpcmd(cmd); if (inset) inset->dispatch(cur, tmpcmd); -- 2.39.2