From fce84d12248ab91081c9fc674a85a025939ea6d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 7 Jan 2007 09:44:57 +0000 Subject: [PATCH] Fix bug 3068. * src/frontends/qt4/QCitationDialog.C: - clear params on dialog closing * src/frontends/qt4/QCitationDialog.[Ch]: - implement CloseEvent git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16563 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QCitationDialog.C | 27 +++++++++++++++++++-------- src/frontends/qt4/QCitationDialog.h | 5 +++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt4/QCitationDialog.C b/src/frontends/qt4/QCitationDialog.C index d10365ae9c..068de2d0ca 100644 --- a/src/frontends/qt4/QCitationDialog.C +++ b/src/frontends/qt4/QCitationDialog.C @@ -26,6 +26,8 @@ #include #include +#include + using std::vector; using std::string; @@ -47,17 +49,17 @@ QCitationDialog::QCitationDialog(Dialog & dialog, QCitation * form) selectedLV->setModel(form_->selected()); availableLV->setModel(form_->available()); - connect(citationStyleCO, SIGNAL(activated(int)), + connect(citationStyleCO, SIGNAL(activated(int)), this, SLOT(changed())); - connect(fulllistCB, SIGNAL(clicked()), + connect(fulllistCB, SIGNAL(clicked()), this, SLOT(changed())); - connect(forceuppercaseCB, SIGNAL(clicked()), + connect(forceuppercaseCB, SIGNAL(clicked()), this, SLOT(changed())); - connect(textBeforeED, SIGNAL(textChanged(const QString&)), + connect(textBeforeED, SIGNAL(textChanged(const QString&)), this, SLOT(changed())); - connect(textAfterED, SIGNAL(textChanged(const QString&)), + connect(textAfterED, SIGNAL(textChanged(const QString&)), this, SLOT(changed())); - connect(clearPB, SIGNAL(clicked()), + connect(clearPB, SIGNAL(clicked()), findLE, SLOT(clear())); connect(availableLV->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), @@ -73,6 +75,14 @@ QCitationDialog::~QCitationDialog() } +void QCitationDialog::closeEvent(QCloseEvent * e) +{ + form_->clearSelection(); + form_->clearParams(); + e->accept(); +} + + void QCitationDialog::apply() { int const choice = std::max(0, citationStyleCO->currentIndex()); @@ -89,6 +99,7 @@ void QCitationDialog::apply() void QCitationDialog::hide() { + form_->clearParams(); accept(); } @@ -109,14 +120,14 @@ void QCitationDialog::on_okPB_clicked() { apply(); form_->clearSelection(); - accept(); + hide(); } void QCitationDialog::on_cancelPB_clicked() { form_->clearSelection(); - accept(); + hide(); } diff --git a/src/frontends/qt4/QCitationDialog.h b/src/frontends/qt4/QCitationDialog.h index f1d89e5440..73fc0eaf02 100644 --- a/src/frontends/qt4/QCitationDialog.h +++ b/src/frontends/qt4/QCitationDialog.h @@ -15,6 +15,8 @@ #include "Dialog.h" #include "ui/QCitationUi.h" +#include + namespace lyx { namespace frontend { @@ -45,6 +47,9 @@ public: /// \return true if the dialog is visible. bool isVisible() const; +protected: + void closeEvent (QCloseEvent * e); + protected Q_SLOTS: void on_okPB_clicked(); -- 2.39.5