[evolution/webkit-composer: 173/181] Fix composer ACTION macros.



commit 79626162608f9968a3c701a4f9d5e43698762d61
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Feb 8 10:47:10 2013 -0500

    Fix composer ACTION macros.
    
    Put them back the way they were.  The macros take a 'composer' argument
    and do "e_editor_get_action (e_msg_composer_get_editor (composer), name)"
    to obtain the GtkAction.

 composer/e-composer-actions.h                     |   84 +++++++++++----------
 composer/e-msg-composer.c                         |   12 ---
 mail/e-mail-reader-utils.c                        |    2 -
 plugins/attachment-reminder/attachment-reminder.c |    4 +-
 4 files changed, 44 insertions(+), 58 deletions(-)
---
diff --git a/composer/e-composer-actions.h b/composer/e-composer-actions.h
index 716c1d5..efea8ea 100644
--- a/composer/e-composer-actions.h
+++ b/composer/e-composer-actions.h
@@ -19,47 +19,49 @@
 #define E_COMPOSER_ACTIONS_H
 
 #define E_COMPOSER_ACTION(composer, name) \
-	(e_editor_get_action (E_EDITOR (editor), (name)))
+	(e_editor_get_action ( \
+		e_msg_composer_get_editor ( \
+		E_MSG_COMPOSER (composer)), (name)))
 
-#define E_COMPOSER_ACTION_ATTACH(editor) \
-	E_COMPOSER_ACTION ((editor), "attach")
-#define E_COMPOSER_ACTION_CLOSE(editor) \
-	E_COMPOSER_ACTION ((editor), "close")
-#define E_COMPOSER_ACTION_PGP_ENCRYPT(editor) \
-	E_COMPOSER_ACTION ((editor), "pgp-encrypt")
-#define E_COMPOSER_ACTION_PGP_SIGN(editor) \
-	E_COMPOSER_ACTION ((editor), "pgp-sign")
-#define E_COMPOSER_ACTION_PICTURE_GALLERY(editor) \
-	E_COMPOSER_ACTION ((editor), "picture-gallery")
-#define E_COMPOSER_ACTION_PRINT(editor) \
-	E_COMPOSER_ACTION ((editor), "print")
-#define E_COMPOSER_ACTION_PRINT_PREVIEW(editor) \
-	E_COMPOSER_ACTION ((editor), "print-preview")
-#define E_COMPOSER_ACTION_PRIORITIZE_MESSAGE(editor) \
-	E_COMPOSER_ACTION ((editor), "prioritize-message")
-#define E_COMPOSER_ACTION_REQUEST_READ_RECEIPT(editor) \
-	E_COMPOSER_ACTION ((editor), "request-read-receipt")
-#define E_COMPOSER_ACTION_SAVE(editor) \
-	E_COMPOSER_ACTION ((editor), "save")
-#define E_COMPOSER_ACTION_SAVE_AS(editor) \
-	E_COMPOSER_ACTION ((editor), "save-as")
-#define E_COMPOSER_ACTION_SAVE_DRAFT(editor) \
-	E_COMPOSER_ACTION ((editor), "save-draft")
-#define E_COMPOSER_ACTION_SECURITY_MENU(editor) \
-	E_COMPOSER_ACTION ((editor), "security-menu")
-#define E_COMPOSER_ACTION_SEND(editor) \
-	E_COMPOSER_ACTION ((editor), "send")
-#define E_COMPOSER_ACTION_NEW_MESSAGE(editor) \
-	E_COMPOSER_ACTION ((editor), "new-message")
-#define E_COMPOSER_ACTION_SMIME_ENCRYPT(editor) \
-	E_COMPOSER_ACTION ((editor), "smime-encrypt")
-#define E_COMPOSER_ACTION_SMIME_SIGN(editor) \
-	E_COMPOSER_ACTION ((editor), "smime-sign")
-#define E_COMPOSER_ACTION_VIEW_BCC(editor) \
-	E_COMPOSER_ACTION ((editor), "view-bcc")
-#define E_COMPOSER_ACTION_VIEW_CC(editor) \
-	E_COMPOSER_ACTION ((editor), "view-cc")
-#define E_COMPOSER_ACTION_VIEW_REPLY_TO(editor) \
-	E_COMPOSER_ACTION ((editor), "view-reply-to")
+#define E_COMPOSER_ACTION_ATTACH(composer) \
+	E_COMPOSER_ACTION ((composer), "attach")
+#define E_COMPOSER_ACTION_CLOSE(composer) \
+	E_COMPOSER_ACTION ((composer), "close")
+#define E_COMPOSER_ACTION_PGP_ENCRYPT(composer) \
+	E_COMPOSER_ACTION ((composer), "pgp-encrypt")
+#define E_COMPOSER_ACTION_PGP_SIGN(composer) \
+	E_COMPOSER_ACTION ((composer), "pgp-sign")
+#define E_COMPOSER_ACTION_PICTURE_GALLERY(composer) \
+	E_COMPOSER_ACTION ((composer), "picture-gallery")
+#define E_COMPOSER_ACTION_PRINT(composer) \
+	E_COMPOSER_ACTION ((composer), "print")
+#define E_COMPOSER_ACTION_PRINT_PREVIEW(composer) \
+	E_COMPOSER_ACTION ((composer), "print-preview")
+#define E_COMPOSER_ACTION_PRIORITIZE_MESSAGE(composer) \
+	E_COMPOSER_ACTION ((composer), "prioritize-message")
+#define E_COMPOSER_ACTION_REQUEST_READ_RECEIPT(composer) \
+	E_COMPOSER_ACTION ((composer), "request-read-receipt")
+#define E_COMPOSER_ACTION_SAVE(composer) \
+	E_COMPOSER_ACTION ((composer), "save")
+#define E_COMPOSER_ACTION_SAVE_AS(composer) \
+	E_COMPOSER_ACTION ((composer), "save-as")
+#define E_COMPOSER_ACTION_SAVE_DRAFT(composer) \
+	E_COMPOSER_ACTION ((composer), "save-draft")
+#define E_COMPOSER_ACTION_SECURITY_MENU(composer) \
+	E_COMPOSER_ACTION ((composer), "security-menu")
+#define E_COMPOSER_ACTION_SEND(composer) \
+	E_COMPOSER_ACTION ((composer), "send")
+#define E_COMPOSER_ACTION_NEW_MESSAGE(composer) \
+	E_COMPOSER_ACTION ((composer), "new-message")
+#define E_COMPOSER_ACTION_SMIME_ENCRYPT(composer) \
+	E_COMPOSER_ACTION ((composer), "smime-encrypt")
+#define E_COMPOSER_ACTION_SMIME_SIGN(composer) \
+	E_COMPOSER_ACTION ((composer), "smime-sign")
+#define E_COMPOSER_ACTION_VIEW_BCC(composer) \
+	E_COMPOSER_ACTION ((composer), "view-bcc")
+#define E_COMPOSER_ACTION_VIEW_CC(composer) \
+	E_COMPOSER_ACTION ((composer), "view-cc")
+#define E_COMPOSER_ACTION_VIEW_REPLY_TO(composer) \
+	E_COMPOSER_ACTION ((composer), "view-reply-to")
 
 #endif /* E_COMPOSER_ACTIONS_H */
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 2b6e49d..5df036e 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1567,7 +1567,6 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
 	ESourceMailComposition *mc;
 	ESourceOpenPGP *pgp;
 	ESourceSMIME *smime;
