| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
| 6 | 6 |
| 7 #include "chrome/browser/options_window.h" | 7 #include "chrome/browser/options_window.h" |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 dialog_ = gtk_dialog_new_with_buttons( | 85 dialog_ = gtk_dialog_new_with_buttons( |
| 86 l10n_util::GetStringFUTF8(IDS_OPTIONS_DIALOG_TITLE, | 86 l10n_util::GetStringFUTF8(IDS_OPTIONS_DIALOG_TITLE, |
| 87 WideToUTF16(l10n_util::GetString(IDS_PRODUCT_NAME))).c_str(), | 87 WideToUTF16(l10n_util::GetString(IDS_PRODUCT_NAME))).c_str(), |
| 88 // Prefs window is shared between all browser windows. | 88 // Prefs window is shared between all browser windows. |
| 89 NULL, | 89 NULL, |
| 90 // Non-modal. | 90 // Non-modal. |
| 91 GTK_DIALOG_NO_SEPARATOR, | 91 GTK_DIALOG_NO_SEPARATOR, |
| 92 GTK_STOCK_CLOSE, | 92 GTK_STOCK_CLOSE, |
| 93 GTK_RESPONSE_CLOSE, | 93 GTK_RESPONSE_CLOSE, |
| 94 NULL); | 94 NULL); |
| 95 gtk_window_set_default_size(GTK_WINDOW(dialog_), 500, -1); |
| 95 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), 18); | 96 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), 18); |
| 96 | 97 |
| 97 notebook_ = gtk_notebook_new(); | 98 notebook_ = gtk_notebook_new(); |
| 98 | 99 |
| 99 gtk_notebook_append_page( | 100 gtk_notebook_append_page( |
| 100 GTK_NOTEBOOK(notebook_), | 101 GTK_NOTEBOOK(notebook_), |
| 101 general_page_.get_page_widget(), | 102 general_page_.get_page_widget(), |
| 102 gtk_label_new( | 103 gtk_label_new( |
| 103 l10n_util::GetStringUTF8(IDS_OPTIONS_GENERAL_TAB_LABEL).c_str())); | 104 l10n_util::GetStringUTF8(IDS_OPTIONS_GENERAL_TAB_LABEL).c_str())); |
| 104 | 105 |
| 105 gtk_notebook_append_page( | 106 gtk_notebook_append_page( |
| 106 GTK_NOTEBOOK(notebook_), | 107 GTK_NOTEBOOK(notebook_), |
| 107 gtk_label_new("TODO content"), | 108 gtk_label_new("TODO content"), |
| 108 gtk_label_new( | 109 gtk_label_new( |
| 109 l10n_util::GetStringUTF8(IDS_OPTIONS_CONTENT_TAB_LABEL).c_str())); | 110 l10n_util::GetStringUTF8(IDS_OPTIONS_CONTENT_TAB_LABEL).c_str())); |
| 110 | 111 |
| 111 #ifdef CHROME_PERSONALIZATION | 112 #ifdef CHROME_PERSONALIZATION |
| 112 if (!Personalization::IsP13NDisabled()) { | 113 if (!Personalization::IsP13NDisabled()) { |
| 113 gtk_notebook_append_page( | 114 gtk_notebook_append_page( |
| 114 GTK_NOTEBOOK(notebook_), | 115 GTK_NOTEBOOK(notebook_), |
| 115 gtk_label_new("TODO personalization"), | 116 gtk_label_new("TODO personalization"), |
| 116 gtk_label_new( | 117 gtk_label_new( |
| 117 l10n_util::GetStringUTF8(IDS_OPTIONS_USER_DATA_TAB_LABEL).c_str())); | 118 l10n_util::GetStringUTF8(IDS_OPTIONS_USER_DATA_TAB_LABEL).c_str())); |
| 118 } | 119 } |
| 119 #endif | 120 #endif |
| 120 | 121 |
| 121 GtkWidget* metrics_vbox = gtk_vbox_new(FALSE, 5); | 122 GtkWidget* metrics_vbox = gtk_vbox_new(FALSE, 6); |
| 122 GtkWidget* metrics = gtk_check_button_new_with_label( | 123 gtk_container_set_border_width(GTK_CONTAINER(metrics_vbox), 12); |
| 124 |
| 125 GtkWidget* metrics = gtk_check_button_new(); |
| 126 GtkWidget* metrics_label = gtk_label_new( |
| 123 l10n_util::GetStringUTF8(IDS_OPTIONS_ENABLE_LOGGING).c_str()); | 127 l10n_util::GetStringUTF8(IDS_OPTIONS_ENABLE_LOGGING).c_str()); |
| 128 gtk_label_set_line_wrap(GTK_LABEL(metrics_label), TRUE); |
| 129 // TODO(evanm): make the label wrap at the appropriate width. |
| 130 gtk_widget_set_size_request(metrics_label, 475, -1); |
| 131 gtk_container_add(GTK_CONTAINER(metrics), metrics_label); |
| 124 gtk_box_pack_start(GTK_BOX(metrics_vbox), metrics, FALSE, FALSE, 0); | 132 gtk_box_pack_start(GTK_BOX(metrics_vbox), metrics, FALSE, FALSE, 0); |
| 125 gtk_box_pack_start(GTK_BOX(metrics_vbox), | 133 gtk_box_pack_start(GTK_BOX(metrics_vbox), |
| 126 gtk_label_new("TODO rest of the advanced options"), | 134 gtk_label_new("TODO rest of the advanced options"), |
| 127 FALSE, FALSE, 0); | 135 FALSE, FALSE, 0); |
| 128 bool logging = g_browser_process->local_state()->GetBoolean( | 136 bool logging = g_browser_process->local_state()->GetBoolean( |
| 129 prefs::kMetricsReportingEnabled); | 137 prefs::kMetricsReportingEnabled); |
| 130 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(metrics), logging); | 138 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(metrics), logging); |
| 131 g_signal_connect(metrics, "clicked", G_CALLBACK(OnLoggingChange), this); | 139 g_signal_connect(metrics, "clicked", G_CALLBACK(OnLoggingChange), this); |
| 132 | 140 |
| 133 gtk_notebook_append_page( | 141 gtk_notebook_append_page( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 OptionsGroup highlight_group, | 230 OptionsGroup highlight_group, |
| 223 Profile* profile) { | 231 Profile* profile) { |
| 224 DCHECK(profile); | 232 DCHECK(profile); |
| 225 // If there's already an existing options window, activate it and switch to | 233 // If there's already an existing options window, activate it and switch to |
| 226 // the specified page. | 234 // the specified page. |
| 227 if (!instance_) { | 235 if (!instance_) { |
| 228 instance_ = new OptionsWindowGtk(profile); | 236 instance_ = new OptionsWindowGtk(profile); |
| 229 } | 237 } |
| 230 instance_->ShowOptionsPage(page, highlight_group); | 238 instance_->ShowOptionsPage(page, highlight_group); |
| 231 } | 239 } |
| OLD | NEW |