filter_->setAutoHideButton(FancyLineEdit::Right, true);
filter_->setPlaceholderText(qt_("All available labels"));
filter_->setToolTip(qt_("Enter string to filter the list of available labels"));
+#if (QT_VERSION < 0x050000)
+ connect(filter_, SIGNAL(downPressed()),
+ refsTW, SLOT(setFocus()));
+#else
+ connect(filter_, &FancyLineEdit::downPressed,
+ refsTW, [=](){ focusAndHighlight(refsTW); });
+#endif
filterBarL->addWidget(filter_, 0);
findKeysLA->setBuddy(filter_);
restored_buffer_ = -1;
active_buffer_ = -1;
+
+ setFocusProxy(filter_);
}
void GuiRef::enableBoxes()
{
- bool const isFormatted =
+ bool const isFormatted =
(InsetRef::getName(typeCO->currentIndex()) == "formatted");
- bool const isLabelOnly =
+ bool const isLabelOnly =
(InsetRef::getName(typeCO->currentIndex()) == "labelonly");
bool const usingRefStyle = buffer().params().use_refstyle;
pluralCB->setEnabled(isFormatted && usingRefStyle);
- capsCB->setEnabled (isFormatted && usingRefStyle);
- noprefixCB->setEnabled (isLabelOnly && usingRefStyle);
+ capsCB->setEnabled(isFormatted && usingRefStyle);
+ noprefixCB->setEnabled(isLabelOnly);
}
// to which we are going (or from which we are returning) is
// restored in the dialog. It's a bit of a hack, but it works,
// and no-one seems to have any better idea.
- bool const toggled =
+ bool const toggled =
last_reference_.isEmpty() || last_reference_.isNull();
if (toggled)
last_reference_ = referenceED->text();
params_.setCmdName(InsetRef::getName(typeCO->currentIndex()));
params_["reference"] = qstring_to_ucs4(last_reference_);
params_["name"] = qstring_to_ucs4(nameED->text());
- params_["plural"] = pluralCB->isChecked() ?
+ params_["plural"] = pluralCB->isChecked() ?
from_ascii("true") : from_ascii("false");
- params_["caps"] = capsCB->isChecked() ?
+ params_["caps"] = capsCB->isChecked() ?
from_ascii("true") : from_ascii("false");
- params_["noprefix"] = noprefixCB->isChecked() ?
+ params_["noprefix"] = noprefixCB->isChecked() ?
from_ascii("true") : from_ascii("false");
restored_buffer_ = bufferCO->currentIndex();
}
sortingCO->setEnabled(!refs_.empty());
refsTW->setEnabled(!refs_.empty());
groupCB->setEnabled(!refs_.empty());
- // refsTW should only be the focus proxy when it is enabled
- setFocusProxy(refs_.empty() ? 0 : refsTW);
redoRefs();
}