GUI2: removed unused MP Command Wrapper dialog

This was the equivalent of the Player Info dialog for the old GUI1 MP Lobby, and is now unused.
The new GUI2 lobby uses the aforementioned Player Info dialog. The functionality is basically
the same, though, except the send-private-message interface is more streamlined in the new lobby.
This commit is contained in:
Charles Dang 2017-10-29 16:56:16 +11:00
parent 0737736d3c
commit b1ad293ccd
7 changed files with 0 additions and 737 deletions

View File

@ -1,493 +0,0 @@
#textdomain wesnoth-lib
###
### A graphical front-end to various commands in the multiplayer lobby
###
[window]
id = "mp_cmd_wrapper"
description =_ "Multiplayer command dialog"
[resolution]
definition = "default"
automatic_placement = true
vertical_placement = "center"
horizontal_placement = "center"
[tooltip]
id = "tooltip"
[/tooltip]
[helptip]
id = "tooltip"
[/helptip]
[grid]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "title"
label = _ "Messaging"
[/label]
[/column]
[/row]
[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = true
[grid]
[row]
grow_factor = 1
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
label = _ "Message:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_grow = true
[text_box]
id = "message"
definition = "default"
[/text_box]
[/column]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "ok"
definition = "default"
label = _ "Send"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "top"
border_size = 30
[spacer]
definition = "default"
[/spacer]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "title"
label = _ "Friends/Ignored List"
[/label]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
horizontal_grow = true
[grid]
[row]
grow_factor = 0
[column]
horizontal_grow = true
border = "all"
border_size = 5
[button]
definition = "default"
id = "add_friend"
label = _ "Add as Friend"
[/button]
[/column]
[column]
horizontal_grow = true
border = "all"
border_size = 5
[button]
definition = "default"
id = "add_ignore"
label = _ "Add as Ignore"
[/button]
[/column]
[column]
horizontal_grow = true
border = "all"
border_size = 5
[button]
definition = "default"
id = "remove"
label = _ "Remove"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "top"
border_size = 30
[spacer]
definition = "default"
[/spacer]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
horizontal_grow = true
[grid]
id = "mod_options"
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "title"
label = _ "Moderating"
[/label]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
horizontal_grow = true
[grid]
[row]
grow_factor = 1
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
label = _ "Reason:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "right"
[text_box]
id = "reason"
definition = "default"
[/text_box]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
horizontal_grow = true
[grid]
[row]
grow_factor = 1
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
label = _ "Time:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "right"
[text_box]
id = "time"
definition = "default"
[/text_box]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
horizontal_grow = true
[grid]
[row]
grow_factor = 0
[column]
horizontal_grow = true
border = "all"
border_size = 5
[button]
definition = "default"
id = "status"
label = _ "Status"
[/button]
[/column]
[column]
horizontal_grow = true
border = "all"
border_size = 5
[button]
definition = "default"
id = "kick"
label = _ "Kick"
[/button]
[/column]
[column]
horizontal_grow = true
border = "all"
border_size = 5
[button]
definition = "default"
id = "ban"
label = _ "Ban"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "top"
border_size = 30
[spacer]
definition = "default"
[/spacer]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 0
[column]
grow_factor = 1
horizontal_grow = true
[grid]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
id = "user_label"
[/label]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "cancel"
definition = "default"
label = _ "Cancel"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[/grid]
[/resolution]
[/window]

View File

@ -1811,13 +1811,6 @@
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
</ClCompile>
<ClCompile Include="..\..\src\gui\dialogs\multiplayer\mp_cmd_wrapper.cpp">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
</ClCompile>
<ClCompile Include="..\..\src\gui\dialogs\multiplayer\mp_connect.cpp">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">$(IntDir)Gui\Dialogs\Multiplayer\</ObjectFileName>
@ -3758,7 +3751,6 @@
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\lobby.hpp" />
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_alerts_options.hpp" />
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_change_control.hpp" />
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_cmd_wrapper.hpp" />
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_connect.hpp" />
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_create_game.hpp" />
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_host_game_prompt.hpp" />

View File

@ -749,9 +749,6 @@
<ClCompile Include="..\..\src\gui\dialogs\multiplayer\mp_change_control.cpp">
<Filter>Gui\Dialogs\Multiplayer</Filter>
</ClCompile>
<ClCompile Include="..\..\src\gui\dialogs\multiplayer\mp_cmd_wrapper.cpp">
<Filter>Gui\Dialogs\Multiplayer</Filter>
</ClCompile>
<ClCompile Include="..\..\src\gui\dialogs\multiplayer\mp_connect.cpp">
<Filter>Gui\Dialogs\Multiplayer</Filter>
</ClCompile>
@ -2157,9 +2154,6 @@
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_change_control.hpp">
<Filter>Gui\Dialogs\Multiplayer</Filter>
</ClInclude>
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_cmd_wrapper.hpp">
<Filter>Gui\Dialogs\Multiplayer</Filter>
</ClInclude>
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\mp_connect.hpp">
<Filter>Gui\Dialogs\Multiplayer</Filter>
</ClInclude>

View File

@ -211,7 +211,6 @@ gui/dialogs/multiplayer/faction_select.cpp
gui/dialogs/multiplayer/lobby.cpp
gui/dialogs/multiplayer/mp_alerts_options.cpp
gui/dialogs/multiplayer/mp_change_control.cpp
gui/dialogs/multiplayer/mp_cmd_wrapper.cpp
gui/dialogs/multiplayer/mp_connect.cpp
gui/dialogs/multiplayer/mp_create_game.cpp
gui/dialogs/multiplayer/mp_host_game_prompt.cpp

View File

@ -1,150 +0,0 @@
/*
Copyright (C) 2009 - 2017 by Thomas Baumhauer
<thomas.baumhauer@NOSPAMgmail.com>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
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
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#define GETTEXT_DOMAIN "wesnoth-lib"
#include "gui/dialogs/multiplayer/mp_cmd_wrapper.hpp"
#include "gui/auxiliary/field.hpp"
#include "gui/widgets/button.hpp"
#include "gui/widgets/settings.hpp"
#include "gui/widgets/window.hpp"
#include "preferences/game.hpp"
namespace gui2
{
namespace dialogs
{
/*WIKI
* @page = GUIWindowDefinitionWML
* @order = 2_mp_cmd_wrapper
*
* == Multiplayer command wrapper ==
*
* This shows a dialog that provides a graphical front-end
* to various commands in the multiplayer lobby
*
* @begin{table}{dialog_widgets}
*
* message & & text_box & o &
* Text to send as a private message. $
*
* reason & & text_box & o &
* The reason for a ban. $
*
* time & & text_box & o &
* The time the ban lasts. $
*
* user_label & & label & o &
* The label to show which user has been selected. $
*
* send_message & & button & m &
* Execute /msg. $
*
* add_friend & & button & m &
* Execute /friend. $
*
* add_ignore & & button & m &
* Execute /ignore. $
*
* remove & & button & m &
* Execute /remove. $
*
* status & & button & m &
* Execute /query status. $
*
* kick & & button & m &
* Execute /query kick. $
*
* ban & & button & m &
* Execute /query kban. $
*
* mod_options & & grid & m &
* Grid containing the status/kick/ban options. This grid and its
* children are hidden when these options are unavailable. $
*
* @end{table}
*/
REGISTER_DIALOG(mp_cmd_wrapper)
mp_cmd_wrapper::mp_cmd_wrapper(const t_string& user)
: message_(), reason_(), time_()
{
register_text("message", false, message_, true);
register_text("reason", false, reason_);
register_text("time", false, time_);
register_label("user_label", false, user);
set_always_save_fields(true);
}
void mp_cmd_wrapper::pre_show(window& window)
{
#if defined(_WIN32) || defined(__APPLE__)
text_box* message
= find_widget<text_box>(&window, "message", false, false);
if(message) {
/**
* @todo For some reason the text wrapping fails on Windows and Mac,
* this causes an exception to be thrown, which brings the user back
* to the main menu. So avoid that problem by imposing a maximum
* length (the number of letters W that fit).
*/
message->set_maximum_length(18);
}
#endif
const bool authenticated = preferences::is_authenticated();
if(grid* g = find_widget<grid>(&window, "mod_options", false, false)) {
g->set_active(authenticated);
g->set_visible(authenticated ? widget::visibility::visible : widget::visibility::invisible);
}
/**
* @todo Not really happy with the retval code in general. Need to give it
* some more thought. Therefore separated the set_retval from the
* set_active code.
*/
if(button* b = find_widget<button>(&window, "add_friend", false, false)) {
b->set_retval(1);
}
if(button* b = find_widget<button>(&window, "add_ignore", false, false)) {
b->set_retval(2);
}
if(button* b = find_widget<button>(&window, "remove", false, false)) {
b->set_retval(3);
}
if(button* b = find_widget<button>(&window, "status", false, false)) {
b->set_retval(4);
}
if(button* b = find_widget<button>(&window, "kick", false, false)) {
b->set_retval(5);
}
if(button* b = find_widget<button>(&window, "ban", false, false)) {
b->set_retval(6);
}
}
} // namespace dialogs
} // namespace gui2

