summaryrefslogtreecommitdiff
path: root/src/gui/dialogsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-28 21:29:43 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-28 21:45:47 +0300
commit0b7ef18ac3c7fb4e3717f6311d4e21a31ff440d5 (patch)
tree6ed783279483538799567c38c2818c5dd136e302 /src/gui/dialogsmanager.cpp
parentbb87f2911b63eaf80e49d689bf52ecf2042ae098 (diff)
downloadmv-0b7ef18ac3c7fb4e3717f6311d4e21a31ff440d5.tar.gz
mv-0b7ef18ac3c7fb4e3717f6311d4e21a31ff440d5.tar.bz2
mv-0b7ef18ac3c7fb4e3717f6311d4e21a31ff440d5.tar.xz
mv-0b7ef18ac3c7fb4e3717f6311d4e21a31ff440d5.zip
Move dialogs related function into separate file.
Diffstat (limited to 'src/gui/dialogsmanager.cpp')
-rw-r--r--src/gui/dialogsmanager.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp
new file mode 100644
index 000000000..ed1ea9604
--- /dev/null
+++ b/src/gui/dialogsmanager.cpp
@@ -0,0 +1,64 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2004-2009 The Mana World Development Team
+ * Copyright (C) 2009-2010 The Mana Developers
+ * Copyright (C) 2011-2014 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include "gui/dialogsmanager.h"
+
+#include "client.h"
+
+#include "gui/windows/buyselldialog.h"
+#include "gui/windows/buydialog.h"
+#include "gui/windows/npcdialog.h"
+#include "gui/windows/okdialog.h"
+#include "gui/windows/selldialog.h"
+#include "gui/windows/updaterwindow.h"
+
+#include "net/inventoryhandler.h"
+#include "net/net.h"
+
+#include "debug.h"
+
+extern OkDialog *deathNotice;
+
+void DialogsManager::closeDialogs()
+{
+ NpcDialog::clearDialogs();
+ BuyDialog::closeAll();
+ BuySellDialog::closeAll();
+ NpcDialog::closeAll();
+ SellDialog::closeAll();
+ if (Net::getInventoryHandler())
+ Net::getInventoryHandler()->closeStorage();
+ if (deathNotice)
+ {
+ deathNotice->scheduleDelete();
+ deathNotice = nullptr;
+ }
+}
+
+void DialogsManager::createUpdaterWindow()
+{
+ updaterWindow = new UpdaterWindow(client->getUpdateHost(),
+ client->getOldUpdates(),
+ false,
+ 0);
+ updaterWindow->postInit();
+}