improvements to the Citation UI.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24507 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-04-26 08:07:46 +00:00
parent 86dd41d5b3
commit 37aefe13ff
3 changed files with 377 additions and 212 deletions

View File

@ -435,7 +435,7 @@ unsigned int const nCiteCommands =
CiteStyle const citeStylesArray[] = { CiteStyle const citeStylesArray[] = {
CITE, NOCITE, CITET, CITEP, CITEALT, CITE, NOCITE, CITET, CITEP, CITEALT,
CITEALP, CITEAUTHOR, CITEYEAR, CITEYEARPAR }; CITEALP, CITEAUTHOR, CITEYEAR, CITEYEARPAR };
unsigned int const nCiteStyles = unsigned int const nCiteStyles =
sizeof(citeStylesArray) / sizeof(CiteStyle); sizeof(citeStylesArray) / sizeof(CiteStyle);

View File

@ -111,6 +111,8 @@ GuiCitation::GuiCitation(GuiView & lv)
this, SLOT(on_okPB_clicked())); this, SLOT(on_okPB_clicked()));
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy); bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
// FIXME: the sizeHint() for this is _way_ too high
infoML->setFixedHeight(60);
} }
@ -132,7 +134,7 @@ void GuiCitation::closeEvent(QCloseEvent * e)
void GuiCitation::applyView() void GuiCitation::applyView()
{ {
int const choice = max(0, citationStyleCO->currentIndex()); int const choice = max(0, citationStyleCO->currentIndex());
style_ = choice; style_ = choice;
bool const full = fulllistCB->isChecked(); bool const full = fulllistCB->isChecked();
bool const force = forceuppercaseCB->isChecked(); bool const force = forceuppercaseCB->isChecked();

View File

@ -6,11 +6,13 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>467</width> <width>467</width>
<height>692</height> <height>572</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" > <sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -22,131 +24,24 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<item row="0" column="0" > <property name="margin" >
<layout class="QGridLayout" > <number>9</number>
<item row="4" column="1" > </property>
<widget class="QPushButton" name="upPB" > <property name="spacing" >
<property name="sizePolicy" > <number>6</number>
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" > </property>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Move the selected citation up (try Ctrl-Up)</string>
</property>
<property name="text" >
<string>&amp;Up</string>
</property>
<property name="icon" >
<iconset/>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="1" >
<widget class="QPushButton" name="downPB" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Move the selected citation down (try Ctrl-Down)</string>
</property>
<property name="text" >
<string>&amp;Down</string>
</property>
<property name="icon" >
<iconset/>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>77</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<widget class="QPushButton" name="deletePB" >
<property name="toolTip" >
<string>The delete key works, too</string>
</property>
<property name="text" >
<string>D&amp;elete</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item rowspan="5" row="1" column="0" >
<widget class="QListView" name="availableLV" >
<property name="editTriggers" >
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QPushButton" name="addPB" >
<property name="toolTip" >
<string>The Enter key works, too</string>
</property>
<property name="text" >
<string>&amp;Add</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QLabel" name="selectedKeysLA" >
<property name="text" >
<string>&amp;Selected Citations:</string>
</property>
<property name="buddy" >
<cstring>selectedLV</cstring>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="availableKeysLA" >
<property name="text" >
<string>A&amp;vailable Citations:</string>
</property>
<property name="buddy" >
<cstring>availableLV</cstring>
</property>
</widget>
</item>
<item rowspan="5" row="1" column="2" >
<widget class="QListView" name="selectedLV" >
<property name="editTriggers" >
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QTextBrowser" name="infoML" > <widget class="QTextEdit" name="infoML" >
<property name="focusPolicy" > <property name="sizePolicy" >
<enum>Qt::NoFocus</enum> <sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly" >
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -159,6 +54,12 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="findKeysLA" > <widget class="QLabel" name="findKeysLA" >
<property name="text" > <property name="text" >
@ -307,7 +208,7 @@
<item row="3" column="3" colspan="2" > <item row="3" column="3" colspan="2" >
<widget class="QCheckBox" name="asTypeCB" > <widget class="QCheckBox" name="asTypeCB" >
<property name="text" > <property name="text" >
<string>Search As You Type</string> <string>Search As You &amp;Type</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -323,100 +224,188 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<item row="0" column="1" colspan="2" > <property name="margin" >
<widget class="QComboBox" name="citationStyleCO" > <number>9</number>
<property name="sizePolicy" > </property>
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" > <property name="spacing" >
<horstretch>0</horstretch> <number>6</number>
<verstretch>0</verstretch> </property>
</sizepolicy> <item row="1" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property> </property>
<property name="toolTip" > <property name="spacing" >
<string>Natbib citation style to use</string> <number>6</number>
</property> </property>
</widget> <item>
<widget class="QCheckBox" name="fulllistCB" >
<property name="toolTip" >
<string>List all authors</string>
</property>
<property name="text" >
<string>Full aut&amp;hor list</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="forceuppercaseCB" >
<property name="toolTip" >
<string>Force upper case in citation</string>
</property>
<property name="text" >
<string>Force u&amp;pper case</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>21</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="citationStyleLA" > <layout class="QHBoxLayout" >
<property name="text" > <property name="margin" >
<string>Citation st&amp;yle:</string> <number>0</number>
</property> </property>
<property name="buddy" > <property name="spacing" >
<cstring>citationStyleCO</cstring> <number>6</number>
</property> </property>
</widget> <item>
</item> <layout class="QVBoxLayout" >
<item row="3" column="0" colspan="2" > <property name="margin" >
<widget class="QCheckBox" name="fulllistCB" > <number>0</number>
<property name="toolTip" > </property>
<string>List all authors</string> <property name="spacing" >
</property> <number>6</number>
<property name="text" > </property>
<string>Full aut&amp;hor list</string> <item>
</property> <widget class="QLabel" name="citationStyleLA" >
</widget> <property name="text" >
</item> <string>Citation st&amp;yle:</string>
<item row="3" column="2" > </property>
<widget class="QCheckBox" name="forceuppercaseCB" > <property name="buddy" >
<property name="toolTip" > <cstring>citationStyleCO</cstring>
<string>Force upper case in citation</string> </property>
</property> </widget>
<property name="text" > </item>
<string>&amp;Force upper case</string> <item>
</property> <widget class="QLabel" name="textBeforeLA" >
</widget> <property name="text" >
</item> <string>Text &amp;before:</string>
<item row="2" column="0" > </property>
<widget class="QLabel" name="textAfterLA" > <property name="buddy" >
<property name="text" > <cstring>textBeforeED</cstring>
<string>&amp;Text after:</string> </property>
</property> </widget>
<property name="buddy" > </item>
<cstring>textAfterED</cstring> </layout>
</property> </item>
</widget> <item>
</item> <layout class="QVBoxLayout" >
<item row="2" column="1" colspan="2" > <property name="margin" >
<widget class="QLineEdit" name="textAfterED" > <number>0</number>
<property name="sizePolicy" > </property>
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" > <property name="spacing" >
<horstretch>0</horstretch> <number>6</number>
<verstretch>0</verstretch> </property>
</sizepolicy> <item>
</property> <layout class="QHBoxLayout" >
<property name="toolTip" > <property name="margin" >
<string>Text to place after citation</string> <number>0</number>
</property> </property>
</widget> <property name="spacing" >
</item> <number>6</number>
<item row="1" column="0" > </property>
<widget class="QLabel" name="textBeforeLA" > <item>
<property name="text" > <widget class="QComboBox" name="citationStyleCO" >
<string>Text &amp;before:</string> <property name="sizePolicy" >
</property> <sizepolicy>
<property name="buddy" > <hsizetype>3</hsizetype>
<cstring>textAfterED</cstring> <vsizetype>0</vsizetype>
</property> <horstretch>0</horstretch>
</widget> <verstretch>0</verstretch>
</item> </sizepolicy>
<item row="1" column="1" colspan="2" > </property>
<widget class="QLineEdit" name="textBeforeED" > <property name="toolTip" >
<property name="sizePolicy" > <string>Natbib citation style to use</string>
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" > </property>
<horstretch>0</horstretch> </widget>
<verstretch>0</verstretch> </item>
</sizepolicy> </layout>
</property> </item>
<property name="toolTip" > <item>
<string>Text to place before citation</string> <layout class="QHBoxLayout" >
</property> <property name="margin" >
</widget> <number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLineEdit" name="textBeforeED" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Text to place before citation</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textAfterLA" >
<property name="text" >
<string>Text a&amp;fter:</string>
</property>
<property name="buddy" >
<cstring>textAfterED</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="textAfterED" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Text to place after citation</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="4" column="0" > <item row="4" column="0" >
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
@ -459,7 +448,7 @@
<item> <item>
<widget class="QPushButton" name="applyPB" > <widget class="QPushButton" name="applyPB" >
<property name="text" > <property name="text" >
<string>A&amp;pply</string> <string>App&amp;ly</string>
</property> </property>
<property name="autoDefault" > <property name="autoDefault" >
<bool>false</bool> <bool>false</bool>
@ -478,6 +467,180 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="0" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="availableKeysLA" >
<property name="text" >
<string>A&amp;vailable Citations:</string>
</property>
<property name="buddy" >
<cstring>availableLV</cstring>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>71</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="selectedKeysLA" >
<property name="text" >
<string>&amp;Selected Citations:</string>
</property>
<property name="buddy" >
<cstring>selectedLV</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QListView" name="availableLV" >
<property name="editTriggers" >
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="addPB" >
<property name="toolTip" >
<string>The Enter key works, too</string>
</property>
<property name="text" >
<string>&amp;Add</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="deletePB" >
<property name="toolTip" >
<string>The delete key works, too</string>
</property>
<property name="text" >
<string>D&amp;elete</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>77</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="upPB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Move the selected citation up (try Ctrl-Up)</string>
</property>
<property name="text" >
<string>&amp;Up</string>
</property>
<property name="icon" >
<iconset/>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="downPB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Move the selected citation down (try Ctrl-Down)</string>
</property>
<property name="text" >
<string>&amp;Down</string>
</property>
<property name="icon" >
<iconset/>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListView" name="selectedLV" >
<property name="editTriggers" >
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>