From c7f54151ba693e7f57378b77cc567d5aa26cf4cf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 14 Feb 2015 23:28:02 +0300 Subject: Enable publish button in personal buy shop only if it allowed by server. --- src/listeners/buyingstoreslotslistener.cpp | 36 ++++++++++++++++++++++++++++ src/listeners/buyingstoreslotslistener.h | 38 ++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 src/listeners/buyingstoreslotslistener.cpp create mode 100644 src/listeners/buyingstoreslotslistener.h (limited to 'src/listeners') diff --git a/src/listeners/buyingstoreslotslistener.cpp b/src/listeners/buyingstoreslotslistener.cpp new file mode 100644 index 000000000..0ab1155df --- /dev/null +++ b/src/listeners/buyingstoreslotslistener.cpp @@ -0,0 +1,36 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "listeners/buyingstoreslotslistener.h" + +#include "debug.h" + +defineListener(BuyingStoreSlotsListener) + +void BuyingStoreSlotsListener::distributeEvent(const int slots) +{ + FOR_EACH (std::vector::iterator, + it, mListeners) + { + BuyingStoreSlotsListener *const listener = *it; + if (listener) + listener->buyingStoreSlotsChanged(slots); + } +} diff --git a/src/listeners/buyingstoreslotslistener.h b/src/listeners/buyingstoreslotslistener.h new file mode 100644 index 000000000..dc180a9cc --- /dev/null +++ b/src/listeners/buyingstoreslotslistener.h @@ -0,0 +1,38 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef LISTENERS_BUYINGSTORESLOTSLISTENER_H +#define LISTENERS_BUYINGSTORESLOTSLISTENER_H + +#include "listeners/baselistener.hpp" + +#include "localconsts.h" + +class BuyingStoreSlotsListener notfinal +{ + public: + virtual void buyingStoreSlotsChanged(const int slots) = 0; + + static void distributeEvent(const int slots); + + defineListenerHeader(BuyingStoreSlotsListener) +}; + +#endif // LISTENERS_BUYINGSTORESLOTSLISTENER_H -- cgit v1.2.3-70-g09d2