branch: Refresh the contents of some dialogs when the document is read-only.

Update the view also when the document is read-only.

see r32694.

Update the GuiInfo dialog also when the document is read-only. A dialog that does not dispatch a single LFUN (see getLfun()) but is buffer dependent (see isBufferDependent()) should implement the canApply function (if I'm correct).

see r32695.

Update the GuiLabel view when the document is read-only. Also disable the text field.

see r32696.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@32802 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-01-06 20:11:45 +00:00
parent 58ca8035bb
commit 0c3357e510
5 changed files with 16 additions and 4 deletions

View File

@ -221,7 +221,7 @@ Inset const * Dialog::inset(InsetCode code) const
void Dialog::checkStatus()
{
// buffer independant dialogs are always active.
// buffer independent dialogs are always active.
// This check allows us leave canApply unimplemented for some dialogs.
if (!isBufferDependent()) {
updateView();
@ -241,9 +241,7 @@ void Dialog::checkStatus()
// refreshReadOnly() is too generous in _enabling_ widgets
// update dialog to disable disabled widgets again
if (!readonly || canApplyToReadOnly())
updateView();
updateView();
} else
enableView(false);
}

View File

@ -33,6 +33,7 @@ public:
void dispatchParams() {}
void enableView(bool enable);
bool isBufferDependent() const { return true; }
bool canApply() const { return true; }
//@}
private Q_SLOTS:

View File

@ -79,6 +79,13 @@ void GuiLabel::applyView()
}
void GuiLabel::enableView(bool enable)
{
keywordED->setEnabled(enable);
}
bool GuiLabel::isValid()
{
return !keywordED->text().isEmpty();

View File

@ -47,6 +47,10 @@ private:
void dispatchParams();
///
bool isBufferDependent() const { return true; }
///
void enableView(bool enable);
///
bool canApply() const { return true; }
private:
///

View File

@ -114,6 +114,8 @@ What's new
- Update the status bar after starting LyX and closing the last document.
- Do not paint the cursor after resizing if it is invisible (bug 6332).
- Refresh the contents of some dialogs when the document is read-only.
* DOCUMENTATION AND LOCALIZATION