View File

@ -1,69 +0,0 @@
/*
Copyright (C) 2009 - 2017 by Thomas Baumhauer
<thomas.baumhauer@NOSPAMgmail.com>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
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
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#pragma once
#include "gui/dialogs/modal_dialog.hpp"
#include "tstring.hpp"
namespace gui2
{
namespace dialogs
{
class mp_cmd_wrapper : public modal_dialog
{
public:
/**
* Constructor.
*
* The text which shows the selected user.
*/
explicit mp_cmd_wrapper(const t_string& user);
/***** ***** ***** setters / getters for members ***** ****** *****/
const std::string& message() const
{
return message_;
}
const std::string& reason() const
{
return reason_;
}
const std::string& time() const
{
return time_;
}
private:
/** The message to send to another user. */
std::string message_;
/** The reason for an action; kick, ban. */
std::string reason_;
/** The duration of a ban. */
std::string time_;
/** Inherited from modal_dialog. */
virtual void pre_show(window& window) override;
/** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
virtual const std::string& window_id() const override;
};
} // namespace dialogs
} // namespace gui2

View File

@ -75,7 +75,6 @@
#include "gui/dialogs/multiplayer/lobby.hpp"
#include "gui/dialogs/multiplayer/mp_alerts_options.hpp"
#include "gui/dialogs/multiplayer/mp_change_control.hpp"
#include "gui/dialogs/multiplayer/mp_cmd_wrapper.hpp"
#include "gui/dialogs/multiplayer/mp_connect.hpp"
#include "gui/dialogs/multiplayer/mp_create_game.hpp"
#include "gui/dialogs/multiplayer/mp_join_game.hpp"
@ -433,7 +432,6 @@ BOOST_AUTO_TEST_CASE(test_gui2)
test<message>();
test<mp_alerts_options>();
//test<mp_change_control>();
test<mp_cmd_wrapper>();
test<mp_connect>();
//test<mp_create_game>();
//test<mp_join_game>();
@ -881,14 +879,6 @@ struct dialog_tester<mp_change_control>
}
};
#endif
template<>
struct dialog_tester<mp_cmd_wrapper>
{
mp_cmd_wrapper* create()
{
return new mp_cmd_wrapper("foo");
}
};
template<>
struct dialog_tester<mp_create_game>