From 84941829031cbd707ab28802c7423ce19bfba32e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 30 Aug 2011 03:26:00 +0300 Subject: Add auction bot support switch. --- src/gui/shopwindow.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index 0988ef759..38985a01c 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -40,6 +40,7 @@ #include "gui/widgets/tradetab.h" #include "actorspritemanager.h" +#include "auctionmanager.h" #include "configuration.h" #include "confirmdialog.h" #include "inventory.h" @@ -119,11 +120,9 @@ ShopWindow::ShopWindow(): mBuyAddButton = new Button(_("Add"), "add buy", this); mBuyDeleteButton = new Button(_("Delete"), "delete buy", this); mBuyAnnounceButton = new Button(_("Announce"), "announce buy", this); - mBuyAuctionButton = new Button(_("Auction"), "auction buy", this); mSellAddButton = new Button(_("Add"), "add sell", this); mSellDeleteButton = new Button(_("Delete"), "delete sell", this); mSellAnnounceButton = new Button(_("Announce"), "announce sell", this); - mSellAuctionButton = new Button(_("Auction"), "auction sell", this); mAnnounceLinks = new CheckBox(_("Show links in announce"), false, this, "link announce"); @@ -137,14 +136,25 @@ ShopWindow::ShopWindow(): place(0, 6, mBuyAddButton); place(1, 6, mBuyDeleteButton); place(3, 6, mBuyAnnounceButton); - place(4, 6, mBuyAuctionButton); place(8, 6, mSellAddButton); place(9, 6, mSellDeleteButton); place(11, 6, mSellAnnounceButton); - place(12, 6, mSellAuctionButton); place(0, 7, mAnnounceLinks, 8); place(15, 7, mCloseButton); + if (auctionManager && auctionManager->getEnableAuctionBot()) + { + mBuyAuctionButton = new Button(_("Auction"), "auction buy", this); + mSellAuctionButton = new Button(_("Auction"), "auction sell", this); + place(4, 6, mBuyAuctionButton); + place(12, 6, mSellAuctionButton); + } + else + { + mBuyAuctionButton = 0; + mSellAuctionButton = 0; + } + Layout &layout = getLayout(); layout.setRowHeight(0, Layout::AUTO_SET); -- cgit v1.2.3-70-g09d2