FindAndReplace: more simplification.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27669 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-11-22 17:54:59 +00:00
parent b718b83074
commit 6f305f211d
2 changed files with 8 additions and 12 deletions

View File

@ -44,11 +44,10 @@ namespace lyx {
namespace frontend { namespace frontend {
FindAndReplace::FindAndReplace(GuiView & parent) FindAndReplace::FindAndReplace(GuiView & parent)
: DockView(parent, "Find LyX", "Find LyX Dialog", Qt::RightDockWidgetArea), : DockView(parent, "Find LyX", "Find LyX Dialog", Qt::RightDockWidgetArea)
parent_view_(parent)
{ {
setupUi(this); setupUi(this);
find_work_area_->setGuiView(parent_view_); find_work_area_->setGuiView(parent);
find_work_area_->init(); find_work_area_->init();
setFocusProxy(find_work_area_); setFocusProxy(find_work_area_);
} }
@ -144,13 +143,16 @@ bool FindAndReplace::initialiseParams(std::string const &)
void FindAndReplace::find(bool backwards) void FindAndReplace::find(bool backwards)
{ {
parent_view_.setCurrentWorkArea(parent_view_.currentMainWorkArea()); // FIXME: create a Dialog::returnFocus() or something instead of this:
GuiView & gv = const_cast<GuiView &>(lyxview());
gv.setCurrentWorkArea(gv.currentMainWorkArea());
// FIXME: This should be an LFUN.
findAdv(caseCB->isChecked(), findAdv(caseCB->isChecked(),
wordsCB->isChecked(), wordsCB->isChecked(),
backwards, backwards,
expandMacrosCB->isChecked(), expandMacrosCB->isChecked(),
ignoreFormatCB->isChecked()); ignoreFormatCB->isChecked());
parent_view_.currentMainWorkArea()->redraw(); gv.currentMainWorkArea()->redraw();
find_work_area_->setFocus(); find_work_area_->setFocus();
} }
@ -174,9 +176,7 @@ void FindAndReplace::on_regexpInsertCombo_currentIndexChanged(int index)
void FindAndReplace::on_closePB_clicked() void FindAndReplace::on_closePB_clicked()
{ {
find_work_area_->disable(); dispatch(FuncRequest(LFUN_DIALOG_TOGGLE, "findreplaceadv"));
LYXERR(Debug::DEBUG, "Dispatching dialog-hide findreplaceadv" << std::endl);
parent_view_.dispatch(FuncRequest(LFUN_DIALOG_TOGGLE, "findreplaceadv"));
} }

View File

@ -65,10 +65,6 @@ private:
bool matchword, bool backwards, bool matchword, bool backwards,
bool expandmacros, bool ignoreformat); bool expandmacros, bool ignoreformat);
GuiView & parent_view_;
GuiWorkArea * searchWorkArea_; // The work area defining what to search
private: private:
/// Apply changes /// Apply changes
virtual void apply() {} virtual void apply() {}