-	EEditor *editor;
 	EComposerHeaderTable *table;
 	GtkToggleAction *action;
 	ESource *source;
@@ -1578,7 +1577,6 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
 	const gchar *extension_name;
 	const gchar *uid;
 
-	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 	table = e_msg_composer_get_header_table (composer);
 	registry = e_composer_header_table_get_registry (table);
 	uid = e_composer_header_table_get_identity_uid (table);
@@ -1787,13 +1785,11 @@ msg_composer_notify_header_cb (EMsgComposer *composer)
 static gboolean
 msg_composer_delete_event_cb (EMsgComposer *composer)
 {
-	EEditor *editor;
 	EShell *shell;
 	GtkApplication *application;
 	GList *windows;
 
 	shell = e_msg_composer_get_shell (composer);
-	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
 	/* If the "async" action group is insensitive, it means an
 	 * asynchronous operation is in progress.  Block the event. */
@@ -1821,10 +1817,6 @@ msg_composer_prepare_for_quit_cb (EShell *shell,
                                   EActivity *activity,
                                   EMsgComposer *composer)
 {
-	EEditor *editor;
-
-	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
-
 	if (e_msg_composer_is_exiting (composer)) {
 		/* needs save draft first */
 		g_object_ref (activity);
@@ -2609,10 +2601,8 @@ handle_multipart_signed (EMsgComposer *composer,
 	CamelSession *session;
 	GtkToggleAction *action = NULL;
 	const gchar *protocol;
-	EEditor *editor;
 
 	session = e_msg_composer_get_session (composer);
-	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
 	content = CAMEL_DATA_WRAPPER (multipart);
 	content_type = camel_data_wrapper_get_mime_type_field (content);
@@ -2695,11 +2685,9 @@ handle_multipart_encrypted (EMsgComposer *composer,
 	CamelCipherValidity *valid;
 	GtkToggleAction *action = NULL;
 	const gchar *protocol;
-	EEditor *editor;
 
 	content_type = camel_mime_part_get_content_type (multipart);
 	protocol = camel_content_type_param (content_type, "protocol");
-	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
 	if (protocol && g_ascii_strcasecmp (protocol, "application/pgp-encrypted") == 0)
 		action = GTK_TOGGLE_ACTION (ACTION (PGP_ENCRYPT));
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index bd0d5e9..1995fa8 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -1487,7 +1487,6 @@ e_mail_reader_reply_to_message (EMailReader *reader,
 		GtkToggleAction *action;
 
 		if ((validity_pgp_sum & E_MAIL_PART_VALIDITY_PGP) != 0) {
-			EEditor *editor = E_EDITOR (composer);
 			if ((validity_pgp_sum & E_MAIL_PART_VALIDITY_SIGNED) != 0) {
 				action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_PGP_SIGN (composer));
 				gtk_toggle_action_set_active (action, TRUE);
@@ -1500,7 +1499,6 @@ e_mail_reader_reply_to_message (EMailReader *reader,
 		}
 
 		if ((validity_smime_sum & E_MAIL_PART_VALIDITY_SMIME) != 0) {
-			EEditor *editor = E_EDITOR (composer);
 			if ((validity_smime_sum & E_MAIL_PART_VALIDITY_SIGNED) != 0) {
 				action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_SMIME_SIGN (composer));
 				gtk_toggle_action_set_active (action, TRUE);
diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c
index fb1bf70..52a0323 100644
--- a/plugins/attachment-reminder/attachment-reminder.c
+++ b/plugins/attachment-reminder/attachment-reminder.c
@@ -129,10 +129,8 @@ ask_for_missing_attachment (EPlugin *ep,
 
 	gtk_widget_destroy (dialog);
 
-	if (response == GTK_RESPONSE_OK) {
-		EEditor *editor = e_editor_window_get_editor (E_EDITOR_WINDOW (window));
+	if (response == GTK_RESPONSE_OK)
 		gtk_action_activate (E_COMPOSER_ACTION_ATTACH (window));
-	}
 
 	return response == GTK_RESPONSE_YES;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]