Remove deck brew by ZeldaZach

This commit is contained in:
Fabio Bas 2015-03-26 23:08:53 +01:00
parent 8ce5c5a276
commit 839da83d2c
7 changed files with 46 additions and 25 deletions

View file

@ -548,13 +548,15 @@ void UserInterfaceSettingsPage::soundPathButtonClicked()
DeckEditorSettingsPage::DeckEditorSettingsPage()
{
priceTagsCheckBox.setChecked(settingsCache->getPriceTagFeature());
connect(&priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int)));
//priceTagsCheckBox.setChecked(settingsCache->getPriceTagFeature());
//connect(&priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int)));
connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int)));
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->setLayout(generalGrid);
@ -567,10 +569,11 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
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"));
}
/*
void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked)
{
if(!checked)
@ -579,6 +582,7 @@ void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked)
int source=AbstractPriceUpdater::DBPriceSource;
emit priceTagSourceChanged(source);
}
*/
MessagesSettingsPage::MessagesSettingsPage()
{
@ -838,7 +842,7 @@ void DlgSettings::closeEvent(QCloseEvent *event)
case NotLoaded:
loadErrorMessage =
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?");
break;
case FileError:
@ -854,7 +858,7 @@ void DlgSettings::closeEvent(QCloseEvent *event)
default:
loadErrorMessage =
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?");
break;
@ -885,9 +889,9 @@ void DlgSettings::retranslateUi()
generalButton->setText(tr("General"));
appearanceButton->setText(tr("Appearance"));
userInterfaceButton->setText(tr("User interface"));
deckEditorButton->setText(tr("Deck editor"));
messagesButton->setText(tr("Chat Settings"));
userInterfaceButton->setText(tr("User Interface"));
deckEditorButton->setText(tr("Deck Editor"));
messagesButton->setText(tr("Chat"));
for (int i = 0; i < pagesWidget->count(); i++)
dynamic_cast<AbstractSettingsPage *>(pagesWidget->widget(i))->retranslateUi();

View file

@ -143,11 +143,11 @@ public:
DeckEditorSettingsPage();
void retranslateUi();
private slots:
void radioPriceTagSourceClicked(bool checked);
//void radioPriceTagSourceClicked(bool checked);
signals:
void priceTagSourceChanged(int _priceTagSource);
//void priceTagSourceChanged(int _priceTagSource);
private:
QCheckBox priceTagsCheckBox;
//QCheckBox priceTagsCheckBox;
QGroupBox *generalGroupBox;
};

View file

@ -35,14 +35,19 @@ AbstractPriceUpdater::AbstractPriceUpdater(const DeckList *_deck)
*
* @param _deck deck.
*/
/*
DBPriceUpdater::DBPriceUpdater(const DeckList *_deck)
: AbstractPriceUpdater(_deck)
{
}
*/
/**
* Update the prices of the cards in deckList.
*/
/*
void DBPriceUpdater::updatePrices()
{
QString base = "https://api.deckbrew.com/mtg/cards", q = "";
@ -88,7 +93,9 @@ void DBPriceUpdater::updatePrices()
requestNext();
}
*/
/*
void DBPriceUpdater::requestNext()
{
if(urls.empty())
@ -99,10 +106,12 @@ void DBPriceUpdater::requestNext()
QNetworkReply *reply = nam->get(QNetworkRequest(url));
connect(reply, SIGNAL(finished()), this, SLOT(downloadFinished()));
}
*/
/**
* Called when the download of the json file with the prices is finished.
*/
/*
void DBPriceUpdater::downloadFinished()
{
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
@ -180,11 +189,11 @@ void DBPriceUpdater::downloadFinished()
float price = edition.value("price").toMap().value("median").toString().toFloat() / 100;
//qDebug() << "card " << name << " set " << set << " price " << price << endl;
/**
* 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
* ends up as the final price.
*/
if (set != "MED" && price > 0 && (!cardsPrice.contains(name) || cardsPrice.value(name) > price))
cardsPrice.insert(name, price);
}
@ -212,3 +221,4 @@ void DBPriceUpdater::downloadFinished()
requestNext();
}
}
*/

View file

@ -31,6 +31,7 @@ public:
virtual void updatePrices() = 0;
};
/*
class DBPriceUpdater : public AbstractPriceUpdater
{
Q_OBJECT
@ -44,4 +45,5 @@ public:
DBPriceUpdater(const DeckList *deck);
virtual void updatePrices();
};
*/
#endif

