FindAndReplace: more simplification and add a WorkArea for replace (not used yet).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27671 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-11-22 18:18:51 +00:00
parent 6f305f211d
commit 9062958419
3 changed files with 93 additions and 69 deletions

View File

@ -50,6 +50,10 @@ FindAndReplace::FindAndReplace(GuiView & parent)
find_work_area_->setGuiView(parent);
find_work_area_->init();
setFocusProxy(find_work_area_);
replace_work_area_->setGuiView(parent);
replace_work_area_->init();
// We don't want two cursors blinking.
replace_work_area_->stopBlinkingCursor();
}
@ -76,14 +80,6 @@ bool FindAndReplace::eventFilter(QObject *obj, QEvent *event)
}
void FindAndReplace::selectAll()
{
dispatch(FuncRequest(LFUN_BUFFER_BEGIN));
dispatch(FuncRequest(LFUN_BUFFER_END_SELECT));
find_work_area_->redraw();
}
void FindAndReplace::findAdv(bool casesensitive,
bool matchword, bool backwards,
bool expandmacros, bool ignoreformat)
@ -135,8 +131,12 @@ void FindAndReplace::findAdv(bool casesensitive,
bool FindAndReplace::initialiseParams(std::string const &)
{
find_work_area_->redraw();
replace_work_area_->setEnabled(true);
replace_work_area_->redraw();
find_work_area_->setFocus();
selectAll();
dispatch(FuncRequest(LFUN_BUFFER_BEGIN));
dispatch(FuncRequest(LFUN_BUFFER_END_SELECT));
return true;
}

View File

@ -1230,7 +1230,6 @@ EmbeddedWorkArea::EmbeddedWorkArea(QWidget * w): GuiWorkArea(w)
buffer_->setUnnamed(true);
buffer_->setFullyLoaded(true);
setBuffer(*buffer_);
setUpdatesEnabled(false);
setDialogMode(true);
}

View File

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>338</width>
<height>400</height>
<width>240</width>
<height>432</height>
</rect>
</property>
<property name="sizePolicy" >
@ -33,17 +33,17 @@
<property name="toolTip" >
<string/>
</property>
<widget class="QWidget" name="layoutWidget" >
<widget class="QWidget" name="" >
<property name="geometry" >
<rect>
<x>4</x>
<y>4</y>
<width>301</width>
<height>381</height>
<x>20</x>
<y>20</y>
<width>212</width>
<height>404</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" colspan="2" >
<item row="0" column="0" colspan="3" >
<widget class="lyx::frontend::EmbeddedWorkArea" name="find_work_area_" >
<property name="widgetResizable" >
<bool>true</bool>
@ -53,14 +53,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>297</width>
<height>123</height>
<width>208</width>
<height>69</height>
</rect>
</property>
</widget>
</widget>
</item>
<item row="1" column="0" >
<item row="1" column="0" colspan="2" >
<widget class="QCheckBox" name="expandMacrosCB" >
<property name="enabled" >
<bool>false</bool>
@ -70,14 +70,14 @@
</property>
</widget>
</item>
<item row="1" column="1" >
<item row="1" column="2" >
<widget class="QCheckBox" name="caseCB" >
<property name="text" >
<string>Case &amp;sensitive</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<item row="2" column="0" colspan="2" >
<widget class="QCheckBox" name="wordsCB" >
<property name="enabled" >
<bool>false</bool>
@ -87,7 +87,7 @@
</property>
</widget>
</item>
<item row="2" column="1" >
<item row="2" column="2" >
<widget class="QCheckBox" name="ignoreFormatCB" >
<property name="enabled" >
<bool>true</bool>
@ -100,7 +100,7 @@
</property>
</widget>
</item>
<item row="3" column="0" >
<item row="3" column="0" colspan="2" >
<widget class="QPushButton" name="findNextPB" >
<property name="enabled" >
<bool>true</bool>
@ -113,7 +113,7 @@
</property>
</widget>
</item>
<item row="3" column="1" >
<item row="3" column="2" >
<widget class="QPushButton" name="findPrevPB" >
<property name="enabled" >
<bool>true</bool>
@ -126,7 +126,7 @@
</property>
</widget>
</item>
<item row="4" column="0" >
<item row="5" column="0" >
<widget class="QPushButton" name="replacePB" >
<property name="enabled" >
<bool>false</bool>
@ -136,7 +136,7 @@
</property>
</widget>
</item>
<item row="5" column="0" >
<item row="6" column="0" >
<widget class="QPushButton" name="replaceallPB" >
<property name="enabled" >
<bool>false</bool>
@ -146,14 +146,14 @@
</property>
</widget>
</item>
<item row="5" column="1" >
<item row="6" column="1" colspan="2" >
<widget class="QPushButton" name="closePB" >
<property name="text" >
<string>&amp;Close</string>
</property>
</widget>
</item>
<item row="6" column="0" >
<item row="7" column="0" >
<widget class="QGroupBox" name="groupBox_2" >
<property name="enabled" >
<bool>false</bool>
@ -245,7 +245,7 @@
</widget>
</widget>
</item>
<item row="6" column="1" >
<item row="7" column="1" colspan="2" >
<widget class="QGroupBox" name="groupBox_3" >
<property name="enabled" >
<bool>true</bool>
@ -265,50 +265,75 @@
<property name="title" >
<string>RegExp</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" >
<widget class="QComboBox" name="regexpInsertCombo" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="geometry" >
<rect>
<x>10</x>
<y>52</y>
<width>101</width>
<height>20</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<widget class="QComboBox" name="regexpInsertCombo" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text" >
<string>Match...</string>
</property>
</item>
<item>
<property name="text" >
<string>Anything</string>
</property>
</item>
<item>
<property name="text" >
<string>Any non-empty</string>
</property>
</item>
<item>
<property name="text" >
<string>Any word</string>
</property>
</item>
<item>
<property name="text" >
<string>Any number</string>
</property>
</item>
</widget>
<property name="text" >
<string>Match...</string>
</property>
</item>
</layout>
<item>
<property name="text" >
<string>Anything</string>
</property>
</item>
<item>
<property name="text" >
<string>Any non-empty</string>
</property>
</item>
<item>
<property name="text" >
<string>Any word</string>
</property>
</item>
<item>
<property name="text" >
<string>Any number</string>
</property>
</item>
</widget>
</widget>
</item>
<item row="4" column="0" colspan="3" >
<widget class="lyx::frontend::EmbeddedWorkArea" name="replace_work_area_" >
<property name="widgetResizable" >
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>208</width>
<height>69</height>
</rect>
</property>
</widget>
</widget>
</item>
</layout>
<zorder>replace_work_area_</zorder>
</widget>
<zorder>layoutWidget</zorder>
<zorder>replace_work_area_</zorder>
<zorder>groupBox_3</zorder>
</widget>
<customwidgets>
<customwidget>