summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-30 16:50:50 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-30 16:50:50 +0300
commit143e04546197d75279d41e9eefe0fca4478673d4 (patch)
tree0a78eb7251943571342bba70210161af603473d8 /src/gui
parentdbe40332cd904f8e48504a2e8a3e7f74f4619712 (diff)
downloadmanaverse-143e04546197d75279d41e9eefe0fca4478673d4.tar.gz
manaverse-143e04546197d75279d41e9eefe0fca4478673d4.tar.bz2
manaverse-143e04546197d75279d41e9eefe0fca4478673d4.tar.xz
manaverse-143e04546197d75279d41e9eefe0fca4478673d4.zip
Add ability to open support page if error happend.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/charselectdialog.cpp2
-rw-r--r--src/gui/confirmdialog.cpp8
-rw-r--r--src/gui/confirmdialog.h3
-rw-r--r--src/gui/logindialog.cpp2
-rw-r--r--src/gui/selldialog.cpp2
-rw-r--r--src/gui/serverdialog.cpp7
-rw-r--r--src/gui/shopwindow.cpp2
-rw-r--r--src/gui/socialwindow.cpp8
-rw-r--r--src/gui/widgets/itemlinkhandler.cpp2
9 files changed, 22 insertions, 14 deletions
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp
index 84217e8f9..8daf1e279 100644
--- a/src/gui/charselectdialog.cpp
+++ b/src/gui/charselectdialog.cpp
@@ -61,7 +61,7 @@ class CharDeleteConfirm final : public ConfirmDialog
ConfirmDialog(_("Confirm Character Delete"),
// TRANSLATORS: char deletion message
_("Are you sure you want to delete this character?"),
- false, false, m),
+ SOUND_REQUEST, false, false, m),
mMaster(m),
mIndex(index)
{
diff --git a/src/gui/confirmdialog.cpp b/src/gui/confirmdialog.cpp
index cef2237d7..a2441c63b 100644
--- a/src/gui/confirmdialog.cpp
+++ b/src/gui/confirmdialog.cpp
@@ -22,8 +22,6 @@
#include "gui/confirmdialog.h"
-#include "soundmanager.h"
-
#include "gui/gui.h"
#include "gui/widgets/button.h"
@@ -36,8 +34,8 @@
#include "debug.h"
ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
- const bool ignore, const bool modal,
- Window *const parent):
+ const std::string &soundEvent, const bool ignore,
+ const bool modal, Window *const parent):
Window(title, modal, parent, "confirm.xml"),
gcn::ActionListener(),
mTextBox(new TextBox(this))
@@ -100,7 +98,7 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
}
setVisible(true);
yesButton->requestFocus();
- soundManager.playGuiSound(SOUND_REQUEST);
+ soundManager.playGuiSound(soundEvent);
}
void ConfirmDialog::action(const gcn::ActionEvent &event)
diff --git a/src/gui/confirmdialog.h b/src/gui/confirmdialog.h
index 70eb10124..f2ac75bbb 100644
--- a/src/gui/confirmdialog.h
+++ b/src/gui/confirmdialog.h
@@ -25,6 +25,8 @@
#include "localconsts.h"
+#include "soundmanager.h"
+
#include "gui/widgets/window.h"
#include <guichan/actionlistener.hpp>
@@ -45,6 +47,7 @@ class ConfirmDialog : public Window, public gcn::ActionListener
* @see Window::Window
*/
ConfirmDialog(const std::string &title, const std::string &msg,
+ const std::string &soundEvent = SOUND_REQUEST,
const bool ignore = false, const bool modal = false,
Window *const parent = nullptr);
diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp
index 7e10a7766..458cb15cd 100644
--- a/src/gui/logindialog.cpp
+++ b/src/gui/logindialog.cpp
@@ -295,7 +295,7 @@ void LoginDialog::action(const gcn::ActionEvent &event)
urlListener.url = url;
// TRANSLATORS: question dialog
ConfirmDialog *const confirmDlg = new ConfirmDialog(
- _("Open register url"), url, false, true);
+ _("Open register url"), url, SOUND_REQUEST, false, true);
confirmDlg->addActionListener(&urlListener);
}
}
diff --git a/src/gui/selldialog.cpp b/src/gui/selldialog.cpp
index c61dec541..2b397b331 100644
--- a/src/gui/selldialog.cpp
+++ b/src/gui/selldialog.cpp
@@ -242,7 +242,7 @@ void SellDialog::action(const gcn::ActionEvent &event)
_("sell item"),
// TRANSLATORS: sell confirmation message
strprintf(_("Do you really want to sell %s?"),
- info.getName().c_str()), false, true);
+ info.getName().c_str()), SOUND_REQUEST, false, true);
dialog->addActionListener(this);
return;
}
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 2da780046..04a07198f 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -386,6 +386,7 @@ void ServerDialog::connectToSelectedServer()
mServerInfo->description = server.description;
mServerInfo->registerUrl = server.registerUrl;
mServerInfo->onlineListUrl = server.onlineListUrl;
+ mServerInfo->supportUrl = server.supportUrl;
mServerInfo->save = true;
if (chatLogger)
@@ -671,6 +672,11 @@ void ServerDialog::loadServers(const bool addNew)
server.onlineListUrl = reinterpret_cast<const char*>(
subNode->xmlChildrenNode->content);
}
+ else if (xmlNameEqual(subNode, "support"))
+ {
+ server.supportUrl = reinterpret_cast<const char*>(
+ subNode->xmlChildrenNode->content);
+ }
}
server.version.first = font->getWidth(version);
@@ -690,6 +696,7 @@ void ServerDialog::loadServers(const bool addNew)
mServers[i].description = server.description;
mServers[i].registerUrl = server.registerUrl;
mServers[i].onlineListUrl = server.onlineListUrl;
+ mServers[i].supportUrl = server.supportUrl;
mServers[i].althostname = server.althostname;
mServersListModel->setVersionString(i, version);
found = true;
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp
index d7fcc2a60..36a67a2af 100644
--- a/src/gui/shopwindow.cpp
+++ b/src/gui/shopwindow.cpp
@@ -774,7 +774,7 @@ void ShopWindow::processRequest(const std::string &nick, std::string data,
// TRANSLATORS: shop window dialog
(_("Request for Trade"), strprintf(_("%s wants to %s %s do you "
"accept?"), nick.c_str(), msg.c_str(),
- mTradeItem->getInfo().getName().c_str()), true);
+ mTradeItem->getInfo().getName().c_str()), SOUND_REQUEST, true);
confirmDlg->addActionListener(this);
}
}
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index bdac7cca6..b4398b29e 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -238,7 +238,7 @@ public:
mConfirmDialog = new ConfirmDialog(_("Leave Guild?"),
// TRANSLATORS: guild leave message
strprintf(_("Are you sure you want to leave guild %s?"),
- mGuild->getName().c_str()), socialWindow);
+ mGuild->getName().c_str()), SOUND_REQUEST, socialWindow);
mConfirmDialog->addActionListener(this);
}
@@ -381,7 +381,7 @@ public:
mConfirmDialog = new ConfirmDialog(_("Leave Party?"),
// TRANSLATORS: party leave message
strprintf(_("Are you sure you want to leave party %s?"),
- mParty->getName().c_str()), socialWindow);
+ mParty->getName().c_str()), SOUND_REQUEST, socialWindow);
mConfirmDialog->addActionListener(this);
}
@@ -1490,7 +1490,7 @@ void SocialWindow::showGuildInvite(const std::string &guildName,
// TRANSLATORS: guild invite message
mGuildAcceptDialog = new ConfirmDialog(_("Accept Guild Invite"),
- msg, false, false, this);
+ msg, SOUND_REQUEST, false, false, this);
mGuildAcceptDialog->addActionListener(this);
mGuildInvited = guildId;
}
@@ -1547,7 +1547,7 @@ void SocialWindow::showPartyInvite(const std::string &partyName,
// show invite
// TRANSLATORS: party invite message
mPartyAcceptDialog = new ConfirmDialog(_("Accept Party Invite"),
- msg, false, false, this);
+ msg, SOUND_REQUEST, false, false, this);
mPartyAcceptDialog->addActionListener(this);
mPartyInviter = inviter;
}
diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp
index fefaae428..188bfa931 100644
--- a/src/gui/widgets/itemlinkhandler.cpp
+++ b/src/gui/widgets/itemlinkhandler.cpp
@@ -84,7 +84,7 @@ void ItemLinkHandler::handleLink(const std::string &link,
{
ConfirmDialog *const confirmDlg = new ConfirmDialog(
// TRANSLATORS: dialog message
- _("Open url"), url, false, true);
+ _("Open url"), url, SOUND_REQUEST, false, true);
confirmDlg->addActionListener(&listener);
}
else if (button == gcn::MouseInput::RIGHT)