]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDialog.cpp
QDialogButtonBox for the remaining dialogs.
[lyx.git] / src / frontends / qt4 / GuiDialog.cpp
index 2f57dc82800260144eaad9789e29af0cd0e5680b..4fcff16a2379f3689b3a61d539375e1f667f7bb8 100644 (file)
@@ -18,6 +18,7 @@
 #include "support/debug.h"
 
 #include <QCloseEvent>
+#include <QDialogButtonBox>
 
 using namespace std;
 
@@ -90,6 +91,30 @@ void GuiDialog::slotRestore()
 }
 
 
+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:
+       case QDialogButtonBox::RestoreDefaults:
+               slotRestore();
+               break;
+       default:
+               break;
+       }
+}
+
+
 void GuiDialog::changed()
 {
        if (updating_)