X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlDialog.tmpl;h=dffa2e7ecc856ab40f91865f510f039035c574bb;hb=120c89f24fae05379fbdc8539d3cfae574c2aecd;hp=adfa9e424f7d2f1321f813a3ad67818ac66299be;hpb=c47cfe391b199c575314a815ab2482f622e2e590;p=lyx.git diff --git a/src/frontends/controllers/ControlDialog.tmpl b/src/frontends/controllers/ControlDialog.tmpl index adfa9e424f..dffa2e7ecc 100644 --- a/src/frontends/controllers/ControlDialog.tmpl +++ b/src/frontends/controllers/ControlDialog.tmpl @@ -1,22 +1,22 @@ // -*- 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 + * \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 ControlDialog::ControlDialog(LyXView & lv, Dialogs & d) @@ -27,30 +27,33 @@ ControlDialog::ControlDialog(LyXView & lv, Dialogs & d) template void ControlDialog::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 void ControlDialog::update() { - if (isBufferDependent() && !lv_.view()->available()) + if (isBufferDependent() && !bufferIsAvailable()) return; setParams(); @@ -59,8 +62,11 @@ void ControlDialog::update() return; } - bc().readOnly(isReadonly()); + bc().readOnly(bufferIsReadonly()); view().update(); + + // The widgets may not be valid, so refresh the button controller + bc().refresh(); } template @@ -72,4 +78,3 @@ void ControlDialog::hide() disconnect(); view().hide(); } -