mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
simplify adv search/replace layout
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33867 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ce5603d445
commit
e7b1808827
@ -96,22 +96,21 @@ bool FindAndReplaceWidget::eventFilter(QObject * obj, QEvent * event)
|
||||
break;
|
||||
|
||||
case Qt::Key_Enter:
|
||||
case Qt::Key_Return:
|
||||
if (e->modifiers() == Qt::ShiftModifier) {
|
||||
if (obj == find_work_area_)
|
||||
on_findPrevPB_clicked();
|
||||
else
|
||||
on_replacePrevPB_clicked();
|
||||
return true;
|
||||
} else if (e->modifiers() == Qt::NoModifier) {
|
||||
case Qt::Key_Return: {
|
||||
// with shift we (temporarily) change search/replace direction
|
||||
bool const searchback = searchbackCB->isChecked();
|
||||
if (e->modifiers() == Qt::ShiftModifier && !searchback)
|
||||
searchbackCB->setChecked(!searchback);
|
||||
|
||||
if (obj == find_work_area_)
|
||||
on_findNextPB_clicked();
|
||||
else
|
||||
on_replaceNextPB_clicked();
|
||||
on_replacePB_clicked();
|
||||
// back to how it was
|
||||
searchbackCB->setChecked(searchback);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
case Qt::Key_Tab:
|
||||
if (e->modifiers() == Qt::NoModifier) {
|
||||
if (obj == find_work_area_){
|
||||
@ -532,28 +531,16 @@ void FindAndReplaceWidget::hideDialog()
|
||||
}
|
||||
|
||||
|
||||
void FindAndReplaceWidget::on_findNextPB_clicked() {
|
||||
findAndReplace(false, false);
|
||||
void FindAndReplaceWidget::on_findNextPB_clicked()
|
||||
{
|
||||
findAndReplace(searchbackCB->isChecked(), false);
|
||||
find_work_area_->setFocus();
|
||||
}
|
||||
|
||||
|
||||
void FindAndReplaceWidget::on_findPrevPB_clicked() {
|
||||
findAndReplace(true, false);
|
||||
find_work_area_->setFocus();
|
||||
}
|
||||
|
||||
|
||||
void FindAndReplaceWidget::on_replaceNextPB_clicked()
|
||||
void FindAndReplaceWidget::on_replacePB_clicked()
|
||||
{
|
||||
findAndReplace(false, true);
|
||||
replace_work_area_->setFocus();
|
||||
}
|
||||
|
||||
|
||||
void FindAndReplaceWidget::on_replacePrevPB_clicked()
|
||||
{
|
||||
findAndReplace(true, true);
|
||||
findAndReplace(searchbackCB->isChecked(), true);
|
||||
replace_work_area_->setFocus();
|
||||
}
|
||||
|
||||
|
@ -67,9 +67,7 @@ private:
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_findNextPB_clicked();
|
||||
void on_findPrevPB_clicked();
|
||||
void on_replaceNextPB_clicked();
|
||||
void on_replacePrevPB_clicked();
|
||||
void on_replacePB_clicked();
|
||||
void on_replaceallPB_clicked();
|
||||
void insertRegexp(QAction *);
|
||||
};
|
||||
|
@ -5,8 +5,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>288</width>
|
||||
<height>366</height>
|
||||
<width>247</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -63,7 +63,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="lyx::frontend::EmbeddedWorkArea" name="find_work_area_">
|
||||
<property name="toolTip">
|
||||
<string>Enter the text to search for in this full-featured LyX editing area</string>
|
||||
@ -77,39 +77,23 @@
|
||||
<height>57</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="caseCB">
|
||||
<property name="toolTip">
|
||||
<string>Perform a case-sensitive search</string>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Case &sensitive</string>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>52</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="wordsCB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Restrict search to whole words only</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Whole &words</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QPushButton" name="regexpInsertPB">
|
||||
<property name="toolTip">
|
||||
<string>Choose one of the pre-arranged regular expressions.</string>
|
||||
@ -119,7 +103,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>&Replace with:</string>
|
||||
@ -129,7 +113,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item row="4" column="0" colspan="3">
|
||||
<widget class="lyx::frontend::EmbeddedWorkArea" name="replace_work_area_">
|
||||
<property name="toolTip">
|
||||
<string>Enter the text to replace in this full-featured LyX editing area</string>
|
||||
@ -143,34 +127,20 @@
|
||||
<height>57</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="findPrevPB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="caseCB">
|
||||
<property name="toolTip">
|
||||
<string>Find previous occurrence [Shift+Enter]</string>
|
||||
<string>Perform a case-sensitive search</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Find &Previous</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
<string>Case &sensitive</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="findNextPB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -186,21 +156,21 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="replacePrevPB">
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="wordsCB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Replace and find previous occurrence [Shift+Enter]</string>
|
||||
<string>Restrict search to whole words only</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Replace Pre&vious</string>
|
||||
<string>Whole &words</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="replaceNextPB">
|
||||
<item row="6" column="2">
|
||||
<widget class="QPushButton" name="replacePB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -208,11 +178,18 @@
|
||||
<string>Replace and find next occurrence [Enter]</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Replace Ne&xt</string>
|
||||
<string>&Replace</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="searchbackCB">
|
||||
<property name="text">
|
||||
<string>Search backwards</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QPushButton" name="replaceallPB">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -226,8 +203,6 @@
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="AdvancedTab">
|
||||
<property name="sizePolicy">
|
||||
|
Loading…
Reference in New Issue
Block a user