[LyX/master] Polish the counter UI a bit and add some to the documentation.
Richard Kimberly Heck
rikiheck at lyx.org
Fri May 1 23:26:30 UTC 2020
commit bc4ca12ab5911c901a3715e434cafd1d9b997ffa
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date: Fri May 1 19:03:54 2020 -0400
Polish the counter UI a bit and add some to the documentation.
---
lib/doc/UserGuide.lyx | 57 ++++++++++++++++++++++++++++++++++++-
lib/ui/stdmenus.inc | 2 +-
src/frontends/qt/GuiCounter.cpp | 6 ++--
src/frontends/qt/ui/CounterUi.ui | 8 ++++-
src/insets/InsetCounter.cpp | 16 +++++-----
5 files changed, 74 insertions(+), 15 deletions(-)
diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx
index 2108016..ca92802 100644
--- a/lib/doc/UserGuide.lyx
+++ b/lib/doc/UserGuide.lyx
@@ -147,7 +147,7 @@ logicalmkup
\papersides 2
\paperpagestyle default
\tablestyle default
-\tracking_changes false
+\tracking_changes true
\output_changes false
\change_bars false
\postpone_fragile_content false
@@ -29903,7 +29903,7 @@ lyxonly "false"
\end_inset
-\change_inserted -584632292 1588304519
+\change_inserted -584632292 1588374084
).
Mostly, this is handled automatically, but there are times one wants to
modify counters directly.
@@ -29917,6 +29917,59 @@ lyxonly "false"
\end_layout
+\begin_layout Standard
+
+\change_inserted -584632292 1588374095
+There are six commands you can use:
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted -584632292 1588374116
+Set Counter: Allows you to assign a specific value to a counter
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted -584632292 1588374135
+Add to Counter: Allows you to add some specified amount to a counter (or
+ to subtract, if you choose a negative number)
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted -584632292 1588374149
+Reset to 0: Sets the value of the counter to 0.
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted -584632292 1588374169
+Save Value of Counter: Saves the value of the counter so that it can later
+ be restored.
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted -584632292 1588374185
+Restore Value of Counter: Restores the previously saved value.
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted -584632292 1588374203
+Display Value of Counter: Shows the value of the counter (in the output).
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted -584632292 1588374230
+The dialog allows you to choose which counter you wish to modify from all
+ those that are available in the current document class.
+\change_unchanged
+
+\end_layout
+
\begin_layout Section
Appendices
\begin_inset Index idx
diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc
index 29fdcef..2b4277b 100644
--- a/lib/ui/stdmenus.inc
+++ b/lib/ui/stdmenus.inc
@@ -123,6 +123,7 @@ Menuset
Item "Paragraph Settings...|P" "layout-paragraph"
Submenu "Text Properties|x" "edit_textprops"
OptSubmenu "Custom Text Styles|S" "edit_textstyles"
+ Item "Manage Counter Values" "dialog-show-new-inset counter"
LanguageSelector
Separator
# Mathed b0rkage means these don't work properly
@@ -398,7 +399,6 @@ Menuset
Item "URL|U" "flex-insert URL"
Item "Hyperlink...|k" "href-insert"
Item "Footnote|F" "footnote-insert"
- Item "Counter" "dialog-show-new-inset counter"
Item "Marginal Note|M" "marginalnote-insert"
Item "Program Listing[[Menu]]" "listing-insert"
Separator
diff --git a/src/frontends/qt/GuiCounter.cpp b/src/frontends/qt/GuiCounter.cpp
index 3103055..6deed4b 100644
--- a/src/frontends/qt/GuiCounter.cpp
+++ b/src/frontends/qt/GuiCounter.cpp
@@ -157,10 +157,10 @@ bool GuiCounter::checkWidgets(bool readonly) const
valueSB->setRange(-10000, 10000);
else
valueSB->setRange(0, 10000);
+ vtypeLA->setEnabled(!readonly && cmdIsValue);
vtypeCB->setEnabled(!readonly && cmdIsValue);
- if (!InsetParamsWidget::checkWidgets())
- return false;
- return !readonly &&
+
+ return InsetParamsWidget::checkWidgets() && !readonly &&
!counterCB->currentText().isEmpty() &&
!actionCB->currentText().isEmpty() &&
!(cmdIsValue && vtypeCB->currentText().isEmpty());
diff --git a/src/frontends/qt/ui/CounterUi.ui b/src/frontends/qt/ui/CounterUi.ui
index c4b8aeb..16300a8 100644
--- a/src/frontends/qt/ui/CounterUi.ui
+++ b/src/frontends/qt/ui/CounterUi.ui
@@ -34,6 +34,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>Select counter to modify</string>
+ </property>
</widget>
</item>
<item row="1" column="0">
@@ -54,6 +57,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>SET counter value; ADD TO (or subtract from) counter value; RESET counter to zero; SAVE counter value; RESTORE previously saved counter value; DISPLAY counter value</string>
+ </property>
</widget>
</item>
<item row="2" column="0">
@@ -93,7 +99,7 @@
<item row="3" column="0">
<widget class="QLabel" name="vtypeLA">
<property name="text">
- <string>Value &Type:</string>
+ <string>Display Format</string>
</property>
<property name="buddy">
<cstring>vtypeCB</cstring>
diff --git a/src/insets/InsetCounter.cpp b/src/insets/InsetCounter.cpp
index 07894a8..32f7c64 100644
--- a/src/insets/InsetCounter.cpp
+++ b/src/insets/InsetCounter.cpp
@@ -60,12 +60,12 @@ InsetCounter::InsetCounter(InsetCounter const & ir)
const map<string, string> InsetCounter::counterTable =
{
- {"set", N_("Set")},
- {"addto", N_("Add To")},
- {"reset", N_("Reset")},
- {"save", N_("Save")},
- {"restore", N_("Restore")},
- {"value", N_("Value")}
+ {"set", N_("Set Counter")},
+ {"addto", N_("Add To Counter")},
+ {"reset", N_("Reset To 0")},
+ {"save", N_("Save Value of Counter")},
+ {"restore", N_("Restore Value of Counter")},
+ {"value", N_("Display Value of Counter")}
};
@@ -237,7 +237,7 @@ void InsetCounter::updateBuffer(ParIterator const &, UpdateType, bool const)
docstring const & val = getParam("value");
cnts.addto(cntr, convert<int>(val));
screen_label_ = bformat(_("Counter: Add to %1$s"), cntr);
- tooltip_ = bformat(_("Add to value of counter %1$s"), cntr);
+ tooltip_ = bformat(_("Add %1$s to value of counter %2$s"), val, cntr);
} else if (cmd == "reset") {
cnts.reset(cntr);
screen_label_ = bformat(_("Counter: Reset %1$s"), cntr);
@@ -252,7 +252,7 @@ void InsetCounter::updateBuffer(ParIterator const &, UpdateType, bool const)
tooltip_ = bformat(_("Restore value of counter %1$s"), cntr);
} else if (cmd == "value") {
screen_label_ = bformat(_("Counter: Value %1$s"), cntr);
- tooltip_ = bformat(_("Print value of counter %1$s"), cntr);
+ tooltip_ = bformat(_("Display value of counter %1$s"), cntr);
}
}
More information about the lyx-cvs
mailing list