]> git.lyx.org Git - features.git/commitdiff
Add context menus to the Toc for labels(settings), branches, graphics, citations...
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 10 Apr 2009 00:42:24 +0000 (00:42 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 10 Apr 2009 00:42:24 +0000 (00:42 +0000)
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
src/frontends/qt4/TocWidget.cpp

index 41540037b50fbbcf83c966ffff6da3e983f69b90..ceb8fdf7a10ffac575fde072d1a7a1514632960c 100644 (file)
@@ -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
index 02f95eefa7b7c7791844bd6c1ea6e91daa54f87e..3387722d52222360efda22394ea479c92d41f60e 100644 (file)
@@ -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);