document.textclass = "cv"
+#
+# add scaleBeforeRotation graphics param
+def convert_graphics_rotation(document):
+ " add scaleBeforeRotation graphics parameter. "
+ i = 0
+ while 1:
+ i = find_token(document.body, "\\begin_inset Graphics", i)
+ if i == -1:
+ return
+ j = find_end_of_inset(document.body, i+1)
+ if j == -1:
+ # should not happen
+ document.warning("Malformed LyX document: Could not find end of graphics inset.")
+ # Seach for rotateAngle and width or height or scale
+ # If these params are not there, nothing needs to be done.
+ # FIXME: this also inserts scaleBeforeRotation if "rotateAngle" is not there!
+ for k in range(i+1, j):
+ if (document.body[k].find("rotateAngle") and \
+ (document.body[k].find("width") or \
+ document.body[k].find("height") or \
+ document.body[k].find("scale"))):
+ document.body.insert(j, 'scaleBeforeRotation')
+ i = i + 1
+
+
+# FIXME: does not work at all
+def revert_graphics_rotation(document):
+ " remove scaleBeforeRotation graphics parameter. "
+ i = 0
+ while 1:
+ i = find_token(document.body, "\\begin_inset Graphics", i)
+ if i == -1:
+ return
+ j = find_end_of_inset(document.body, i + 1)
+ if j == -1:
+ # should not happen
+ document.warning("Malformed LyX document: Could not find end of graphics inset.")
+ for k in range(i+1, j):
+ # If there's a scaleBeforeRotation param, just remove that
+ if document.body[k].find('scaleBeforeRotation'):
+ del document.body[k]
+ break
+ # if not, and if we have rotateAngle and width or height or scale,
+ # we have to put the rotateAngle value to special
+ rotateAngle = get_value(document.body, 'rotateAngle', i+1, j)
+ special = get_value(document.body, 'special', i+1, j)
+ if (document.body[k].find("width") or \
+ document.body[k].find("height") or \
+ document.body[k].find("scale") and \
+ document.body[k].find("rotateAngle")):
+ if special == "":
+ document.body.insert(j-1, '\tspecial angle=%s' % rotateAngle)
+ else:
+ l = find_token(document.body, "special", i+1, j)
+ document.body[l].replace(special, 'angle=%s,%s' % (rotateAngle, special))
+ i = i + 1
+
+
+
def convert_tableborder(document):
# The problematic is: LyX double the table cell border as it ignores the "|" character in
# the cell arguments. A fix takes care of this and therefore the "|" has to be removed
[271, [convert_ext_font_sizes]],
[272, []],
[273, []],
- [274, [normalize_font_whitespace_274]]
+ [274, [normalize_font_whitespace_274]],
+ [275, [convert_graphics_rotation]]
]
revert = [
+ [274, [revert_graphics_rotation]],
[273, []],
[272, [revert_separator_layout]],
[271, [revert_preamble_listings_params, revert_listings_inset, revert_include_listings]],
<rect>
<x>0</x>
<y>0</y>
- <width>432</width>
- <height>328</height>
+ <width>450</width>
+ <height>379</height>
</rect>
</property>
<property name="sizePolicy" >
</property>
</widget>
</item>
- <item row="2" column="0" colspan="4" >
- <widget class="QGroupBox" name="rotationGB" >
- <property name="title" >
- <string>Rotate Graphics</string>
- </property>
- <property name="flat" >
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
- <widget class="QLabel" name="angleL" >
- <property name="toolTip" >
- <string>Angle to rotate image by</string>
- </property>
- <property name="text" >
- <string>A&ngle (Degrees):</string>
- </property>
- <property name="buddy" >
- <cstring>angle</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="angle" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>3</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip" >
- <string>Angle to rotate image by</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2" >
- <widget class="QLabel" name="originL" >
- <property name="toolTip" >
- <string>The origin of the rotation</string>
- </property>
- <property name="text" >
- <string>Or&igin:</string>
- </property>
- <property name="buddy" >
- <cstring>origin</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="3" >
- <widget class="QComboBox" name="origin" >
- <property name="toolTip" >
- <string>The origin of the rotation</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
<item row="1" column="0" colspan="4" >
<widget class="QGroupBox" name="sizeGB" >
<property name="title" >
<string>Output Size</string>
</property>
<property name="flat" >
- <bool>true</bool>
+ <bool>false</bool>
</property>
<layout class="QGridLayout" >
<property name="margin" >
</layout>
</widget>
</item>
+ <item row="2" column="0" colspan="4" >
+ <widget class="QGroupBox" name="rotationGB" >
+ <property name="title" >
+ <string>Rotate Graphics</string>
+ </property>
+ <property name="flat" >
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" colspan="2" >
+ <widget class="QCheckBox" name="rotateOrderCB" >
+ <property name="toolTip" >
+ <string>Check to change the order of rotating and scaling</string>
+ </property>
+ <property name="text" >
+ <string>Ro&tate after scaling</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QComboBox" name="origin" >
+ <property name="toolTip" >
+ <string>The origin of the rotation</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="originL" >
+ <property name="toolTip" >
+ <string>The origin of the rotation</string>
+ </property>
+ <property name="text" >
+ <string>Or&igin:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>origin</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="angle" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" >
+ <string>Angle to rotate image by</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="angleL" >
+ <property name="toolTip" >
+ <string>Angle to rotate image by</string>
+ </property>
+ <property name="text" >
+ <string>A&ngle (Degrees):</string>
+ </property>
+ <property name="buddy" >
+ <cstring>angle</cstring>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="Clipping" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
- <enum>QFrame::Raised</enum>
+ <enum>QFrame::Plain</enum>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<property name="spacing" >
<number>6</number>
</property>
- <item row="0" column="0" >
- <widget class="QLabel" name="latexoptionsLA" >
- <property name="toolTip" >
- <string>Additional LaTeX options</string>
- </property>
- <property name="text" >
- <string>LaTeX &options:</string>
+ <item row="3" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
</property>
- <property name="buddy" >
- <cstring>latexoptions</cstring>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
</property>
- </widget>
+ </spacer>
</item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="latexoptions" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>3</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="6" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
</property>
- <property name="toolTip" >
- <string>Additional LaTeX options</string>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>41</height>
+ </size>
</property>
- </widget>
+ </spacer>
</item>
- <item row="2" column="0" colspan="2" >
+ <item row="2" column="0" colspan="3" >
<widget class="QCheckBox" name="unzipCB" >
<property name="toolTip" >
<string>Don't uncompress image before exporting to LaTeX</string>
</property>
</widget>
</item>
- <item row="1" column="0" colspan="2" >
- <widget class="QCheckBox" name="draftCB" >
- <property name="toolTip" >
- <string>Draft mode</string>
- </property>
- <property name="text" >
- <string>&Draft mode</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="2" >
+ <item row="4" column="0" colspan="3" >
<widget class="QGroupBox" name="subfigure" >
<property name="focusPolicy" >
<enum>Qt::StrongFocus</enum>
<string>S&ubfigure</string>
</property>
<property name="flat" >
- <bool>true</bool>
+ <bool>false</bool>
</property>
<property name="checkable" >
<bool>true</bool>
</layout>
</widget>
</item>
- <item row="4" column="0" colspan="2" >
+ <item row="5" column="0" colspan="3" >
<widget class="QGroupBox" name="displayGB" >
<property name="focusPolicy" >
<enum>Qt::StrongFocus</enum>
<string>Sho&w in LyX</string>
</property>
<property name="flat" >
- <bool>true</bool>
+ <bool>false</bool>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
- <layout class="QHBoxLayout" >
+ <layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
- <item>
- <widget class="QLabel" name="showL" >
+ <item row="0" column="3" >
+ <widget class="QLineEdit" name="displayscale" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="toolTip" >
- <string>Screen display</string>
+ <string>Percentage to scale by in LyX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="scaleLA" >
+ <property name="toolTip" >
+ <string>Percentage to scale by in LyX</string>
</property>
<property name="text" >
- <string>&Display:</string>
+ <string>Sca&le on Screen (%):</string>
</property>
<property name="buddy" >
- <cstring>showCB</cstring>
+ <cstring>displayscale</cstring>
</property>
</widget>
</item>
- <item>
+ <item row="0" column="1" >
<widget class="QComboBox" name="showCB" >
<property name="toolTip" >
<string>Screen display</string>
</item>
</widget>
</item>
- <item>
- <widget class="QLabel" name="scaleLA" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="showL" >
<property name="toolTip" >
- <string>Percentage to scale by in LyX</string>
+ <string>Screen display</string>
</property>
<property name="text" >
- <string>Sca&le on Screen (%):</string>
+ <string>&Display:</string>
</property>
<property name="buddy" >
- <cstring>displayscale</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="displayscale" >
- <property name="enabled" >
- <bool>true</bool>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip" >
- <string>Percentage to scale by in LyX</string>
+ <cstring>showCB</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
+ <item row="0" column="1" colspan="2" >
+ <widget class="QLineEdit" name="latexoptions" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" >
+ <string>Additional LaTeX options</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="latexoptionsLA" >
+ <property name="toolTip" >
+ <string>Additional LaTeX options</string>
+ </property>
+ <property name="text" >
+ <string>LaTeX &options:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>latexoptions</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="3" >
+ <widget class="QCheckBox" name="draftCB" >
+ <property name="toolTip" >
+ <string>Draft mode</string>
+ </property>
+ <property name="text" >
+ <string>&Draft mode</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</widget>
<tabstop>aspectratio</tabstop>
<tabstop>angle</tabstop>
<tabstop>origin</tabstop>
+ <tabstop>rotateOrderCB</tabstop>
<tabstop>restorePB</tabstop>
<tabstop>okPB</tabstop>
<tabstop>applyPB</tabstop>
<include location="local" >qt_helpers.h</include>
</includes>
<resources/>
- <connections>
- </connections>
+ <connections/>
</ui>