Merge remote-tracking branch 'upstream/master' into local_scry_and_move

This commit is contained in:
Fabio Bas 2015-01-05 11:08:11 +01:00
commit 2671d6abdc
34 changed files with 12013 additions and 5621 deletions

View file

@ -31,7 +31,7 @@ static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardSet *set)
}
CardSet::CardSet(const QString &_shortName, const QString &_longName, const QString &_setType, const QDate &_releaseDate)
: shortName(_shortName), longName(_longName), setType(_setType), releaseDate(_releaseDate)
: shortName(_shortName), longName(_longName), releaseDate(_releaseDate), setType(_setType)
{
updateSortKey();
}

View file

@ -75,6 +75,7 @@ DlgConnect::DlgConnect(QWidget *parent)
void DlgConnect::passwordSaved(int state)
{
Q_UNUSED(state);
if(savePasswordCheckBox->isChecked()) {
autoConnectCheckBox->setEnabled(true);
} else {

View file

@ -44,7 +44,7 @@ GeneralSettingsPage::GeneralSettingsPage()
picDownloadCheckBox = new QCheckBox;
picDownloadCheckBox->setChecked(settingsCache->getPicDownload());
QPushButton *clearDownloadedPicsButton = new QPushButton(tr("Reset/Clear Downloaded Pictures"));
clearDownloadedPicsButton = new QPushButton();
connect(clearDownloadedPicsButton, SIGNAL(clicked()), this, SLOT(clearDownloadedPicsButtonClicked()));
picDownloadHqCheckBox = new QCheckBox;
@ -227,6 +227,7 @@ void GeneralSettingsPage::retranslateUi()
picsPathLabel->setText(tr("Pictures directory:"));
cardDatabasePathLabel->setText(tr("Card database:"));
tokenDatabasePathLabel->setText(tr("Token database:"));
clearDownloadedPicsButton->setText(tr("Reset/Clear Downloaded Pictures"));
}
AppearanceSettingsPage::AppearanceSettingsPage()

View file

@ -44,6 +44,7 @@ private:
QCheckBox *picDownloadCheckBox;
QCheckBox *picDownloadHqCheckBox;
QLabel *languageLabel, *deckPathLabel, *replaysPathLabel, *picsPathLabel, *cardDatabasePathLabel, *tokenDatabasePathLabel;
QPushButton *clearDownloadedPicsButton;
};
class AppearanceSettingsPage : public AbstractSettingsPage {

View file

@ -154,7 +154,7 @@ public:
FilterTreeNode *termNode(const CardFilter *f);
FilterTreeNode *attrTypeNode(CardFilter::Attr attr,
CardFilter::Type type);
const char *textCStr() { return "root"; }
const char *textCStr() const { return "root"; }
int index() const { return 0; }
bool acceptsCard(const CardInfo *info) const;

View file

@ -70,13 +70,13 @@ PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient
setMinimumHeight(60);
setIconSize(QSize(20, 15));
setColumnCount(6);
setColumnWidth(0, 20);
setColumnWidth(1, 20);
setColumnWidth(2, 20);
setColumnWidth(3, 20);
setColumnWidth(5, 20);
setHeaderHidden(true);
setRootIsDecorated(false);
#if QT_VERSION < 0x050000
header()->setResizeMode(QHeaderView::ResizeToContents);
#else
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
#endif
retranslateUi();
}
@ -116,6 +116,7 @@ void PlayerListWidget::updatePlayerProperties(const ServerInfo_PlayerProperties
player->setData(3, Qt::UserRole, prop.user_info().user_level());
player->setIcon(3, QIcon(UserLevelPixmapGenerator::generatePixmap(12, UserLevelFlags(prop.user_info().user_level()))));
player->setText(4, QString::fromStdString(prop.user_info().name()));
resizeColumnToContents(4);
const QString country = QString::fromStdString(prop.user_info().country());
if (!country.isEmpty())
player->setIcon(4, QIcon(CountryPixmapGenerator::generatePixmap(12, country)));
@ -123,8 +124,10 @@ void PlayerListWidget::updatePlayerProperties(const ServerInfo_PlayerProperties
}
if (prop.has_player_id())
player->setData(4, Qt::UserRole + 1, prop.player_id());
if (prop.has_deck_hash())
if (prop.has_deck_hash()) {
player->setText(5, QString::fromStdString(prop.deck_hash()));
resizeColumnToContents(5);
}
if (prop.has_sideboard_locked())
player->setIcon(5, prop.sideboard_locked() ? lockIcon : QIcon());
if (prop.has_ping_seconds())

View file

@ -29,7 +29,7 @@ public:
SetsModel(CardDatabase *_db, QObject *parent = 0);
~SetsModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const { return NUM_COLS; }
int columnCount(const QModelIndex &parent = QModelIndex()) const { Q_UNUSED(parent); return NUM_COLS; }
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const;

View file

@ -10,6 +10,10 @@ Tab::Tab(TabSupervisor *_tabSupervisor, QWidget *parent)
void Tab::showCardInfoPopup(const QPoint &pos, const QString &cardName)
{
if (infoPopup) {
infoPopup->deleteLater();
}
currentCardName = cardName;
infoPopup = new CardInfoWidget(CardInfoWidget::ModePopUp, cardName, 0, Qt::Widget | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint);
infoPopup->setAttribute(Qt::WA_TransparentForMouseEvents);
QRect screenRect = qApp->desktop()->screenGeometry(this);
@ -23,7 +27,7 @@ void Tab::showCardInfoPopup(const QPoint &pos, const QString &cardName)
void Tab::deleteCardInfoPopup(const QString &cardName)
{
if (infoPopup) {
if ((infoPopup->getCardName() == cardName) || (cardName == "_")) {
if ((currentCardName == cardName) || (cardName == "_")) {
infoPopup->deleteLater();
infoPopup = 0;
}

View file

@ -19,6 +19,7 @@ protected slots:
void showCardInfoPopup(const QPoint &pos, const QString &cardName);
void deleteCardInfoPopup(const QString &cardName);
private:
QString currentCardName;
bool contentsChanged;
CardInfoWidget *infoPopup;
QList<QMenu *> tabMenus;

View file

@ -224,6 +224,7 @@ void MainWindow::actAbout()
+ tr("Portugese (Brazil):") + " Thiago Queiroz<br>"
+ tr("French:") + " Yannick Hammer, Arnaud Faes<br>"
+ tr("Japanese:") + " Nagase Task<br>"
+ tr("Korean:") + " Jaeic Lee<br>"
+ tr("Russian:") + " Alexander Davidov<br>"
+ tr("Italian:") + " Luigi Sciolla<br>"
+ tr("Swedish:") + " Jessica Dahl<br>"

View file

@ -37,6 +37,7 @@ WndSets::WndSets(QWidget *parent)
view->sortByColumn(SetsModel::SortKeyCol, Qt::AscendingOrder);
view->setColumnHidden(SetsModel::SortKeyCol, true);
view->setRootIsDecorated(false);
saveButton = new QPushButton(tr("Save set ordering"));
connect(saveButton, SIGNAL(clicked()), this, SLOT(actSave()));