mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 14:32:04 +00:00
01b31c56c9
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7314 a592a061-630c-0410-9148-cb99ea01b6c8
83 lines
1.5 KiB
C++
83 lines
1.5 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file ControlDialog.tmpl
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \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 "ButtonController.h"
|
|
#include "ViewBase.h"
|
|
|
|
|
|
template <class Base>
|
|
ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
|
|
: Base(lv, d), dialog_built_(false)
|
|
{}
|
|
|
|
|
|
template <class Base>
|
|
void ControlDialog<Base>::show()
|
|
{
|
|
if (this->isBufferDependent() && !this->bufferIsAvailable())
|
|
return;
|
|
|
|
this->connect();
|
|
|
|
if (!dialog_built_) {
|
|
this->view().build();
|
|
dialog_built_ = true;
|
|
}
|
|
|
|
setParams();
|
|
if (this->emergency_exit_) {
|
|
hide();
|
|
return;
|
|
}
|
|
|
|
this->bc().readOnly(this->bufferIsReadonly());
|
|
this->view().show();
|
|
|
|
// The widgets may not be valid, so refresh the button controller
|
|
this->bc().refresh();
|
|
}
|
|
|
|
|
|
template <class Base>
|
|
void ControlDialog<Base>::update()
|
|
{
|
|
if (this->isBufferDependent() && !this->bufferIsAvailable())
|
|
return;
|
|
|
|
setParams();
|
|
if (this->emergency_exit_) {
|
|
hide();
|
|
return;
|
|
}
|
|
|
|
this->bc().readOnly(this->bufferIsReadonly());
|
|
this->view().update();
|
|
|
|
// The widgets may not be valid, so refresh the button controller
|
|
this->bc().refresh();
|
|
}
|
|
|
|
|
|
template <class Base>
|
|
void ControlDialog<Base>::hide()
|
|
{
|
|
this->emergency_exit_ = false;
|
|
clearParams();
|
|
|
|
this->disconnect();
|
|
this->view().hide();
|
|
}
|