selectedLV->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
#endif
+ selectedLV->setToolTip(qt_("Ordered list of all cited references.\n"
+ "You can reorder, add and remove references with the buttons on the left."));
setFocusProxy(filter_);
}
void GuiCitation::showEvent(QShowEvent * e)
{
- filter_->clear();
+ if (!filter_->text().isEmpty())
+ filterPressed();
availableLV->setFocus();
DialogView::showEvent(e);
}
bool const qualified = currentStyle.hasQualifiedList
&& (rows > 1
|| !params_["pretextlist"].empty()
- || !params_["posttextlist"].empty());
+ || !params_["posttextlist"].empty()
+ || !getPreTexts().empty()
+ || !getPostTexts().empty());
+
selectedLV->horizontalHeader()->setVisible(qualified);
selectedLV->setColumnHidden(0, !qualified);
selectedLV->setColumnHidden(2, !qualified);
starredCB->setToolTip(qt_("Always list all authors (rather than using \"et al.\"), "
"if the current citation style supports this."));
}
+ if (availableLV->selectionModel()->selectedIndexes().isEmpty())
+ availableLV->setToolTip(qt_("All references available for citing."));
+ else
+ availableLV->setToolTip(qt_("All references available for citing.\n"
+ "To add the selected one, hit Add, press Enter or double-click.\n"
+ "Hit Ctrl-Enter to add and close the dialog."));
}
int curr = selectedLV->model()->rowCount() - 1;
if (curr < 0 || selected_keys.empty()) {
+ last_chosen_style_ =
+ citationStyleCO->itemData(citationStyleCO->currentIndex()).toString();
citationStyleCO->clear();
citationStyleCO->setEnabled(false);
citationStyleLA->setEnabled(false);
// save old style selection
QString const curdata =
citationStyleCO->itemData(citationStyleCO->currentIndex()).toString();
- QString const olddata = (curdata.isEmpty()) ? style_ : curdata;
+ QString const olddata = (curdata.isEmpty()) ?
+ (last_chosen_style_.isEmpty() ? style_ : last_chosen_style_): curdata;
+ // reset this
+ last_chosen_style_.clear();
citationStyleCO->clear();
BiblioInfo::CiteStringMap::const_iterator cit = sty.begin();
BiblioInfo::CiteStringMap::const_iterator end = sty.end();
for (int i = 0; i != selected_model_.rowCount(); ++i) {
QStandardItem const * key = selected_model_.item(i, 1);
QStandardItem const * post = selected_model_.item(i, 2);
- if (key && post)
+ if (key && post && !key->text().isEmpty() && !post->text().isEmpty())
res.push_back(qstring_to_ucs4(key->text()) + " " + qstring_to_ucs4(post->text()));
}
return res;