]> git.lyx.org Git - features.git/commitdiff
Fix bug 3068.
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 7 Jan 2007 09:44:57 +0000 (09:44 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 7 Jan 2007 09:44:57 +0000 (09:44 +0000)
* 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
src/frontends/qt4/QCitationDialog.h

index d10365ae9c0e8ef8767ec72be83fa94e5ad0b536..068de2d0ca8a24d6d909e6aad994b083a9a33102 100644 (file)
@@ -26,6 +26,8 @@
 #include <vector>
 #include <string>
 
+#include <QCloseEvent>
+
 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();
 }
 
 
index f1d89e5440eb05048219180684ea2aa771dbb687..73fc0eaf02a41efca5883bc982cfdac10596a73a 100644 (file)
@@ -15,6 +15,8 @@
 #include "Dialog.h"
 #include "ui/QCitationUi.h"
 
+#include <QCloseEvent>
+
 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();