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,7 +59,6 @@ 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_breaklinks " << convert<string>(breaklinks) << '\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 + ',';
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,161 +5,37 @@
<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>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</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>
</property>
</widget>
<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>bookmarksopenlevelLE</cstring>
</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>
<x>186</x>
<y>170</y>
<width>231</width>
<height>148</height>
</rect>
</property>
@ -222,13 +98,105 @@
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2" >
<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="title" >
<string>Generate Bookmarks</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<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="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>30</y>
<width>421</width>
<height>132</height>
<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" >
@ -241,29 +209,19 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="1" >
<widget class="QLineEdit" name="subjectLE" />
<item row="1" column="1" >
<widget class="QLineEdit" name="authorLE" />
</item>
<item row="3" column="1" >
<widget class="QLineEdit" name="keywordsLE" />
<item row="0" column="1" >
<widget class="QLineEdit" name="titleLE" />
</item>
<item row="3" column="0" >
<widget class="QLabel" name="keywordsL" >
<item row="0" column="0" >
<widget class="QLabel" name="titleL" >
<property name="text" >
<string>&amp;Keywords:</string>
<string>&amp;Title:</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>
<cstring>titleLE</cstring>
</property>
</widget>
</item>
@ -277,43 +235,73 @@
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="titleL" >
<item row="2" column="0" >
<widget class="QLabel" name="subjectL" >
<property name="text" >
<string>&amp;Title:</string>
<string>&amp;Subject:</string>
</property>
<property name="buddy" >
<cstring>titleLE</cstring>
<cstring>subjectLE</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="titleLE" />
<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="1" column="1" >
<widget class="QLineEdit" name="authorLE" />
<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>
<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>
</widget>
<includes>
<include location="local" >qt_helpers.h</include>
</includes>