[evolution/wip/gsettings] Miscellaneous GtkAction-related cleanups.
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/gsettings] Miscellaneous GtkAction-related cleanups.
- Date: Wed, 29 Jun 2011 17:22:19 +0000 (UTC)
commit cb8915bcaa591e15c405a175e6904528ae9a446f
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Mar 27 17:58:32 2011 -0400
Miscellaneous GtkAction-related cleanups.
Prefer the newer GtkAction "set" functions over g_object_set().
mail/e-mail-reader.c | 36 +++++++++++++-------------
modules/addressbook/e-book-shell-view.c | 4 +-
modules/calendar/e-cal-shell-view-actions.c | 14 +++++-----
modules/calendar/e-memo-shell-view.c | 2 +-
modules/calendar/e-task-shell-view.c | 2 +-
modules/mail/e-mail-shell-backend.c | 5 ++-
modules/mail/e-mail-shell-view.c | 2 +-
7 files changed, 33 insertions(+), 32 deletions(-)
---
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 9da57fb..c288db0 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -3205,24 +3205,25 @@ mail_reader_update_actions (EMailReader *reader,
gtk_action_set_sensitive (action, sensitive);
action_name = "mail-goto-folder";
+ sensitive = e_mail_reader_get_enable_show_folder (reader);
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "visible", e_mail_reader_get_enable_show_folder (reader), NULL);
- gtk_action_set_sensitive (action, e_mail_reader_get_enable_show_folder (reader));
+ gtk_action_set_sensitive (action, sensitive);
+ gtk_action_set_visible (action, sensitive);
action_name = "mail-goto-nexttab";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "visible", FALSE, NULL);
gtk_action_set_sensitive (action, TRUE);
+ gtk_action_set_visible (action, FALSE);
action_name = "mail-goto-prevtab";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "visible", FALSE, NULL);
gtk_action_set_sensitive (action, TRUE);
+ gtk_action_set_visible (action, FALSE);
action_name = "mail-close-tab";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "visible", FALSE, NULL);
gtk_action_set_sensitive (action, TRUE);
+ gtk_action_set_visible (action, FALSE);
action_name = "mail-move";
sensitive = any_messages_selected;
@@ -3607,54 +3608,53 @@ e_mail_reader_init (EMailReader *reader,
action_name = "mail-delete";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "short-label", _("Delete"), NULL);
+ gtk_action_set_short_label (action, _("Delete"));
action_name = "mail-forward";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "is-important", TRUE, NULL);
+ gtk_action_set_is_important (action, TRUE);
action_name = "mail-reply-group";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "is-important", TRUE, NULL);
+ gtk_action_set_is_important (action, TRUE);
action_name = "mail-goto-folder";
action = e_mail_reader_get_action (reader, action_name);
sensitive = e_mail_reader_get_enable_show_folder (reader);
- g_object_set (action, "visible", FALSE, NULL);
gtk_action_set_sensitive (action, sensitive);
+ gtk_action_set_visible (action, FALSE);
action_name = "mail-goto-nexttab";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "visible", FALSE, NULL);
gtk_action_set_sensitive (action, TRUE);
+ gtk_action_set_visible (action, FALSE);
action_name = "mail-goto-prevtab";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "visible", FALSE, NULL);
gtk_action_set_sensitive (action, TRUE);
+ gtk_action_set_visible (action, FALSE);
action_name = "mail-close-tab";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "visible", FALSE, NULL);
gtk_action_set_sensitive (action, TRUE);
+ gtk_action_set_visible (action, FALSE);
action_name = "mail-next";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "short-label", _("Next"), NULL);
+ gtk_action_set_short_label (action, _("Next"));
action_name = "mail-previous";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "short-label", _("Previous"), NULL);
+ gtk_action_set_short_label (action, _("Previous"));
action_name = "mail-reply-all";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (action, "is-important", TRUE, NULL);
+ gtk_action_set_is_important (action, TRUE);
action_name = "mail-reply-sender";
action = e_mail_reader_get_action (reader, action_name);
- g_object_set (
- action, "is-important", TRUE,
- "short-label", _("Reply"), NULL);
+ gtk_action_set_is_important (action, TRUE);
+ gtk_action_set_short_label (action, _("Reply"));
action_name = "add-to-address-book";
action = e_web_view_get_action (web_view, action_name);
diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c
index 4f0d349..3a325b0 100644
--- a/modules/addressbook/e-book-shell-view.c
+++ b/modules/addressbook/e-book-shell-view.c
@@ -345,7 +345,7 @@ book_shell_view_update_actions (EShellView *shell_view)
label = _("_Forward Contacts");
else
label = _("_Forward Contact");
- g_object_set (action, "label", label, NULL);
+ gtk_action_set_label (action, label);
action = ACTION (CONTACT_MOVE);
sensitive = source_is_editable && any_contacts_selected;
@@ -380,7 +380,7 @@ book_shell_view_update_actions (EShellView *shell_view)
label = _("_Send Message to List");
else
label = _("_Send Message to Contact");
- g_object_set (action, "label", label, NULL);
+ gtk_action_set_label (action, label);
}
static void
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index ba72a41..ceeab0b 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -1808,25 +1808,25 @@ e_cal_shell_view_actions_init (ECalShellView *cal_shell_view)
/* Fine tuning. */
action = ACTION (CALENDAR_GO_TODAY);
- g_object_set (action, "short-label", _("Today"), NULL);
+ gtk_action_set_short_label (action, _("Today"));
action = ACTION (CALENDAR_JUMP_TO);
- g_object_set (action, "short-label", _("Go To"), NULL);
+ gtk_action_set_short_label (action, _("Go To"));
action = ACTION (CALENDAR_VIEW_DAY);
- g_object_set (action, "is-important", TRUE, NULL);
+ gtk_action_set_is_important (action, TRUE);
action = ACTION (CALENDAR_VIEW_LIST);
- g_object_set (action, "is-important", TRUE, NULL);
+ gtk_action_set_is_important (action, TRUE);
action = ACTION (CALENDAR_VIEW_MONTH);
- g_object_set (action, "is-important", TRUE, NULL);
+ gtk_action_set_is_important (action, TRUE);
action = ACTION (CALENDAR_VIEW_WEEK);
- g_object_set (action, "is-important", TRUE, NULL);
+ gtk_action_set_is_important (action, TRUE);
action = ACTION (CALENDAR_VIEW_WORKWEEK);
- g_object_set (action, "is-important", TRUE, NULL);
+ gtk_action_set_is_important (action, TRUE);
g_signal_connect (
ACTION (GAL_SAVE_CUSTOM_VIEW), "activate",
diff --git a/modules/calendar/e-memo-shell-view.c b/modules/calendar/e-memo-shell-view.c
index d0986e7..c6d620d 100644
--- a/modules/calendar/e-memo-shell-view.c
+++ b/modules/calendar/e-memo-shell-view.c
@@ -223,7 +223,7 @@ memo_shell_view_update_actions (EShellView *shell_view)
label = _("Delete Memos");
else
label = _("Delete Memo");
- g_object_set (action, "label", label, NULL);
+ gtk_action_set_label (action, label);
action = ACTION (MEMO_FIND);
sensitive = single_memo_selected;
diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c
index 76410b3..fd4f762 100644
--- a/modules/calendar/e-task-shell-view.c
+++ b/modules/calendar/e-task-shell-view.c
@@ -358,7 +358,7 @@ task_shell_view_update_actions (EShellView *shell_view)
label = _("Delete Tasks");
else
label = _("Delete Task");
- g_object_set (action, "label", label, NULL);
+ gtk_action_set_label (action, label);
action = ACTION (TASK_FIND);
sensitive = single_task_selected;
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index af4af56..1de34a9 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -78,7 +78,8 @@ mail_shell_backend_init_importers (void)
importer = mbox_importer_peek ();
e_import_class_add_importer (import_class, importer, NULL, NULL);
- mbox_importer_set_preview_funcs (mbox_create_preview_cb, mbox_fill_preview_cb);
+ mbox_importer_set_preview_funcs (
+ mbox_create_preview_cb, mbox_fill_preview_cb);
importer = elm_importer_peek ();
e_import_class_add_importer (import_class, importer, NULL, NULL);
@@ -95,7 +96,7 @@ mail_shell_backend_mail_icon_cb (EShellWindow *shell_window,
action = e_shell_window_get_shell_view_action (
shell_window, BACKEND_NAME);
- g_object_set (action, "icon-name", icon_name, NULL);
+ gtk_action_set_icon_name (action, icon_name);
}
static void
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index 0c7feba..2a3e255 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -952,7 +952,7 @@ mail_shell_view_update_actions (EShellView *shell_view)
else
label = _("_Disable Account");
gtk_action_set_sensitive (action, sensitive);
- g_object_set (action, "label", label, NULL);
+ gtk_action_set_label (action, label);
action = ACTION (MAIL_ACCOUNT_EXPUNGE);
sensitive = folder_is_trash;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]