support preview for include file

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5765 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-12-03 05:09:50 +00:00
parent 7f262a2432
commit e1f3cdcd77
3 changed files with 263 additions and 163 deletions

View File

@ -1,3 +1,8 @@
2002-12-03 John Levon <levon@movementarian.org>
* ui/QIncludeDialog.ui:
* QInclude.C: support preview()
2002-12-01 Lars Gullik Bjønnes <larsbj@gullik.net> 2002-12-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* several files: ws changes * several files: ws changes

View File

@ -58,10 +58,14 @@ void QInclude::update_contents()
dialog_->visiblespaceCB->setChecked(false); dialog_->visiblespaceCB->setChecked(false);
dialog_->visiblespaceCB->setEnabled(false); dialog_->visiblespaceCB->setEnabled(false);
dialog_->previewCB->setChecked(false);
dialog_->previewCB->setEnabled(false);
switch (params.flag) { switch (params.flag) {
case InsetInclude::INPUT: case InsetInclude::INPUT:
dialog_->typeCO->setCurrentItem(0); dialog_->typeCO->setCurrentItem(0);
dialog_->previewCB->setEnabled(true);
dialog_->previewCB->setChecked(params.cparams.preview());
break; break;
case InsetInclude::INCLUDE: case InsetInclude::INCLUDE:
@ -84,6 +88,7 @@ void QInclude::apply()
InsetInclude::Params & params = controller().params(); InsetInclude::Params & params = controller().params();
params.cparams.setContents(dialog_->filenameED->text().latin1()); params.cparams.setContents(dialog_->filenameED->text().latin1());
params.cparams.preview(dialog_->previewCB->isChecked());
int const item = dialog_->typeCO->currentItem(); int const item = dialog_->typeCO->currentItem();
if (item == 0) if (item == 0)

View File

@ -13,8 +13,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>311</width> <width>282</width>
<height>158</height> <height>185</height>
</rect> </rect>
</property> </property>
<property stdset="1"> <property stdset="1">
@ -25,7 +25,7 @@
<name>sizeGripEnabled</name> <name>sizeGripEnabled</name>
<bool>true</bool> <bool>true</bool>
</property> </property>
<grid> <vbox>
<property stdset="1"> <property stdset="1">
<name>margin</name> <name>margin</name>
<number>11</number> <number>11</number>
@ -34,7 +34,99 @@
<name>spacing</name> <name>spacing</name>
<number>6</number> <number>6</number>
</property> </property>
<widget row="1" column="1" > <widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout2</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>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>filenameLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;File:</string>
</property>
<property>
<name>buddy</name>
<cstring>filenameED</cstring>
</property>
<property>
<name>toolTip</name>
<string></string>
</property>
</widget>
<widget>
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>filenameED</cstring>
</property>
<property>
<name>toolTip</name>
<string>File name to include</string>
</property>
</widget>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>browsePB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Browse...</string>
</property>
<property>
<name>toolTip</name>
<string>Select a file</string>
</property>
</widget>
</hbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout3</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>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Include Type:</string>
</property>
<property>
<name>buddy</name>
<cstring>typeCO</cstring>
</property>
</widget>
<widget>
<class>QComboBox</class> <class>QComboBox</class>
<item> <item>
<property> <property>
@ -59,7 +151,7 @@
<cstring>typeCO</cstring> <cstring>typeCO</cstring>
</property> </property>
</widget> </widget>
<spacer row="1" column="3" > <spacer>
<property> <property>
<name>name</name> <name>name</name>
<cstring>Spacer27</cstring> <cstring>Spacer27</cstring>
@ -80,29 +172,126 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget row="0" column="0" > <widget>
<class>QLabel</class> <class>QPushButton</class>
<property stdset="1"> <property stdset="1">
<name>name</name> <name>name</name>
<cstring>filenameLA</cstring> <cstring>loadPB</cstring>
</property> </property>
<property stdset="1"> <property stdset="1">
<name>text</name> <name>text</name>
<string>&amp;File:</string> <string>&amp;Load</string>
</property>
<property>
<name>buddy</name>
<cstring>filenameED</cstring>
</property> </property>
<property> <property>
<name>toolTip</name> <name>toolTip</name>
<string></string> <string>Load the file</string>
</property> </property>
</widget> </widget>
<spacer row="2" column="4" rowspan="2" colspan="1" > </hbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout5</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>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout4</cstring>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>visiblespaceCB</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Visible Space</string>
</property>
<property>
<name>toolTip</name>
<string>FIXME</string>
</property>
</widget>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>previewCB</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Show preview</string>
</property>
<property>
<name>toolTip</name>
<string>Show LaTeX preview</string>
</property>
</widget>
</vbox>
</widget>
<spacer>
<property> <property>
<name>name</name> <name>name</name>
<cstring>Spacer13</cstring> <cstring>Spacer5</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>
<spacer>
<property>
<name>name</name>
<cstring>Spacer13_2</cstring>
</property> </property>
<property stdset="1"> <property stdset="1">
<name>orientation</name> <name>orientation</name>
@ -120,44 +309,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget row="3" column="1" rowspan="1" colspan="3" > <widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>visiblespaceCB</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>text</name>
<string>Visible &amp;Space</string>
</property>
<property>
<name>toolTip</name>
<string>FIXME</string>
</property>
</widget>
<widget row="1" column="4" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>loadPB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Load</string>
</property>
<property>
<name>toolTip</name>
<string>Load the file</string>
</property>
</widget>
<widget row="6" column="0" rowspan="1" colspan="5" >
<class>QLayoutWidget</class> <class>QLayoutWidget</class>
<property stdset="1"> <property stdset="1">
<name>name</name> <name>name</name>
@ -221,69 +373,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<spacer row="4" column="2" > </vbox>
<property>
<name>name</name>
<cstring>Spacer13_2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</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 row="0" column="4" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>browsePB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Browse...</string>
</property>
<property>
<name>toolTip</name>
<string>Select a file</string>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Include Type:</string>
</property>
<property>
<name>buddy</name>
<cstring>typeCO</cstring>
</property>
</widget>
<widget row="0" column="1" rowspan="1" colspan="3" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>filenameED</cstring>
</property>
<property>
<name>toolTip</name>
<string>File name to include</string>
</property>
</widget>
</grid>
</widget> </widget>
<connections> <connections>
<connection> <connection>