From: Juergen Spitzmueller Date: Thu, 22 Aug 2024 06:11:18 +0000 (+0200) Subject: Add GUI support for nomencl options X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=33869b62bf201e03d0085f190e514ed14b177ef3;p=lyx.git Add GUI support for nomencl options --- diff --git a/development/FORMAT b/development/FORMAT index d7146861d3..d4015ffa96 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -11,6 +11,8 @@ changes happened in particular if possible. A good example would be * Format incremented to 628: Add support for nomentbl-style nomencl insets: \nomenclature[]{}{}{}{} + New buffer param \nomencl_options which holds a comma-separated + list of options (of the nomencl package). 2024-08-12 Jürgen Spitzmüller * Format incremented to 627: Transform nomenclature inset to diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx index 72640e7be1..aded3b154d 100644 --- a/lib/doc/UserGuide.lyx +++ b/lib/doc/UserGuide.lyx @@ -9646,14 +9646,12 @@ Verbatim \end_layout \begin_layout Verbatim - This is Verbatim. \end_layout \begin_layout Verbatim \noindent \align block - The following 2 lines are empty: \end_layout @@ -9666,7 +9664,6 @@ The following 2 lines are empty: \end_layout \begin_layout Verbatim - Almost everything is allowed in Verbatim:"%&$§#~'` \backslash }][{| @@ -9690,7 +9687,6 @@ Verbatim \end_layout \begin_layout Verbatim* - This is Verbatim*. \end_layout @@ -36773,7 +36769,7 @@ Tabular \family sans Document\SpecialChar menuseparator Settings\SpecialChar menuseparator -Indexes & Nomenclature +Nomenclature \family default . With this, @@ -37282,6 +37278,8 @@ a \end_layout \begin_layout Standard + +\change_deleted -712698321 1724304988 For subgrouping and tips for using sort entries see the \series bold nomencl @@ -37296,6 +37294,8 @@ literal "true" \end_inset . +\change_unchanged + \end_layout \begin_layout Subsection @@ -37336,13 +37336,90 @@ The \series bold nomencl \series default - package offers some options to adjust the appearance of the nomenclature. - Here are some of its options; + package offers +\change_deleted -712698321 1724303919 +some +\change_inserted -712698321 1724303922 +a range of +\change_unchanged + options to adjust the appearance of the nomenclature. + +\change_inserted -712698321 1724303527 +They can be set in +\family sans +Document\SpecialChar menuseparator +Settings\SpecialChar menuseparator +Nomenclature +\family default +: +\change_deleted -712698321 1724303912 +Here are some of its options; for more have a look at its documentation: +\change_unchanged + +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1724303686 +Nomenclature +\begin_inset space ~ +\end_inset + +style offers the selection between the default style, + which outputs the nomenclature as a list and a tabular style which sets it as a multipart table. + The latter style features two more constituents of the nomenclature entry: + a unit (which is typeset by means of the +\family sans +siunits +\family default + package) and an additional note. \end_layout \begin_layout Description -refeq Appends the phrase + +\change_inserted -712698321 1724303561 +Add +\begin_inset space ~ +\end_inset + +to +\begin_inset space ~ +\end_inset + +table +\begin_inset space ~ +\end_inset + +of +\begin_inset space ~ +\end_inset + +contents adds the nomenclature list to the table of contents. +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1724305361 +Add +\begin_inset space ~ +\end_inset + +equation +\begin_inset space ~ +\end_inset + +references +\change_deleted -712698321 1724303715 +refeq +\change_unchanged + +\change_deleted -712698321 1724303716 +A +\change_inserted -712698321 1724303717 +a +\change_unchanged +ppends the phrase \begin_inset Quotes eld \end_inset @@ -37370,7 +37447,27 @@ eq \end_layout \begin_layout Description -refpage Appends the phrase + +\change_deleted -712698321 1724303727 +refpage +\change_inserted -712698321 1724305363 +Add +\begin_inset space ~ +\end_inset + +page +\begin_inset space ~ +\end_inset + +references +\change_unchanged + +\change_deleted -712698321 1724303734 +A +\change_inserted -712698321 1724303734 +a +\change_unchanged +ppends the phrase \begin_inset Quotes eld \end_inset @@ -37394,14 +37491,87 @@ page page \family default \emph default - is the number of the page on which the nomenclature entry appeared + is the number of the page on which the nomenclature entry appear +\change_deleted -712698321 1724305457 +ed +\change_inserted -712698321 1724305457 +s +\change_unchanged + \end_layout \begin_layout Description -intoc Inserts the nomenclature in the Table of Contents + +\change_deleted -712698321 1724303752 +intoc +\change_inserted -712698321 1724303758 +Use +\begin_inset space ~ +\end_inset + +standard +\begin_inset space ~ +\end_inset + +subgroups +\change_unchanged + +\change_deleted -712698321 1724303777 +Inserts the nomenclature in the Table of Contents +\change_inserted -712698321 1724305020 +uses predefined subgroups (Latin Letters, + Greek Letters, + Superscripts, + Subscripts) to structure the nomenclature list. + Please refer to the +\series bold +nomencl +\series default + documentation, + +\begin_inset CommandInset citation +LatexCommand cite +key "nomencl" +literal "true" + +\end_inset + +, + if you need different subgrouping. +\change_unchanged + +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1724303903 +Other +\begin_inset space ~ +\end_inset + +options lets you insert any of the other options the package provides. + Please refer to the +\series bold +nomencl +\series default + documentation, + +\begin_inset CommandInset citation +LatexCommand cite +key "nomencl" +literal "true" + +\end_inset + +, + for details. +\change_unchanged + \end_layout \begin_layout Standard + +\change_deleted -712698321 1724303935 To use one or more of the options, add them to the comma-separated document class options list in the \family sans @@ -37418,73 +37588,183 @@ refpage, \end_layout \begin_layout Standard + +\change_deleted -712698321 1724303935 \begin_inset VSpace bigskip \end_inset +\change_unchanged + \end_layout \begin_layout Standard -You can also use the first two options above only for certain nomenclature entries when you add one of the following commands as last entry to the + +\change_deleted -712698321 1724303954 +You can also use the first two options above +\change_inserted -712698321 1724306838 +With the default style, + if you want to add page or equation references +\change_unchanged + only +\change_deleted -712698321 1724303972 +for +\change_inserted -712698321 1724303972 +to +\change_unchanged + +\change_inserted -712698321 1724303974 +selected +\change_deleted -712698321 1724303976 +certain +\change_unchanged + nomenclature entries +\change_inserted -712698321 1724303985 +, + you can do this by +\change_deleted -712698321 1724303987 + when you +\change_unchanged + add +\change_inserted -712698321 1724303990 +ing +\change_unchanged + one of the following commands +\change_inserted -712698321 1724304028 +in \SpecialChar TeX + mode +\change_unchanged +a +\change_inserted -712698321 1724304042 +t +\change_deleted -712698321 1724304042 +s +\change_unchanged + +\change_inserted -712698321 1724304098 +the very end +\change_deleted -712698321 1724304050 +last entry to +\change_inserted -712698321 1724304050 +of +\change_unchanged + the \family sans Description \family default - field in the nomenclature dialog: + field +\change_deleted -712698321 1724304011 +in +\change_inserted -712698321 1724304011 +of +\change_unchanged + the nomenclature +\change_inserted -712698321 1724304088 +entry +\change_deleted -712698321 1724304016 +dialog +\change_unchanged +: \end_layout \begin_layout Description \backslash -nomrefeq Like the +nomrefeq +\change_deleted -712698321 1724304118 +Like the \series bold refeq \series default option +\change_inserted -712698321 1724304130 +for an equation reference +\change_unchanged + \end_layout \begin_layout Description \backslash -nomrefpage Like the +nomrefpage +\change_deleted -712698321 1724304133 +Like the \series bold refpage \series default option +\change_inserted -712698321 1724304135 +for a page reference +\change_unchanged + \end_layout \begin_layout Description \backslash -nomrefeqpage Short notation of +nomrefeqpage +\change_deleted -712698321 1724304161 +Short notation of \series bold \backslash nomrefeq \backslash nomrefpage +\change_inserted -712698321 1724304175 +for a combined equation and page reference +\end_layout + +\begin_layout Standard + +\change_inserted -712698321 1724304216 +If you have selected a reference option in document settings, + you can also disable it for selected entries by adding instead either of +\change_unchanged + \end_layout \begin_layout Description \backslash -nomnorefeq, +nomnorefeq +\change_deleted -712698321 1724304228 +, \begin_inset space ~ \end_inset +\change_inserted -712698321 1724304229 + +\end_layout + +\begin_layout Description + \backslash -nomnorefpage, +nomnorefpage +\change_deleted -712698321 1724304230 +, \begin_inset space ~ \end_inset +\change_inserted -712698321 1724304231 + +\end_layout + +\begin_layout Description + \backslash -nomnorefeqpage Turns off the corresponding options +nomnorefeqpage +\change_deleted -712698321 1724304230 + Turns off the corresponding options +\change_unchanged + \end_layout \begin_layout Standard -\change_inserted -712698321 1723460016 +\change_inserted -712698321 1724306868 Note that you need to add \begin_inset Flex Code status collapsed @@ -37501,11 +37781,18 @@ protect \end_inset - in front of the command if the nomenclature is in a section heading or caption. + in front of these command if the nomenclature is in a section heading or caption. + Also note that these commands do not work in tabular style. \end_layout \begin_layout Standard -Words like + +\change_deleted -712698321 1724304289 +Words like +\change_inserted -712698321 1724304292 +Expressions such as +\change_unchanged + \begin_inset Quotes eld \end_inset @@ -37514,7 +37801,11 @@ page \end_inset are automatically translated for most document languages. - If not, + If not +\change_inserted -712698321 1724304360 + (or if you want a different wording) +\change_unchanged +, add these lines in front of the nomenclature list as \SpecialChar TeX code: \end_layout @@ -37704,7 +37995,17 @@ Printing \end_layout \begin_layout Standard -To print the nomenclature, +To +\change_deleted -712698321 1724304544 +print +\change_inserted -712698321 1724304545 +input +\change_unchanged + the nomenclature +\change_inserted -712698321 1724304556 + at the location where it should be printed +\change_unchanged +, use the menu \family sans Insert\SpecialChar menuseparator @@ -37725,9 +38026,36 @@ Nomenclature \end_inset will show the place where the nomenclature is printed in the output. - By right-clicking on it, - the amount of space for symbols can be altered. - You can choose between these settings: + +\change_inserted -712698321 1724304569 + +\end_layout + +\begin_layout Standard + +\change_inserted -712698321 1724304668 +With default nomenclature style, + you can adjust the list appearance (space between symbol and description and list indentation) +\change_deleted -712698321 1724304607 +B +\change_inserted -712698321 1724304610 +b +\change_unchanged +y right-clicking on +\change_inserted -712698321 1724304620 +this box. +\change_deleted -712698321 1724304636 +it, + the amount of space for symbols can be altered +\change_unchanged +. + You can +\change_deleted -712698321 1724304674 +choose +\change_inserted -712698321 1724304674 +select +\change_unchanged + between these settings: \end_layout \begin_layout Description @@ -37776,14 +38104,14 @@ d \change_inserted -712698321 1721576994 Note that this guessing might go wrong, as \SpecialChar LyX - does not know how how the formatted output in your PDF will look like exactly. + does not know how the formatted output in your PDF will look like exactly. \change_unchanged \end_layout \begin_layout Description -\change_inserted -712698321 1721577537 +\change_inserted -712698321 1724304720 Longest \begin_inset space ~ \end_inset @@ -37798,13 +38126,17 @@ width (set) here you can enter the widest symbol yourself to use its width. While this is more accurate than the second method, - the disadvantage is that you need to keep this up-to date if new (longer) entries are added to the nomenclature. + the disadvantage is that you need to keep this up to date if new (longer) entries are added to the nomenclature. \change_unchanged \end_layout \begin_layout Description Custom custom space +\change_inserted -712698321 1724304744 + as specified in the widget. +\change_unchanged + \end_layout \begin_layout Standard @@ -37851,7 +38183,13 @@ nomname{List of Symbols}}} \end_layout \begin_layout Standard -When you are using another document language than English, + +\change_deleted -712698321 1724304772 +When +\change_inserted -712698321 1724304772 +If +\change_unchanged + you are using another document language than English, replace \begin_inset Newline newline \end_inset @@ -37866,7 +38204,13 @@ captionsenglish \series bold \backslash -extras*** + +\change_deleted -712698321 1724304814 +extras +\change_inserted -712698321 1724304814 +captions +\change_unchanged +*** \series default , where *** is the name of the language used. @@ -52286,10 +52630,20 @@ nolink "false" \end_inset for details). +\change_inserted -712698321 1724303218 -\change_inserted -712698321 1724253333 - Moreover, - you can select a nomenclature style (see section +\end_layout + +\begin_layout Section + +\change_inserted -712698321 1724303226 +Nomenclature +\end_layout + +\begin_layout Standard + +\change_inserted -712698321 1724303279 +Here you can select a nomenclature style and select among some options that determine the output of the nomenclature list (see section \begin_inset space ~ \end_inset diff --git a/lib/doc/de/UserGuide.lyx b/lib/doc/de/UserGuide.lyx index 9f1145fdd6..cb34b220c3 100644 --- a/lib/doc/de/UserGuide.lyx +++ b/lib/doc/de/UserGuide.lyx @@ -9302,12 +9302,10 @@ Unformatiert \end_layout \begin_layout Verbatim - Dies ist Unformatiert. \end_layout \begin_layout Verbatim - Die folgenden 2 Zeilen sind leer: \end_layout @@ -9320,7 +9318,6 @@ Die folgenden 2 Zeilen sind leer: \end_layout \begin_layout Verbatim - Fast alles ist in Unformatiert erlaubt:"%&$§#~'` \backslash }][{| @@ -9346,7 +9343,6 @@ Unformatiert \end_layout \begin_layout Verbatim* - Dies ist Unformatiert*. \end_layout @@ -35804,10 +35800,7 @@ Nomenklatur \begin_layout Standard Manchmal benötigen Sie vielleicht ein Verzeichnis von Symbolen oder Begriffen mit deren Bedeutung – eine sogenannte Nomenklatur bzw. -\begin_inset space ~ -\end_inset - -ein Glossar. + ein Glossar. \end_layout \begin_layout Standard @@ -35876,7 +35869,11 @@ Nom wird eingefügt. Falls der Cursor direkt hinter einem Wort steht, wird dieses hineinkopiert. - Ein Nomenklatur-Eintrag besteht im Standard-Stil aus zwei Hauptteilen: + +\end_layout + +\begin_layout Standard +Ein Nomenklatur-Eintrag besteht im Standard-Stil aus zwei Hauptteilen: das \family sans Symbol @@ -35899,7 +35896,7 @@ Wenn Sie in \family sans Dokument\SpecialChar menuseparator Einstellungen\SpecialChar menuseparator -Stichwortverzeichnis & Nomenklatur +Nomenklatur \family default den Nomenklatur-Stil \begin_inset Quotes gld @@ -36095,24 +36092,6 @@ Einfügen Dann stimmt die Sortierreihenfolge wieder. \end_layout -\begin_layout Standard -Um verschachtelte Nomenklaturen zu erstellen, - lesen Sie bitte in der -\series bold -nomencl -\series default --Dokumentation nach, - -\begin_inset CommandInset citation -LatexCommand cite -key "nomencl" -literal "true" - -\end_inset - -. -\end_layout - \begin_layout Subsection Nomenklatur-Optionen \begin_inset Index idx @@ -36151,78 +36130,134 @@ Das Paket \series bold nomencl \series default - bietet einige Optionen an um das Aussehen der Nomenklatur zu verändern. - Hier sind einige seiner Optionen, - für weitere siehe seine Dokumentation: + bietet eine Reihe von Optionen an, + um das Aussehen des Nomenklaturverzeichnisses zu verändern. + Diese können Sie in +\family sans +Dokument\SpecialChar menuseparator +Einstellungen\SpecialChar menuseparator +Nomenklatur +\family default + verwalten: \end_layout \begin_layout Description -refeq Verweis mit dem Ausdruck +Nomenklatur-Stil bietet Ihnen die Auswahl zwischen dem Standard-Stil, + der das Nomenklaturverzeichnis als Liste ausgibt, + und dem Tabellen-Stil, + der es als mehrseitige Tabelle setzt. + Im letzteren haben Sie zwei zusätzliche Konstituenten zur Verfügung: + (Maß-)Einheit (welche mithilfe des Pakets \family sans -„, - siehe Gleichung (#) +siunits \family default -“ + gesetzt wird) sowie ein Feld für zusätzliche Anmerkungen. \end_layout \begin_layout Description -refpage Verweis mit dem Ausdruck +Zum +\begin_inset space ~ +\end_inset + +Inhaltsverzeichnis +\begin_inset space ~ +\end_inset + +hinzufügen fügt das Nomenklaturverzeichnis ins Inhaltsverzeichnis ein. +\end_layout + +\begin_layout Description +Gleichungsverweise +\begin_inset space ~ +\end_inset + +hinzufügen fügt den Einträgen den Zusatz \family sans „, - Seite (#) + siehe Gleichung (#) \family default -“ +“ an, + wobei (#) die Nummer der letzten Gleichung vor dem jeweiligen Nomenklatureintrag ist. \end_layout \begin_layout Description -intoc fügt die Nomenklatur ins Inhaltsverzeichnis ein. -\end_layout +Seitenverweise +\begin_inset space ~ +\end_inset -\begin_layout Standard -Um eine oder mehrere Optionen benutzen zu können, - fügen Sie sie, - durch Kommas getrennt, - in das Feld -\family sans -Optionen -\family default - von +einfügen fügt den Einträgen den Zusatz \family sans -Dokument\SpecialChar menuseparator -Einstellungen\SpecialChar menuseparator -Dokumentklasse +„, + Seite # \family default - ein. - In diesem Dokument werden die Optionen +“ an, + wobei # die Paginierung der Seite ist, + auf der der jeweilige Eintrag erscheint. +\end_layout + +\begin_layout Description +Standard-Untergruppen +\begin_inset space ~ +\end_inset + +verwenden verwendet vordefinierte Untergruppen (lateinische Buchstaben, + griechische Buchstaben, + Hochgestellt, + Tiefgestellt), + um das Nomenklaturverzeichnis zu strukturieren. + Wenn Sie eine andere Strukturierung brauchen, + konsultieren Sie bitte die \series bold -refpage, - intoc +nomencl \series default - verwendet. +-Dokumentation +\begin_inset CommandInset citation +LatexCommand cite +key "nomencl" +literal "true" + +\end_inset + +. \end_layout -\begin_layout Standard -\begin_inset VSpace bigskip +\begin_layout Description +Andere +\begin_inset space ~ \end_inset +Optionen ermöglicht es Ihnen, + jede weitere Option des Pakets einzufügen. + Bitte konsultieren Sie bitte die +\series bold +nomencl +\series default +-Dokumentation +\begin_inset CommandInset citation +LatexCommand cite +key "nomencl" +literal "true" +\end_inset + + für Einzelheiten. \end_layout \begin_layout Standard -Die ersten beiden Optionen können Sie auch nur für gewisse Nomenklatureinträge benutzen, +Falls Sie Seiten- oder Gleichungsverweise nur für einzelne Nomenklatureinträge verwenden wollen, + können Sie dies im Standardstil tun, wenn Sie als letzten Eintrag im Feld \family sans Beschreibung \family default - folgendes schreiben: + im \SpecialChar TeX +-Modus folgendes schreiben: \end_layout \begin_layout Description \backslash -nomrefeq wie die Option -\series bold -refeq +nomrefeq für einen Gleichungsverweis \end_layout \begin_layout Description @@ -36232,44 +36267,42 @@ refeq \backslash nomrefpage \series default - wie die Option -\series bold -refpage -\series default - + für einen Seitenverweis \end_layout \begin_layout Description \backslash -nomrefeqpage ist die Kurzform von -\series bold +nomrefeqpage für einen kombinierten Gleichungs- und Seitenverweis +\end_layout -\backslash -nomrefeq +\begin_layout Standard +Falls Sie eine Verweis-Option in den Dokumenteinstellungen ausgewählt haben, + können Sie diese für einzelne Einträge auch deaktivieren. + Schreiben Sie hierfür an die genannte Position statt dessen eines dieser Befehle \end_layout \begin_layout Description \backslash -nomnorefeq, -\begin_inset space ~ -\end_inset +nomnorefeq +\end_layout +\begin_layout Description \backslash -nomnorefpage, -\begin_inset space ~ -\end_inset +nomnorefpage +\end_layout +\begin_layout Description \backslash -nomnorefeqpage schaltet die entsprechende Option ab +nomnorefeqpage \end_layout \begin_layout Standard Beachten Sie, - dass Sie dem Befehl + dass Sie den Befehlen \begin_inset Flex Code status collapsed @@ -36283,6 +36316,8 @@ protect voranstellen müssen, wenn sich der Nomenklatureintrag in einer Überschrift oder Legende befindet. + Beachten Sie weiterhin, + dass diese Befehle im Tabellenstil nichts bewirken. \end_layout \begin_layout Standard @@ -36297,7 +36332,7 @@ Seite automatisch übersetzt. Wenn Sie diese Übersetzungen ändern wollen, fügen Sie diese Zeilen als \SpecialChar TeX --Code vor dem Nomenklatueverzeichnis ein: +-Code vor dem Nomenklaturverzeichnis ein: \end_layout \begin_layout Standard @@ -36370,7 +36405,7 @@ Wenn die Nummern Hyperlinks sein sollen, \family sans Hyperref-Unterstützung \family default - in den Documenteinstellungen unter + in den Dokumenteinstellungen unter \family sans PDF-Eigenschaften \family default @@ -36445,7 +36480,7 @@ nobreakspace{}#1}} \end_layout \begin_layout Subsection -Nomenklatur drucken +Nomenklaturverzeichnis drucken \begin_inset Index idx range none pageformat default @@ -36477,25 +36512,19 @@ Einfügen\SpecialChar menuseparator Verzeichnis\SpecialChar menuseparator Nomenklatur \family default - können Sie ein Nomenklatur -\begin_inset ERT -status collapsed - -\begin_layout Plain Layout - -"= -\end_layout - -\end_inset - -Verzeichnis einfügen. + können Sie ein Nomenklaturverzeichnis einfügen. An der Stelle erscheint ein Kästchen mit der Aufschrift \family sans „Nomenklatur \family default “, und dort wird das Verzeichnis auch gedruckt. - Mit einem Rechtsklick auf das Kästchen kann man die verfügbare Breite für die Symbole einstellen. + +\end_layout + +\begin_layout Standard +Im Fall des Standardstils können Sie mit einem Rechtsklick auf das Kästchen einen Dialog öffnen, + in dem Sie das Aussehen der Liste (den Einzug und den Abstand zwischen Symbol und Beschreibung) anpassen können. Sie können dabei zwischen diesen Einstellungen wählen: \end_layout @@ -36560,7 +36589,7 @@ Marke \end_layout \begin_layout Description -Benutzerdefiniert benutzerdefinierte Breite +Benutzerdefiniert benutzerdefinierte Breite wie im Dialog eingegeben. \end_layout \begin_layout Standard @@ -36605,7 +36634,7 @@ captionsngerman \series bold \backslash -extras*** +captions*** \series default , wobei *** der Name der verwendeten Sprache ist. @@ -50625,7 +50654,7 @@ nolink "false" \end_layout \begin_layout Section -Stichwortverzeichnis & Nomenklatur +Stichwortverzeichnis \end_layout \begin_layout Standard @@ -50647,7 +50676,15 @@ nolink "false" \end_inset für Details). - Außerdem können Sie hier einen Nomenklatur-Stil auswählen (siehe Abschnitt +\end_layout + +\begin_layout Section +Nomenklatur +\end_layout + +\begin_layout Standard +Hier können Sie hier Nomenklatur-Stil auswählen und einige Optionen verwalten, + die die Darstellung der Nomenklaturverzeichnisses bestimmten (siehe Abschnitt \begin_inset space ~ \end_inset diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp index 5ab4c53b5b..20bacc228a 100644 --- a/src/frontends/qt/GuiDocument.cpp +++ b/src/frontends/qt/GuiDocument.cpp @@ -1491,6 +1491,24 @@ GuiDocument::GuiDocument(GuiView & lv) connect(indicesModule, SIGNAL(changed()), this, SLOT(change_adaptor())); + // nomencl + nomenclModule = new UiWidget(this); + connect(nomenclModule->nomenclStyleCO, SIGNAL(activated(int)), + this, SLOT(change_adaptor())); + connect(nomenclModule->inTocCB, SIGNAL(clicked()), + this, SLOT(change_adaptor())); + connect(nomenclModule->eqRefCB, SIGNAL(clicked()), + this, SLOT(change_adaptor())); + connect(nomenclModule->pageRefCB, SIGNAL(clicked()), + this, SLOT(change_adaptor())); + connect(nomenclModule->subgroupsCB, SIGNAL(clicked()), + this, SLOT(change_adaptor())); + connect(nomenclModule->extraOptionsLE, SIGNAL(textChanged(const QString &)), + this, SLOT(change_adaptor())); + nomenclModule->nomenclStyleCO->clear(); + nomenclModule->nomenclStyleCO->addItem(qt_("Default"), QString("default")); + nomenclModule->nomenclStyleCO->addItem(qt_("Tabular"), QString("tabular")); + // maths mathsModule = new UiWidget(this); @@ -1836,7 +1854,8 @@ GuiDocument::GuiDocument(GuiView & lv) docPS->addPanel(changesModule, N_("Change Tracking")); docPS->addPanel(numberingModule, N_("Numbering & TOC")); docPS->addPanel(biblioModule, N_("Bibliography")); - docPS->addPanel(indicesModule, N_("Indexes & Nomenclature")); + docPS->addPanel(indicesModule, N_("Indexes")); + docPS->addPanel(nomenclModule, N_("Nomenclature")); docPS->addPanel(pdfSupportModule, N_("PDF Properties")); docPS->addPanel(mathsModule, N_("Math Options")); docPS->addPanel(floatModule, N_("Float Settings")); @@ -3678,6 +3697,27 @@ void GuiDocument::applyView() // Indices indicesModule->apply(bp_); + // nomencl + vector nomenclOpts; + if (nomenclModule->nomenclStyleCO->currentIndex() == 1) + nomenclOpts.push_back("nomentbl"); + if (nomenclModule->inTocCB->isChecked()) + nomenclOpts.push_back("intoc"); + if (nomenclModule->eqRefCB->isChecked()) + nomenclOpts.push_back("refeq"); + if (nomenclModule->pageRefCB->isChecked()) + nomenclOpts.push_back("refpage"); + if (nomenclModule->subgroupsCB->isChecked()) + nomenclOpts.push_back("stdsubgroups"); + + bp_.nomencl_opts = getStringFromVector(nomenclOpts); + + if (!nomenclModule->extraOptionsLE->text().isEmpty()) { + if (!bp_.nomencl_opts.empty()) + bp_.nomencl_opts += ","; + bp_.nomencl_opts += fromqstr(nomenclModule->extraOptionsLE->text()); + } + // language & quotes switch (langModule->encodingCO->currentIndex()) { case EncodingSets::unicode: { @@ -4213,6 +4253,40 @@ void GuiDocument::paramsToDialog() bool const isReadOnly = isBufferAvailable() ? buffer().isReadonly() : false; indicesModule->update(bp_, isReadOnly); + // nomenclature + vector nomencl_opts = getVectorFromString(bp_.nomencl_opts); + vector::iterator it = std::find(nomencl_opts.begin(), nomencl_opts.end(), "nomentbl"); + if (it != nomencl_opts.end()) { + nomenclModule->nomenclStyleCO->setCurrentIndex(1); + nomencl_opts.erase(it); + } else + nomenclModule->nomenclStyleCO->setCurrentIndex(0); + it = std::find(nomencl_opts.begin(), nomencl_opts.end(), "intoc"); + if (it != nomencl_opts.end()) { + nomenclModule->inTocCB->setChecked(true); + nomencl_opts.erase(it); + } else + nomenclModule->inTocCB->setChecked(false); + it = std::find(nomencl_opts.begin(), nomencl_opts.end(), "refeq"); + if (it != nomencl_opts.end()) { + nomenclModule->eqRefCB->setChecked(true); + nomencl_opts.erase(it); + } else + nomenclModule->eqRefCB->setChecked(false); + it = std::find(nomencl_opts.begin(), nomencl_opts.end(), "refpage"); + if (it != nomencl_opts.end()) { + nomenclModule->pageRefCB->setChecked(true); + nomencl_opts.erase(it); + } else + nomenclModule->pageRefCB->setChecked(false); + it = std::find(nomencl_opts.begin(), nomencl_opts.end(), "stdsubgroups"); + if (it != nomencl_opts.end()) { + nomenclModule->subgroupsCB->setChecked(true); + nomencl_opts.erase(it); + } else + nomenclModule->subgroupsCB->setChecked(false); + nomenclModule->extraOptionsLE->setText(toqstr(getStringFromVector(nomencl_opts))); + // language & quotes int const pos = langModule->languageCO->findData(toqstr( bp_.language->lang())); diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h index acb7c91b17..28d41d777a 100644 --- a/src/frontends/qt/GuiDocument.h +++ b/src/frontends/qt/GuiDocument.h @@ -32,6 +32,7 @@ #include "ui_MasterChildUi.h" #include "ui_MathsUi.h" #include "ui_ModulesUi.h" +#include "ui_NomenclUi.h" #include "ui_NumberingUi.h" #include "ui_OutputUi.h" #include "ui_PageLayoutUi.h" @@ -192,6 +193,7 @@ private: UiWidget *modulesModule; UiWidget *outputModule; UiWidget *listingsModule; + UiWidget *nomenclModule; PreambleModule * preambleModule; LocalLayout * localLayout; diff --git a/src/frontends/qt/GuiIndices.cpp b/src/frontends/qt/GuiIndices.cpp index f6003ec399..25742131dd 100644 --- a/src/frontends/qt/GuiIndices.cpp +++ b/src/frontends/qt/GuiIndices.cpp @@ -62,10 +62,6 @@ GuiIndices::GuiIndices(QWidget * parent) indexCO->addItem(command, command); } - nomenclStyleCO->clear(); - nomenclStyleCO->addItem(qt_("Default"), QString("default")); - nomenclStyleCO->addItem(qt_("Tabular"), QString("tabular")); - indexOptionsLE->setValidator(new NoNewLineValidator(indexOptionsLE)); newIndexLE->setValidator(new NoNewLineValidator(newIndexLE)); } @@ -119,9 +115,6 @@ void GuiIndices::update(BufferParams const & params, bool const readonly) indexOptionsLE->clear(); } - pos = (contains(params.nomencl_opts, "nomentbl")) ? 1 : 0; - nomenclStyleCO->setCurrentIndex(pos); - updateView(); } @@ -169,9 +162,6 @@ void GuiIndices::apply(BufferParams & params) const params.use_indices = multipleIndicesCB->isChecked(); params.indiceslist() = indiceslist_; - if (nomenclStyleCO->currentIndex() == 1) - params.nomencl_opts = "nomentbl"; - string const index_command = fromqstr(indexCO->itemData( indexCO->currentIndex()).toString()); @@ -311,11 +301,6 @@ void GuiIndices::toggleColor(QTreeWidgetItem * item) } -void GuiIndices::on_nomenclStyleCO_activated(int) -{ - changed(); -} - } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt/GuiIndices.h b/src/frontends/qt/GuiIndices.h index 4ba15dbfa6..efaec8354f 100644 --- a/src/frontends/qt/GuiIndices.h +++ b/src/frontends/qt/GuiIndices.h @@ -54,7 +54,6 @@ protected Q_SLOTS: void on_indicesTW_itemSelectionChanged(); void on_colorPB_clicked(); void on_multipleIndicesCB_toggled(bool); - void on_nomenclStyleCO_activated(int); private: /// diff --git a/src/frontends/qt/Makefile.am b/src/frontends/qt/Makefile.am index 6cdc6ed865..c2bac234b0 100644 --- a/src/frontends/qt/Makefile.am +++ b/src/frontends/qt/Makefile.am @@ -306,6 +306,7 @@ UIFILES = \ MathMatrixUi.ui \ MathsUi.ui \ ModulesUi.ui \ + NomenclUi.ui \ NoteUi.ui \ NumberingUi.ui \ OutputUi.ui \ diff --git a/src/frontends/qt/ui/IndicesUi.ui b/src/frontends/qt/ui/IndicesUi.ui index ac7ed3a986..a7b92b90ad 100644 --- a/src/frontends/qt/ui/IndicesUi.ui +++ b/src/frontends/qt/ui/IndicesUi.ui @@ -1,96 +1,78 @@ - - + IndicesUi - - + + 0 0 - 341 - 479 + 401 + 340 - + - - - - - Check if you need multiple indexes (e.g., an Index of Names) - - - &Use multiple indexes - - - - - - - Qt::Orientation::Horizontal - - - - - - + + + + Here you can define an alternative index processor and specify its options. - + Index Generation - + true - - - + + + - - + + &Processor: - + indexCO - - + + Select a processor - - + + - - + + &Options: - + indexOptionsLE - - + + Define program options of the selected processor. - - - - Qt::Orientation::Horizontal + + + + Qt::Horizontal - + 183 20 @@ -101,169 +83,129 @@ - - - + + + + Check if you need multiple indexes (e.g., an Index of Names) + + + &Use multiple indexes + + + + + + + Qt::Horizontal + + + + + + 6 - + 0 - - + + &New:[[index]] - + newIndexLE - - - Enter the name of the desired index (e.g. "Index of Names") and hit "Add" + + + Enter the name of the desired index (e.g. "Index of Names") and hit "Add" - - + + Add a new index to the list - + &Add - - - - Nomenclature + + + + A&vailable Indexes: + + + indicesTW - - - - - - - - Nomenclature St&yle: - - - nomenclStyleCO - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 1 - - - - - - - - - 0 - 0 - - - - Remove the selected index - - - &Remove - - - - - - - - 0 - 0 - - - - Rename the selected index - - - R&ename... - - - - - - - - 0 - 0 - - - - Define or change button color - - - Alter Co&lor... - - - - - - - Qt::Orientation::Vertical - - - QSizePolicy::Policy::Expanding - - - - 20 - 121 - - - - - + + + + + 1 + + + - - - - A&vailable Indexes: + + + + Remove the selected index - - indicesTW + + &Remove + + + + + + + Rename the selected index + + + R&ename... + + + + Define or change button color + + + Alter Co&lor... + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 121 + + + + - qt_i18n.h + qt_i18n.h