From: John Levon Date: Sat, 29 Mar 2003 03:46:27 +0000 (+0000) Subject: UI for numbering changes X-Git-Tag: 1.6.10~17136 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1583833ef445a4d61da6a258c1fceb7ea01b7aae;p=features.git UI for numbering changes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6621 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/BulletsModule.C b/src/frontends/qt2/BulletsModule.C index 254d05cd99..7e83bfb8a5 100644 --- a/src/frontends/qt2/BulletsModule.C +++ b/src/frontends/qt2/BulletsModule.C @@ -253,7 +253,6 @@ Bullet const BulletsModule::getBullet(int level) void BulletsModule::setCurrentBullet(int font, int character) { - lyxerr << "set current bullet " << std::endl; tmpbulletset = true; tmpbullet.setFont(font); tmpbullet.setCharacter(character); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index a0010cd89e..72dafec25d 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,12 @@ +2003-03-29 John Levon + + * QDocument.C: + * QDocumentDialog.C: + * QDocumentDialog.h: + * ui/NumberingModuleBase.ui: feedback for numbering + + * ui/TextLayoutModuleBase.ui: relayout + 2003-03-29 John Levon * BulletsModule.h: diff --git a/src/frontends/qt2/QDocument.C b/src/frontends/qt2/QDocument.C index 62ae825dfa..4b937368cf 100644 --- a/src/frontends/qt2/QDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include "lengthcombo.h" @@ -230,10 +230,8 @@ void QDocument::apply() params.language = languages.getLanguage(lang_[pos]); // numbering - params.tocdepth = - dialog_->numberingModule->tocDepthSB->value(); - params.secnumdepth = - dialog_->numberingModule->sectionnrDepthSB->value(); + params.tocdepth = dialog_->numberingModule->tocSL->value(); + params.secnumdepth = dialog_->numberingModule->depthSL->value(); // bullets params.user_defined_bullets[0] = dialog_->bulletsModule->getBullet(0); @@ -466,10 +464,9 @@ void QDocument::update_contents() } // numbering - dialog_->numberingModule->tocDepthSB->setValue( - params.tocdepth); - dialog_->numberingModule->sectionnrDepthSB->setValue( - params.secnumdepth); + dialog_->numberingModule->tocSL->setValue(params.tocdepth); + dialog_->numberingModule->depthSL->setValue(params.secnumdepth); + dialog_->updateNumbering(); // bullets dialog_->bulletsModule->setBullet(0,params.user_defined_bullets[0]); diff --git a/src/frontends/qt2/QDocumentDialog.C b/src/frontends/qt2/QDocumentDialog.C index dda87e5c85..3ed90e3f68 100644 --- a/src/frontends/qt2/QDocumentDialog.C +++ b/src/frontends/qt2/QDocumentDialog.C @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include "lengthcombo.h" @@ -79,7 +79,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form) docPS->addPanel(pageLayoutModule, _("Page Layout")); docPS->addPanel(marginsModule, _("Page Margins")); docPS->addPanel(langModule, _("Language")); - docPS->addPanel(numberingModule, _("Table of Contents")); + docPS->addPanel(numberingModule, _("Numbering & TOC")); docPS->addPanel(biblioModule, _("Bibliography")); docPS->addPanel(mathsModule, _("Math options")); docPS->addPanel(floatModule, _("Float Placement")); @@ -100,8 +100,11 @@ QDocumentDialog::QDocumentDialog(QDocument * form) connect(langModule->encodingCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); connect(langModule->quoteStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); // numbering - connect(numberingModule->sectionnrDepthSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); - connect(numberingModule->tocDepthSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); + connect(numberingModule->depthSL, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); + connect(numberingModule->tocSL, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); + connect(numberingModule->depthSL, SIGNAL(valueChanged(int)), this, SLOT(updateNumbering())); + connect(numberingModule->tocSL, SIGNAL(valueChanged(int)), this, SLOT(updateNumbering())); + numberingModule->tocLV->setSorting(-1); // maths connect(mathsModule->amsCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); @@ -364,3 +367,57 @@ void QDocumentDialog::classChanged() } } } + + +void QDocumentDialog::updateNumbering() +{ + int const depth = numberingModule->depthSL->value(); + int const toc = numberingModule->tocSL->value(); + QListViewItem * partitem = numberingModule->tocLV->firstChild(); + QListViewItem * chapteritem = partitem->nextSibling(); + QListViewItem * sectionitem = chapteritem->nextSibling(); + QListViewItem * subsectionitem = sectionitem->nextSibling(); + QListViewItem * subsubsectionitem = subsectionitem->nextSibling(); + QListViewItem * paragraphitem = subsubsectionitem->nextSibling(); + QListViewItem * subparagraphitem = paragraphitem->nextSibling(); + + QString const no = qt_("No"); + QString const yes = qt_("Yes"); + + //numberingModule->tocLV->setUpdatesEnabled(false); + + partitem->setText(1, yes); + chapteritem->setText(1, yes); + sectionitem->setText(1, yes); + subsectionitem->setText(1, yes); + subsubsectionitem->setText(1, yes); + paragraphitem->setText(1, yes); + subparagraphitem->setText(1, yes); + partitem->setText(2, yes); + chapteritem->setText(2, yes); + sectionitem->setText(2, yes); + subsectionitem->setText(2, yes); + subsubsectionitem->setText(2, yes); + paragraphitem->setText(2, yes); + subparagraphitem->setText(2, yes); + + // numbering + if (depth < -1) partitem->setText(1, no); + if (depth < 0) chapteritem->setText(1, no); + if (depth < 1) sectionitem->setText(1, no); + if (depth < 2) subsectionitem->setText(1, no); + if (depth < 3) subsubsectionitem->setText(1, no); + if (depth < 4) paragraphitem->setText(1, no); + if (depth < 5) subparagraphitem->setText(1, no); + + // in toc + if (toc < 0) chapteritem->setText(2, no); + if (toc < 1) sectionitem->setText(2, no); + if (toc < 2) subsectionitem->setText(2, no); + if (toc < 3) subsubsectionitem->setText(2, no); + if (toc < 4) paragraphitem->setText(2, no); + if (toc < 5) subparagraphitem->setText(2, no); + + //numberingModule->tocLV->setUpdatesEnabled(true); + //numberingModule->tocLV->update(); +} diff --git a/src/frontends/qt2/QDocumentDialog.h b/src/frontends/qt2/QDocumentDialog.h index 2620a39edf..8983b1dd2d 100644 --- a/src/frontends/qt2/QDocumentDialog.h +++ b/src/frontends/qt2/QDocumentDialog.h @@ -46,6 +46,7 @@ public: void showPreamble(); public slots: + void updateNumbering(); void change_adaptor(); void saveDefaultClicked(); void useDefaultsClicked(); diff --git a/src/frontends/qt2/ui/NumberingModuleBase.ui b/src/frontends/qt2/ui/NumberingModuleBase.ui index f165c6045a..2f0e762ca2 100644 --- a/src/frontends/qt2/ui/NumberingModuleBase.ui +++ b/src/frontends/qt2/ui/NumberingModuleBase.ui @@ -13,8 +13,8 @@ 0 0 - 450 - 313 + 319 + 323 @@ -30,11 +30,26 @@ spacing 6 + + QLabel + + name + TextLabel1_2 + + + text + &Numbering + + + buddy + depthSL + + QLayoutWidget name - Layout1 + Layout5 @@ -46,159 +61,328 @@ 6 - QGroupBox + QSlider name - GroupBox1 + depthSL - frameShape - Box + minValue + -2 - title - Numbering Depth + maxValue + 5 - - - margin - 11 - - - spacing - 6 - - - QLabel - - name - sectionnrDepthL - - - text - &Section: - - - buddy - sectionnrDepthSB - - - - QLabel - - name - tocDepthL - - - text - &Table of contents: - - - buddy - tocDepthSB - - - - QSpinBox - - name - tocDepthSB - - - maxValue - 5 - - - minValue - -1 - - - - QSpinBox - - name - sectionnrDepthSB - - - maxValue - 5 - - - minValue - -2 - - - - - name - Spacer3 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - name - Spacer2 + + value + 3 orientation Horizontal - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - + - + + QLabel + + name + TextLabel1 + + + text + &List in Table of Contents + + buddy + tocSL + + + + QSlider + name - Spacer3_2 + tocSL + + + minValue + -1 + + + maxValue + 5 + + + value + 3 orientation - Vertical + Horizontal + + + + QListView + + + text + Example + + + clickable + true + + + resizeable + true + + + + + text + Numbered + + + clickable + true + + + resizeable + true + + + + + text + Appears in TOC + + + clickable + true + + + resizeable + true + + + + + text + Part + + + text + + + + text + + + + pixmap + + + + pixmap + + + pixmap + + + + + + text + Chapter + + + text + + + + text + + + + pixmap + + + + pixmap + + + + pixmap + + + + + + text + Section + + + text + + + + text + + + + pixmap + + + + pixmap + + + + pixmap + + + + + + text + Subsection + + + text + + + + text + + + + pixmap + + + + pixmap + + + + pixmap + + + + + + text + Subsubsection + + + text + + + + text + + + + pixmap + + + + pixmap + + + + pixmap + + + + + + text + Paragraph + + + text + + + + text + + + + pixmap + + + + pixmap + + + + pixmap + + + + + + text + Subparagraph + + + text + + + + text + + + + pixmap + + + + pixmap + + + + pixmap + + + - sizeType - Expanding + name + tocLV + + + enabled + false + + + resizePolicy + AutoOneFit + + + vScrollBarMode + AlwaysOff + + + hScrollBarMode + AlwaysOff + + + rootIsDecorated + false - sizeHint - - 20 - 20 - + toolTip + Example numbering and table of contents - + - sectionnrDepthSB - tocDepthSB + tocSL + depthSL + tocLV diff --git a/src/frontends/qt2/ui/TextLayoutModuleBase.ui b/src/frontends/qt2/ui/TextLayoutModuleBase.ui index e9c4ba2609..f927a06cd5 100644 --- a/src/frontends/qt2/ui/TextLayoutModuleBase.ui +++ b/src/frontends/qt2/ui/TextLayoutModuleBase.ui @@ -13,8 +13,8 @@ 0 0 - 441 - 440 + 344 + 404 @@ -179,7 +179,7 @@ QLayoutWidget name - Layout2 + Layout9 @@ -215,9 +215,9 @@ QLayoutWidget name - Layout1 + Layout8 - + margin 0 @@ -227,46 +227,101 @@ 6 - QComboBox + QLayoutWidget name - skipCO - - - enabled - false + Layout6 + + + margin + 0 + + + spacing + 6 + + + QComboBox + + name + skipCO + + + enabled + false + + + + + name + Spacer3_2 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + - QLineEdit + QLayoutWidget name - skipLE - - - enabled - false - - - sizePolicy - - 1 - 0 - + Layout7 + + + margin + 0 + + + spacing + 6 + + + QLineEdit + + name + skipLE + + + enabled + false + + + sizePolicy + + 1 + 0 + + + + + LengthCombo + + name + skipLengthCO + + + enabled + false + + + - - LengthCombo - - name - skipLengthCO - - - enabled - false - - - + @@ -419,14 +474,14 @@ - lspacingCO - lspacingLE fontsCO fontsizeCO indentRB skipRB skipCO skipLE + lspacingCO + lspacingLE twoColumnCB