UI for numbering changes

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6621 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-03-29 03:46:27 +00:00
parent 762cccfa4f
commit 1583833ef4
7 changed files with 486 additions and 184 deletions

View File

@ -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);

View File

@ -1,3 +1,12 @@
2003-03-29 John Levon <levon@movementarian.org>
* QDocument.C:
* QDocumentDialog.C:
* QDocumentDialog.h:
* ui/NumberingModuleBase.ui: feedback for numbering
* ui/TextLayoutModuleBase.ui: relayout
2003-03-29 John Levon <levon@movementarian.org>
* BulletsModule.h:

View File

@ -37,7 +37,7 @@
#include <qradiobutton.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qspinbox.h>
#include <qslider.h>
#include <qlineedit.h>
#include <qstringlist.h>
#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]);

View File

@ -46,7 +46,7 @@
#include <qcombobox.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qspinbox.h>
#include <qslider.h>
#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();
}

View File

@ -46,6 +46,7 @@ public:
void showPreamble();
public slots:
void updateNumbering();
void change_adaptor();
void saveDefaultClicked();
void useDefaultsClicked();

View File

@ -13,8 +13,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>313</height>
<width>319</width>
<height>323</height>
</rect>
</property>
<property stdset="1">
@ -30,11 +30,26 @@
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1_2</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Numbering</string>
</property>
<property>
<name>buddy</name>
<cstring>depthSL</cstring>
</property>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout1</cstring>
<cstring>Layout5</cstring>
</property>
<hbox>
<property stdset="1">
@ -46,159 +61,328 @@
<number>6</number>
</property>
<widget>
<class>QGroupBox</class>
<class>QSlider</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox1</cstring>
<cstring>depthSL</cstring>
</property>
<property stdset="1">
<name>frameShape</name>
<enum>Box</enum>
<name>minValue</name>
<number>-2</number>
</property>
<property stdset="1">
<name>title</name>
<string>Numbering Depth</string>
<name>maxValue</name>
<number>5</number>
</property>
<grid>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget row="0" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>sectionnrDepthL</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Section:</string>
</property>
<property>
<name>buddy</name>
<cstring>sectionnrDepthSB</cstring>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>tocDepthL</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Table of contents:</string>
</property>
<property>
<name>buddy</name>
<cstring>tocDepthSB</cstring>
</property>
</widget>
<widget row="1" column="1" >
<class>QSpinBox</class>
<property stdset="1">
<name>name</name>
<cstring>tocDepthSB</cstring>
</property>
<property stdset="1">
<name>maxValue</name>
<number>5</number>
</property>
<property stdset="1">
<name>minValue</name>
<number>-1</number>
</property>
</widget>
<widget row="0" column="1" >
<class>QSpinBox</class>
<property stdset="1">
<name>name</name>
<cstring>sectionnrDepthSB</cstring>
</property>
<property stdset="1">
<name>maxValue</name>
<number>5</number>
</property>
<property stdset="1">
<name>minValue</name>
<number>-2</number>
</property>
</widget>
<spacer row="1" column="2" >
<property>
<name>name</name>
<cstring>Spacer3</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</grid>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer2</cstring>
<property stdset="1">
<name>value</name>
<number>3</number>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</widget>
</hbox>
</widget>
<spacer>
<property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>Spacer3_2</cstring>
<cstring>TextLabel1</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;List in Table of Contents</string>
</property>
<property>
<name>buddy</name>
<cstring>tocSL</cstring>
</property>
</widget>
<widget>
<class>QSlider</class>
<property stdset="1">
<name>name</name>
<cstring>tocSL</cstring>
</property>
<property stdset="1">
<name>minValue</name>
<number>-1</number>
</property>
<property stdset="1">
<name>maxValue</name>
<number>5</number>
</property>
<property stdset="1">
<name>value</name>
<number>3</number>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</widget>
<widget>
<class>QListView</class>
<column>
<property>
<name>text</name>
<string>Example</string>
</property>
<property>
<name>clickable</name>
<bool>true</bool>
</property>
<property>
<name>resizeable</name>
<bool>true</bool>
</property>
</column>
<column>
<property>
<name>text</name>
<string>Numbered</string>
</property>
<property>
<name>clickable</name>
<bool>true</bool>
</property>
<property>
<name>resizeable</name>
<bool>true</bool>
</property>
</column>
<column>
<property>
<name>text</name>
<string>Appears in TOC</string>
</property>
<property>
<name>clickable</name>
<bool>true</bool>
</property>
<property>
<name>resizeable</name>
<bool>true</bool>
</property>
</column>
<item>
<property>
<name>text</name>
<string>Part</string>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
<name>text</name>
<string></string>
</property>
</spacer>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
</item>
<item>
<property>
<name>text</name>
<string>Chapter</string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
</item>
<item>
<property>
<name>text</name>
<string>Section</string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
</item>
<item>
<property>
<name>text</name>
<string>Subsection</string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
</item>
<item>
<property>
<name>text</name>
<string>Subsubsection</string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
</item>
<item>
<property>
<name>text</name>
<string>Paragraph</string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
</item>
<item>
<property>
<name>text</name>
<string>Subparagraph</string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>text</name>
<string></string>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
<property>
<name>pixmap</name>
<pixmap></pixmap>
</property>
</item>
<property stdset="1">
<name>name</name>
<cstring>tocLV</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>resizePolicy</name>
<enum>AutoOneFit</enum>
</property>
<property stdset="1">
<name>vScrollBarMode</name>
<enum>AlwaysOff</enum>
</property>
<property stdset="1">
<name>hScrollBarMode</name>
<enum>AlwaysOff</enum>
</property>
<property stdset="1">
<name>rootIsDecorated</name>
<bool>false</bool>
</property>
<property>
<name>toolTip</name>
<string>Example numbering and table of contents</string>
</property>
</widget>
</vbox>
</widget>
<tabstops>
<tabstop>sectionnrDepthSB</tabstop>
<tabstop>tocDepthSB</tabstop>
<tabstop>tocSL</tabstop>
<tabstop>depthSL</tabstop>
<tabstop>tocLV</tabstop>
</tabstops>
</UI>

