From: Abdelrazak Younes Date: Tue, 6 May 2008 13:50:37 +0000 (+0000) Subject: A bit of house cleaning. X-Git-Tag: 1.6.10~4878 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=39276a1254c4edf0f2cf1cc8436e724e6e09eccc;p=features.git A bit of house cleaning. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24638 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 0ac0022e55..c2d35a3b1b 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -15,8 +15,11 @@ #include "GuiCitation.h" +#include "GuiSelectionManager.h" #include "qt_helpers.h" + #include "Buffer.h" +#include "BiblioInfo.h" #include "BufferParams.h" #include "FuncRequest.h" @@ -77,7 +80,7 @@ static vector to_docstring_vector(QStringList const & qlist) GuiCitation::GuiCitation(GuiView & lv) - : GuiDialog(lv, "citation", qt_("Citation")), + : DialogView(lv, "citation", qt_("Citation")), params_(insetCode("citation")) { setupUi(this); @@ -106,11 +109,10 @@ GuiCitation::GuiCitation(GuiView & lv) connect(selectionManager, SIGNAL(selectionChanged()), this, SLOT(setCitedKeys())); connect(selectionManager, SIGNAL(updateHook()), - this, SLOT(updateDialog())); + this, SLOT(updateControls())); connect(selectionManager, SIGNAL(okHook()), this, SLOT(on_okPB_clicked())); - bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy); // FIXME: the sizeHint() for this is _way_ too high infoML->setFixedHeight(60); } @@ -154,10 +156,9 @@ void GuiCitation::applyView() void GuiCitation::showEvent(QShowEvent * e) { - init(); findLE->clear(); availableLV->setFocus(); - GuiDialog::showEvent(e); + DialogView::showEvent(e); } @@ -185,16 +186,6 @@ void GuiCitation::on_applyPB_clicked() void GuiCitation::on_restorePB_clicked() { init(); - updateView(); -} - - -void GuiCitation::updateView() -{ - init(); - fillFields(); - fillEntries(); - updateDialog(); } @@ -204,7 +195,7 @@ void GuiCitation::updateView() // will not have changed. At the moment, however, the division between // fillStyles() and updateStyle() doesn't lend itself to dividing the // two methods, though they should be divisible. -void GuiCitation::updateDialog() +void GuiCitation::updateControls() { if (selectionManager->selectedFocused()) { if (selectedLV->selectionModel()->selectedIndexes().isEmpty()) @@ -406,7 +397,7 @@ void GuiCitation::findText(QString const & text, bool reset) //availableLV. Currently, we get an automatic reset, since the //model is reset. - updateDialog(); + updateControls(); } @@ -537,6 +528,10 @@ void GuiCitation::init() else cited_keys_ = str.split(","); selected_model_.setStringList(cited_keys_); + + fillFields(); + fillEntries(); + updateControls(); } @@ -628,6 +623,7 @@ bool GuiCitation::initialiseParams(string const & data) InsetCommand::string2params("citation", data, params_); CiteEngine const engine = buffer().params().citeEngine(); citeStyles_ = citeStyles(engine); + init(); return true; } diff --git a/src/frontends/qt4/GuiCitation.h b/src/frontends/qt4/GuiCitation.h index 3187a1f631..52b6b315d6 100644 --- a/src/frontends/qt4/GuiCitation.h +++ b/src/frontends/qt4/GuiCitation.h @@ -15,22 +15,25 @@ #ifndef GUICITATION_H #define GUICITATION_H -#include "GuiDialog.h" -#include "GuiSelectionManager.h" +#include "DialogView.h" #include "ui_CitationUi.h" -#include "BiblioInfo.h" -#include "Citation.h" - #include "insets/InsetCommandParams.h" +#include "Citation.h" + #include #include namespace lyx { + +class BiblioInfo; + namespace frontend { -class GuiCitation : public GuiDialog, public Ui::CitationUi +class GuiSelectionManager; + +class GuiCitation : public DialogView, public Ui::CitationUi { Q_OBJECT @@ -42,9 +45,7 @@ public: /// void applyView(); -public Q_SLOTS: - /// Update the display of the dialog whilst it is still visible. - void updateView(); + void updateView() {} private: /// @@ -77,7 +78,7 @@ private Q_SLOTS: /// void setCitedKeys(); /// performs a limited update, suitable for internal call - void updateDialog(); + void updateControls(); private: /// enable/disable buttons