mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
Fix part of bug 4775. We need to search here only when the user requests it, and not try to do "search as you go". This is too slow, even on fast machines, if you have more than a handful of entries.
I've also added some tooltips to direct people to the keyboard shortcuts. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24495 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
696f745f63
commit
022ea0feb6
@ -92,8 +92,12 @@ GuiCitation::GuiCitation(GuiView & lv)
|
||||
this, SLOT(changed()));
|
||||
connect(textAfterED, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(changed()));
|
||||
connect(clearPB, SIGNAL(clicked()),
|
||||
findLE, SLOT(clear()));
|
||||
connect(findLE, SIGNAL(returnPressed()),
|
||||
this, SLOT(on_searchPB_clicked()));
|
||||
connect(textBeforeED, SIGNAL(returnPressed()),
|
||||
this, SLOT(on_okPB_clicked()));
|
||||
connect(textAfterED, SIGNAL(returnPressed()),
|
||||
this, SLOT(on_okPB_clicked()));
|
||||
connect(this, SIGNAL(rejected()), this, SLOT(cleanUp()));
|
||||
|
||||
selectionManager = new GuiSelectionManager(availableLV, selectedLV,
|
||||
@ -420,10 +424,16 @@ void GuiCitation::on_citationStyleCO_currentIndexChanged(int index)
|
||||
|
||||
void GuiCitation::on_findLE_textChanged(const QString & text)
|
||||
{
|
||||
clearPB->setDisabled(text.isEmpty());
|
||||
if (text.isEmpty())
|
||||
findLE->setFocus();
|
||||
findText(text);
|
||||
searchPB->setDisabled(text.isEmpty());
|
||||
if (!text.isEmpty())
|
||||
return;
|
||||
findText(findLE->text());
|
||||
findLE->setFocus();
|
||||
}
|
||||
|
||||
void GuiCitation::on_searchPB_clicked()
|
||||
{
|
||||
findText(findLE->text());
|
||||
}
|
||||
|
||||
|
||||
@ -527,7 +537,7 @@ void GuiCitation::findKey(QString const & str, bool only_keys,
|
||||
last_case_sensitive = case_sensitive;
|
||||
last_reg_exp = reg_exp;
|
||||
|
||||
Qt::CaseSensitivity qtcase = case_sensitive?
|
||||
Qt::CaseSensitivity qtcase = case_sensitive ?
|
||||
Qt::CaseSensitive: Qt::CaseInsensitive;
|
||||
QStringList keys;
|
||||
// If new string (str) contains the last searched one...
|
||||
|
@ -64,6 +64,7 @@ private Q_SLOTS:
|
||||
void on_cancelPB_clicked();
|
||||
void on_restorePB_clicked();
|
||||
void on_applyPB_clicked();
|
||||
void on_searchPB_clicked();
|
||||
void on_findLE_textChanged(const QString & text);
|
||||
void on_fieldsCO_currentIndexChanged(int index);
|
||||
void on_entriesCO_currentIndexChanged(int index);
|
||||
|
@ -33,7 +33,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Move the selected citation up</string>
|
||||
<string>Move the selected citation up (try Ctrl-Up)</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Up</string>
|
||||
@ -41,6 +41,9 @@
|
||||
<property name="icon" >
|
||||
<iconset/>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" >
|
||||
@ -52,7 +55,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Move the selected citation down</string>
|
||||
<string>Move the selected citation down (try Ctrl-Down)</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Down</string>
|
||||
@ -60,6 +63,9 @@
|
||||
<property name="icon" >
|
||||
<iconset/>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
@ -77,9 +83,15 @@
|
||||
</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&elete</string>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="5" row="1" column="0" >
|
||||
@ -92,13 +104,13 @@
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="addPB" >
|
||||
<property name="toolTip" >
|
||||
<string/>
|
||||
<string>The Enter key works, too</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Add</string>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -162,18 +174,27 @@
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3" >
|
||||
<widget class="QLineEdit" name="findLE" >
|
||||
<property name="toolTip" >
|
||||
<string>Hit Enter to search, or click Go!</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4" >
|
||||
<widget class="QPushButton" name="clearPB" >
|
||||
<widget class="QPushButton" name="searchPB" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>You can also hit Enter in the search box</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string><- C&lear</string>
|
||||
<string>&Go!</string>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -384,6 +405,9 @@
|
||||
<property name="text" >
|
||||
<string>&Restore</string>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -405,10 +429,10 @@
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -417,6 +441,9 @@
|
||||
<property name="text" >
|
||||
<string>A&pply</string>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -441,7 +468,7 @@
|
||||
<tabstop>upPB</tabstop>
|
||||
<tabstop>downPB</tabstop>
|
||||
<tabstop>findLE</tabstop>
|
||||
<tabstop>clearPB</tabstop>
|
||||
<tabstop>searchPB</tabstop>
|
||||
<tabstop>caseCB</tabstop>
|
||||
<tabstop>regexCB</tabstop>
|
||||
<tabstop>citationStyleCO</tabstop>
|
||||
|
Loading…
Reference in New Issue
Block a user