| Index: remoting/host/disconnect_window_linux.cc
|
| diff --git a/remoting/host/disconnect_window_linux.cc b/remoting/host/disconnect_window_linux.cc
|
| index 280c43dec5a4e15d959b07ef47d51e5b12cd7175..572df1bf5d8cd94f3c8111b921248529e6182f48 100644
|
| --- a/remoting/host/disconnect_window_linux.cc
|
| +++ b/remoting/host/disconnect_window_linux.cc
|
| @@ -9,8 +9,19 @@
|
| #include "base/compiler_specific.h"
|
| #include "base/logging.h"
|
| #include "remoting/host/chromoting_host.h"
|
| +#include "remoting/host/ui_strings.h"
|
| #include "ui/base/gtk/gtk_signal.h"
|
|
|
| +namespace {
|
| +// The width in pixels at which the message will wrap. Given that the message
|
| +// contains an un-splittable email address, it's unlikely that a fixed width
|
| +// is going to look aesthetically pleasing in all languages.
|
| +// TODO(jamiewalch): Replace this with a layout that only uses a single line,
|
| +// and which is docked at the top or bottom of the host screen, as in our
|
| +// UI mocks.
|
| +const int kMessageWidth = 300;
|
| +}
|
| +
|
| namespace remoting {
|
|
|
| class DisconnectWindowLinux : public DisconnectWindow {
|
| @@ -29,7 +40,7 @@ class DisconnectWindowLinux : public DisconnectWindow {
|
|
|
| ChromotingHost* host_;
|
| GtkWidget* disconnect_window_;
|
| - GtkWidget* user_label_;
|
| + GtkWidget* message_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DisconnectWindowLinux);
|
| };
|
| @@ -45,13 +56,14 @@ DisconnectWindowLinux::~DisconnectWindowLinux() {
|
| void DisconnectWindowLinux::CreateWindow() {
|
| if (disconnect_window_) return;
|
|
|
| - std::string disconnect_button(kDisconnectButton);
|
| - disconnect_button += kDisconnectKeysLinux;
|
| + std::string buttonLabel = ui_strings::disconnectButtonText + " (" +
|
| + ui_strings::disconnectButtonShortcut + ")";
|
| +
|
| disconnect_window_ = gtk_dialog_new_with_buttons(
|
| - kTitle,
|
| + ui_strings::productName.c_str(),
|
| NULL,
|
| GTK_DIALOG_NO_SEPARATOR,
|
| - disconnect_button.c_str(), GTK_RESPONSE_OK,
|
| + buttonLabel.c_str(), GTK_RESPONSE_OK,
|
| NULL);
|
|
|
| GtkWindow* window = GTK_WINDOW(disconnect_window_);
|
| @@ -69,27 +81,27 @@ void DisconnectWindowLinux::CreateWindow() {
|
| GtkWidget* content_area =
|
| gtk_dialog_get_content_area(GTK_DIALOG(disconnect_window_));
|
|
|
| - GtkWidget* username_row = gtk_hbox_new(FALSE, 0);
|
| + GtkWidget* message_row = gtk_hbox_new(FALSE, 0);
|
| // TODO(lambroslambrou): Replace the magic number with an appropriate
|
| // constant from a header file (such as chrome/browser/ui/gtk/gtk_util.h
|
| // but check_deps disallows its #inclusion here).
|
| - gtk_container_set_border_width(GTK_CONTAINER(username_row), 12);
|
| - gtk_container_add(GTK_CONTAINER(content_area), username_row);
|
| -
|
| - GtkWidget* share_label = gtk_label_new(kSharingWith);
|
| - gtk_container_add(GTK_CONTAINER(username_row), share_label);
|
| + gtk_container_set_border_width(GTK_CONTAINER(message_row), 12);
|
| + gtk_container_add(GTK_CONTAINER(content_area), message_row);
|
|
|
| - user_label_ = gtk_label_new(NULL);
|
| - gtk_container_add(GTK_CONTAINER(username_row), user_label_);
|
| + message_ = gtk_label_new(NULL);
|
| + gtk_widget_set_size_request(message_, kMessageWidth, -1);
|
| + gtk_label_set_line_wrap(GTK_LABEL(message_), true);
|
| + gtk_container_add(GTK_CONTAINER(message_row), message_);
|
|
|
| gtk_widget_show_all(content_area);
|
| }
|
|
|
| void DisconnectWindowLinux::Show(ChromotingHost* host,
|
| - const std::string& username) {
|
| + const std::string& /* unused */) {
|
| host_ = host;
|
| CreateWindow();
|
| - gtk_label_set_text(GTK_LABEL(user_label_), username.c_str());
|
| + gtk_label_set_text(GTK_LABEL(message_),
|
| + ui_strings::disconnectMessage.c_str());
|
| gtk_window_present(GTK_WINDOW(disconnect_window_));
|
| }
|
|
|
|
|