From 6f0703e707a529823fe23342fd01ae36e8b5c8aa Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 15 Sep 2007 01:53:26 +0000 Subject: [PATCH] Repair behavior of citation dialog after all the recent changes in src/frontends/. Previously, there had been a virtual initialiseParams() method in QCitation which overrode the corresponding method in ControlCitation. But now there is no "local" controller, and so intialiseParams() overrode nothing and so never got called. I've also made some minor changes here to GuiSelectionManager, changing updateView(), which is now used as a commonly overridden method of GuiDialog, back to update(). The method does not serve the same purpose here. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20281 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiCitation.cpp | 13 +++---------- src/frontends/qt4/GuiCitation.h | 3 --- src/frontends/qt4/GuiSelectionManager.cpp | 2 +- src/frontends/qt4/GuiSelectionManager.h | 2 +- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 4f2e5cc625..cbb72edabb 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -147,6 +147,7 @@ void GuiCitationDialog::hideView() void GuiCitationDialog::showView() { + init(); findLE->clear(); availableLV->setFocus(); QDialog::show(); @@ -191,6 +192,7 @@ void GuiCitationDialog::on_restorePB_clicked() void GuiCitationDialog::updateView() { + init(); fillFields(); fillEntries(); updateDialog(); @@ -351,7 +353,7 @@ bool GuiCitationDialog::isSelected(const QModelIndex & idx) void GuiCitationDialog::setButtons() { - selectionManager->updateView(); + selectionManager->update(); int const srows = selectedLV->model()->rowCount(); applyPB->setEnabled(srows > 0); okPB->setEnabled(srows > 0); @@ -487,15 +489,6 @@ QString GuiCitationDialog::textAfter() } -bool GuiCitationDialog::initialiseParams(std::string const & data) -{ - if (!controller().initialiseParams(data)) - return false; - init(); - return true; -} - - void GuiCitationDialog::init() { // Make the list of all available bibliography keys diff --git a/src/frontends/qt4/GuiCitation.h b/src/frontends/qt4/GuiCitation.h index 95a0158dce..583d432b9c 100644 --- a/src/frontends/qt4/GuiCitation.h +++ b/src/frontends/qt4/GuiCitation.h @@ -97,9 +97,6 @@ private: GuiSelectionManager * selectionManager; - /// - bool initialiseParams(std::string const & data); - /// void init(); diff --git a/src/frontends/qt4/GuiSelectionManager.cpp b/src/frontends/qt4/GuiSelectionManager.cpp index 130d3f85c4..2333d3cc8f 100644 --- a/src/frontends/qt4/GuiSelectionManager.cpp +++ b/src/frontends/qt4/GuiSelectionManager.cpp @@ -67,7 +67,7 @@ selectedLV->installEventFilter(this); } -void GuiSelectionManager::updateView() +void GuiSelectionManager::update() { int const arows = availableLV->model()->rowCount(); QModelIndexList const availSels = diff --git a/src/frontends/qt4/GuiSelectionManager.h b/src/frontends/qt4/GuiSelectionManager.h index a9d1f72bf8..ac4671be45 100644 --- a/src/frontends/qt4/GuiSelectionManager.h +++ b/src/frontends/qt4/GuiSelectionManager.h @@ -50,7 +50,7 @@ public: /// Sets the state of the various push buttons, depending upon the /// state of the widgets. (E.g., "delete" is enabled only if the /// selection is non-empty.) - virtual void updateView(); + void update(); /// Not strictly a matter of focus, which may be elsewhere, but /// whether selectedLV is `more focused' than availableLV. Intended