From 9539cc3ff38ee6453a017eb06ae64c53402fbe8f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 24 Mar 2011 15:58:48 -0400 Subject: Bug 645545 - Attachment reminder dialog uses wrong expand --- plugins/attachment-reminder/attachment-reminder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins/attachment-reminder/attachment-reminder.c') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 25b0ddb514..723e8cfe5d 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -115,9 +115,8 @@ ask_for_missing_attachment (EPlugin *ep, GtkWindow *window) /*Check buttons*/ check = gtk_check_button_new_with_mnemonic (_("_Do not show this message again.")); - gtk_container_set_border_width ((GtkContainer *)check, 12); content_area = gtk_dialog_get_content_area (dialog); - gtk_box_pack_start (GTK_BOX (content_area), check, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), check, FALSE, FALSE, 0); gtk_widget_show (check); response = gtk_dialog_run ((GtkDialog *) dialog); -- cgit v1.2.3 From eccfd921ed7a7017cf3b893c9146c4ee0438d86b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 24 Mar 2011 16:47:53 -0400 Subject: Fix alignment of extra widgets in EAlertDialogs. Add e_alert_dialog_get_content_area(), which returns the GtkVBox containing the primary and secondary labels. Use this instead of gtk_dialog_get_content_area() to maintain the dialog's left margin beneath the image. --- plugins/attachment-reminder/attachment-reminder.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'plugins/attachment-reminder/attachment-reminder.c') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 723e8cfe5d..113424bd78 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -105,26 +105,29 @@ org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t) static gboolean ask_for_missing_attachment (EPlugin *ep, GtkWindow *window) { - GtkWidget *check = NULL; - GtkDialog *dialog = NULL; - GtkWidget *content_area; + GtkWidget *check; + GtkWidget *dialog; + GtkWidget *container; gint response; - dialog = (GtkDialog*) e_alert_dialog_new_for_args ( - window, "org.gnome.evolution.plugins.attachment_reminder:attachment-reminder", NULL); + dialog = e_alert_dialog_new_for_args ( + window, "org.gnome.evolution.plugins.attachment_reminder:" + "attachment-reminder", NULL); + + container = e_alert_dialog_get_content_area (E_ALERT_DIALOG (dialog)); /*Check buttons*/ - check = gtk_check_button_new_with_mnemonic (_("_Do not show this message again.")); - content_area = gtk_dialog_get_content_area (dialog); - gtk_box_pack_start (GTK_BOX (content_area), check, FALSE, FALSE, 0); + check = gtk_check_button_new_with_mnemonic ( + _("_Do not show this message again.")); + gtk_box_pack_start (GTK_BOX (container), check, FALSE, FALSE, 0); gtk_widget_show (check); - response = gtk_dialog_run ((GtkDialog *) dialog); + response = gtk_dialog_run (GTK_DIALOG (dialog)); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) e_plugin_enable (ep, FALSE); - gtk_widget_destroy ((GtkWidget *)dialog); + gtk_widget_destroy (dialog); if (response == GTK_RESPONSE_OK) gtk_action_activate (E_COMPOSER_ACTION_ATTACH (window)); -- cgit v1.2.3 From 54da4fc09cf226fdb59b9f0c70555e2e57dc1f91 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 8 May 2011 13:24:42 -0400 Subject: Coding style cleanups. --- plugins/attachment-reminder/attachment-reminder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/attachment-reminder/attachment-reminder.c') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 113424bd78..e21dd94498 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -96,7 +96,7 @@ org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t) /* Set presend_check_status for the composer*/ if (check_for_attachment_clues (filtered_str) && !check_for_attachment (t->composer)) - if (!ask_for_missing_attachment (ep, (GtkWindow *)t->composer)) + if (!ask_for_missing_attachment (ep, (GtkWindow *) t->composer)) g_object_set_data ((GObject *) t->composer, "presend_check_status", GINT_TO_POINTER(1)); g_free (filtered_str); -- cgit v1.2.3 From c24038c4f62f37b89d1bda9542ca5ccc843d4ea0 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 27 May 2011 15:23:07 +0200 Subject: Bug #646109 - Fix use of include to make sure translations work --- plugins/attachment-reminder/attachment-reminder.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins/attachment-reminder/attachment-reminder.c') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index e21dd94498..5c842d156d 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -20,6 +20,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include -- cgit v1.2.3 From 777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 16 Aug 2011 11:25:56 -0400 Subject: Coding style and whitespace cleanup. --- plugins/attachment-reminder/attachment-reminder.c | 45 +++++++++++++++-------- 1 file changed, 30 insertions(+), 15 deletions(-) (limited to 'plugins/attachment-reminder/attachment-reminder.c') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 5c842d156d..7a6a9fce55 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -66,7 +66,7 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable); GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *plugin); void org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t); -GtkWidget* org_gnome_attachment_reminder_config_option (EPlugin *plugin, struct _EConfigHookItemFactoryData *data); +GtkWidget * org_gnome_attachment_reminder_config_option (EPlugin *plugin, struct _EConfigHookItemFactoryData *data); static gboolean ask_for_missing_attachment (EPlugin *ep, GtkWindow *widget); static gboolean check_for_attachment_clues (gchar *msg); @@ -75,13 +75,15 @@ static gchar * strip_text_msg (gchar *msg); static void commit_changes (UIData *ui); gint -e_plugin_lib_enable (EPlugin *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, + gint enable) { return 0; } void -org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t) +org_gnome_evolution_attachment_reminder (EPlugin *ep, + EMEventTargetComposer *t) { GByteArray *raw_msg_barray; @@ -107,7 +109,8 @@ org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t) } static gboolean -ask_for_missing_attachment (EPlugin *ep, GtkWindow *window) +ask_for_missing_attachment (EPlugin *ep, + GtkWindow *window) { GtkWidget *check; GtkWidget *dialog; @@ -157,7 +160,7 @@ check_for_attachment_clues (gchar *msg) g_object_unref (gconf); msg_length = strlen (msg); - for (list = clue_list;list && !ret_val;list=g_slist_next (list)) { + for (list = clue_list; list && !ret_val; list = g_slist_next (list)) { gchar *needle = g_utf8_strdown (list->data, -1); if (g_strstr_len (msg, msg_length, needle)) { ret_val = TRUE; @@ -191,7 +194,7 @@ strip_text_msg (gchar *msg) { gchar **lines = g_strsplit ( msg, "\n", -1); gchar *stripped_msg = g_strdup (" "); - guint i=0; + guint i = 0; gchar *temp; /* Note : HTML Signatures won't work. Depends on Bug #522784 */ @@ -273,7 +276,8 @@ cell_editing_canceled_cb (GtkCellRenderer *cell, } static void -clue_add_clicked (GtkButton *button, UIData *ui) +clue_add_clicked (GtkButton *button, + UIData *ui) { GtkTreeModel *model; GtkTreeView *tree_view; @@ -294,7 +298,8 @@ clue_add_clicked (GtkButton *button, UIData *ui) } static void -clue_remove_clicked (GtkButton *button, UIData *ui) +clue_remove_clicked (GtkButton *button, + UIData *ui) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -337,7 +342,8 @@ clue_remove_clicked (GtkButton *button, UIData *ui) } static void -clue_edit_clicked (GtkButton *button, UIData *ui) +clue_edit_clicked (GtkButton *button, + UIData *ui) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -359,7 +365,8 @@ clue_edit_clicked (GtkButton *button, UIData *ui) } static void -selection_changed (GtkTreeSelection *selection, UIData *ui) +selection_changed (GtkTreeSelection *selection, + UIData *ui) { GtkTreeModel *model; GtkTreeIter iter; @@ -456,7 +463,7 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) renderer = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"), renderer, "text", CLUE_KEYWORD_COLUMN, NULL); - g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_object_set (renderer, "editable", TRUE, NULL); g_signal_connect ( renderer, "edited", G_CALLBACK (cell_edited_cb), ui); @@ -466,18 +473,26 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), ui); + g_signal_connect ( + selection, "changed", + G_CALLBACK (selection_changed), ui); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ui->treeview), TRUE); ui->clue_add = clue_add; - g_signal_connect (G_OBJECT (ui->clue_add), "clicked", G_CALLBACK (clue_add_clicked), ui); + g_signal_connect ( + ui->clue_add, "clicked", + G_CALLBACK (clue_add_clicked), ui); ui->clue_remove = clue_remove; - g_signal_connect (G_OBJECT (ui->clue_remove), "clicked", G_CALLBACK (clue_remove_clicked), ui); + g_signal_connect ( + ui->clue_remove, "clicked", + G_CALLBACK (clue_remove_clicked), ui); gtk_widget_set_sensitive (ui->clue_remove, FALSE); ui->clue_edit = clue_edit; - g_signal_connect (G_OBJECT (ui->clue_edit), "clicked", G_CALLBACK (clue_edit_clicked), ui); + g_signal_connect ( + ui->clue_edit, "clicked", + G_CALLBACK (clue_edit_clicked), ui); gtk_widget_set_sensitive (ui->clue_edit, FALSE); /* Populate tree view with values from gconf */ -- cgit v1.2.3 From 48b565039b8a442ec4b5d8602e3d5e43399684f8 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Thu, 3 Nov 2011 22:26:04 +0100 Subject: Migrate attachment reminder plugin to GSettings --- plugins/attachment-reminder/attachment-reminder.c | 57 +++++++++++------------ 1 file changed, 28 insertions(+), 29 deletions(-) (limited to 'plugins/attachment-reminder/attachment-reminder.c') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 7a6a9fce55..f2d7382314 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -28,8 +28,6 @@ #include #include -#include - #include #include #include @@ -45,11 +43,11 @@ #include "widgets/misc/e-attachment-view.h" #include "widgets/misc/e-attachment-store.h" -#define GCONF_KEY_ATTACH_REMINDER_CLUES "/apps/evolution/mail/attachment_reminder_clues" +#define CONF_KEY_ATTACH_REMINDER_CLUES "attachment-reminder-clues" #define SIGNATURE "-- " typedef struct { - GConfClient *gconf; + GSettings *settings; GtkWidget *treeview; GtkWidget *clue_add; GtkWidget *clue_edit; @@ -147,21 +145,22 @@ static gboolean check_for_attachment_clues (gchar *msg) { /* TODO : Add more strings. RegEx ??? */ - GConfClient *gconf; - GSList *clue_list = NULL, *list; + GSettings *settings; + gchar **clue_list; + gint i; gboolean ret_val = FALSE; guint msg_length; - gconf = gconf_client_get_default (); + settings = g_settings_new ("org.gnome.evolution.eplugin.attachment-reminder"); - /* Get the list from gconf */ - clue_list = gconf_client_get_list ( gconf, GCONF_KEY_ATTACH_REMINDER_CLUES, GCONF_VALUE_STRING, NULL ); + /* Get the list from GSettings */ + clue_list = g_settings_get_strv (settings, CONF_KEY_ATTACH_REMINDER_CLUES); - g_object_unref (gconf); + g_object_unref (settings); msg_length = strlen (msg); - for (list = clue_list; list && !ret_val; list = g_slist_next (list)) { - gchar *needle = g_utf8_strdown (list->data, -1); + for (i = 0; clue_list[i] != NULL; i++) { + gchar *needle = g_utf8_strdown (clue_list[i], -1); if (g_strstr_len (msg, msg_length, needle)) { ret_val = TRUE; } @@ -169,8 +168,7 @@ check_for_attachment_clues (gchar *msg) } if (clue_list) { - g_slist_foreach (clue_list, (GFunc) g_free, NULL); - g_slist_free (clue_list); + g_strfreev (clue_list); } return ret_val; @@ -221,13 +219,15 @@ static void commit_changes (UIData *ui) { GtkTreeModel *model = NULL; - GSList *clue_list = NULL; + GVariantBuilder b; + GVariant v; GtkTreeIter iter; gboolean valid; model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview)); valid = gtk_tree_model_get_iter_first (model, &iter); + g_variant_builder_init (&b, G_VARIANT_TYPE ("as")); while (valid) { gchar *keyword; @@ -236,14 +236,14 @@ commit_changes (UIData *ui) /* Check if the keyword is not empty */ if ((keyword) && (g_utf8_strlen (g_strstrip (keyword), -1) > 0)) - clue_list = g_slist_append (clue_list, keyword); + g_variant_builder_add (&b, "s", keyword); valid = gtk_tree_model_iter_next (model, &iter); } - gconf_client_set_list (ui->gconf, GCONF_KEY_ATTACH_REMINDER_CLUES, GCONF_VALUE_STRING, clue_list, NULL); + v = g_variant_builder_end (&b); + g_settings_set_value (ui->settings, CONF_KEY_ATTACH_REMINDER_CLUES, v); - g_slist_foreach (clue_list, (GFunc) g_free, NULL); - g_slist_free (clue_list); + g_variant_unref (v); } static void @@ -388,7 +388,7 @@ destroy_ui_data (gpointer data) if (!ui) return; - g_object_unref (ui->gconf); + g_object_unref (ui->settings); g_free (ui); } @@ -398,9 +398,9 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) GtkCellRenderer *renderer; GtkTreeSelection *selection; GtkTreeIter iter; - GConfClient *gconf = gconf_client_get_default (); GtkWidget *hbox; - GSList *clue_list = NULL, *list; + gchar **clue_list; + gint i; GtkWidget *reminder_configuration_box; GtkWidget *clue_container; @@ -452,7 +452,7 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_remove); gtk_widget_set_can_default (clue_remove, TRUE); - ui->gconf = gconf_client_get_default (); + ui->settings = g_settings_new ("org.gnome.evolution.eplugin.attachment-reminder"); ui->treeview = clue_treeview; @@ -495,17 +495,16 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) G_CALLBACK (clue_edit_clicked), ui); gtk_widget_set_sensitive (ui->clue_edit, FALSE); - /* Populate tree view with values from gconf */ - clue_list = gconf_client_get_list ( gconf, GCONF_KEY_ATTACH_REMINDER_CLUES, GCONF_VALUE_STRING, NULL ); + /* Populate tree view with values from GSettings */ + clue_list = g_settings_get_strv (ui->settings, CONF_KEY_ATTACH_REMINDER_CLUES); - for (list = clue_list; list; list = g_slist_next (list)) { + for (i = 0; clue_list[i] != NULL; i++) { gtk_list_store_append (ui->store, &iter); - gtk_list_store_set (ui->store, &iter, CLUE_KEYWORD_COLUMN, list->data, -1); + gtk_list_store_set (ui->store, &iter, CLUE_KEYWORD_COLUMN, clue_list[i], -1); } if (clue_list) { - g_slist_foreach (clue_list, (GFunc) g_free, NULL); - g_slist_free (clue_list); + g_strfreev (clue_list); } /* Add the list here */ -- cgit v1.2.3 From 925b03c373fc79ccd56ab718a0ab97ab92c06115 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 9 Nov 2011 12:35:00 +0100 Subject: Make it fully build --- plugins/attachment-reminder/attachment-reminder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/attachment-reminder/attachment-reminder.c') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index f2d7382314..988d3aa290 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -220,7 +220,7 @@ commit_changes (UIData *ui) { GtkTreeModel *model = NULL; GVariantBuilder b; - GVariant v; + GVariant *v; GtkTreeIter iter; gboolean valid; -- cgit v1.2.3 From 2e60b6a4a21105bb4a1e2badd1be51b3e684d165 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 22 Nov 2011 17:53:07 -0500 Subject: Tweak GSettings schemas. - Don't use the term "eplugin" for modules. - Use the term "plugin" instead of "eplugin" for plugins. - Split SpamAssassin settings into a separate schema. --- plugins/attachment-reminder/attachment-reminder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/attachment-reminder/attachment-reminder.c') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 988d3aa290..9f2837d923 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -151,7 +151,7 @@ check_for_attachment_clues (gchar *msg) gboolean ret_val = FALSE; guint msg_length; - settings = g_settings_new ("org.gnome.evolution.eplugin.attachment-reminder"); + settings = g_settings_new ("org.gnome.evolution.plugin.attachment-reminder"); /* Get the list from GSettings */ clue_list = g_settings_get_strv (settings, CONF_KEY_ATTACH_REMINDER_CLUES); @@ -452,7 +452,7 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_remove); gtk_widget_set_can_default (clue_remove, TRUE); - ui->settings = g_settings_new ("org.gnome.evolution.eplugin.attachment-reminder"); + ui->settings = g_settings_new ("org.gnome.evolution.plugin.attachment-reminder"); ui->treeview = clue_treeview; -- cgit v1.2.3