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
e5d15e8d
Commit
e5d15e8d
authored
Jun 22, 2014
by
Daenyth
Browse files
Notify deck editor when price feature setting is changed
Ref #112
parent
951f08dd
Changes
5
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/priceupdater.cpp
View file @
e5d15e8d
...
...
@@ -27,7 +27,7 @@ void PriceUpdater::updatePrices()
QString
q
=
"http://blacklotusproject.com/json/?cards="
;
QStringList
cards
=
deck
->
getCardList
();
for
(
int
i
=
0
;
i
<
cards
.
size
();
++
i
)
{
q
+=
cards
[
i
]
+
"|"
;
q
+=
cards
[
i
]
.
toLower
()
+
"|"
;
}
QUrl
url
(
q
.
replace
(
' '
,
'+'
));
...
...
cockatrice/src/settingscache.cpp
View file @
e5d15e8d
...
...
@@ -242,6 +242,7 @@ void SettingsCache::setPriceTagFeature(int _priceTagFeature)
{
priceTagFeature
=
_priceTagFeature
;
settings
->
setValue
(
"deckeditor/pricetags"
,
priceTagFeature
);
emit
priceTagFeatureChanged
(
priceTagFeature
);
}
void
SettingsCache
::
setIgnoreUnregisteredUsers
(
bool
_ignoreUnregisteredUsers
)
...
...
cockatrice/src/settingscache.h
View file @
e5d15e8d
...
...
@@ -28,10 +28,11 @@ signals:
void
minPlayersForMultiColumnLayoutChanged
();
void
soundEnabledChanged
();
void
soundPathChanged
();
void
priceTagFeatureChanged
(
int
enabled
);
void
ignoreUnregisteredUsersChanged
();
private:
QSettings
*
settings
;
QByteArray
mainWindowGeometry
;
QString
lang
;
QString
deckPath
,
replaysPath
,
picsPath
,
cardDatabasePath
,
tokenDatabasePath
;
...
...
cockatrice/src/tab_deck_editor.cpp
View file @
e5d15e8d
...
...
@@ -172,6 +172,7 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
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
);
...
...
@@ -182,7 +183,7 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
deckToolbarLayout
->
addStretch
();
deckToolbarLayout
->
addWidget
(
deckToolBar
);
deckToolbarLayout
->
addStretch
();
QVBoxLayout
*
rightFrame
=
new
QVBoxLayout
;
rightFrame
->
addLayout
(
grid
);
rightFrame
->
addWidget
(
deckView
,
10
);
...
...
@@ -193,7 +194,7 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
mainLayout
->
addLayout
(
middleFrame
);
mainLayout
->
addLayout
(
rightFrame
);
setLayout
(
mainLayout
);
aNewDeck
=
new
QAction
(
QString
(),
this
);
aNewDeck
->
setShortcuts
(
QKeySequence
::
New
);
connect
(
aNewDeck
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actNewDeck
()));
...
...
@@ -635,6 +636,11 @@ void TabDeckEditor::actDecrement()
offsetCountAtIndex
(
currentIndex
,
-
1
);
}
void
TabDeckEditor
::
setPriceTagFeatureEnabled
(
int
enabled
)
{
aUpdatePrices
->
setVisible
(
enabled
);
}
void
TabDeckEditor
::
actUpdatePrices
()
{
aUpdatePrices
->
setDisabled
(
true
);
...
...
cockatrice/src/tab_deck_editor.h
View file @
e5d15e8d
...
...
@@ -50,7 +50,7 @@ private slots:
void
actEditSets
();
void
actEditTokens
();
void
actClearSearch
();
void
actAddCard
();
...
...
@@ -67,6 +67,7 @@ private slots:
void
saveDeckRemoteFinished
(
const
Response
&
r
);
void
filterViewCustomContextMenu
(
const
QPoint
&
point
);
void
filterRemove
(
QAction
*
action
);
void
setPriceTagFeatureEnabled
(
int
enabled
);
private:
CardInfo
*
currentCardInfo
()
const
;
void
addCardHelper
(
QString
zoneName
);
...
...
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