Git commit 2df62e86ac4b14e65d987db93e2ef050e6bf61f7 by Michel Ludwig.
Committed on 29/01/2017 at 09:39.
Pushed by mludwig into branch 'master'.

Fix enabling/disabling of checkboxes in the user menu dialog

Also improve the documentation of the user menu a little.

Patch by Fritz Meier

BUG: 373301

M  +14   -0    doc/usermenu.docbook
A  +-    --    doc/usermenu_11b.png
M  +5    -0    src/dialogs/usermenu/usermenudialog.cpp

https://commits.kde.org/kile/2df62e86ac4b14e65d987db93e2ef050e6bf61f7

diff --git a/doc/usermenu.docbook b/doc/usermenu.docbook
index 86594279..24e7fc9b 100644
--- a/doc/usermenu.docbook
+++ b/doc/usermenu.docbook
@@ -362,6 +362,20 @@ Now we invoke this macro and obtain 
<userinput>\frac{42}{}</userinput> with the
 
 <para>You can see that a <userinput>perl</userinput> script is called, which 
should work with current selection. The <guilabel>Needs selected 
text</guilabel> parameter is checked to assure a selection. The output of this 
script will be inserted (<guilabel>Insert the output of the chosen 
program</guilabel>) and replace the current  selection (<guilabel>Replace 
selected text</guilabel>), but not selected itself.</para>
 
+<para>Of course you can also call your own programs or scripts. For example 
select a list of numbers, separated by spaces, and call a script or Perl 
program, which transforms this selection into &latex; code for a matrix. 
Whatever your ideas may be, you can realize them using the following usermenu 
entry.</para>
+
+       <screenshot>
+               <screeninfo>Parameter example 2</screeninfo>
+               <mediaobject>
+               <imageobject>
+               <imagedata fileref="usermenu_11b.png" format="PNG" />
+               </imageobject>
+               <textobject>
+               <phrase>Parameter example 2</phrase>
+               </textobject>
+               </mediaobject>
+       </screenshot>
+
 </sect1>
 
 
diff --git a/doc/usermenu_11b.png b/doc/usermenu_11b.png
new file mode 100644
index 00000000..ed44d555
Binary files /dev/null and b/doc/usermenu_11b.png differ
diff --git a/src/dialogs/usermenu/usermenudialog.cpp 
b/src/dialogs/usermenu/usermenudialog.cpp
index bacebc47..65fff392 100644
--- a/src/dialogs/usermenu/usermenudialog.cpp
+++ b/src/dialogs/usermenu/usermenudialog.cpp
@@ -934,6 +934,11 @@ void UserMenuDialog::setMenuentryCheckboxes(UserMenuItem 
*item, bool useInsertOu
 
        // m_cbNeedsSelection and m_cbSelectInsertion are always enabled
        m_UserMenuDialog.m_cbNeedsSelection->setChecked(selectionState);
+
+       // m_cbContextMenu and m_cbReplaceSelection need a selection to be 
enabled
+       m_UserMenuDialog.m_cbContextMenu->setEnabled(selectionState);
+       m_UserMenuDialog.m_cbReplaceSelection->setEnabled(selectionState);
+
        m_UserMenuDialog.m_cbContextMenu->setChecked(contextState);
        m_UserMenuDialog.m_cbReplaceSelection->setChecked(replaceState);
        m_UserMenuDialog.m_cbSelectInsertion->setChecked(insertionState);

Reply via email to