]> git.lyx.org Git - features.git/commitdiff
A bit of house cleaning.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 6 May 2008 13:50:37 +0000 (13:50 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 6 May 2008 13:50:37 +0000 (13:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24638 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiCitation.cpp
src/frontends/qt4/GuiCitation.h

index 0ac0022e55dbd80b9859aeb572f7d1362e11c00e..c2d35a3b1be7fef97687d0336300607dada2b241 100644 (file)
 
 #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<lyx::docstring> 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;
 }
 
index 3187a1f6315fa4bf63c1f185be9fc12d97514cd9..52b6b315d6ac2a1ae6803a3ea5ed6fdc788c66f1 100644 (file)
 #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 <QStringList>
 #include <QStringListModel>
 
 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