connect(textAfterED, SIGNAL(returnPressed()),
this, SLOT(on_okPB_clicked()));
- selectionManager = new GuiSelectionManager(availableLV, selectedLV,
+ selectionManager = new GuiSelectionManager(this, availableLV, selectedLV,
addPB, deletePB, upPB, downPB, &available_model_, &selected_model_, 1);
connect(selectionManager, SIGNAL(selectionChanged()),
this, SLOT(setCitedKeys()));
this, SLOT(filterChanged(QString)));
connect(filter_, SIGNAL(returnPressed()),
this, SLOT(filterPressed()));
+#if (QT_VERSION < 0x050000)
+ connect(filter_, SIGNAL(downPressed()),
+ availableLV, SLOT(setFocus()));
+#else
+ connect(filter_, &FancyLineEdit::downPressed,
+ availableLV, [=](){ focusAndHighlight(availableLV); });
+#endif
connect(regexp_, SIGNAL(triggered()),
this, SLOT(regexChanged()));
connect(casesense_, SIGNAL(triggered()),
}
-GuiCitation::~GuiCitation()
-{
- delete selectionManager;
-}
-
-
void GuiCitation::closeEvent(QCloseEvent * e)
{
clearSelection();
selectedLV->horizontalHeader()->setVisible(qualified);
selectedLV->setColumnHidden(0, !qualified);
selectedLV->setColumnHidden(2, !qualified);
+ bool const haveSelection = rows > 0;
if (qualified) {
textBeforeLA->setText(qt_("General text befo&re:"));
textAfterLA->setText(qt_("General &text after:"));
textBeforeED->setToolTip(qt_("Text that precedes the whole reference list. "
- "For text that precedes individual items, double-click on the respective entry above."));
+ "For text that precedes individual items, "
+ "double-click on the respective entry above."));
textAfterLA->setToolTip(qt_("General &text after:"));
textAfterED->setToolTip(qt_("Text that follows the whole reference list. "
- "For text that follows individual items, double-click on the respective entry above."));
+ "For text that follows individual items, "
+ "double-click on the respective entry above."));
} else {
textBeforeLA->setText(qt_("Text befo&re:"));
- textBeforeED->setToolTip(qt_("Text that precedes the reference (e.g., \"cf.\")"));
+ if (textbefore && haveSelection)
+ textBeforeED->setToolTip(qt_("Text that precedes the reference (e.g., \"cf.\")"));
+ else
+ textBeforeED->setToolTip(qt_("Text that precedes the reference (e.g., \"cf.\"), "
+ "if the current citation style supports this."));
textAfterLA->setText(qt_("&Text after:"));
- textAfterED->setToolTip(qt_("Text that follows the reference (e.g., pages)"));
+ if (textafter && haveSelection)
+ textAfterED->setToolTip(qt_("Text that follows the reference (e.g., pages)"));
+ else
+ textAfterED->setToolTip(qt_("Text that follows the reference (e.g., pages), "
+ "if the current citation style supports this."));
}
- bool const haveSelection = rows > 0;
-
forceuppercaseCB->setEnabled(force && haveSelection);
+ if (force && haveSelection)
+ forceuppercaseCB->setToolTip("Force upper case in names (\"Del Piero\", not \"del Piero\").");
+ else
+ forceuppercaseCB->setToolTip("Force upper case in names (\"Del Piero\", not \"del Piero\"), "
+ "if the current citation style supports this.");
starredCB->setEnabled(full && haveSelection);
textBeforeED->setEnabled(textbefore && haveSelection);
textBeforeLA->setEnabled(textbefore && haveSelection);
} else {
// This is the default meaning of the starred commands
starredCB->setText(qt_("All aut&hors"));
- starredCB->setToolTip(qt_("Always list all authors (rather than using \"et al.\")"));
+ if (full && haveSelection)
+ starredCB->setToolTip(qt_("Always list all authors (rather than using \"et al.\")"));
+ else
+ starredCB->setToolTip(qt_("Always list all authors (rather than using \"et al.\"), "
+ "if the current citation style supports this."));
}
}
QSettings settings;
regexp_->setChecked(settings.value(sessionKey() + "/regex").toBool());
casesense_->setChecked(settings.value(sessionKey() + "/casesensitive").toBool());
- instant_->setChecked(settings.value(sessionKey() + "/autofind").toBool());
+ instant_->setChecked(settings.value(sessionKey() + "/autofind", true).toBool());
style_ = settings.value(sessionKey() + "/citestyle").toInt();
updateFilterHint();
}