#include "support/debug.h"
#include <QCloseEvent>
+#include <QDialogButtonBox>
using namespace std;
namespace frontend {
GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
- : QDialog(&lv), Dialog(lv, name, "LyX: " + title), updating_(false),
+ : QDialog(&lv), Dialog(lv, name, "LyX: " + title), updating_(false),
is_closing_(false)
{
+ connect(&lv, SIGNAL(bufferViewChanged()),
+ this, SLOT(onBufferViewChanged()));
+
// remove question marks from Windows dialogs
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}
}
+void GuiDialog::slotButtonBox(QAbstractButton * button)
+{
+ QDialogButtonBox * bbox = qobject_cast<QDialogButtonBox*>(sender());
+ switch (bbox->standardButton(button)) {
+ case QDialogButtonBox::Ok:
+ slotOK();
+ break;
+ case QDialogButtonBox::Apply:
+ slotApply();
+ break;
+ case QDialogButtonBox::Cancel:
+ case QDialogButtonBox::Close:
+ slotClose();
+ break;
+ case QDialogButtonBox::Reset:
+ slotRestore();
+ break;
+ case QDialogButtonBox::RestoreDefaults:
+ slotRestoreDefaults();
+ break;
+ default:
+ break;
+ }
+}
+
+
void GuiDialog::changed()
{
if (updating_)