summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-19 20:12:20 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-19 20:12:20 +0300
commitce6238dcc772ec901291c5f1dc5e57b89a0a2fc4 (patch)
tree87f1544fb41ea2e08212a87534675126c770bd25 /src/gui
parent2ff996eb1b6e7e8f277efe369d616d57558c6667 (diff)
downloadmanaplus-ce6238dcc772ec901291c5f1dc5e57b89a0a2fc4.tar.gz
manaplus-ce6238dcc772ec901291c5f1dc5e57b89a0a2fc4.tar.bz2
manaplus-ce6238dcc772ec901291c5f1dc5e57b89a0a2fc4.tar.xz
manaplus-ce6238dcc772ec901291c5f1dc5e57b89a0a2fc4.zip
improve selldialog class.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/selldialog.cpp12
-rw-r--r--src/gui/selldialog.h2
2 files changed, 5 insertions, 9 deletions
diff --git a/src/gui/selldialog.cpp b/src/gui/selldialog.cpp
index 82d79104a..8006355bc 100644
--- a/src/gui/selldialog.cpp
+++ b/src/gui/selldialog.cpp
@@ -151,7 +151,6 @@ SellDialog::~SellDialog()
{
delete mShopItems;
mShopItems = nullptr;
-
instances.remove(this);
}
@@ -159,10 +158,7 @@ void SellDialog::reset()
{
mShopItems->clear();
mSlider->setValue(0);
-
- // Reset previous selected item to prevent failing asserts
mShopItemList->setSelected(-1);
-
updateButtonsAndLabels();
}
@@ -234,12 +230,13 @@ void SellDialog::action(const gcn::ActionEvent &event)
{
if (eventId == "presell")
{
- ShopItem *const item = mShopItems->at(selectedItem);
+ const ShopItem *const item = mShopItems->at(selectedItem);
const ItemInfo &info = ItemDB::get(item->getId());
if (info.isProtected())
{
- // TRANSLATORS: sell confirmation header
- ConfirmDialog *dialog = new ConfirmDialog(_("sell item"),
+ ConfirmDialog *const dialog = new ConfirmDialog(
+ // TRANSLATORS: sell confirmation header
+ _("sell item"),
// TRANSLATORS: sell confirmation message
strprintf(_("Do you really want to sell %s?"),
info.getName().c_str()), false, true);
@@ -292,7 +289,6 @@ void SellDialog::action(const gcn::ActionEvent &event)
else
{
ShopItem *const item = mShopItems->at(selectedItem);
-
Net::getBuySellHandler()->sendSellRequest(mNick,
item, mAmountItems);
diff --git a/src/gui/selldialog.h b/src/gui/selldialog.h
index 2002c67e4..91dcf74c8 100644
--- a/src/gui/selldialog.h
+++ b/src/gui/selldialog.h
@@ -99,7 +99,7 @@ class SellDialog final : public Window,
/**
* Sets the visibility of this window.
*/
- void setVisible(bool visible);
+ void setVisible(bool visible) override;
void addItem(const int id, const unsigned char color,
const int amount, const int price);