View File

@ -13,8 +13,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>441</width>
<height>440</height>
<width>344</width>
<height>404</height>
</rect>
</property>
<property stdset="1">
@ -179,7 +179,7 @@
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout2</cstring>
<cstring>Layout9</cstring>
</property>
<hbox>
<property stdset="1">
@ -215,9 +215,9 @@
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout1</cstring>
<cstring>Layout8</cstring>
</property>
<hbox>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
@ -227,46 +227,101 @@
<number>6</number>
</property>
<widget>
<class>QComboBox</class>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>skipCO</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
<cstring>Layout6</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QComboBox</class>
<property stdset="1">
<name>name</name>
<cstring>skipCO</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer3_2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<widget>
<class>QLineEdit</class>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>skipLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
<cstring>Layout7</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>skipLE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
</property>
</widget>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>skipLengthCO</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
</hbox>
</widget>
<widget>
<class>LengthCombo</class>
<property stdset="1">
<name>name</name>
<cstring>skipLengthCO</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
</widget>
</hbox>
</vbox>
</widget>
</hbox>
</widget>
@ -419,14 +474,14 @@
</image>
</images>
<tabstops>
<tabstop>lspacingCO</tabstop>
<tabstop>lspacingLE</tabstop>
<tabstop>fontsCO</tabstop>
<tabstop>fontsizeCO</tabstop>
<tabstop>indentRB</tabstop>
<tabstop>skipRB</tabstop>
<tabstop>skipCO</tabstop>
<tabstop>skipLE</tabstop>
<tabstop>lspacingCO</tabstop>
<tabstop>lspacingLE</tabstop>
<tabstop>twoColumnCB</tabstop>
</tabstops>
</UI>