Remove deck brew by ZeldaZach
This commit is contained in:
parent
8ce5c5a276
commit
839da83d2c
7 changed files with 46 additions and 25 deletions
|
@ -548,13 +548,15 @@ void UserInterfaceSettingsPage::soundPathButtonClicked()
|
||||||
|
|
||||||
DeckEditorSettingsPage::DeckEditorSettingsPage()
|
DeckEditorSettingsPage::DeckEditorSettingsPage()
|
||||||
{
|
{
|
||||||
priceTagsCheckBox.setChecked(settingsCache->getPriceTagFeature());
|
//priceTagsCheckBox.setChecked(settingsCache->getPriceTagFeature());
|
||||||
connect(&priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int)));
|
//connect(&priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int)));
|
||||||
|
|
||||||
connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int)));
|
connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int)));
|
||||||
|
|
||||||
QGridLayout *generalGrid = new QGridLayout;
|
QGridLayout *generalGrid = new QGridLayout;
|
||||||
generalGrid->addWidget(&priceTagsCheckBox, 0, 0);
|
//generalGrid->addWidget(&priceTagsCheckBox, 0, 0);
|
||||||
|
|
||||||
|
generalGrid->addWidget(new QLabel(tr("Nothing is here... yet")), 0, 0);
|
||||||
|
|
||||||
generalGroupBox = new QGroupBox;
|
generalGroupBox = new QGroupBox;
|
||||||
generalGroupBox->setLayout(generalGrid);
|
generalGroupBox->setLayout(generalGrid);
|
||||||
|
@ -567,10 +569,11 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
|
||||||
|
|
||||||
void DeckEditorSettingsPage::retranslateUi()
|
void DeckEditorSettingsPage::retranslateUi()
|
||||||
{
|
{
|
||||||
priceTagsCheckBox.setText(tr("Enable &price tag feature from deckbrew.com"));
|
//priceTagsCheckBox.setText(tr("Enable &price tag feature from deckbrew.com"));
|
||||||
generalGroupBox->setTitle(tr("General"));
|
generalGroupBox->setTitle(tr("General"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked)
|
void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked)
|
||||||
{
|
{
|
||||||
if(!checked)
|
if(!checked)
|
||||||
|
@ -579,6 +582,7 @@ void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked)
|
||||||
int source=AbstractPriceUpdater::DBPriceSource;
|
int source=AbstractPriceUpdater::DBPriceSource;
|
||||||
emit priceTagSourceChanged(source);
|
emit priceTagSourceChanged(source);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
MessagesSettingsPage::MessagesSettingsPage()
|
MessagesSettingsPage::MessagesSettingsPage()
|
||||||
{
|
{
|
||||||
|
@ -838,7 +842,7 @@ void DlgSettings::closeEvent(QCloseEvent *event)
|
||||||
case NotLoaded:
|
case NotLoaded:
|
||||||
loadErrorMessage =
|
loadErrorMessage =
|
||||||
tr("Your card database did not finish loading\n\n"
|
tr("Your card database did not finish loading\n\n"
|
||||||
"Please file a ticket at http://github.com/Daenyth/Cockatrice/issues with your cards.xml attached\n\n"
|
"Please file a ticket at http://github.com/Cockatrice/Cockatrice/issues with your cards.xml attached\n\n"
|
||||||
"Would you like to change your database location setting?");
|
"Would you like to change your database location setting?");
|
||||||
break;
|
break;
|
||||||
case FileError:
|
case FileError:
|
||||||
|
@ -854,7 +858,7 @@ void DlgSettings::closeEvent(QCloseEvent *event)
|
||||||
default:
|
default:
|
||||||
loadErrorMessage =
|
loadErrorMessage =
|
||||||
tr("Unknown card database load status\n\n"
|
tr("Unknown card database load status\n\n"
|
||||||
"Please file a ticket at http://github.com/Daenyth/Cockatrice/issues\n\n"
|
"Please file a ticket at http://github.com/Cockatrice/Cockatrice/issues\n\n"
|
||||||
"Would you like to change your database location setting?");
|
"Would you like to change your database location setting?");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -885,9 +889,9 @@ void DlgSettings::retranslateUi()
|
||||||
|
|
||||||
generalButton->setText(tr("General"));
|
generalButton->setText(tr("General"));
|
||||||
appearanceButton->setText(tr("Appearance"));
|
appearanceButton->setText(tr("Appearance"));
|
||||||
userInterfaceButton->setText(tr("User interface"));
|
userInterfaceButton->setText(tr("User Interface"));
|
||||||
deckEditorButton->setText(tr("Deck editor"));
|
deckEditorButton->setText(tr("Deck Editor"));
|
||||||
messagesButton->setText(tr("Chat Settings"));
|
messagesButton->setText(tr("Chat"));
|
||||||
|
|
||||||
for (int i = 0; i < pagesWidget->count(); i++)
|
for (int i = 0; i < pagesWidget->count(); i++)
|
||||||
dynamic_cast<AbstractSettingsPage *>(pagesWidget->widget(i))->retranslateUi();
|
dynamic_cast<AbstractSettingsPage *>(pagesWidget->widget(i))->retranslateUi();
|
||||||
|
|
|
@ -143,11 +143,11 @@ public:
|
||||||
DeckEditorSettingsPage();
|
DeckEditorSettingsPage();
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
private slots:
|
private slots:
|
||||||
void radioPriceTagSourceClicked(bool checked);
|
//void radioPriceTagSourceClicked(bool checked);
|
||||||
signals:
|
signals:
|
||||||
void priceTagSourceChanged(int _priceTagSource);
|
//void priceTagSourceChanged(int _priceTagSource);
|
||||||
private:
|
private:
|
||||||
QCheckBox priceTagsCheckBox;
|
//QCheckBox priceTagsCheckBox;
|
||||||
QGroupBox *generalGroupBox;
|
QGroupBox *generalGroupBox;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,14 +35,19 @@ AbstractPriceUpdater::AbstractPriceUpdater(const DeckList *_deck)
|
||||||
*
|
*
|
||||||
* @param _deck deck.
|
* @param _deck deck.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
DBPriceUpdater::DBPriceUpdater(const DeckList *_deck)
|
DBPriceUpdater::DBPriceUpdater(const DeckList *_deck)
|
||||||
: AbstractPriceUpdater(_deck)
|
: AbstractPriceUpdater(_deck)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the prices of the cards in deckList.
|
* Update the prices of the cards in deckList.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
void DBPriceUpdater::updatePrices()
|
void DBPriceUpdater::updatePrices()
|
||||||
{
|
{
|
||||||
QString base = "https://api.deckbrew.com/mtg/cards", q = "";
|
QString base = "https://api.deckbrew.com/mtg/cards", q = "";
|
||||||
|
@ -88,7 +93,9 @@ void DBPriceUpdater::updatePrices()
|
||||||
|
|
||||||
requestNext();
|
requestNext();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
void DBPriceUpdater::requestNext()
|
void DBPriceUpdater::requestNext()
|
||||||
{
|
{
|
||||||
if(urls.empty())
|
if(urls.empty())
|
||||||
|
@ -99,10 +106,12 @@ void DBPriceUpdater::requestNext()
|
||||||
QNetworkReply *reply = nam->get(QNetworkRequest(url));
|
QNetworkReply *reply = nam->get(QNetworkRequest(url));
|
||||||
connect(reply, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
connect(reply, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the download of the json file with the prices is finished.
|
* Called when the download of the json file with the prices is finished.
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
void DBPriceUpdater::downloadFinished()
|
void DBPriceUpdater::downloadFinished()
|
||||||
{
|
{
|
||||||
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
|
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
|
||||||
|
@ -180,11 +189,11 @@ void DBPriceUpdater::downloadFinished()
|
||||||
float price = edition.value("price").toMap().value("median").toString().toFloat() / 100;
|
float price = edition.value("price").toMap().value("median").toString().toFloat() / 100;
|
||||||
//qDebug() << "card " << name << " set " << set << " price " << price << endl;
|
//qDebug() << "card " << name << " set " << set << " price " << price << endl;
|
||||||
|
|
||||||
/**
|
|
||||||
* Make sure Masters Edition (MED) isn't the set, as it doesn't
|
* Make sure Masters Edition (MED) isn't the set, as it doesn't
|
||||||
* physically exist. Also check the price to see that the cheapest set
|
* physically exist. Also check the price to see that the cheapest set
|
||||||
* ends up as the final price.
|
* ends up as the final price.
|
||||||
*/
|
|
||||||
if (set != "MED" && price > 0 && (!cardsPrice.contains(name) || cardsPrice.value(name) > price))
|
if (set != "MED" && price > 0 && (!cardsPrice.contains(name) || cardsPrice.value(name) > price))
|
||||||
cardsPrice.insert(name, price);
|
cardsPrice.insert(name, price);
|
||||||
}
|
}
|
||||||
|
@ -212,3 +221,4 @@ void DBPriceUpdater::downloadFinished()
|
||||||
requestNext();
|
requestNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -31,6 +31,7 @@ public:
|
||||||
virtual void updatePrices() = 0;
|
virtual void updatePrices() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
class DBPriceUpdater : public AbstractPriceUpdater
|
class DBPriceUpdater : public AbstractPriceUpdater
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -44,4 +45,5 @@ public:
|
||||||
DBPriceUpdater(const DeckList *deck);
|
DBPriceUpdater(const DeckList *deck);
|
||||||
virtual void updatePrices();
|
virtual void updatePrices();
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
bool getZoneViewPileView() const { return zoneViewPileView; }
|
bool getZoneViewPileView() const { return zoneViewPileView; }
|
||||||
bool getSoundEnabled() const { return soundEnabled; }
|
bool getSoundEnabled() const { return soundEnabled; }
|
||||||
QString getSoundPath() const { return soundPath; }
|
QString getSoundPath() const { return soundPath; }
|
||||||
bool getPriceTagFeature() const { return priceTagFeature; }
|
bool getPriceTagFeature() const { return false; /* #859; priceTagFeature;*/ }
|
||||||
int getPriceTagSource() const { return priceTagSource; }
|
int getPriceTagSource() const { return priceTagSource; }
|
||||||
bool getIgnoreUnregisteredUsers() const { return ignoreUnregisteredUsers; }
|
bool getIgnoreUnregisteredUsers() const { return ignoreUnregisteredUsers; }
|
||||||
bool getIgnoreUnregisteredUserMessages() const { return ignoreUnregisteredUserMessages; }
|
bool getIgnoreUnregisteredUserMessages() const { return ignoreUnregisteredUserMessages; }
|
||||||
|
|
|
@ -173,19 +173,20 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
|
||||||
grid->addWidget(hashLabel1, 2, 0);
|
grid->addWidget(hashLabel1, 2, 0);
|
||||||
grid->addWidget(hashLabel, 2, 1);
|
grid->addWidget(hashLabel, 2, 1);
|
||||||
|
|
||||||
// Update price
|
/* Update price
|
||||||
aUpdatePrices = new QAction(QString(), this);
|
aUpdatePrices = new QAction(QString(), this);
|
||||||
aUpdatePrices->setIcon(QIcon(":/resources/icon_update.png"));
|
aUpdatePrices->setIcon(QIcon(":/resources/icon_update.png"));
|
||||||
connect(aUpdatePrices, SIGNAL(triggered()), this, SLOT(actUpdatePrices()));
|
connect(aUpdatePrices, SIGNAL(triggered()), this, SLOT(actUpdatePrices()));
|
||||||
if (!settingsCache->getPriceTagFeature())
|
if (!settingsCache->getPriceTagFeature())
|
||||||
aUpdatePrices->setVisible(false);
|
aUpdatePrices->setVisible(false);
|
||||||
connect(settingsCache, SIGNAL(priceTagFeatureChanged(int)), this, SLOT(setPriceTagFeatureEnabled(int)));
|
connect(settingsCache, SIGNAL(priceTagFeatureChanged(int)), this, SLOT(setPriceTagFeatureEnabled(int)));
|
||||||
|
*/
|
||||||
|
|
||||||
QToolBar *deckToolBar = new QToolBar;
|
QToolBar *deckToolBar = new QToolBar;
|
||||||
deckToolBar->setOrientation(Qt::Vertical);
|
deckToolBar->setOrientation(Qt::Vertical);
|
||||||
deckToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
deckToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||||
deckToolBar->setIconSize(QSize(24, 24));
|
deckToolBar->setIconSize(QSize(24, 24));
|
||||||
deckToolBar->addAction(aUpdatePrices);
|
//deckToolBar->addAction(aUpdatePrices);
|
||||||
QHBoxLayout *deckToolbarLayout = new QHBoxLayout;
|
QHBoxLayout *deckToolbarLayout = new QHBoxLayout;
|
||||||
deckToolbarLayout->addStretch();
|
deckToolbarLayout->addStretch();
|
||||||
deckToolbarLayout->addWidget(deckToolBar);
|
deckToolbarLayout->addWidget(deckToolBar);
|
||||||
|
@ -299,8 +300,8 @@ void TabDeckEditor::retranslateUi()
|
||||||
commentsLabel->setText(tr("&Comments:"));
|
commentsLabel->setText(tr("&Comments:"));
|
||||||
hashLabel1->setText(tr("Hash:"));
|
hashLabel1->setText(tr("Hash:"));
|
||||||
|
|
||||||
aUpdatePrices->setText(tr("&Update prices"));
|
//aUpdatePrices->setText(tr("&Update prices"));
|
||||||
aUpdatePrices->setShortcut(tr("Ctrl+U"));
|
//aUpdatePrices->setShortcut(tr("Ctrl+U"));
|
||||||
|
|
||||||
aNewDeck->setText(tr("&New deck"));
|
aNewDeck->setText(tr("&New deck"));
|
||||||
aLoadDeck->setText(tr("&Load deck..."));
|
aLoadDeck->setText(tr("&Load deck..."));
|
||||||
|
@ -669,10 +670,12 @@ void TabDeckEditor::actDecrement()
|
||||||
|
|
||||||
void TabDeckEditor::setPriceTagFeatureEnabled(int enabled)
|
void TabDeckEditor::setPriceTagFeatureEnabled(int enabled)
|
||||||
{
|
{
|
||||||
aUpdatePrices->setVisible(enabled);
|
//aUpdatePrices->setVisible(enabled);
|
||||||
deckModel->pricesUpdated();
|
deckModel->pricesUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
void TabDeckEditor::actUpdatePrices()
|
void TabDeckEditor::actUpdatePrices()
|
||||||
{
|
{
|
||||||
aUpdatePrices->setDisabled(true);
|
aUpdatePrices->setDisabled(true);
|
||||||
|
@ -689,12 +692,14 @@ void TabDeckEditor::actUpdatePrices()
|
||||||
connect(up, SIGNAL(finishedUpdate()), this, SLOT(finishedUpdatingPrices()));
|
connect(up, SIGNAL(finishedUpdate()), this, SLOT(finishedUpdatingPrices()));
|
||||||
up->updatePrices();
|
up->updatePrices();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
void TabDeckEditor::finishedUpdatingPrices()
|
void TabDeckEditor::finishedUpdatingPrices()
|
||||||
{
|
{
|
||||||
deckModel->pricesUpdated();
|
//deckModel->pricesUpdated();
|
||||||
setModified(true);
|
//setModified(true);
|
||||||
aUpdatePrices->setDisabled(false);
|
//aUpdatePrices->setDisabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabDeckEditor::setDeck(DeckLoader *_deck)
|
void TabDeckEditor::setDeck(DeckLoader *_deck)
|
||||||
|
|
|
@ -62,7 +62,7 @@ private slots:
|
||||||
void actDecrementCard();
|
void actDecrementCard();
|
||||||
void actDecrementCardFromSideboard();
|
void actDecrementCardFromSideboard();
|
||||||
|
|
||||||
void actUpdatePrices();
|
//void actUpdatePrices();
|
||||||
|
|
||||||
void finishedUpdatingPrices();
|
void finishedUpdatingPrices();
|
||||||
void saveDeckRemoteFinished(const Response &r);
|
void saveDeckRemoteFinished(const Response &r);
|
||||||
|
@ -99,7 +99,7 @@ private:
|
||||||
QMenu *deckMenu, *dbMenu;
|
QMenu *deckMenu, *dbMenu;
|
||||||
QAction *aNewDeck, *aLoadDeck, *aSaveDeck, *aSaveDeckAs, *aLoadDeckFromClipboard, *aSaveDeckToClipboard, *aPrintDeck, *aAnalyzeDeck, *aClose;
|
QAction *aNewDeck, *aLoadDeck, *aSaveDeck, *aSaveDeckAs, *aLoadDeckFromClipboard, *aSaveDeckToClipboard, *aPrintDeck, *aAnalyzeDeck, *aClose;
|
||||||
QAction *aEditSets, *aEditTokens, *aClearSearch, *aCardTextOnly;
|
QAction *aEditSets, *aEditTokens, *aClearSearch, *aCardTextOnly;
|
||||||
QAction *aAddCard, *aAddCardToSideboard, *aRemoveCard, *aIncrement, *aDecrement, *aUpdatePrices;
|
QAction *aAddCard, *aAddCardToSideboard, *aRemoveCard, *aIncrement, *aDecrement;// *aUpdatePrices;
|
||||||
|
|
||||||
bool modified;
|
bool modified;
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue