Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
839da83d
Commit
839da83d
authored
Mar 26, 2015
by
Fabio Bas
Browse files
Remove deck brew by ZeldaZach
parent
8ce5c5a2
Changes
7
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/dlg_settings.cpp
View file @
839da83d
...
...
@@ -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
i
nterface"
));
deckEditorButton
->
setText
(
tr
(
"Deck
e
ditor"
));
messagesButton
->
setText
(
tr
(
"Chat
Settings
"
));
userInterfaceButton
->
setText
(
tr
(
"User
I
nterface"
));
deckEditorButton
->
setText
(
tr
(
"Deck
E
ditor"
));
messagesButton
->
setText
(
tr
(
"Chat"
));
for
(
int
i
=
0
;
i
<
pagesWidget
->
count
();
i
++
)
dynamic_cast
<
AbstractSettingsPage
*>
(
pagesWidget
->
widget
(
i
))
->
retranslateUi
();
...
...
cockatrice/src/dlg_settings.h
View file @
839da83d
...
...
@@ -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
;
};
...
...
cockatrice/src/priceupdater.cpp
View file @
839da83d
...
...
@@ -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();
}
}
*/
cockatrice/src/priceupdater.h
View file @
839da83d
...
...
@@ -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
cockatrice/src/settingscache.h
View file @
839da83d
...
...
@@ -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
;
}
...
...
cockatrice/src/tab_deck_editor.cpp
View file @
839da83d
...
...
@@ -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
)
...
...
cockatrice/src/tab_deck_editor.h
View file @
839da83d
...
...
@@ -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:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment