// -*- C++ -*-
-/*
+/**
* \file ControlDialog.tmpl
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
*
* ControlDialog is a base class and so these templatised methods will be
* instantiated if this file is #included in the derived classes' .C file.
*/
#include "ControlDialog.h"
+
#include "ButtonControllerBase.h"
-#include "ControlConnections.h"
-#include "frontends/LyXView.h"
-#include "BufferView.h"
#include "ViewBase.h"
-#include "debug.h"
+
template <class Base>
ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
template <class Base>
void ControlDialog<Base>::show()
{
- if (isBufferDependent() && !lv_.view()->available())
+ if (isBufferDependent() && !bufferIsAvailable())
return;
connect();
+ if (!dialog_built_) {
+ view().build();
+ dialog_built_ = true;
+ }
+
setParams();
if (emergency_exit_) {
hide();
return;
}
- if (!dialog_built_) {
- view().build();
- dialog_built_ = true;
- }
-
- bc().readOnly(isReadonly());
+ bc().readOnly(bufferIsReadonly());
view().show();
+
+ // The widgets may not be valid, so refresh the button controller
+ bc().refresh();
}
template <class Base>
void ControlDialog<Base>::update()
{
- if (isBufferDependent() && !lv_.view()->available())
+ if (isBufferDependent() && !bufferIsAvailable())
return;
setParams();
return;
}
- bc().readOnly(isReadonly());
+ bc().readOnly(bufferIsReadonly());
view().update();
+
+ // The widgets may not be valid, so refresh the button controller
+ bc().refresh();
}
template <class Base>