fixed issue #37: add option to manually add token cards to the database

This commit is contained in:
Max-Wilhelm Bruker 2012-05-17 18:29:35 +02:00
parent d5a1032cf3
commit 3ba3952604
15 changed files with 434 additions and 93 deletions

View file

@ -123,7 +123,7 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
void DlgCreateToken::tokenSelectionChanged(const QModelIndex &current, const QModelIndex & /*previous*/)
{
const QModelIndex realIndex = cardDatabaseDisplayModel->mapToSource(current);
const CardInfo *cardInfo = cardDatabaseModel->getCard(realIndex.row());
const CardInfo *cardInfo = current.row() >= 0 ? cardDatabaseModel->getCard(realIndex.row()) : db->getCard();
nameEdit->setText(cardInfo->getName());
const QString cardColor = cardInfo->getColors().isEmpty() ? QString() : (cardInfo->getColors().size() > 1 ? QString("m") : cardInfo->getColors().first());