]> git.lyx.org Git - features.git/commitdiff
Fix citation bug: In certain circumstances, attempts to insert a new citation
authorRichard Heck <rgheck@comcast.net>
Wed, 13 Aug 2008 14:32:30 +0000 (14:32 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 13 Aug 2008 14:32:30 +0000 (14:32 +0000)
would instead change an old one. The problem was that we were hiding the dialog
with hide(), which does not trigger closeEvent(). So we have to implement
hideEvent().

http://marc.info/?l=lyx-devel&m=121278861019829&w=2

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26143 a592a061-630c-0410-9148-cb99ea01b6c8

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

index 3901c769941ac8a4fe365e3e4c1723fea4aef383..058d21dbf2764118bbec7b25220744b95a1648bd 100644 (file)
@@ -49,6 +49,15 @@ protected:
                Dialog::disconnect();
                ev->accept();
        }
+       /// Any dialog that overrides this method should make sure to call it.
+       void hideEvent(QHideEvent * ev)
+       {
+               if (!ev->spontaneous()) {
+                       clearParams();
+                       Dialog::disconnect();
+                       ev->accept();
+               }
+       }
 };
 
 } // namespace frontend
index 74d7c1508d88f35c1ba26d18af7176a1c749c2b0..601b386221106c36f1c97476fc9fc9343bee385e 100644 (file)
@@ -105,8 +105,6 @@ GuiCitation::GuiCitation(GuiView & lv)
        connect(textAfterED, SIGNAL(returnPressed()),
                this, SLOT(on_okPB_clicked()));
 
-       connect(this, SIGNAL(rejected()), this, SLOT(cleanUp()));
-
        selectionManager = new GuiSelectionManager(availableLV, selectedLV, 
                        addPB, deletePB, upPB, downPB, &available_model_, &selected_model_);
        connect(selectionManager, SIGNAL(selectionChanged()),
@@ -127,13 +125,6 @@ GuiCitation::~GuiCitation()
 }
 
 
-void GuiCitation::cleanUp() 
-{
-       clearParams();
-       close();
-}
-
-
 void GuiCitation::closeEvent(QCloseEvent * e)
 {
        clearSelection();
index b8ca33f488f18b008799453941a175704cc7a353..27f69e56bc457ab1bb5c7f7a1bf63b968850c39a 100644 (file)
@@ -44,7 +44,6 @@ public:
        ~GuiCitation();
 
 private Q_SLOTS:
-       void cleanUp();
        void on_okPB_clicked();
        void on_cancelPB_clicked();
        void on_restorePB_clicked();