Hi!
Just noticed another use case where the problem shows up:

1. Insert a cross-reference and close the cross-ref-dialog.
2. Click on the cross-ref such that the dialog opens. Close the dialog with ESC. 3. Insert a cross-reference, but double-click on the label in the dialog.
=> no new cross-ref is created, but the previous one is changed.

Stefan

Am 13.08.2008 um 03:39 schrieb rgheck:

Stefan Schimanski wrote:
The patch looks good. Tried it with and without as you said.

OK, I've actually figured all this out now. I think. We talked about all this a couple months ago, here:
http://marc.info/?l=lyx-devel&m=121278861019829&w=2
but the fix upon which we agreed never actually got implemented. The attached patch does what I think we need.

rh

Index: frontends/qt4/GuiCitation.h
===================================================================
--- frontends/qt4/GuiCitation.h (revision 26122)
+++ frontends/qt4/GuiCitation.h (working copy)
@@ -44,7 +44,6 @@
        ~GuiCitation();

private Q_SLOTS:
-       void cleanUp();
        void on_okPB_clicked();
        void on_cancelPB_clicked();
        void on_restorePB_clicked();
Index: frontends/qt4/GuiCitation.cpp
===================================================================
--- frontends/qt4/GuiCitation.cpp       (revision 26122)
+++ frontends/qt4/GuiCitation.cpp       (working copy)
@@ -105,8 +105,6 @@
        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 @@
}


-void GuiCitation::cleanUp()
-{
-       clearParams();
-       close();
-}
-
-
void GuiCitation::closeEvent(QCloseEvent * e)
{
        clearSelection();
Index: frontends/qt4/DialogView.h
===================================================================
--- frontends/qt4/DialogView.h  (revision 26126)
+++ frontends/qt4/DialogView.h  (working copy)
@@ -49,6 +49,15 @@
                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

Reply via email to