View file

@ -117,7 +117,7 @@ public:
bool getZoneViewPileView() const { return zoneViewPileView; }
bool getSoundEnabled() const { return soundEnabled; }
QString getSoundPath() const { return soundPath; }
bool getPriceTagFeature() const { return priceTagFeature; }
bool getPriceTagFeature() const { return false; /* #859; priceTagFeature;*/ }
int getPriceTagSource() const { return priceTagSource; }
bool getIgnoreUnregisteredUsers() const { return ignoreUnregisteredUsers; }
bool getIgnoreUnregisteredUserMessages() const { return ignoreUnregisteredUserMessages; }

View file

@ -173,19 +173,20 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
grid->addWidget(hashLabel1, 2, 0);
grid->addWidget(hashLabel, 2, 1);
// Update price
/* Update price
aUpdatePrices = new QAction(QString(), this);
aUpdatePrices->setIcon(QIcon(":/resources/icon_update.png"));
connect(aUpdatePrices, SIGNAL(triggered()), this, SLOT(actUpdatePrices()));
if (!settingsCache->getPriceTagFeature())
aUpdatePrices->setVisible(false);
connect(settingsCache, SIGNAL(priceTagFeatureChanged(int)), this, SLOT(setPriceTagFeatureEnabled(int)));
*/
QToolBar *deckToolBar = new QToolBar;
deckToolBar->setOrientation(Qt::Vertical);
deckToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
deckToolBar->setIconSize(QSize(24, 24));
deckToolBar->addAction(aUpdatePrices);
//deckToolBar->addAction(aUpdatePrices);
QHBoxLayout *deckToolbarLayout = new QHBoxLayout;
deckToolbarLayout->addStretch();
deckToolbarLayout->addWidget(deckToolBar);
@ -299,8 +300,8 @@ void TabDeckEditor::retranslateUi()
commentsLabel->setText(tr("&Comments:"));
hashLabel1->setText(tr("Hash:"));
aUpdatePrices->setText(tr("&Update prices"));
aUpdatePrices->setShortcut(tr("Ctrl+U"));
//aUpdatePrices->setText(tr("&Update prices"));
//aUpdatePrices->setShortcut(tr("Ctrl+U"));
aNewDeck->setText(tr("&New deck"));
aLoadDeck->setText(tr("&Load deck..."));
@ -669,10 +670,12 @@ void TabDeckEditor::actDecrement()
void TabDeckEditor::setPriceTagFeatureEnabled(int enabled)
{
aUpdatePrices->setVisible(enabled);
//aUpdatePrices->setVisible(enabled);
deckModel->pricesUpdated();
}
/*
void TabDeckEditor::actUpdatePrices()
{
aUpdatePrices->setDisabled(true);
@ -689,12 +692,14 @@ void TabDeckEditor::actUpdatePrices()
connect(up, SIGNAL(finishedUpdate()), this, SLOT(finishedUpdatingPrices()));
up->updatePrices();
}
*/
void TabDeckEditor::finishedUpdatingPrices()
{
deckModel->pricesUpdated();
setModified(true);
aUpdatePrices->setDisabled(false);
//deckModel->pricesUpdated();
//setModified(true);
//aUpdatePrices->setDisabled(false);
}
void TabDeckEditor::setDeck(DeckLoader *_deck)

View file

@ -62,7 +62,7 @@ private slots:
void actDecrementCard();
void actDecrementCardFromSideboard();
void actUpdatePrices();
//void actUpdatePrices();
void finishedUpdatingPrices();
void saveDeckRemoteFinished(const Response &r);
@ -99,7 +99,7 @@ private:
QMenu *deckMenu, *dbMenu;
QAction *aNewDeck, *aLoadDeck, *aSaveDeck, *aSaveDeckAs, *aLoadDeckFromClipboard, *aSaveDeckToClipboard, *aPrintDeck, *aAnalyzeDeck, *aClose;
QAction *aEditSets, *aEditTokens, *aClearSearch, *aCardTextOnly;
QAction *aAddCard, *aAddCardToSideboard, *aRemoveCard, *aIncrement, *aDecrement, *aUpdatePrices;
QAction *aAddCard, *aAddCardToSideboard, *aRemoveCard, *aIncrement, *aDecrement;// *aUpdatePrices;
bool modified;
public: