[latexila] Don't use GtkStock where possible
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Don't use GtkStock where possible
- Date: Sat, 27 Dec 2014 10:07:52 +0000 (UTC)
commit e1da1cc2641f2684b8758d0a35e01a3cfb5f118e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Dec 27 10:14:53 2014 +0100
Don't use GtkStock where possible
src/preferences_dialog.vala | 8 ++++----
src/project_dialogs.vala | 28 ++++++++++++++--------------
src/symbols_view.vala | 2 +-
src/tab_info_bar.vala | 2 +-
src/templates.vala | 1 -
src/templates_dialogs.vala | 12 ++++++------
6 files changed, 26 insertions(+), 27 deletions(-)
---
diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala
index a0242ac..a8a4e16 100644
--- a/src/preferences_dialog.vala
+++ b/src/preferences_dialog.vala
@@ -33,13 +33,13 @@ public class PreferencesDialog : Dialog
border_width = 5;
// reset all button
- Button reset_button = new Button.with_label (_("Reset All"));
+ Button reset_button = new Button.with_mnemonic (_("_Reset All"));
reset_button.set_tooltip_text (_("Reset all preferences"));
reset_button.show_all ();
add_action_widget (reset_button, ResponseType.APPLY);
// close button
- add_button (Stock.CLOSE, ResponseType.CLOSE);
+ add_button (_("_Close"), ResponseType.CLOSE);
response.connect ((response_id) =>
{
@@ -114,8 +114,8 @@ public class PreferencesDialog : Dialog
MessageType.QUESTION, ButtonsType.NONE,
"%s", _("Do you really want to reset all preferences?"));
- dialog.add_button (Stock.CANCEL, ResponseType.CANCEL);
- dialog.add_button (_("Reset All"), ResponseType.YES);
+ dialog.add_button (_("_Cancel"), ResponseType.CANCEL);
+ dialog.add_button (_("_Reset All"), ResponseType.YES);
int resp = dialog.run ();
dialog.destroy ();
diff --git a/src/project_dialogs.vala b/src/project_dialogs.vala
index df64501..5dbcb40 100644
--- a/src/project_dialogs.vala
+++ b/src/project_dialogs.vala
@@ -25,8 +25,8 @@ namespace ProjectDialogs
{
Dialog dialog = new Dialog.with_buttons (_("New Project"), main_window,
DialogFlags.DESTROY_WITH_PARENT,
- Stock.CANCEL, ResponseType.CANCEL,
- Stock.NEW, ResponseType.OK,
+ _("_Cancel"), ResponseType.CANCEL,
+ _("_New"), ResponseType.OK,
null);
/* create dialog widgets */
@@ -116,8 +116,8 @@ namespace ProjectDialogs
Dialog dialog = new Dialog.with_buttons (_("Configure Project"),
main_window,
DialogFlags.DESTROY_WITH_PARENT,
- Stock.CANCEL, ResponseType.CANCEL,
- Stock.OK, ResponseType.OK,
+ _("_Cancel"), ResponseType.CANCEL,
+ _("_OK"), ResponseType.OK,
null);
/* create dialog widgets */
@@ -183,7 +183,7 @@ namespace ProjectDialogs
Dialog dialog = new Dialog.with_buttons (_("Manage Projects"),
main_window,
DialogFlags.DESTROY_WITH_PARENT,
- Stock.CLOSE, ResponseType.OK,
+ _("_Close"), ResponseType.OK,
null);
Box content_area = dialog.get_content_area () as Box;
@@ -203,7 +203,7 @@ namespace ProjectDialogs
column.title = _("Directory");
CellRendererPixbuf pixbuf_renderer = new CellRendererPixbuf ();
- pixbuf_renderer.stock_id = Stock.DIRECTORY;
+ pixbuf_renderer.icon_name = "folder";
column.pack_start (pixbuf_renderer, false);
CellRendererText text_renderer = new CellRendererText ();
@@ -216,7 +216,7 @@ namespace ProjectDialogs
column.title = _("Main File");
pixbuf_renderer = new CellRendererPixbuf ();
- pixbuf_renderer.stock_id = Stock.FILE;
+ pixbuf_renderer.icon_name = "text-x-generic";
column.pack_start (pixbuf_renderer, false);
text_renderer = new CellRendererText ();
@@ -237,9 +237,9 @@ namespace ProjectDialogs
grid.set_column_spacing (5);
content_area.pack_start (grid, false, false, 5);
- Button edit_button = new Button.from_stock (Stock.PROPERTIES);
- Button delete_button = new Button.from_stock (Stock.DELETE);
- Button clear_all_button = new Button.with_label (_("Clear All"));
+ Button edit_button = new Button.with_mnemonic (_("_Properties"));
+ Button delete_button = new Button.with_mnemonic (_("_Delete"));
+ Button clear_all_button = new Button.with_mnemonic (_("_Clear All"));
grid.add (edit_button);
grid.add (delete_button);
@@ -272,8 +272,8 @@ namespace ProjectDialogs
_("Do you really want to delete the project \"%s\"?"),
directory);
- delete_dialog.add_buttons (Stock.CANCEL, ResponseType.CANCEL,
- Stock.DELETE, ResponseType.YES);
+ delete_dialog.add_buttons (_("_Cancel"), ResponseType.CANCEL,
+ _("_Delete"), ResponseType.YES);
if (delete_dialog.run () == ResponseType.YES)
{
@@ -292,8 +292,8 @@ namespace ProjectDialogs
ButtonsType.NONE,
"%s", _("Do you really want to clear all projects?"));
- clear_dialog.add_button (Stock.CANCEL, ResponseType.CANCEL);
- clear_dialog.add_button (_("Clear All"), ResponseType.YES);
+ clear_dialog.add_button (_("_Cancel"), ResponseType.CANCEL);
+ clear_dialog.add_button (_("Clear _All"), ResponseType.YES);
if (clear_dialog.run () == ResponseType.YES)
{
diff --git a/src/symbols_view.vala b/src/symbols_view.vala
index 858648d..3696cd0 100644
--- a/src/symbols_view.vala
+++ b/src/symbols_view.vala
@@ -153,7 +153,7 @@ public class SymbolsView : Grid
private void create_clear_button ()
{
- _clear_button = new Button.from_stock (Stock.CLEAR);
+ _clear_button = new Button.with_mnemonic (_("_Clear"));
_clear_button.clicked.connect (() =>
{
diff --git a/src/tab_info_bar.vala b/src/tab_info_bar.vala
index b4747fc..497bc67 100644
--- a/src/tab_info_bar.vala
+++ b/src/tab_info_bar.vala
@@ -74,7 +74,7 @@ public class TabInfoBar : InfoBar
public void add_ok_button ()
{
- add_button (Stock.OK, ResponseType.OK);
+ add_button (_("_OK"), ResponseType.OK);
response.connect ((response_id) =>
{
if (response_id == ResponseType.OK)
diff --git a/src/templates.vala b/src/templates.vala
index 9b21646..805cf23 100644
--- a/src/templates.vala
+++ b/src/templates.vala
@@ -341,7 +341,6 @@ public class Templates : GLib.Object
return "text-x-preview";
case "article":
- // Same as Stock.FILE (but it's the theme icon name)
return "text-x-generic";
case "report":
diff --git a/src/templates_dialogs.vala b/src/templates_dialogs.vala
index 7b35f7e..a5b57b0 100644
--- a/src/templates_dialogs.vala
+++ b/src/templates_dialogs.vala
@@ -33,8 +33,8 @@ public class OpenTemplateDialog
_dialog = new Dialog.with_buttons (_("New File..."), main_window,
DialogFlags.DESTROY_WITH_PARENT,
- Stock.CANCEL, ResponseType.REJECT,
- Stock.OK, ResponseType.ACCEPT
+ _("_Cancel"), ResponseType.REJECT,
+ _("_OK"), ResponseType.ACCEPT
);
Box content_area = _dialog.get_content_area () as Box;
@@ -173,8 +173,8 @@ public class CreateTemplateDialog : Dialog
title = _("New Template...");
set_transient_for (parent);
destroy_with_parent = true;
- add_button (Stock.CANCEL, ResponseType.REJECT);
- add_button (Stock.OK, ResponseType.ACCEPT);
+ add_button (_("_Cancel"), ResponseType.REJECT);
+ add_button (_("_OK"), ResponseType.ACCEPT);
Box content_area = get_content_area () as Box;
content_area.homogeneous = false;
@@ -240,8 +240,8 @@ public class DeleteTemplateDialog : Dialog
public DeleteTemplateDialog (MainWindow parent)
{
title = _("Delete Template(s)...");
- add_button (Stock.DELETE, ResponseType.ACCEPT);
- add_button (Stock.CLOSE, ResponseType.REJECT);
+ add_button (_("_Delete"), ResponseType.ACCEPT);
+ add_button (_("_Close"), ResponseType.REJECT);
set_transient_for (parent);
destroy_with_parent = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]