void Dialog::checkStatus() { // buffer independent dialogs are always active. // This check allows us leave canApply unimplemented for some dialogs. if (!isBufferDependent()) { updateView(); return; } // deactivate the dialog if we have no buffer if (!isBufferAvailable()) { enableView(false); return; } // check whether this dialog may be active if (canApply()) { bool const readonly = isBufferReadonly(); enableView(!readonly || canApplyToReadOnly()); // refreshReadOnly() is too generous in _enabling_ widgets // update dialog to disable disabled widgets again updateView(); } else enableView(false); }
ResourceStateEvent ResourceManager::canBeDispatched(ArrayRef<uint64_t> Buffers) const { ResourceStateEvent Result = ResourceStateEvent::RS_BUFFER_AVAILABLE; for (uint64_t Buffer : Buffers) { Result = isBufferAvailable(Buffer); if (Result != ResourceStateEvent::RS_BUFFER_AVAILABLE) break; } return Result; }
void Dialog::showData(string const & data) { if (isBufferDependent() && !isBufferAvailable()) return; if (!initialiseParams(data)) { LYXERR0("Dialog \"" << name() << "\" failed to translate the data string passed to show()"); return; } showView(); }
void Dialog::apply() { if (isBufferDependent()) { if (!isBufferAvailable() || (isBufferReadonly() && !canApplyToReadOnly())) return; } applyView(); dispatchParams(); if (disconnectOnApply() && !isClosing()) { disconnect(); initialiseParams(string()); updateView(); } }