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."));
+ // With qualified citation lists, it makes sense to add the same key multiple times
+ selectionManager->allowMultiSelection(currentStyle.hasQualifiedList);
}
: QObject(parent), availableLV(avail), selectedLV(sel),
addPB(add), deletePB(del), upPB(up), downPB(down),
availableModel(amod), selectedModel(smod),
- selectedHasFocus_(false), main_sel_col_(main_sel_col)
+ selectedHasFocus_(false), main_sel_col_(main_sel_col),
+ allow_multi_selection_(false)
{
selectedLV->setModel(smod);
availableLV->setModel(amod);
availableLV->selectionModel()->selectedIndexes();
addPB->setEnabled(arows > 0 &&
!availSels.isEmpty() &&
- !isSelected(availSels.first()));
+ (allow_multi_selection_ || !isSelected(availSels.first())));
}
/// Returns the selected index. Note that this will depend upon
/// selectedFocused().
QModelIndex getSelectedIndex(int const c = 0) const;
+ ///
+ void allowMultiSelection(bool b) { allow_multi_selection_ = b; }
Q_SIGNALS:
/// Emitted when the list of selected items has changed.
bool selectedHasFocus_;
///
int main_sel_col_;
+ ///
+ bool allow_multi_selection_;
};
} // namespace frontend