#ifndef GUIDIALOG_H
#define GUIDIALOG_H
-#include "DialogView.h"
+#include "Dialog.h"
#include "ButtonController.h"
-#include "insets/InsetCommandParams.h"
+#include <QDialog>
+
namespace lyx {
namespace frontend {
-/** \c Dialog collects the different parts of a Model-Controller-View
- * split of a generic dialog together.
- */
-class GuiDialog : public DialogView
+/// Base class for historical LyX dialogs.
+/**
+ * \warning New dialogs should use the leaner classes \c DialogView or
+ * \c DockView depending on the intent. Eventually, old dialogs should be
+ * converted to \c DialogView too.
+ */
+class GuiDialog : public QDialog, public Dialog
{
Q_OBJECT
/// \param lv is the access point for the dialog to the LyX kernel.
/// \param name is the identifier given to the dialog by its parent
/// container.
- explicit GuiDialog(GuiView & lv, std::string const & name);
+ /// \param title is the window title used for decoration.
+ GuiDialog(GuiView & lv, QString const & name, QString const & title);
+
+ virtual QWidget * asQWidget() { return this; }
+ virtual QWidget const * asQWidget() const { return this; }
public Q_SLOTS:
/** \name Buttons
void slotOK();
// Apply button clicked
void slotApply();
+ // AutoApply checkbox clicked
+ void slotAutoApply();
// Close button clicked or closed from WindowManager
void slotClose();
+ ///
+ void closeEvent(QCloseEvent * e);
+
+protected Q_SLOTS:
+ void onBufferViewChanged() {};//override
public:
/** Check whether we may apply our data.
*/
bool isClosing() const { return is_closing_; }
+ ///
+ bool needBufferOpen() const { return isBufferDependent(); }
+
/// Update the display of the dialog whilst it is still visible.
virtual void updateView();
};
-class GuiCommand : public GuiDialog
-{
-public:
- /// We need to know with what sort of inset we're associated.
- // FIXME This should probably be an InsetCode
- GuiCommand(GuiView &, std::string const & name);
- ///
- bool initialiseParams(std::string const & data);
- /// clean-up on hide.
- void clearParams() { params_.clear(); }
- /// clean-up on hide.
- void dispatchParams();
- ///
- bool isBufferDependent() const { return true; }
-
-protected:
- ///
- InsetCommandParams params_;
- //FIXME It should be possible to eliminate lfun_name_
- //now and recover that information from params().insetType().
- //But let's not do that quite yet.
- /// Flags what action is taken by Kernel::dispatch()
- std::string const lfun_name_;
-};
-
} // namespace frontend
} // namespace lyx