#include "QFloat.h"
#include "Qt2BC.h"
#include "gettext.h"
-#include "helper_funcs.h"
#include "support/lstrings.h"
-#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
typedef Qt2CB<ControlFloat, Qt2DB<QFloatDialog> > base_class;
QFloat::QFloat()
- : base_class(_("LaTeX Information"))
+ : base_class(_("Float Settings"))
{
}
bc().setApply(dialog_->applyPB);
bc().setOK(dialog_->okPB);
bc().setRestore(dialog_->restorePB);
+
+ bc().addReadOnly(dialog_->topCB);
+ bc().addReadOnly(dialog_->bottomCB);
+ bc().addReadOnly(dialog_->herepossiblyCB);
+ bc().addReadOnly(dialog_->heredefinitelyCB);
+ bc().addReadOnly(dialog_->pageCB);
+ bc().addReadOnly(dialog_->ignoreCB);
+ bc().addReadOnly(dialog_->defaultsCB);
+ bc().addReadOnly(dialog_->spanCB);
}
void QFloat::update_contents()
{
+ bool def_placement = false;
bool top = false;
bool bottom = false;
bool page = false;
bool here = false;
- bool forcehere = false;
+ bool force = false;
+ bool here_definitely = false;
- string placement(controller().params().placement);
+ string const placement(controller().params().placement);
- if (contains(placement, "H")) {
- forcehere = true;
+ if (placement.empty()) {
+ def_placement = true;
+ } else if (contains(placement, "H")) {
+ here_definitely = true;
} else {
+ if (contains(placement, "!")) {
+ force = true;
+ }
if (contains(placement, "t")) {
top = true;
}
here = true;
}
}
-
- dialog_->top->setChecked(top);
- dialog_->bottom->setChecked(bottom);
- dialog_->page->setChecked(page);
- dialog_->here->setChecked(here);
- dialog_->forcehere->setChecked(forcehere);
+
+ dialog_->defaultsCB->setChecked(def_placement);
+ dialog_->topCB->setChecked(top);
+ dialog_->bottomCB->setChecked(bottom);
+ dialog_->pageCB->setChecked(page);
+ dialog_->herepossiblyCB->setChecked(here);
+ dialog_->ignoreCB->setChecked(force);
+ dialog_->ignoreCB->setEnabled(top || bottom || page || here);
+ dialog_->heredefinitelyCB->setChecked(here_definitely);
+
+ if (controller().params().wide) {
+ dialog_->herepossiblyCB->setChecked(false);
+ dialog_->bottomCB->setChecked(false);
+ }
+
+ dialog_->spanCB->setChecked(controller().params().wide);
}
+
void QFloat::apply()
{
string placement;
- if (dialog_->forcehere->isChecked()) {
+ if (dialog_->heredefinitelyCB->isChecked()) {
placement += "H";
} else {
- if (dialog_->top->isChecked()) {
+ if (dialog_->ignoreCB->isChecked()) {
+ placement += "!";
+ }
+ if (dialog_->topCB->isChecked()) {
placement += "t";
}
- if (dialog_->bottom->isChecked()) {
+ if (dialog_->bottomCB->isChecked()) {
placement += "b";
}
- if (dialog_->page->isChecked()) {
+ if (dialog_->pageCB->isChecked()) {
placement += "p";
}
- if (dialog_->here->isChecked()) {
+ if (dialog_->herepossiblyCB->isChecked()) {
placement += "h";
}
}
controller().params().placement = placement;
+ controller().params().wide = dialog_->spanCB->isChecked();
}
<x>0</x>
<y>0</y>
<width>369</width>
- <height>169</height>
+ <height>259</height>
</rect>
</property>
<property stdset="1">
<name>sizeGripEnabled</name>
<bool>true</bool>
</property>
- <grid>
+ <vbox>
<property stdset="1">
<name>margin</name>
<number>11</number>
<name>spacing</name>
<number>6</number>
</property>
- <widget row="2" column="0" >
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>defaultsCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Use &default placement</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Use LaTeX default settings</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>placement</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Advanced placement options</string>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout6</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>topCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Top of page</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Prefer top of page</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>bottomCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Bottom of page</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Prefer bottom of page</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>pageCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Page of floats</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Separate page for multiple floats</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>herepossiblyCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Here if possible</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Place float at current position if possible</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ignoreCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Ignore LaTeX rules</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Ignore the internal LaTeX placement rules</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout7</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>heredefinitelyCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Here definitely</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Place float at current position</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer7</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>spanCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Span columns</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Span columns in multi-column documents</string>
+ </property>
+ </widget>
+ <widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
</widget>
</hbox>
</widget>
- <widget row="0" column="0" >
- <class>QGroupBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>placement</cstring>
- </property>
- <property stdset="1">
- <name>title</name>
- <string>Placement</string>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget row="1" column="0" >
- <class>QRadioButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>bottom</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Bottom of the page</string>
- </property>
- </widget>
- <widget row="0" column="0" >
- <class>QRadioButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>top</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Top of the page</string>
- </property>
- </widget>
- <widget row="0" column="1" >
- <class>QRadioButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>page</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Page of floats</string>
- </property>
- </widget>
- <widget row="1" column="1" >
- <class>QRadioButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>here</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Here, if possible</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget row="1" column="0" >
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>forcehere</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Here, definitely</string>
- </property>
- </widget>
- </grid>
+ </vbox>
</widget>
<connections>
<connection>
- <sender>forcehere</sender>
+ <sender>defaultsCB</sender>
<signal>toggled(bool)</signal>
<receiver>placement</receiver>
<slot>setDisabled(bool)</slot>
</connection>
<connection>
- <sender>top</sender>
+ <sender>defaultsCB</sender>
<signal>toggled(bool)</signal>
<receiver>QFloatDialogBase</receiver>
<slot>change_adaptor()</slot>
</connection>
<connection>
- <sender>page</sender>
+ <sender>defaultsCB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>tbhpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>topCB</sender>
<signal>toggled(bool)</signal>
<receiver>QFloatDialogBase</receiver>
<slot>change_adaptor()</slot>
</connection>
<connection>
- <sender>bottom</sender>
+ <sender>topCB</sender>
+ <signal>clicked()</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>tbhpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>bottomCB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>change_adaptor()</slot>
+ </connection>
+ <connection>
+ <sender>bottomCB</sender>
+ <signal>clicked()</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>tbhpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>pageCB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>change_adaptor()</slot>
+ </connection>
+ <connection>
+ <sender>pageCB</sender>
+ <signal>clicked()</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>tbhpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>herepossiblyCB</sender>
<signal>toggled(bool)</signal>
<receiver>QFloatDialogBase</receiver>
<slot>change_adaptor()</slot>
</connection>
<connection>
- <sender>here</sender>
- <signal>stateChanged(int)</signal>
+ <sender>herepossiblyCB</sender>
+ <signal>clicked()</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>tbhpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>ignoreCB</sender>
+ <signal>toggled(bool)</signal>
<receiver>QFloatDialogBase</receiver>
<slot>change_adaptor()</slot>
</connection>
<connection>
- <sender>forcehere</sender>
+ <sender>spanCB</sender>
<signal>toggled(bool)</signal>
<receiver>QFloatDialogBase</receiver>
<slot>change_adaptor()</slot>
</connection>
+ <connection>
+ <sender>spanCB</sender>
+ <signal>clicked()</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>spanClicked()</slot>
+ </connection>
+ <connection>
+ <sender>heredefinitelyCB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>change_adaptor()</slot>
+ </connection>
+ <connection>
+ <sender>heredefinitelyCB</sender>
+ <signal>clicked()</signal>
+ <receiver>QFloatDialogBase</receiver>
+ <slot>heredefinitelyClicked()</slot>
+ </connection>
<slot access="protected">change_adaptor()</slot>
+ <slot access="public">heredefinitelyClicked()</slot>
+ <slot access="public">spanClicked()</slot>
+ <slot access="public">tbhpClicked()</slot>
</connections>
<tabstops>
- <tabstop>top</tabstop>
- <tabstop>bottom</tabstop>
- <tabstop>page</tabstop>
- <tabstop>here</tabstop>
- <tabstop>forcehere</tabstop>
<tabstop>restorePB</tabstop>
<tabstop>okPB</tabstop>
<tabstop>applyPB</tabstop>