fixed alphabetical sorting
This commit is contained in:
parent
224a4969bd
commit
fcb4316de4
2 changed files with 15 additions and 9 deletions
|
@ -6,7 +6,7 @@ void AbstractGraphicsItem::paintNumberEllipse(int number, QPainter *painter)
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
QString numStr = QString::number(number);
|
QString numStr = QString::number(number);
|
||||||
QFont font("Times");
|
QFont font("Serif");
|
||||||
font.setPixelSize(32);
|
font.setPixelSize(32);
|
||||||
font.setWeight(QFont::Bold);
|
font.setWeight(QFont::Bold);
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,13 @@ ZoneViewWidget::ZoneViewWidget(CardDatabase *_db, Player *_player, CardZone *_or
|
||||||
QGraphicsLinearLayout *vbox = new QGraphicsLinearLayout(Qt::Vertical);
|
QGraphicsLinearLayout *vbox = new QGraphicsLinearLayout(Qt::Vertical);
|
||||||
setLayout(vbox);
|
setLayout(vbox);
|
||||||
|
|
||||||
|
if (numberCards == -1) {
|
||||||
sortCheckBox = new QCheckBox;
|
sortCheckBox = new QCheckBox;
|
||||||
QGraphicsProxyWidget *sortProxy = new QGraphicsProxyWidget;
|
QGraphicsProxyWidget *sortProxy = new QGraphicsProxyWidget;
|
||||||
sortProxy->setWidget(sortCheckBox);
|
sortProxy->setWidget(sortCheckBox);
|
||||||
vbox->addItem(sortProxy);
|
vbox->addItem(sortProxy);
|
||||||
|
} else
|
||||||
|
sortCheckBox = 0;
|
||||||
|
|
||||||
if (_origZone->getIsShufflable() && (numberCards == -1)) {
|
if (_origZone->getIsShufflable() && (numberCards == -1)) {
|
||||||
shuffleCheckBox = new QCheckBox;
|
shuffleCheckBox = new QCheckBox;
|
||||||
|
@ -48,14 +51,16 @@ ZoneViewWidget::ZoneViewWidget(CardDatabase *_db, Player *_player, CardZone *_or
|
||||||
resize(w, h);
|
resize(w, h);
|
||||||
|
|
||||||
zone = new ZoneViewZone(player, _origZone, numberCards, this);
|
zone = new ZoneViewZone(player, _origZone, numberCards, this);
|
||||||
connect(sortCheckBox, SIGNAL(stateChanged(int)), zone, SLOT(setSortingEnabled(int)));
|
|
||||||
connect(zone, SIGNAL(contentsChanged()), this, SLOT(resizeToZoneContents()));
|
connect(zone, SIGNAL(contentsChanged()), this, SLOT(resizeToZoneContents()));
|
||||||
zone->dumpObjectInfo();
|
zone->dumpObjectInfo();
|
||||||
vbox->addItem(zone);
|
vbox->addItem(zone);
|
||||||
zone->initializeCards();
|
zone->initializeCards();
|
||||||
|
|
||||||
|
if (sortCheckBox) {
|
||||||
|
connect(sortCheckBox, SIGNAL(stateChanged(int)), zone, SLOT(setSortingEnabled(int)));
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
sortCheckBox->setChecked(settings.value("zoneview/sorting").toInt());
|
sortCheckBox->setChecked(settings.value("zoneview/sorting").toInt());
|
||||||
|
}
|
||||||
|
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
}
|
}
|
||||||
|
@ -63,6 +68,7 @@ ZoneViewWidget::ZoneViewWidget(CardDatabase *_db, Player *_player, CardZone *_or
|
||||||
void ZoneViewWidget::retranslateUi()
|
void ZoneViewWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
setWindowTitle(zone->getTranslatedName(false, CaseNominative));
|
setWindowTitle(zone->getTranslatedName(false, CaseNominative));
|
||||||
|
if (sortCheckBox)
|
||||||
sortCheckBox->setText(tr("sort alphabetically"));
|
sortCheckBox->setText(tr("sort alphabetically"));
|
||||||
if (shuffleCheckBox)
|
if (shuffleCheckBox)
|
||||||
shuffleCheckBox->setText(tr("shuffle when closing"));
|
shuffleCheckBox->setText(tr("shuffle when closing"));
|
||||||
|
|
Loading…
Reference in a new issue