Commit 403dd850 authored by Jim Nelson's avatar Jim Nelson

Drop Gtk.Stock: Closes #7203, Closes #7294

These changes also invalidates #7218, as we're no longer using
buttons with icons with these changes.
parent d3377178
......@@ -332,6 +332,7 @@ client/ui/main-toolbar.vala
client/ui/main-window.vala
client/ui/monitored-progress-bar.vala
client/ui/monitored-spinner.vala
client/ui/stock.vala
client/util/util-date.vala
client/util/util-email.vala
......
......@@ -8,8 +8,8 @@
public class AccountDialogAddEditPane : AccountDialogPane {
public AddEditPage add_edit_page { get; private set; default = new AddEditPage(); }
private Gtk.ButtonBox button_box = new Gtk.ButtonBox(Gtk.Orientation.HORIZONTAL);
private Gtk.Button ok_button = new Gtk.Button.from_stock(Gtk.Stock.OK);
private Gtk.Button cancel_button = new Gtk.Button.from_stock(Gtk.Stock.CANCEL);
private Gtk.Button ok_button = new Gtk.Button.with_mnemonic(Stock._OK);
private Gtk.Button cancel_button = new Gtk.Button.with_mnemonic(Stock._CANCEL);
public signal void ok(Geary.AccountInformation info);
......
......@@ -24,9 +24,9 @@ public class LoginDialog : Gtk.Dialog {
page.size_changed.connect(() => { resize(1, 1); });
page.info_changed.connect(on_info_changed);
cancel_button = new Gtk.Button.from_stock(Gtk.Stock.CANCEL);
cancel_button = new Gtk.Button.from_stock(Stock._CANCEL);
add_action_widget(cancel_button, Gtk.ResponseType.CANCEL);
ok_button = new Gtk.Button.from_stock(Gtk.Stock.ADD);
ok_button = new Gtk.Button.from_stock(Stock._ADD);
ok_button.can_default = true;
add_action_widget(ok_button, Gtk.ResponseType.OK);
set_default_response(Gtk.ResponseType.OK);
......
......@@ -641,7 +641,7 @@ public class ComposerWindow : Gtk.Window {
if (editor.can_undo()) {
present();
ConfirmationDialog dialog = new ConfirmationDialog(this,
_("Do you want to discard the unsaved message?"), null, Gtk.Stock.DISCARD);
_("Do you want to discard the unsaved message?"), null, Stock._DISCARD);
if (dialog.run() != Gtk.ResponseType.OK)
return false;
}
......@@ -725,7 +725,7 @@ public class ComposerWindow : Gtk.Window {
}
if (confirmation != null) {
ConfirmationDialog dialog = new ConfirmationDialog(this,
confirmation, null, Gtk.Stock.OK);
confirmation, null, Stock._OK);
if (dialog.run() != Gtk.ResponseType.OK)
return false;
}
......@@ -832,7 +832,7 @@ public class ComposerWindow : Gtk.Window {
label.halign = Gtk.Align.START;
label.xpad = 4;
Gtk.Button remove_button = new Gtk.Button.from_stock(Gtk.Stock.REMOVE);
Gtk.Button remove_button = new Gtk.Button.with_mnemonic(Stock._REMOVE);
box.pack_start(remove_button, false, false);
remove_button.clicked.connect(() => remove_attachment(attachment_file, box));
......@@ -1145,10 +1145,10 @@ public class ComposerWindow : Gtk.Window {
if (selected != null && (selected is WebKit.DOM.HTMLAnchorElement ||
selected.get_parent_element() is WebKit.DOM.HTMLAnchorElement)) {
existing_link = true;
dialog.add_buttons(Gtk.Stock. REMOVE, Gtk.ResponseType.REJECT);
dialog.add_buttons(Stock._REMOVE, Gtk.ResponseType.REJECT);
}
dialog.add_buttons(Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL, Gtk.Stock.OK,
dialog.add_buttons(Stock._CANCEL, Gtk.ResponseType.CANCEL, Stock._OK,
Gtk.ResponseType.OK);
Gtk.Entry entry = new Gtk.Entry();
......@@ -1313,7 +1313,7 @@ public class ComposerWindow : Gtk.Window {
context_menu.append(new Gtk.SeparatorMenuItem());
// Select all.
Gtk.MenuItem select_all_item = new Gtk.ImageMenuItem.from_stock(Gtk.Stock.SELECT_ALL, null);
Gtk.MenuItem select_all_item = new Gtk.MenuItem.with_mnemonic(Stock.SELECT__ALL);
select_all_item.activate.connect(on_select_all);
context_menu.append(select_all_item);
......
......@@ -48,14 +48,14 @@ abstract class AlertDialog : Object {
class ConfirmationDialog : AlertDialog {
public ConfirmationDialog(Gtk.Window? parent, string primary, string? secondary, string? ok_button) {
base (parent, Gtk.MessageType.WARNING, primary, secondary, ok_button, Gtk.Stock.CANCEL,
base (parent, Gtk.MessageType.WARNING, primary, secondary, ok_button, Stock._CANCEL,
null, Gtk.ResponseType.NONE);
}
}
class ErrorDialog : AlertDialog {
public ErrorDialog(Gtk.Window? parent, string primary, string? secondary) {
base (parent, Gtk.MessageType.ERROR, primary, secondary, Gtk.Stock.OK, null, null,
base (parent, Gtk.MessageType.ERROR, primary, secondary, Stock._OK, null, null,
Gtk.ResponseType.NONE);
}
}
......
......@@ -19,7 +19,7 @@ public class AttachmentDialog : Gtk.FileChooserDialog {
}
construct {
add_button(Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL);
add_button(Stock._CANCEL, Gtk.ResponseType.CANCEL);
add_button(_("_Attach"), Gtk.ResponseType.ACCEPT);
if (!Geary.String.is_empty(current_folder)) {
......
......@@ -97,8 +97,8 @@ public class PasswordDialog {
check_remember_password.active = account_information.imap_remember_password;
// Add action buttons
Gtk.Button cancel_button = new Gtk.Button.from_stock(Gtk.Stock.CANCEL);
ok_button = new Gtk.Button.from_stock(Gtk.Stock.OK);
Gtk.Button cancel_button = new Gtk.Button.from_stock(Stock._CANCEL);
ok_button = new Gtk.Button.from_stock(Stock._OK);
ok_button.can_default = true;
dialog.add_action_widget(cancel_button, Gtk.ResponseType.CANCEL);
dialog.add_action_widget(ok_button, Gtk.ResponseType.OK);
......
......@@ -230,20 +230,20 @@ public class GearyController : Geary.BaseObject {
accounts.label = _("A_ccounts");
entries += accounts;
Gtk.ActionEntry prefs = { ACTION_PREFERENCES, Gtk.Stock.PREFERENCES, TRANSLATABLE, "<Ctrl>E",
Gtk.ActionEntry prefs = { ACTION_PREFERENCES, Stock._PREFERENCES, TRANSLATABLE, "<Ctrl>E",
null, on_preferences };
prefs.label = _("_Preferences");
entries += prefs;
Gtk.ActionEntry help = { ACTION_HELP, Gtk.Stock.HELP, TRANSLATABLE, "F1", null, on_help };
Gtk.ActionEntry help = { ACTION_HELP, Stock._HELP, TRANSLATABLE, "F1", null, on_help };
help.label = _("_Help");
entries += help;
Gtk.ActionEntry about = { ACTION_ABOUT, Gtk.Stock.ABOUT, TRANSLATABLE, null, null, on_about };
Gtk.ActionEntry about = { ACTION_ABOUT, Stock._ABOUT, TRANSLATABLE, null, null, on_about };
about.label = _("_About");
entries += about;
Gtk.ActionEntry quit = { ACTION_QUIT, Gtk.Stock.QUIT, TRANSLATABLE, "<Ctrl>Q", null, on_quit };
Gtk.ActionEntry quit = { ACTION_QUIT, Stock._QUIT, TRANSLATABLE, "<Ctrl>Q", null, on_quit };
quit.label = _("_Quit");
entries += quit;
......@@ -1016,7 +1016,7 @@ public class GearyController : Geary.BaseObject {
} catch (Error error) {
debug("Error showing help: %s", error.message);
Gtk.Dialog dialog = new Gtk.Dialog.with_buttons("Error", null,
Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.Stock.CLOSE, Gtk.ResponseType.CLOSE, null);
Gtk.DialogFlags.DESTROY_WITH_PARENT, Stock._CLOSE, Gtk.ResponseType.CLOSE, null);
dialog.response.connect(() => { dialog.destroy(); });
dialog.get_content_area().add(new Gtk.Label("Error showing help: %s".printf(error.message)));
dialog.show_all();
......@@ -1283,7 +1283,7 @@ public class GearyController : Geary.BaseObject {
QuestionDialog ask_to_open = new QuestionDialog.with_checkbox(main_window,
_("Are you sure you want to open \"%s\"?").printf(attachment.filename),
_("Attachments may cause damage to your system if opened. Only open files from trusted sources."),
Gtk.Stock.OPEN, Gtk.Stock.CANCEL, _("Don't _ask me again"), false);
Stock._OPEN, Stock._CANCEL, _("Don't _ask me again"), false);
if (ask_to_open.run() != Gtk.ResponseType.OK)
return;
......@@ -1319,7 +1319,7 @@ public class GearyController : Geary.BaseObject {
? Gtk.FileChooserAction.SAVE
: Gtk.FileChooserAction.SELECT_FOLDER;
Gtk.FileChooserDialog dialog = new Gtk.FileChooserDialog(null, main_window, action,
Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL, Gtk.Stock.SAVE, Gtk.ResponseType.ACCEPT, null);
Stock._CANCEL, Gtk.ResponseType.CANCEL, Stock._SAVE, Gtk.ResponseType.ACCEPT, null);
if (last_save_directory != null)
dialog.set_current_folder(last_save_directory.get_path());
if (attachments.size == 1) {
......
/* Copyright 2013 Yorba Foundation
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
/**
* With GtkStock deprecated in GTK+ 3.10, these strings offer replacements for commonly-needed
* text labels.
*
* Plain text use all-caps constant names and an underscore indicating where in the English text the
* mnemonic lies. This can be used to ensure that the mnemonic doesn't interfere with other custom
* strings in the grouping.
*/
namespace Stock {
public const string _OK = _("_OK");
public const string _CANCEL = _("_Cancel");
public const string _ABOUT = _("_About");
public const string _ADD = _("_Add");
public const string _CLOSE = _("_Close");
public const string _DISCARD = _("_Discard");
public const string _HELP = _("_Help");
public const string _OPEN = _("_Open");
public const string _PREFERENCES = _("_Preferences");
public const string _PRINT = _("_Print");
public const string _QUIT = _("_Quit");
public const string _REMOVE = _("_Remove");
public const string _SAVE = _("_Save");
public const string SELECT__ALL = _("Select _All");
}
......@@ -1344,7 +1344,7 @@ public class ConversationViewer : Gtk.Box {
}
// Print a message.
Gtk.MenuItem print_item = new Gtk.ImageMenuItem.from_stock(Gtk.Stock.PRINT, null);
Gtk.MenuItem print_item = new Gtk.MenuItem.with_mnemonic(Stock._PRINT);
print_item.activate.connect(() => on_print_message(email));
menu.append(print_item);
......
......@@ -3,9 +3,7 @@
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkActionGroup" id="actions">
<child>
<object class="GtkAction" id="ok_action">
<property name="stock_id">gtk-ok</property>
</object>
<object class="GtkAction" id="ok_action"/>
</child>
</object>
<object class="GtkBox" id="container">
......@@ -17,7 +15,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="yalign">0</property>
<property name="stock">gtk-dialog-error</property>
<property name="pixel_size">60</property>
<property name="icon_name">dialog-error</property>
<property name="icon-size">6</property>
</object>
<packing>
......@@ -72,7 +71,8 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button2">
<property name="label" translatable="yes">_Remove</property>
<property name="label" translatable="yes">_OK</property>
<property name="use_action_appearance">False</property>
<property name="related_action">ok_action</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......
......@@ -8,9 +8,7 @@
</object>
</child>
<child>
<object class="GtkAction" id="close">
<property name="stock_id">gtk-close</property>
</object>
<object class="GtkAction" id="close"/>
</child>
<child>
<object class="GtkAction" id="edit_account">
......@@ -122,11 +120,13 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
<property name="use_action_appearance">False</property>
<property name="related_action">close</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
<property name="use_underline">True</property>
<property name="yalign">0.54000002145767212</property>
</object>
<packing>
......
......@@ -3,57 +3,43 @@
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkActionGroup" id="compose actions">
<child>
<object class="GtkAction" id="undo">
<property name="stock_id">gtk-undo</property>
</object>
<object class="GtkAction" id="undo"/>
<accelerator key="z" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkAction" id="redo">
<property name="stock_id">gtk-redo</property>
</object>
<object class="GtkAction" id="redo"/>
<accelerator key="z" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkAction" id="cut">
<property name="stock_id">gtk-cut</property>
</object>
<object class="GtkAction" id="cut"/>
<accelerator key="x" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkAction" id="copy">
<property name="stock_id">gtk-copy</property>
</object>
<object class="GtkAction" id="copy"/>
<accelerator key="c" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkAction" id="paste">
<property name="stock_id">gtk-paste</property>
</object>
<object class="GtkAction" id="paste"/>
<accelerator key="v" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkAction" id="justifyleft">
<property name="label" translatable="yes">_Left</property>
<property name="stock_id">gtk-justify-left</property>
</object>
</child>
<child>
<object class="GtkAction" id="justifyright">
<property name="label" translatable="yes">_Right</property>
<property name="stock_id">gtk-justify-right</property>
</object>
</child>
<child>
<object class="GtkAction" id="justifycenter">
<property name="label" translatable="yes">_Center</property>
<property name="stock_id">gtk-justify-center</property>
</object>
</child>
<child>
<object class="GtkAction" id="justifyfull">
<property name="label" translatable="yes">_Justify</property>
<property name="stock_id">gtk-justify-fill</property>
</object>
</child>
<child>
......@@ -66,27 +52,26 @@
<child>
<object class="GtkAction" id="color">
<property name="label" translatable="yes">C_olor</property>
<property name="stock_id">gtk-select-color</property>
</object>
<accelerator key="r" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkAction" id="menu">
<property name="label" translatable="yes">Menu</property>
<property name="stock_id">gtk-go-down</property>
<property name="icon_name">go-down</property>
</object>
</child>
<child>
<object class="GtkAction" id="indent">
<property name="label" translatable="yes">Quote text</property>
<property name="stock_id">gtk-indent</property>
<property name="icon_name">format-indent-more</property>
</object>
<accelerator key="bracketright" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkAction" id="outdent">
<property name="label" translatable="yes">Unquote text</property>
<property name="stock_id">gtk-unindent</property>
<property name="icon_name">format-indent-less</property>
</object>
<accelerator key="bracketleft" modifiers="GDK_CONTROL_MASK"/>
</child>
......@@ -110,25 +95,25 @@
</child>
<child>
<object class="GtkToggleAction" id="bold">
<property name="stock_id">gtk-bold</property>
<property name="icon_name">format-text-bold</property>
</object>
<accelerator key="b" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkToggleAction" id="italic">
<property name="stock_id">gtk-italic</property>
<property name="icon_name">format-text-italic</property>
</object>
<accelerator key="i" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkToggleAction" id="underline">
<property name="stock_id">gtk-underline</property>
<property name="icon_name">format-text-underline</property>
</object>
<accelerator key="u" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkToggleAction" id="strikethrough">
<property name="stock_id">gtk-strikethrough</property>
<property name="icon_name">format-text-strikethrough</property>
</object>
<accelerator key="k" modifiers="GDK_CONTROL_MASK"/>
</child>
......@@ -554,10 +539,8 @@
</child>
<child>
<object class="GtkToolItem" id="filler">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<child>
<placeholder/>
</child>
......@@ -568,8 +551,8 @@
</child>
<child>
<object class="GtkToggleToolButton" id="menu button">
<property name="related_action">menu</property>
<property name="use_action_appearance">False</property>
<property name="related_action">menu</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" comments="Various options for formatting text">Formatting Menu</property>
......@@ -665,10 +648,9 @@
<child>
<object class="GtkButton" id="add_pending_attachments">
<property name="label" translatable="yes">_Include Original Attachments</property>
<property name="visible">False</property>
<property name="no_show_all">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="use_underline">True</property>
......@@ -681,11 +663,11 @@
</child>
<child>
<object class="GtkButton" id="Discard">
<property name="label">gtk-discard</property>
<property name="label">_Discard</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
......
......@@ -9,7 +9,7 @@
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">gtk-close</property>
<property name="icon_name">window-close</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image3">
......
......@@ -24,7 +24,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="yalign">0</property>
<property name="stock">gtk-dialog-authentication</property>
<property name="pixel_size">60</property>
<property name="icon_name">security-high</property>
<property name="icon-size">6</property>
</object>
<packing>
......
......@@ -18,15 +18,13 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="close_button">
<property name="label">gtk-close</property>
<property name="use_action_appearance">False</property>
<property name="label">_Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -69,7 +67,6 @@
<child>
<object class="GtkCheckButton" id="autoselect">
<property name="label" translatable="yes">_Automatically select next message</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -77,7 +74,6 @@
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -92,7 +88,6 @@
<child>
<object class="GtkCheckButton" id="display_preview">
<property name="label" translatable="yes">_Display conversation preview</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -100,7 +95,6 @@
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -135,7 +129,6 @@
<child>
<object class="GtkCheckButton" id="spell_check">
<property name="label" translatable="yes">Enable _spell checking</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -143,7 +136,6 @@
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -178,7 +170,6 @@
<child>
<object class="GtkCheckButton" id="play_sounds">
<property name="label" translatable="yes">_Play notification sounds</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -186,7 +177,6 @@
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -201,7 +191,6 @@
<child>
<object class="GtkCheckButton" id="show_notifications">
<property name="label" translatable="yes">Show _notifications for new mail</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -209,7 +198,6 @@
<property name="margin_right">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
......@@ -221,6 +209,9 @@
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......
......@@ -3,14 +3,10 @@
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkActionGroup" id="actions">
<child>
<object class="GtkAction" id="cancel_action">
<property name="stock_id">gtk-cancel</property>
</object>
<object class="GtkAction" id="cancel_action"/>
</child>
<child>
<object class="GtkAction" id="remove_action">
<property name="stock_id">gtk-remove</property>
</object>
<object class="GtkAction" id="remove_action"/>
</child>
</object>
<object class="GtkBox" id="container">
......@@ -22,7 +18,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="yalign">0</property>
<property name="stock">gtk-dialog-warning</property>
<property name="pixel_size">60</property>
<property name="icon_name">dialog-warning</property>
<property name="icon-size">6</property>
</object>
<packing>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment