Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: chrome/browser/gtk/keyword_editor_view.cc

Issue 518028: views/gtk: Add missing keyboard accelerators to Search Engines dialog. (Closed)
Patch Set: added views side Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/views/keyword_editor_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/gtk/keyword_editor_view.h" 5 #include "chrome/browser/gtk/keyword_editor_view.h"
6 6
7 #include "app/gfx/gtk_util.h" 7 #include "app/gfx/gtk_util.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/gtk/edit_search_engine_dialog.h" 10 #include "chrome/browser/gtk/edit_search_engine_dialog.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 selection_ = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_)); 145 selection_ = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_));
146 gtk_tree_selection_set_mode(selection_, GTK_SELECTION_SINGLE); 146 gtk_tree_selection_set_mode(selection_, GTK_SELECTION_SINGLE);
147 gtk_tree_selection_set_select_function(selection_, OnSelectionFilter, 147 gtk_tree_selection_set_select_function(selection_, OnSelectionFilter,
148 NULL, NULL); 148 NULL, NULL);
149 g_signal_connect(G_OBJECT(selection_), "changed", 149 g_signal_connect(G_OBJECT(selection_), "changed",
150 G_CALLBACK(OnSelectionChanged), this); 150 G_CALLBACK(OnSelectionChanged), this);
151 151
152 GtkWidget* button_box = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); 152 GtkWidget* button_box = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
153 gtk_box_pack_start(GTK_BOX(hbox), button_box, FALSE, FALSE, 0); 153 gtk_box_pack_start(GTK_BOX(hbox), button_box, FALSE, FALSE, 0);
154 154
155 add_button_ = gtk_button_new_with_label( 155 add_button_ = gtk_button_new_with_mnemonic(
156 l10n_util::GetStringUTF8(IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON).c_str()); 156 gtk_util::ConvertAcceleratorsFromWindowsStyle(
157 l10n_util::GetStringUTF8(
158 IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON)).c_str());
157 g_signal_connect(G_OBJECT(add_button_), "clicked", 159 g_signal_connect(G_OBJECT(add_button_), "clicked",
158 G_CALLBACK(OnAddButtonClicked), this); 160 G_CALLBACK(OnAddButtonClicked), this);
159 gtk_box_pack_start(GTK_BOX(button_box), add_button_, FALSE, FALSE, 0); 161 gtk_box_pack_start(GTK_BOX(button_box), add_button_, FALSE, FALSE, 0);
160 162
161 edit_button_ = gtk_button_new_with_label( 163 edit_button_ = gtk_button_new_with_label(
162 l10n_util::GetStringUTF8(IDS_SEARCH_ENGINES_EDITOR_EDIT_BUTTON).c_str()); 164 l10n_util::GetStringUTF8(IDS_SEARCH_ENGINES_EDITOR_EDIT_BUTTON).c_str());
163 g_signal_connect(G_OBJECT(edit_button_), "clicked", 165 g_signal_connect(G_OBJECT(edit_button_), "clicked",
164 G_CALLBACK(OnEditButtonClicked), this); 166 G_CALLBACK(OnEditButtonClicked), this);
165 gtk_box_pack_start(GTK_BOX(button_box), edit_button_, FALSE, FALSE, 0); 167 gtk_box_pack_start(GTK_BOX(button_box), edit_button_, FALSE, FALSE, 0);
166 168
167 remove_button_ = gtk_button_new_with_label( 169 remove_button_ = gtk_button_new_with_mnemonic(
168 l10n_util::GetStringUTF8( 170 gtk_util::ConvertAcceleratorsFromWindowsStyle(
169 IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON).c_str()); 171 l10n_util::GetStringUTF8(
172 IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON)).c_str());
170 g_signal_connect(G_OBJECT(remove_button_), "clicked", 173 g_signal_connect(G_OBJECT(remove_button_), "clicked",
171 G_CALLBACK(OnRemoveButtonClicked), this); 174 G_CALLBACK(OnRemoveButtonClicked), this);
172 gtk_box_pack_start(GTK_BOX(button_box), remove_button_, FALSE, FALSE, 0); 175 gtk_box_pack_start(GTK_BOX(button_box), remove_button_, FALSE, FALSE, 0);
173 176
174 make_default_button_ = gtk_button_new_with_label( 177 make_default_button_ = gtk_button_new_with_label(
175 l10n_util::GetStringUTF8( 178 l10n_util::GetStringUTF8(
176 IDS_SEARCH_ENGINES_EDITOR_MAKE_DEFAULT_BUTTON).c_str()); 179 IDS_SEARCH_ENGINES_EDITOR_MAKE_DEFAULT_BUTTON).c_str());
177 g_signal_connect(G_OBJECT(make_default_button_), "clicked", 180 g_signal_connect(G_OBJECT(make_default_button_), "clicked",
178 G_CALLBACK(OnMakeDefaultButtonClicked), this); 181 G_CALLBACK(OnMakeDefaultButtonClicked), this);
179 gtk_box_pack_start(GTK_BOX(button_box), make_default_button_, FALSE, FALSE, 182 gtk_box_pack_start(GTK_BOX(button_box), make_default_button_, FALSE, FALSE,
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 int model_row = editor->GetSelectedModelRow(); 486 int model_row = editor->GetSelectedModelRow();
484 if (model_row == -1) { 487 if (model_row == -1) {
485 NOTREACHED(); 488 NOTREACHED();
486 return; 489 return;
487 } 490 }
488 int new_index = editor->controller_->MakeDefaultTemplateURL(model_row); 491 int new_index = editor->controller_->MakeDefaultTemplateURL(model_row);
489 if (new_index > 0) { 492 if (new_index > 0) {
490 editor->SelectModelRow(new_index); 493 editor->SelectModelRow(new_index);
491 } 494 }
492 } 495 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/views/keyword_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698