+// -*- C++ -*-
/* This file is part of
* ======================================================
*
* \file ControlDialogs.h
* \author Angus Leeming <a.leeming@ic.ac.uk>
*
- * ControlDialog is to be used as a parent class for popups that are not
- * Inset-popups. (An ugly description I know, but I hope the meaning is clear!
- * Can anyone do any better?) Examples would be the Document and Paragraph
- * popups.
+ * ControlDialog is to be used as a parent class for dialogs that are not
+ * views onto parameters of insets. (An ugly description I know, but I hope
+ * the meaning is clear! * Can anyone do any better?) Examples would be the
+ * Document and Paragraph dialogs.
*/
#ifndef CONTROLDIALOGS_H
#define CONTROLDIALOGS_H
#include "ControlConnections.h"
+#include "debug.h"
/** Base class to control connection/disconnection of signals with the LyX
kernel for dialogs NOT used with insets.
virtual void clearParams() {}
/// set the params before show or update
virtual void setParams() {}
+
+private:
+ /// is the dialog built ?
+ bool dialog_built_;
};
#include "LyXView.h"
-
template <class Base>
ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
- : Base(lv, d)
+ : Base(lv, d), dialog_built_(false)
{}
if (isBufferDependent() && !lv_.view()->available())
return;
+ connect();
+
setParams();
+ if (!dialog_built_) {
+ view().build();
+ dialog_built_ = true;
+ }
+
bc().readOnly(isReadonly());
view().show();
}
return;
setParams();
-
+
bc().readOnly(isReadonly());
view().update();
}