mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
make thesaurus usable for readonly documents
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37216 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ce7a4d2e2b
commit
fa632bfd7e
@ -86,7 +86,16 @@ GuiThesaurus::GuiThesaurus(GuiView & lv)
|
||||
bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
|
||||
}
|
||||
|
||||
|
||||
void GuiThesaurus::checkStatus()
|
||||
{
|
||||
if (!isBufferAvailable()) {
|
||||
// deactivate the thesaurus if we have no buffer
|
||||
enableView(false);
|
||||
return;
|
||||
}
|
||||
updateView();
|
||||
}
|
||||
|
||||
void GuiThesaurus::change_adaptor()
|
||||
{
|
||||
changed();
|
||||
@ -119,7 +128,7 @@ void GuiThesaurus::selectionChanged()
|
||||
if (pos > -1)
|
||||
item = rex.cap(2).trimmed();
|
||||
replaceED->setText(item);
|
||||
replacePB->setEnabled(true);
|
||||
replacePB->setEnabled(!isBufferReadonly());
|
||||
changed();
|
||||
}
|
||||
|
||||
@ -182,8 +191,9 @@ void GuiThesaurus::updateLists()
|
||||
}
|
||||
meaningsTV->setEnabled(true);
|
||||
lookupPB->setEnabled(true);
|
||||
replaceED->setEnabled(true);
|
||||
replacePB->setEnabled(true);
|
||||
bool const readonly = isBufferReadonly();
|
||||
replaceED->setEnabled(!readonly);
|
||||
replacePB->setEnabled(!readonly);
|
||||
}
|
||||
|
||||
if (meanings.empty()) {
|
||||
|
@ -28,6 +28,8 @@ class GuiThesaurus : public GuiDialog, public Ui::ThesaurusUi
|
||||
public:
|
||||
GuiThesaurus(GuiView & lv);
|
||||
|
||||
void checkStatus();
|
||||
|
||||
private Q_SLOTS:
|
||||
void change_adaptor();
|
||||
void entryChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user