namespace lyx {
namespace frontend {
-static void setWidgetEnabled(QWidget * obj, bool enabled)
-{
- if (QLineEdit * le = qobject_cast<QLineEdit*>(obj))
- le->setReadOnly(!enabled);
- else
- obj->setEnabled(enabled);
-
- obj->setFocusPolicy(enabled ? Qt::StrongFocus : Qt::NoFocus);
-}
-
-
/////////////////////////////////////////////////////////////////////////
//
// CheckedLineEdit
d->policy_.input(ro ?
ButtonPolicy::SMI_READ_ONLY : ButtonPolicy::SMI_READ_WRITE);
- // refreshReadOnly(); This will enable all widgets in dialogs, no matter if
- // they allowed to be enabled, so when you plan to
- // reenable this call, read this before:
- // http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg128222.html
+
refresh();
return ro;
}
}
-void ButtonController::refreshReadOnly() const
-{
- if (d->read_only_.empty())
- return;
- bool const enable = !policy().isReadOnly();
- for(QWidget * w : d->read_only_)
- setWidgetEnabled(w, enable);
-}
-
-
void ButtonController::addCheckedLineEdit(QLineEdit * input, QWidget * label)
{
d->checked_widgets_.append(CheckedLineEdit(input, label));
*/
void refresh() const;
- /** Refresh the activation state of all the widgets under the control
- * of the BC to reflect the read-only status of the underlying buffer.
- */
- void refreshReadOnly() const;
-
/** Passthrough function -- returns its input value
* Tell the BC about the read-only status of the underlying buffer.
*/