fix: remove unused id argument from TranslateToStock() (#44910)
unused since fb537d91fc
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
217a6c03b2
commit
4286610961
1 changed files with 11 additions and 8 deletions
|
@ -101,11 +101,10 @@ class GtkMessageBox : private NativeWindowObserver {
|
||||||
// Add buttons.
|
// Add buttons.
|
||||||
GtkDialog* dialog = GTK_DIALOG(dialog_);
|
GtkDialog* dialog = GTK_DIALOG(dialog_);
|
||||||
if (settings.buttons.size() == 0) {
|
if (settings.buttons.size() == 0) {
|
||||||
gtk_dialog_add_button(dialog, TranslateToStock(0, "OK"), 0);
|
gtk_dialog_add_button(dialog, TranslateToStock("OK"), 0);
|
||||||
} else {
|
} else {
|
||||||
for (size_t i = 0; i < settings.buttons.size(); ++i) {
|
for (size_t i = 0; i < settings.buttons.size(); ++i) {
|
||||||
gtk_dialog_add_button(dialog, TranslateToStock(i, settings.buttons[i]),
|
gtk_dialog_add_button(dialog, TranslateToStock(settings.buttons[i]), i);
|
||||||
i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gtk_dialog_set_default_response(dialog, settings.default_id);
|
gtk_dialog_set_default_response(dialog, settings.default_id);
|
||||||
|
@ -146,16 +145,20 @@ class GtkMessageBox : private NativeWindowObserver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* TranslateToStock(int id, const std::string& text) {
|
static const char* TranslateToStock(const std::string& text) {
|
||||||
const std::string lower = base::ToLowerASCII(text);
|
const std::string lower = base::ToLowerASCII(text);
|
||||||
if (lower == "cancel")
|
if (lower == "cancel") {
|
||||||
return gtk_util::GetCancelLabel();
|
return gtk_util::GetCancelLabel();
|
||||||
if (lower == "no")
|
}
|
||||||
|
if (lower == "no") {
|
||||||
return gtk_util::GetNoLabel();
|
return gtk_util::GetNoLabel();
|
||||||
if (lower == "ok")
|
}
|
||||||
|
if (lower == "ok") {
|
||||||
return gtk_util::GetOkLabel();
|
return gtk_util::GetOkLabel();
|
||||||
if (lower == "yes")
|
}
|
||||||
|
if (lower == "yes") {
|
||||||
return gtk_util::GetYesLabel();
|
return gtk_util::GetYesLabel();
|
||||||
|
}
|
||||||
return text.c_str();
|
return text.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue