PDFOptions: replace bookmarkslevel edit field by a spinbox (by Pavel)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20441 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2007-09-22 22:18:44 +00:00
parent 8f4b99167c
commit 65a9b1a683
3 changed files with 276 additions and 289 deletions

View File

@ -36,7 +36,6 @@ bool PDFOptions::empty() const
&& subject.empty()
&& keywords.empty()
&& pagemode.empty()
&& bookmarksopenlevel.empty()
&& quoted_options.empty();
}
@ -60,8 +59,7 @@ void PDFOptions::writeFile(ostream & os) const
os << "\\pdf_bookmarks " << convert<string>(bookmarks) << '\n';
os << "\\pdf_bookmarksnumbered " << convert<string>(bookmarksnumbered) << '\n';
os << "\\pdf_bookmarksopen " << convert<string>(bookmarksopen) << '\n';
if (!bookmarksopenlevel.empty())
os << "\\pdf_bookmarksopenlevel \"" << bookmarksopenlevel << "\"\n";
os << "\\pdf_bookmarksopenlevel \"" << bookmarksopenlevel << "\"\n";
os << "\\pdf_breaklinks " << convert<string>(breaklinks) << '\n';
os << "\\pdf_pdfborder " << convert<string>(pdfborder) << '\n';
@ -97,8 +95,8 @@ void PDFOptions::writeLaTeX(odocstringstream &os) const
opt += "bookmarksnumbered=" + convert<string>(bookmarksnumbered) + ',';
opt += "bookmarksopen=" + convert<string>(bookmarksopen) + ',';
if (bookmarksopen && !bookmarksopenlevel.empty())
opt += "bookmarksopenlevel=" + bookmarksopenlevel + ',';
if (bookmarksopen)
opt += "bookmarksopenlevel=" + convert<string>(bookmarksopenlevel) + ',';
}
opt += "\n ";
opt += "breaklinks=" + convert<string>(breaklinks) + ',';
@ -113,8 +111,10 @@ void PDFOptions::writeLaTeX(odocstringstream &os) const
opt += "colorlinks=" + convert<string>(colorlinks) + ',';
if (!pagemode.empty())
opt += "pdfpagemode=" + pagemode + ',';
opt += "\n ";
opt += quoted_options_get();
if (!quoted_options.empty()){
opt += "\n ";
opt += quoted_options_get();
}
opt = support::rtrim(opt,",");
opt += "]\n {hyperref}\n";
@ -172,7 +172,6 @@ string PDFOptions::quoted_options_get() const
return quoted_options;
}
// Keep implicit hyperref settings
void PDFOptions::clear()
{
@ -184,7 +183,7 @@ void PDFOptions::clear()
bookmarks = true;
bookmarksnumbered = false;
bookmarksopen = false;
bookmarksopenlevel.clear();
bookmarksopenlevel = 1;
breaklinks = false;
pdfborder = false;
colorlinks = false;

View File

@ -65,7 +65,7 @@ public:
* Level (\maxdimen) to which bookmarks are open
* bookmarksopenlevel parameter
*/
std::string bookmarksopenlevel;
int bookmarksopenlevel;
/**
* Allows link text to break across lines.
* breaklinks boolean false

View File

@ -5,315 +5,303 @@
<rect>
<x>0</x>
<y>0</y>
<width>448</width>
<height>403</height>
<width>436</width>
<height>394</height>
</rect>
</property>
<widget class="QCheckBox" name="use_hyperrefCB" >
<widget class="QGroupBox" name="use_hyperrefGB" >
<property name="geometry" >
<rect>
<x>10</x>
<y>0</y>
<width>141</width>
<height>21</height>
<x>2</x>
<y>2</y>
<width>423</width>
<height>381</height>
</rect>
</property>
<property name="toolTip" >
<string>Enable clickable crossreferences and header informations</string>
</property>
<property name="text" >
<property name="title" >
<string>&amp;Use hyperref support</string>
</property>
</widget>
<widget class="QCheckBox" name="fullscreenCB" >
<property name="geometry" >
<rect>
<x>14</x>
<y>310</y>
<width>161</width>
<height>21</height>
</rect>
</property>
<property name="toolTip" >
<string>Enable fullscreen PDF presentation</string>
</property>
<property name="text" >
<string>Load in &amp;fullscreen mode</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_3" >
<property name="geometry" >
<rect>
<x>10</x>
<y>340</y>
<width>421</width>
<height>54</height>
</rect>
</property>
<property name="title" >
<string>Additional o&amp;ptions for hyperref</string>
</property>
<property name="flat" >
<bool>true</bool>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
<property name="checked" >
<bool>false</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="QLineEdit" name="optionsLE" >
<property name="toolTip" >
<string>eg: pdfstartview=XYZ, plainpages=false, pdfpagelabels</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="bookmarksGB" >
<property name="geometry" >
<rect>
<x>10</x>
<y>180</y>
<width>181</width>
<height>121</height>
</rect>
</property>
<property name="title" >
<string>Generate Bookmarks</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>true</bool>
<bool>false</bool>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
<widget class="QGroupBox" name="groupBox_4" >
<property name="geometry" >
<rect>
<x>186</x>
<y>170</y>
<width>231</width>
<height>148</height>
</rect>
</property>
<property name="spacing" >
<number>6</number>
<property name="title" >
<string>Links</string>
</property>
<item row="1" column="0" >
<widget class="QGroupBox" name="bookmarksopenGB" >
<property name="title" >
<string>Open bookmarks</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>false</bool>
</property>
<widget class="QLineEdit" name="bookmarksopenlevelLE" >
<property name="geometry" >
<rect>
<x>60</x>
<y>19</y>
<width>91</width>
<height>22</height>
</rect>
</property>
<property name="toolTip" >
<string>Number of levels</string>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="0" >
<widget class="QCheckBox" name="colorlinksCB" >
<property name="text" >
<string>Color links</string>
</property>
</widget>
<widget class="QLabel" name="label" >
<property name="geometry" >
<rect>
<x>21</x>
<y>22</y>
<width>31</width>
<height>16</height>
</rect>
</item>
<item row="1" column="0" >
<widget class="QCheckBox" name="pdfborderCB" >
<property name="text" >
<string>No frames around links</string>
</property>
<property name="tristate" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QCheckBox" name="breaklinksCB" >
<property name="toolTip" >
<string>Allows link text to break across lines.</string>
</property>
<property name="text" >
<string>&amp;Level:</string>
</property>
<property name="buddy" >
<cstring>bookmarksopenlevelLE</cstring>
<string>Break links over lines</string>
</property>
</widget>
</widget>
</item>
<item row="0" column="0" >
<widget class="QCheckBox" name="bookmarksnumberedCB" >
<property name="text" >
<string>Numbered bookmarks</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_4" >
<property name="geometry" >
<rect>
<x>209</x>
<y>180</y>
<width>221</width>
<height>148</height>
</rect>
</property>
<property name="title" >
<string>Links</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="backrefCB" >
<property name="toolTip" >
<string>Adds "backlink" text to the end of each item in the bibliography</string>
</property>
<property name="text" >
<string>&amp;Bibliographical backreferences</string>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QCheckBox" name="pagebackrefCB" >
<property name="toolTip" >
<string>Adds "backlink" text to the end of each item in the bibliography</string>
</property>
<property name="text" >
<string>Backreference by pa&amp;ge number</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="bookmarksGB" >
<property name="geometry" >
<rect>
<x>6</x>
<y>170</y>
<width>171</width>
<height>112</height>
</rect>
</property>
<property name="spacing" >
<number>6</number>
<property name="title" >
<string>Generate Bookmarks</string>
</property>
<item row="2" column="0" >
<widget class="QCheckBox" name="colorlinksCB" >
<property name="text" >
<string>Color links</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QCheckBox" name="pdfborderCB" >
<property name="text" >
<string>No frames around links</string>
</property>
<property name="tristate" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QCheckBox" name="breaklinksCB" >
<property name="toolTip" >
<string>Allows link text to break across lines.</string>
</property>
<property name="text" >
<string>Break links over lines</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="backrefCB" >
<property name="toolTip" >
<string>Adds "backlink" text to the end of each item in the bibliography</string>
</property>
<property name="text" >
<string>&amp;Bibliographical backreferences</string>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QCheckBox" name="pagebackrefCB" >
<property name="toolTip" >
<string>Adds "backlink" text to the end of each item in the bibliography</string>
</property>
<property name="text" >
<string>Backreference by pa&amp;ge number</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2" >
<property name="geometry" >
<rect>
<x>10</x>
<y>30</y>
<width>421</width>
<height>132</height>
</rect>
</property>
<property name="title" >
<string>Header Information</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="spacing" >
<number>6</number>
<property name="checked" >
<bool>true</bool>
</property>
<item row="2" column="1" >
<widget class="QLineEdit" name="subjectLE" />
</item>
<item row="3" column="1" >
<widget class="QLineEdit" name="keywordsLE" />
</item>
<item row="3" column="0" >
<widget class="QLabel" name="keywordsL" >
<property name="text" >
<string>&amp;Keywords:</string>
</property>
<property name="buddy" >
<cstring>keywordsLE</cstring>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="subjectL" >
<property name="text" >
<string>&amp;Subject:</string>
</property>
<property name="buddy" >
<cstring>subjectLE</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="authorL" >
<property name="text" >
<string>&amp;Author:</string>
</property>
<property name="buddy" >
<cstring>authorLE</cstring>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="titleL" >
<property name="text" >
<string>&amp;Title:</string>
</property>
<property name="buddy" >
<cstring>titleLE</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="titleLE" />
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="authorLE" />
</item>
</layout>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QCheckBox" name="bookmarksnumberedCB" >
<property name="text" >
<string>Numbered bookmarks</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QGroupBox" name="bookmarksopenGB" >
<property name="title" >
<string>Open bookmarks</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>false</bool>
</property>
<widget class="QLabel" name="label" >
<property name="geometry" >
<rect>
<x>21</x>
<y>22</y>
<width>31</width>
<height>16</height>
</rect>
</property>
<property name="text" >
<string>&amp;Level:</string>
</property>
<property name="buddy" >
<cstring>bookmarksopenlevelSB</cstring>
</property>
</widget>
<widget class="QSpinBox" name="bookmarksopenlevelSB" >
<property name="geometry" >
<rect>
<x>60</x>
<y>20</y>
<width>61</width>
<height>22</height>
</rect>
</property>
<property name="toolTip" >
<string>Number of levels</string>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QCheckBox" name="fullscreenCB" >
<property name="geometry" >
<rect>
<x>10</x>
<y>300</y>
<width>161</width>
<height>21</height>
</rect>
</property>
<property name="toolTip" >
<string>Enable fullscreen PDF presentation</string>
</property>
<property name="text" >
<string>Load in &amp;fullscreen mode</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_2" >
<property name="geometry" >
<rect>
<x>6</x>
<y>20</y>
<width>411</width>
<height>141</height>
</rect>
</property>
<property name="title" >
<string>Header Information</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="1" >
<widget class="QLineEdit" name="authorLE" />
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="titleLE" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="titleL" >
<property name="text" >
<string>&amp;Title:</string>
</property>
<property name="buddy" >
<cstring>titleLE</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="authorL" >
<property name="text" >
<string>&amp;Author:</string>
</property>
<property name="buddy" >
<cstring>authorLE</cstring>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="subjectL" >
<property name="text" >
<string>&amp;Subject:</string>
</property>
<property name="buddy" >
<cstring>subjectLE</cstring>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="keywordsL" >
<property name="text" >
<string>&amp;Keywords:</string>
</property>
<property name="buddy" >
<cstring>keywordsLE</cstring>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLineEdit" name="keywordsLE" />
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="subjectLE" />
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_3" >
<property name="geometry" >
<rect>
<x>6</x>
<y>330</y>
<width>411</width>
<height>54</height>
</rect>
</property>
<property name="title" >
<string>Additional o&amp;ptions for hyperref</string>
</property>
<property name="flat" >
<bool>true</bool>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
<property name="checked" >
<bool>false</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="QLineEdit" name="optionsLE" >
<property name="toolTip" >
<string>eg: pdfstartview=XYZ, plainpages=false, pdfpagelabels</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<tabstops>
<tabstop>use_hyperrefCB</tabstop>
<tabstop>titleLE</tabstop>
<tabstop>authorLE</tabstop>
<tabstop>subjectLE</tabstop>
<tabstop>keywordsLE</tabstop>
<tabstop>bookmarksGB</tabstop>
<tabstop>bookmarksnumberedCB</tabstop>
<tabstop>bookmarksopenGB</tabstop>
<tabstop>bookmarksopenlevelLE</tabstop>
<tabstop>optionsLE</tabstop>
<tabstop>breaklinksCB</tabstop>
<tabstop>pdfborderCB</tabstop>
<tabstop>colorlinksCB</tabstop>
<tabstop>backrefCB</tabstop>
<tabstop>pagebackrefCB</tabstop>
<tabstop>fullscreenCB</tabstop>
</tabstops>
<includes>
<include location="local" >qt_helpers.h</include>
</includes>