#include "GuiCitation.h"
+#include "GuiSelectionManager.h"
#include "qt_helpers.h"
+
#include "Buffer.h"
+#include "BiblioInfo.h"
#include "BufferParams.h"
#include "FuncRequest.h"
GuiCitation::GuiCitation(GuiView & lv)
- : GuiDialog(lv, "citation", qt_("Citation")),
+ : DialogView(lv, "citation", qt_("Citation")),
params_(insetCode("citation"))
{
setupUi(this);
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);
}
void GuiCitation::showEvent(QShowEvent * e)
{
- init();
findLE->clear();
availableLV->setFocus();
- GuiDialog::showEvent(e);
+ DialogView::showEvent(e);
}
void GuiCitation::on_restorePB_clicked()
{
init();
- updateView();
-}
-
-
-void GuiCitation::updateView()
-{
- init();
- fillFields();
- fillEntries();
- updateDialog();
}
// 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())
//availableLV. Currently, we get an automatic reset, since the
//model is reset.
- updateDialog();
+ updateControls();
}
else
cited_keys_ = str.split(",");
selected_model_.setStringList(cited_keys_);
+
+ fillFields();
+ fillEntries();
+ updateControls();
}
InsetCommand::string2params("citation", data, params_);
CiteEngine const engine = buffer().params().citeEngine();
citeStyles_ = citeStyles(engine);
+ init();
return true;
}
#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
///
void applyView();
-public Q_SLOTS:
- /// Update the display of the dialog whilst it is still visible.
- void updateView();
+ void updateView() {}
private:
///
///
void setCitedKeys();
/// performs a limited update, suitable for internal call
- void updateDialog();
+ void updateControls();
private:
/// enable/disable buttons