Factorize closeEvent() for GuiDialog based dialogs.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23045 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-17 20:16:14 +00:00
parent db2f9afc84
commit 9f3c7cf1ea
60 changed files with 14 additions and 247 deletions

View File

@ -14,7 +14,6 @@
#include "qt_helpers.h"
#include "FuncRequest.h"
#include <QCloseEvent>
#include <QLineEdit>
#include <QPushButton>
@ -50,13 +49,6 @@ void GuiBibitem::change_adaptor()
}
void GuiBibitem::closeEvent(QCloseEvent *e)
{
slotClose();
e->accept();
}
void GuiBibitem::updateContents()
{
keyED->setText(toqstr(params_["key"]));

View File

@ -31,10 +31,6 @@ public:
private Q_SLOTS:
void change_adaptor();
private:
///
void closeEvent(QCloseEvent * e);
private:
///
bool isValid();

View File

@ -278,13 +278,6 @@ void GuiBibtex::availableChanged()
}
void GuiBibtex::closeEvent(QCloseEvent *e)
{
slotClose();
e->accept();
}
void GuiBibtex::updateContents()
{
bool bibtopic = usingBibtopic();

View File

@ -59,9 +59,6 @@ private Q_SLOTS:
void availableChanged();
void bibEDChanged();
private:
void closeEvent(QCloseEvent * e);
private:
///
bool isValid();

View File

@ -144,13 +144,6 @@ GuiBox::GuiBox(GuiView & lv)
}
void GuiBox::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiBox::change_adaptor()
{
changed();

View File

@ -38,9 +38,6 @@ private Q_SLOTS:
void pagebreakClicked();
private:
///
void closeEvent(QCloseEvent * e);
/// add and remove special lengths
void setSpecial(bool ibox);
/// only show valid inner box items

View File

@ -47,13 +47,6 @@ GuiBranch::GuiBranch(GuiView & lv)
}
void GuiBranch::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiBranch::change_adaptor()
{
changed();

View File

@ -33,8 +33,6 @@ private Q_SLOTS:
void change_adaptor();
private:
///
void closeEvent(QCloseEvent * e);
/// Apply changes
void applyView();
/// Update dialog before showing it

View File

@ -54,13 +54,6 @@ GuiChanges::GuiChanges(GuiView & lv)
}
void GuiChanges::closeEvent(QCloseEvent *e)
{
slotClose();
e->accept();
}
void GuiChanges::updateContents()
{
docstring text;

View File

@ -37,7 +37,7 @@ protected Q_SLOTS:
void nextChange();
private:
void closeEvent(QCloseEvent * e);
///
void updateContents();
/// Nothing to initialise in this case.

View File

@ -377,13 +377,6 @@ void GuiCharacter::change_adaptor()
}
void GuiCharacter::closeEvent(QCloseEvent * e)
{
slotClose();
GuiDialog::closeEvent(e);
}
template<class A, class B>
static int findPos2nd(vector<pair<A, B> > const & vec, B const & val)
{

View File

@ -57,7 +57,6 @@ protected Q_SLOTS:
void change_adaptor();
private:
void closeEvent(QCloseEvent * e);
/// Apply changes
void applyView();
/// update

View File

@ -119,7 +119,7 @@ void GuiCitation::closeEvent(QCloseEvent * e)
{
clearSelection();
clearParams();
GuiDialog::closeEvent(e);
e->accept();
}

View File

@ -31,6 +31,13 @@ GuiDialog::GuiDialog(GuiView & lv, string const & name, QString const & title)
{}
void GuiDialog::closeEvent(QCloseEvent *e)
{
slotClose();
e->accept();
}
void GuiDialog::setButtonsValid(bool valid)
{
bc().setValid(valid);

View File

@ -58,6 +58,8 @@ public Q_SLOTS:
void slotApply();
// Close button clicked or closed from WindowManager
void slotClose();
///
void closeEvent(QCloseEvent * e);
public:
/** Check whether we may apply our data.

View File

@ -1034,13 +1034,6 @@ void GuiDocument::set_listings_msg()
}
void GuiDocument::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiDocument::setLSpacing(int item)
{
textLayoutModule->lspacingLE->setEnabled(item == 3);

View File

@ -141,9 +141,6 @@ private Q_SLOTS:
void classChanged();
void updateModuleInfo();
void updateEmbeddedFileList();
private:
void closeEvent(QCloseEvent * e);
private:
UiWidget<Ui::TextLayoutUi> *textLayoutModule;

View File

@ -41,13 +41,6 @@ GuiERT::GuiERT(GuiView & lv)
}
void GuiERT::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiERT::change_adaptor()
{
changed();

View File

@ -30,7 +30,6 @@ private Q_SLOTS:
void change_adaptor();
private:
void closeEvent(QCloseEvent * e);
/// Apply changes
void applyView();
/// update

View File

@ -49,13 +49,6 @@ GuiErrorList::GuiErrorList(GuiView & lv)
}
void GuiErrorList::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiErrorList::showEvent(QShowEvent * e)
{
errorsLW->setCurrentRow(0);

View File

@ -33,8 +33,6 @@ public Q_SLOTS:
void select(QListWidgetItem *);
private:
///
void closeEvent(QCloseEvent *);
///
void showEvent(QShowEvent *);
/// update contents

View File

@ -271,13 +271,6 @@ void GuiExternal::change_adaptor()
}
void GuiExternal::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiExternal::editClicked()
{
editExternal();

View File

@ -60,8 +60,7 @@ public:
typedef std::map<std::string, QString> MapType;
private:
void closeEvent(QCloseEvent * e);
//
///
bool activateAspectratio() const;
/// Apply changes
void applyView();

View File

@ -59,13 +59,6 @@ void GuiFloat::change_adaptor()
}
void GuiFloat::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiFloat::updateContents()
{
floatFP->set(params_);

View File

@ -31,7 +31,6 @@ private Q_SLOTS:
void change_adaptor();
private:
void closeEvent(QCloseEvent * e);
/// Apply changes
void applyView();
/// update

View File

@ -268,13 +268,6 @@ void GuiGraphics::change_bb()
}
void GuiGraphics::closeEvent(QCloseEvent * e)
{
slotClose();
GuiDialog::closeEvent(e);
}
void GuiGraphics::on_browsePB_clicked()
{
docstring const str = browse(qstring_to_ucs4(filename->text()));

View File

@ -53,7 +53,7 @@ private Q_SLOTS:
void on_angle_textChanged(const QString &);
private:
void closeEvent(QCloseEvent * e);
///
bool isValid();
/// Apply changes
void applyView();

View File

@ -62,13 +62,6 @@ void GuiHyperlink::changed_adaptor()
}
void GuiHyperlink::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiHyperlink::updateContents()
{
targetED->setText(toqstr(params_["target"]));

View File

@ -31,7 +31,6 @@ public Q_SLOTS:
void changed_adaptor();
private:
void closeEvent(QCloseEvent *);
///
bool isValid();
/// apply dialog

View File

@ -127,13 +127,6 @@ void GuiInclude::set_listings_msg()
}
void GuiInclude::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiInclude::typeChanged(int v)
{
switch (v) {

View File

@ -60,8 +60,6 @@ private:
LISTINGS,
};
///
void closeEvent(QCloseEvent * e);
///
void updateLists();
/// validate listings parameters and return an error message, if any
docstring validate_listings_params();

View File

@ -238,13 +238,6 @@ GuiListings::GuiListings(GuiView & lv)
}
void GuiListings::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiListings::change_adaptor()
{
changed();

View File

@ -44,7 +44,6 @@ private Q_SLOTS:
/// show dialect when language is chosen
void on_languageCO_currentIndexChanged(int);
private:
void closeEvent(QCloseEvent * e);
/// return false if validate_listings_params returns error
bool isValid();
/// Apply changes

View File

@ -120,13 +120,6 @@ GuiLog::GuiLog(GuiView & lv)
}
void GuiLog::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiLog::updateContents()
{
setTitle(toqstr(title()));

View File

@ -37,7 +37,6 @@ private Q_SLOTS:
void on_copyPB_clicked();
private:
void closeEvent(QCloseEvent * e);
/// Apply changes
void applyView() {}

View File

@ -63,13 +63,6 @@ void GuiNomenclature::reject()
}
void GuiNomenclature::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiNomenclature::updateContents()
{
prefixED->setText(toqstr(params_["prefix"]));

View File

@ -32,8 +32,6 @@ private Q_SLOTS:
void reject();
private:
///
void closeEvent(QCloseEvent * e);
///
bool isValid();
/// Apply changes

View File

@ -42,13 +42,6 @@ GuiNote::GuiNote(GuiView & lv)
}
void GuiNote::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiNote::change_adaptor()
{
changed();

View File

@ -27,7 +27,6 @@ public:
private Q_SLOTS:
void change_adaptor();
private:
void closeEvent(QCloseEvent * e);
/// Apply changes
void applyView();
/// Update dialog before showing it

View File

@ -2211,13 +2211,6 @@ void GuiPreferences::add(PrefModule * module)
}
void GuiPreferences::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiPreferences::change_adaptor()
{
changed();

View File

@ -436,8 +436,6 @@ public Q_SLOTS:
void change_adaptor();
public:
//
void closeEvent(QCloseEvent * e);
///
void add(PrefModule * module);
/// Apply changes

View File

@ -180,7 +180,7 @@ void GuiRef::closeEvent(QCloseEvent * e)
{
slotClose();
reset_dialog();
GuiDialog::closeEvent(e);
e->accept();
}

View File

@ -70,13 +70,6 @@ void GuiSearch::showEvent(QShowEvent * e)
}
void GuiSearch::closeEvent(QCloseEvent * e)
{
slotClose();
GuiDialog::closeEvent(e);
}
void GuiSearch::findChanged()
{
if (findCO->currentText().isEmpty()) {

View File

@ -34,7 +34,6 @@ private Q_SLOTS:
private:
void showEvent(QShowEvent * e);
void closeEvent(QCloseEvent * e);
///
bool initialiseParams(std::string const &) { return true; }
void clearParams() {}

View File

@ -65,13 +65,6 @@ void GuiSendTo::changed_adaptor()
}
void GuiSendTo::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiSendTo::updateContents()
{
all_formats_ = allFormats();

View File

@ -39,7 +39,6 @@ private Q_SLOTS:
void slotFormatSelected(QListWidgetItem *) {}
private:
void closeEvent(QCloseEvent * e);
///
bool isValid();
/// Apply from dialog

View File

@ -39,13 +39,6 @@ GuiShowFile::GuiShowFile(GuiView & lv)
}
void GuiShowFile::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiShowFile::updateContents()
{
setWindowTitle(toqstr(onlyFilename(filename_.absFilename())));

View File

@ -29,8 +29,6 @@ public:
GuiShowFile(GuiView & lv);
private:
///
void closeEvent(QCloseEvent * e);
/// update
void updateContents();
///

View File

@ -110,13 +110,6 @@ void GuiSpellchecker::replaceChanged(const QString & str)
}
void GuiSpellchecker::closeEvent(QCloseEvent * e)
{
slotClose();
GuiDialog::closeEvent(e);
}
void GuiSpellchecker::reject()
{
slotClose();

View File

@ -47,8 +47,6 @@ private Q_SLOTS:
void reject();
private:
///
void closeEvent(QCloseEvent * e);
/// update from controller
void partialUpdate(int id);
///

View File

@ -161,13 +161,6 @@ void GuiTabular::change_adaptor()
}
void GuiTabular::closeEvent(QCloseEvent * e)
{
slotClose();
GuiDialog::closeEvent(e);
}
void GuiTabular::booktabsChanged(bool)
{
changed();

View File

@ -69,8 +69,6 @@ private Q_SLOTS:
void ltLastFooterEmpty_clicked();
private:
///
void closeEvent(QCloseEvent * e);
///
bool isValid() { return true; }
/// update borders

View File

@ -113,13 +113,6 @@ void GuiTexInfo::change_adaptor()
}
void GuiTexInfo::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiTexInfo::rescanClicked()
{
// build new *Files.lst

View File

@ -49,8 +49,6 @@ private Q_SLOTS:
void enableViewPB();
private:
///
void closeEvent(QCloseEvent * e);
///
void updateStyles(TexFileType);
///

View File

@ -72,13 +72,6 @@ void GuiThesaurus::change_adaptor()
}
void GuiThesaurus::closeEvent(QCloseEvent * e)
{
slotClose();
GuiDialog::closeEvent(e);
}
void GuiThesaurus::entryChanged()
{
updateLists();

View File

@ -37,7 +37,6 @@ private Q_SLOTS:
void itemClicked(QTreeWidgetItem *, int);
private:
void closeEvent(QCloseEvent * e);
/// update
void updateContents();
///

View File

@ -82,13 +82,6 @@ GuiVSpace::GuiVSpace(GuiView & lv)
}
void GuiVSpace::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiVSpace::change_adaptor()
{
changed();

View File

@ -33,8 +33,6 @@ private Q_SLOTS:
///
void change_adaptor();
///
void closeEvent(QCloseEvent *);
///
void enableCustom(int);
private:

View File

@ -84,13 +84,6 @@ GuiWrap::GuiWrap(GuiView & lv)
}
void GuiWrap::closeEvent(QCloseEvent * e)
{
slotClose();
e->accept();
}
void GuiWrap::change_adaptor()
{
changed();

View File

@ -30,7 +30,6 @@ private Q_SLOTS:
void change_adaptor();
private:
void closeEvent(QCloseEvent * e);
/// Apply changes
void applyView();
/// update