Fix citation bug: In certain circumstances, attempts to insert a new citation

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
This commit is contained in:
Richard Heck 2008-08-13 14:32:30 +00:00
parent 1c5003c4ef
commit 419642ad9e
3 changed files with 9 additions and 10 deletions

View 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

View 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();

View File

@ -44,7 +44,6 @@ public:
~GuiCitation();
private Q_SLOTS:
void cleanUp();
void on_okPB_clicked();
void on_cancelPB_clicked();
void on_restorePB_clicked();