diff --git a/data/gui/online/user_info_dialog.stkgui b/data/gui/online/user_info_dialog.stkgui index 5383b91d6..fc45c4b32 100644 --- a/data/gui/online/user_info_dialog.stkgui +++ b/data/gui/online/user_info_dialog.stkgui @@ -3,13 +3,13 @@ <div x="2%" y="5%" width="96%" height="85%" layout="vertical-row" > <header id="title" width="96%" height="fit" text_align="center" word_wrap="true" - I18N="In the server info dialog' dialog" text="Server Info"/> + I18N="User info dialog' dialog" text="User Info"/> <spacer height="20" width="50"> <div width="80%" align="center" layout="vertical-row" height="fit" > <div width="100%" height="fit" layout="horizontal-row" > - <label proportion="1" text_align="left" I18N="In the server info dialog" text="Name"/> + <label proportion="1" text_align="left" I18N="User info dialog" text="Name"/> <label id="name" proportion="2" text_align="left" text=""/> </div> </div> @@ -21,10 +21,16 @@ <spacer height="20" width="50"> <buttonbar id="options" width="90%" height="20%" align="center"> - <icon-button id="enter" width="64" height="64" icon="gui/green_check.png" - I18N="Login dialog" text="Enter" label_location="bottom"/> - <icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png" - I18N="Login dialog" text="Cancel" label_location="bottom"/> + <icon-button id="friend" width="64" height="64" icon="gui/main_help.png" + I18N="User info dialog" text="Add Friend" label_location="bottom"/> + <icon-button id="accept" width="64" height="64" icon="gui/green_check.png" + I18N="User info dialog" text="Accept" label_location="bottom"/> + <icon-button id="decline" width="64" height="64" icon="gui/red_mark.png" + I18N="User info dialog" text="Decline" label_location="bottom"/> + <icon-button id="enter" width="64" height="64" icon="gui/difficulty_medium.png" + I18N="User info dialog" text="View" label_location="bottom"/> + <icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png" + I18N="User info dialog" text="Cancel" label_location="bottom"/> </buttonbar> diff --git a/src/online/current_user.cpp b/src/online/current_user.cpp index e2592cb6e..393184083 100644 --- a/src/online/current_user.cpp +++ b/src/online/current_user.cpp @@ -280,10 +280,10 @@ namespace Online{ // ============================================================================ - const CurrentUser::setAddonVoteRequest * CurrentUser::requestSetAddonVote( const std::string & addon_id, float rating) const + const CurrentUser::SetAddonVoteRequest * CurrentUser::requestSetAddonVote( const std::string & addon_id, float rating) const { assert(isRegisteredUser()); - CurrentUser::setAddonVoteRequest * request = new CurrentUser::setAddonVoteRequest(); + CurrentUser::SetAddonVoteRequest * request = new CurrentUser::SetAddonVoteRequest(); request->setURL((std::string)UserConfigParams::m_server_multiplayer + "client-user.php"); request->setParameter("action", std::string("set-addon-vote")); request->setParameter("token", getToken()); @@ -294,7 +294,7 @@ namespace Online{ return request; } - void CurrentUser::setAddonVoteRequest::callback() + void CurrentUser::SetAddonVoteRequest::callback() { if(m_success) { @@ -321,6 +321,14 @@ namespace Online{ return request; } + void CurrentUser::FriendRequest::callback() + { + if(m_success) + { + //FIXME + } + } + // ============================================================================ const CurrentUser::AcceptFriendRequest * CurrentUser::requestAcceptFriend(const uint32_t friend_id) const @@ -336,6 +344,14 @@ namespace Online{ return request; } + void CurrentUser::AcceptFriendRequest::callback() + { + if(m_success) + { + //FIXME + } + } + // ============================================================================ const CurrentUser::DeclineFriendRequest * CurrentUser::requestDeclineFriend(const uint32_t friend_id) const @@ -351,6 +367,14 @@ namespace Online{ return request; } + void CurrentUser::DeclineFriendRequest::callback() + { + if(m_success) + { + //FIXME + } + } + // ============================================================================ const irr::core::stringw CurrentUser::getUserName() const diff --git a/src/online/current_user.hpp b/src/online/current_user.hpp index f960fa26b..fd5ed33e1 100644 --- a/src/online/current_user.hpp +++ b/src/online/current_user.hpp @@ -19,7 +19,7 @@ #ifndef HEADER_CURRENT_ONLINE_USER_HPP #define HEADER_CURRENT_ONLINE_USER_HPP -#include "http_manager.hpp" +#include "online/http_manager.hpp" #include "online/server.hpp" #include "online/user.hpp" #include "online/profile.hpp" @@ -88,10 +88,10 @@ namespace Online{ ServerJoinRequest() : XMLRequest(RT_SERVER_JOIN) {} }; - class setAddonVoteRequest : public XMLRequest { + class SetAddonVoteRequest : public XMLRequest { virtual void callback (); public: - setAddonVoteRequest() : XMLRequest() {} + SetAddonVoteRequest() : XMLRequest() {} }; class FriendRequest : public XMLRequest { @@ -155,7 +155,7 @@ namespace Online{ const irr::core::stringw &email); const XMLRequest * requestGetAddonVote(const std::string & addon_id) const; - const setAddonVoteRequest * requestSetAddonVote(const std::string & addon_id, float rating) const; + const SetAddonVoteRequest * requestSetAddonVote(const std::string & addon_id, float rating) const; const FriendRequest * requestFriendRequest(const uint32_t friend_id) const; const AcceptFriendRequest * requestAcceptFriend(const uint32_t friend_id) const; const DeclineFriendRequest * requestDeclineFriend(const uint32_t friend_id) const; diff --git a/src/states_screens/dialogs/user_info_dialog.cpp b/src/states_screens/dialogs/user_info_dialog.cpp index 4d45ee47d..549d7818c 100644 --- a/src/states_screens/dialogs/user_info_dialog.cpp +++ b/src/states_screens/dialogs/user_info_dialog.cpp @@ -56,6 +56,12 @@ UserInfoDialog::UserInfoDialog(uint32_t visiting_id) assert(m_info_widget != NULL); m_options_widget = getWidget<RibbonWidget>("options"); assert(m_options_widget != NULL); + m_friend_widget = getWidget<IconButtonWidget>("friend"); + assert(m_friend_widget != NULL); + m_accept_widget = getWidget<IconButtonWidget>("accept"); + assert(m_accept_widget != NULL); + m_decline_widget = getWidget<IconButtonWidget>("decline"); + assert(m_decline_widget != NULL); m_enter_widget = getWidget<IconButtonWidget>("enter"); assert(m_enter_widget != NULL); m_cancel_widget = getWidget<IconButtonWidget>("cancel"); diff --git a/src/states_screens/dialogs/user_info_dialog.hpp b/src/states_screens/dialogs/user_info_dialog.hpp index 034800141..af370f322 100644 --- a/src/states_screens/dialogs/user_info_dialog.hpp +++ b/src/states_screens/dialogs/user_info_dialog.hpp @@ -47,7 +47,9 @@ private: GUIEngine::LabelWidget * m_info_widget; GUIEngine::RibbonWidget * m_options_widget; - GUIEngine::IconButtonWidget * m_add_widget; + GUIEngine::IconButtonWidget * m_friend_widget; + GUIEngine::IconButtonWidget * m_accept_widget; + GUIEngine::IconButtonWidget * m_decline_widget; GUIEngine::IconButtonWidget * m_enter_widget; GUIEngine::IconButtonWidget * m_cancel_widget; diff --git a/src/states_screens/dialogs/vote_dialog.hpp b/src/states_screens/dialogs/vote_dialog.hpp index 3d7c801a9..384c4e2c2 100644 --- a/src/states_screens/dialogs/vote_dialog.hpp +++ b/src/states_screens/dialogs/vote_dialog.hpp @@ -46,7 +46,7 @@ private: const std::string m_addon_id; bool m_self_destroy; const Online::XMLRequest * m_fetch_vote_request; - const Online::CurrentUser::setAddonVoteRequest * m_perform_vote_request; + const Online::CurrentUser::SetAddonVoteRequest * m_perform_vote_request; GUIEngine::LabelWidget * m_info_widget;