From 40085e043615d8f1cdb583d014d774724e15d9b3 Mon Sep 17 00:00:00 2001 From: Sankarasivasubramanian Pasupathilingam Date: Wed, 16 Jul 2008 11:41:04 +0000 Subject: Pushing changes from the madagascar branch related to the on-disk summary work. svn path=/trunk/; revision=35747 --- plugins/itip-formatter/ChangeLog | 6 ++++++ plugins/itip-formatter/itip-formatter.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog index fbcd25aa96..0f987b36d0 100644 --- a/plugins/itip-formatter/ChangeLog +++ b/plugins/itip-formatter/ChangeLog @@ -1,3 +1,9 @@ +2008-07-16 Sankar P + + Pushing disk summary changes from the madagascar branch + + * itip-formatter.c (view_response_cb): + 2008-05-29 Milan Crha ** Fix for bug #535459 diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 5447ac3537..d44493df91 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -1741,7 +1741,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) } camel_message_info_free (mi); } - camel_folder_summary_array_free (pitip->folder->summary, summary_array); + camel_folder_free_summary (pitip->folder, summary_array); } } else { /* Either not a recurring appointment or "apply-to-all" is not selected. So just delete this instance alone */ -- cgit v1.2.3 From 68d73b10b22a2ba0e022b812321bc435e04c4867 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Thu, 17 Jul 2008 07:20:16 +0000 Subject: Added some FIXME's for code cleanup. 2008-07-17 Chenthill Palanisamy * itip-formatter.c: (view_response_cb): Added some FIXME's for code cleanup. svn path=/trunk/; revision=35749 --- plugins/itip-formatter/ChangeLog | 5 +++++ plugins/itip-formatter/itip-formatter.c | 2 ++ 2 files changed, 7 insertions(+) (limited to 'plugins') diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog index 0f987b36d0..a59b464bda 100644 --- a/plugins/itip-formatter/ChangeLog +++ b/plugins/itip-formatter/ChangeLog @@ -1,3 +1,8 @@ +2008-07-17 Chenthill Palanisamy + + * itip-formatter.c: (view_response_cb): Added some + FIXME's for code cleanup. + 2008-07-16 Sankar P Pushing disk summary changes from the madagascar branch diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index d44493df91..6839a68160 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -1652,6 +1652,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) icalcomponent_add_property (pitip->ical_comp, prop); } + /*FIXME Save schedules is misused here, remove it */ save_schedules = e_cal_get_save_schedules (pitip->current_ecal); switch (response) { @@ -1713,6 +1714,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) break; } + /* FIXME Remove this and handle this at the groupwise mail provider */ if (delete_invitation_from_cache) { CamelFolderChangeInfo *changes = NULL; const char *tag = NULL; -- cgit v1.2.3 From b437b5ed8fed646b97a7726e13ddcdcb2bc793ac Mon Sep 17 00:00:00 2001 From: Ashish Shrivastava Date: Sun, 20 Jul 2008 16:03:43 +0000 Subject: Committing on behalf of Ashish Shrivastava 2008-06-25 Ashish Shrivastava * email-custom-header.glade: Marked strings for translation. remove "window1" string from translation. 2008-06-24 Ashish Shrivastava * email-custom-header.c: (e_plugin_lib_get_configure_widget), (org_gnome_email_custom_header_config_option): Added Support for configuring gconf values. * email-custom-header.glade: Configure email-custom-header plugin within the plugin-manager. * org-gnome-email-custom-header.eplug.xml: Add hook class for Configure tab. * Makefile.am: Add new file.(email-custom-header.glade). svn path=/trunk/; revision=35774 --- plugins/email-custom-header/ChangeLog | 16 + plugins/email-custom-header/Makefile.am | 3 +- plugins/email-custom-header/email-custom-header.c | 414 ++++++++++++++++++++- .../org-gnome-email-custom-header.eplug.xml | 7 + 4 files changed, 437 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/email-custom-header/ChangeLog b/plugins/email-custom-header/ChangeLog index 0fbc6ac296..f40af40522 100644 --- a/plugins/email-custom-header/ChangeLog +++ b/plugins/email-custom-header/ChangeLog @@ -1,3 +1,19 @@ +2008-06-25 Ashish Shrivastava + * email-custom-header.glade: Marked strings for + translation. + remove "window1" string from translation. + +2008-06-24 Ashish Shrivastava + + * email-custom-header.c: (e_plugin_lib_get_configure_widget), + (org_gnome_email_custom_header_config_option): + Added Support for configuring gconf values. + * email-custom-header.glade: + Configure email-custom-header plugin within the plugin-manager. + * org-gnome-email-custom-header.eplug.xml: Add hook class + for Configure tab. + * Makefile.am: Add new file.(email-custom-header.glade). + 2008-06-02 Matthew Barnes * Makefile.am: diff --git a/plugins/email-custom-header/Makefile.am b/plugins/email-custom-header/Makefile.am index f7a9c84e2f..91a3b52df4 100644 --- a/plugins/email-custom-header/Makefile.am +++ b/plugins/email-custom-header/Makefile.am @@ -42,7 +42,8 @@ install-data-local: fi glade_DATA = \ - org-gnome-email-custom-header.glade + org-gnome-email-custom-header.glade \ + email-custom-header.glade EXTRA_DIST = \ org-gnome-email-custom-header.eplug.xml \ diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index ef2ac976a7..5579e9c420 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -37,6 +37,23 @@ #define d(x) x +#define GCONF_KEY_CUSTOM_HEADER "/apps/evolution/eplugin/email_custom_header/customHeader" + +typedef struct { + GladeXML *xml; + GConfClient *gconf; + GtkWidget *treeview; + GtkWidget *header_add; + GtkWidget *header_edit; + GtkWidget *header_remove; + GtkListStore *store; +} ConfigData; + +enum { + HEADER_KEY_COLUMN, + HEADER_VALUE_COLUMN, + HEADER_N_COLUMNS, +}; struct _EmailCustomHeaderOptionsDialogPrivate { /* Glade XML data */ @@ -60,9 +77,17 @@ static void epech_dialog_init (GObject *object); static void epech_dialog_dispose (GObject *object); static void epech_setup_widgets (CustomHeaderOptionsDialog *mch); static gint epech_check_existing_composer_window(gconstpointer a, gconstpointer b); - +static void commit_changes (ConfigData *cd); +int e_plugin_lib_enable (EPluginLib *ep, int enable); +GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl); gboolean e_plugin_ui_init(GtkUIManager *manager, EMsgComposer *composer); +int +e_plugin_lib_enable (EPluginLib *ep, int enable) +{ + return 0; +} + static void epech_get_widgets_data (CustomHeaderOptionsDialog *mch) { @@ -242,7 +267,7 @@ epech_get_header_list (CustomHeaderOptionsDialog *mch) client = gconf_client_get_default (); g_return_if_fail (GCONF_IS_CLIENT (client)); - gconf_client_add_dir (client, "/apps/evolution/eplugin/email_custom_header" , GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + gconf_client_add_dir (client, GCONF_KEY_CUSTOM_HEADER, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); epech_load_from_gconf (client, "/apps/evolution/eplugin/email_custom_header/customHeader", mch); return; @@ -554,3 +579,388 @@ e_plugin_ui_init (GtkUIManager *manager, return TRUE; } +static void +commit_changes (ConfigData *cd) +{ + GtkTreeModel *model = NULL; + GSList *header_config_list = NULL; + GtkTreeIter iter; + gboolean valid; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->treeview)); + valid = gtk_tree_model_get_iter_first (model, &iter); + + while (valid) { + gchar *keyword = NULL, *value = NULL; + gtk_tree_model_get (model, &iter, HEADER_KEY_COLUMN, &keyword, -1); + /* Check if the keyword is not empty */ + gtk_tree_model_get (model, &iter, HEADER_VALUE_COLUMN, &value, -1); + /* Check if the keyword is not empty */ + if ((keyword) && (g_utf8_strlen(g_strstrip(keyword), -1) > 0)){ + if ((value) && (g_utf8_strlen(g_strstrip(value), -1) > 0)){ + keyword = g_strconcat (keyword, "=", value, NULL); + } + header_config_list = g_slist_append (header_config_list, g_strdup(keyword)); + } + g_free (keyword); + valid = gtk_tree_model_iter_next (model, &iter); + } + + gconf_client_set_list (cd->gconf, GCONF_KEY_CUSTOM_HEADER, GCONF_VALUE_STRING, header_config_list, NULL); + + g_slist_foreach (header_config_list, (GFunc) g_free, NULL); + g_slist_free (header_config_list); +} + +static void +header_isempty (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, ConfigData *cd) +{ + GtkTreeSelection *selection; + char *keyword = NULL; + char *value = NULL; + gboolean valid; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cd->treeview)); + /* move to the previous node */ + valid = gtk_tree_path_prev (path); + + gtk_tree_model_get (model, iter, HEADER_KEY_COLUMN, &keyword, -1); + + if ((keyword) && !(g_utf8_strlen (g_strstrip (keyword), -1) > 0)) + gtk_list_store_remove (cd->store, iter); + + /* Check if we have a valid row to select. If not, then select + * the previous row */ + if (gtk_list_store_iter_is_valid (GTK_LIST_STORE (model), iter)) { + gtk_tree_selection_select_iter (selection, iter); + } else { + if (path && valid) { + gtk_tree_model_get_iter (model, iter, path); + gtk_tree_selection_select_iter (selection, iter); + } + } + + gtk_widget_grab_focus (cd->treeview); + g_free (keyword); + g_free (value); +} + +static gboolean +header_foreach_check_isempty (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, ConfigData *cd) +{ + gboolean valid; + + valid = gtk_tree_model_get_iter_first (model, iter); + while (valid && gtk_list_store_iter_is_valid (cd->store, iter)) { + char *keyword = NULL; + gtk_tree_model_get (model, iter, HEADER_KEY_COLUMN, &keyword, -1); + /* Check if the keyword is not empty and then emit the row-changed + signal (if we delete the row, then the iter gets corrupted) */ + if ((keyword) && !(g_utf8_strlen (g_strstrip (keyword), -1) > 0)) + gtk_tree_model_row_changed (model, path, iter); + + char *value = NULL; + gtk_tree_model_get (model, iter, HEADER_VALUE_COLUMN, &value, -1); + /* Check if the keyword is not empty and then emit the row-changed + signal (if we delete the row, then the iter gets corrupted) */ + if ((value) && !(g_utf8_strlen (g_strstrip (value), -1) > 0)) + gtk_tree_model_row_changed (model, path, iter); + + g_free (keyword); + g_free (value); + + valid = gtk_tree_model_iter_next (model, iter); + } + + return FALSE; +} + +static void +cell_edited_callback (GtkCellRendererText *cell, + gchar *path_string, + gchar *new_text, + ConfigData *cd) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->treeview)); + + gtk_tree_model_get_iter_from_string (model, &iter, path_string); + + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + HEADER_KEY_COLUMN, new_text, -1); + + commit_changes (cd); +} + +static void +cell_value_edited_callback (GtkCellRendererText *cell, + gchar *path_string, + gchar *new_text, + ConfigData *cd) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->treeview)); + + gtk_tree_model_get_iter_from_string (model, &iter, path_string); + + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + HEADER_VALUE_COLUMN, new_text, -1); + + commit_changes (cd); +} + +static void +header_add_clicked (GtkButton *button, ConfigData *cd) +{ + GtkTreeModel *model; + GtkTreeIter iter; + gchar *new_header = NULL; + GtkTreeViewColumn *focus_col; + GtkTreePath *path; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->treeview)); + gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc) header_foreach_check_isempty, cd); + + /* Disconnect from signal so that we can create an empty row */ + g_signal_handlers_disconnect_matched(G_OBJECT(model), G_SIGNAL_MATCH_FUNC, 0, 0, NULL, header_isempty, cd); + + new_header = g_strdup (""); + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + HEADER_KEY_COLUMN, new_header, -1); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + HEADER_VALUE_COLUMN, new_header, -1); + + focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (cd->treeview), HEADER_KEY_COLUMN); + path = gtk_tree_model_get_path (model, &iter); + + if (path) { + gtk_tree_view_set_cursor (GTK_TREE_VIEW (cd->treeview), path, focus_col, TRUE); + gtk_tree_view_row_activated(GTK_TREE_VIEW(cd->treeview), path, focus_col); + gtk_tree_path_free (path); + } + + /* We have done our job, connect back to the signal */ + g_signal_connect(G_OBJECT(model), "row-changed", G_CALLBACK(header_isempty), cd); +} + +static void +header_remove_clicked (GtkButton *button, ConfigData *cd) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + GtkTreePath *path; + gboolean valid; + gint len; + + valid = FALSE; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cd->treeview)); + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return; + + /* Get the path and move to the previous node :) */ + path = gtk_tree_model_get_path (model, &iter); + if (path) + valid = gtk_tree_path_prev(path); + + gtk_list_store_remove (GTK_LIST_STORE (model), &iter); + + len = gtk_tree_model_iter_n_children (model, NULL); + if (len > 0) { + if (gtk_list_store_iter_is_valid (GTK_LIST_STORE(model), &iter)) { + gtk_tree_selection_select_iter (selection, &iter); + } else { + if (path && valid) { + gtk_tree_model_get_iter(model, &iter, path); + gtk_tree_selection_select_iter (selection, &iter); + } + } + } else { + gtk_widget_set_sensitive (cd->header_edit, FALSE); + gtk_widget_set_sensitive (cd->header_remove, FALSE); + } + + gtk_widget_grab_focus(cd->treeview); + gtk_tree_path_free (path); + + commit_changes (cd); +} + +static void +header_edit_clicked (GtkButton *button, ConfigData *cd) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + GtkTreeViewColumn *focus_col; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cd->treeview)); + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return; + + focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (cd->treeview), HEADER_KEY_COLUMN); + path = gtk_tree_model_get_path (model, &iter); + + if (path) { + gtk_tree_view_set_cursor (GTK_TREE_VIEW (cd->treeview), path, focus_col, TRUE); + gtk_tree_path_free (path); + } +} + +static void +selection_changed (GtkTreeSelection *selection, ConfigData *cd) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + if (gtk_tree_selection_get_selected (selection, &model, &iter)) { + gtk_widget_set_sensitive (cd->header_edit, TRUE); + gtk_widget_set_sensitive (cd->header_remove, TRUE); + } else { + gtk_widget_set_sensitive (cd->header_edit, FALSE); + gtk_widget_set_sensitive (cd->header_remove, FALSE); + } +} + +static void +destroy_cd_data (gpointer data) +{ + ConfigData *cd = (ConfigData *) data; + + if (!cd) + return; + + g_object_unref (cd->xml); + g_object_unref (cd->gconf); + g_free (cd); +} + +GtkWidget * +e_plugin_lib_get_configure_widget (EPlugin *epl) +{ + GtkCellRenderer *renderer; + GtkTreeSelection *selection; + GtkTreeIter iter; + GtkWidget *hbox; + GSList *list; + GSList *header_list = NULL; + GtkTreeModel *model; + gint index; + gchar *buffer; + char *str_colon = NULL, *str1_colon = NULL; + GtkTreeViewColumn *col; + int col_pos; + + GConfClient *client = gconf_client_get_default(); + + ConfigData *cd = g_new0 (ConfigData, 1); + + char *gladefile; + + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + "email-custom-header.glade", + NULL); + cd->xml = glade_xml_new (gladefile, "ech_configuration_box", NULL); + g_free (gladefile); + + cd->gconf = gconf_client_get_default (); + + cd->treeview = glade_xml_get_widget (cd->xml, "header_treeview"); + + cd->store = gtk_list_store_new (HEADER_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING); + + gtk_tree_view_set_model (GTK_TREE_VIEW (cd->treeview), GTK_TREE_MODEL (cd->store)); + + renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cd->treeview), -1, _("Key"), + renderer, "text", HEADER_KEY_COLUMN, NULL); + col = gtk_tree_view_get_column (GTK_TREE_VIEW (cd->treeview), col_pos -1); + gtk_tree_view_column_set_resizable (col, TRUE); + gtk_tree_view_column_set_reorderable(col, TRUE); + g_object_set (col, "min-width", 50, NULL); + + g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + g_signal_connect(renderer, "edited", (GCallback) cell_edited_callback, cd); + + renderer = gtk_cell_renderer_text_new (); + col_pos = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cd->treeview), -1, _("Values"), + renderer, "text", HEADER_VALUE_COLUMN, NULL); + col = gtk_tree_view_get_column (GTK_TREE_VIEW (cd->treeview), col_pos -1); + gtk_tree_view_column_set_resizable (col, TRUE); + gtk_tree_view_column_set_reorderable(col, TRUE); + g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL); + + g_signal_connect(renderer, "edited", (GCallback) cell_value_edited_callback, cd); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cd->treeview)); + gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); + g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), cd); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (cd->treeview), TRUE); + + cd->header_add = glade_xml_get_widget (cd->xml, "header_add"); + g_signal_connect (G_OBJECT (cd->header_add), "clicked", G_CALLBACK (header_add_clicked), cd); + + cd->header_remove = glade_xml_get_widget (cd->xml, "header_remove"); + g_signal_connect (G_OBJECT (cd->header_remove), "clicked", G_CALLBACK (header_remove_clicked), cd); + gtk_widget_set_sensitive (cd->header_remove, FALSE); + + cd->header_edit = glade_xml_get_widget (cd->xml, "header_edit"); + g_signal_connect (G_OBJECT (cd->header_edit), "clicked", G_CALLBACK (header_edit_clicked), cd); + gtk_widget_set_sensitive (cd->header_edit, FALSE); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->treeview)); + g_signal_connect(G_OBJECT(model), "row-changed", G_CALLBACK(header_isempty), cd); + + /* Populate tree view with values from gconf */ + header_list = gconf_client_get_list (client,GCONF_KEY_CUSTOM_HEADER,GCONF_VALUE_STRING, NULL); + + for (list = header_list; list; list = g_slist_next (list)) { + gtk_list_store_append (cd->store, &iter); + gchar **parse_header_list; + buffer = list->data; + parse_header_list = g_strsplit_set (buffer, "=,", -1); + str_colon = g_strconcat (parse_header_list[0], "", NULL); + gtk_list_store_set (cd->store, &iter, HEADER_KEY_COLUMN, str_colon, -1); + + for (index = 0; parse_header_list[index+1] ; ++index) { + str1_colon = g_strconcat (parse_header_list[index+1], "", NULL); + gtk_list_store_set (cd->store, &iter, HEADER_VALUE_COLUMN, str1_colon, -1); + } + } + g_free (str_colon); + g_free (str1_colon); + + if (header_list) { + g_slist_foreach (header_list, (GFunc) g_free, NULL); + g_slist_free (header_list); + } + + /* Add the list here */ + + hbox = gtk_vbox_new (FALSE, 0); + + gtk_box_pack_start (GTK_BOX (hbox), glade_xml_get_widget (cd->xml, "ech_configuration_box"), TRUE, TRUE, 0); + + /* to let free data properly on destroy of configuration widget */ + g_object_set_data_full (G_OBJECT (hbox), "mycd-data", cd, destroy_cd_data); + + return hbox; +} + +/* Configuration in Mail Prefs Page goes here */ + +GtkWidget * +org_gnome_email_custom_header_config_option (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data) +{ + /* This function and the hook needs to be removed, + once the configure code is thoroughly tested */ + + return NULL; + +} diff --git a/plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml b/plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml index 055acc1030..94102ba62a 100644 --- a/plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml +++ b/plugins/email-custom-header/org-gnome-email-custom-header.eplug.xml @@ -18,5 +18,12 @@ + + + + + + + -- cgit v1.2.3 From 474f15f5571bc0d2e64785963703852f274e74df Mon Sep 17 00:00:00 2001 From: Bharath Acharya Date: Sun, 20 Jul 2008 17:15:08 +0000 Subject: ** Fix for bug #542149 2008-07-11 Bharath Acharya ** Fix for bug #542149 * exchange-folder-subscription.c: (subscribe_to_folder): Display an error message to restart if user tries to subscribe to other's mailbox. * org-gnome-exchange-operations.error.xml: Added the corresponding error message. svn path=/trunk/; revision=35779 --- plugins/exchange-operations/ChangeLog | 9 +++++++++ plugins/exchange-operations/exchange-folder-subscription.c | 3 +++ .../exchange-operations/org-gnome-exchange-operations.error.xml | 4 ++++ 3 files changed, 16 insertions(+) (limited to 'plugins') diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index 5386d2bbfd..1ab777f81a 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,3 +1,12 @@ +2008-07-11 Bharath Acharya + + ** Fix for bug #542149 + + * exchange-folder-subscription.c: (subscribe_to_folder): Display an + error message to restart if user tries to subscribe to other's mailbox. + * org-gnome-exchange-operations.error.xml: Added the corresponding + error message. + 2008-06-16 Milan Crha ** Fix for bug #273627 diff --git a/plugins/exchange-operations/exchange-folder-subscription.c b/plugins/exchange-operations/exchange-folder-subscription.c index 021a06434b..9706dd29ab 100644 --- a/plugins/exchange-operations/exchange-folder-subscription.c +++ b/plugins/exchange-operations/exchange-folder-subscription.c @@ -237,9 +237,12 @@ subscribe_to_folder (GtkWidget *dialog, gint response, gpointer data) user_email_address, folder_name, &folder); g_free (folder_name); + gtk_widget_hide (dialog); switch (result) { case EXCHANGE_ACCOUNT_FOLDER_OK: exchange_account_rescan_tree (subscription_info->account); + if (!g_ascii_strcasecmp (e_folder_get_type_string (folder), "mail")) + e_error_run (NULL, ERROR_DOMAIN ":folder-restart-evo", NULL); break; case EXCHANGE_ACCOUNT_FOLDER_ALREADY_EXISTS: e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL); diff --git a/plugins/exchange-operations/org-gnome-exchange-operations.error.xml b/plugins/exchange-operations/org-gnome-exchange-operations.error.xml index 0aa4b6fb79..c162f365ec 100644 --- a/plugins/exchange-operations/org-gnome-exchange-operations.error.xml +++ b/plugins/exchange-operations/org-gnome-exchange-operations.error.xml @@ -221,6 +221,10 @@ username, and password, and try again. <_primary>Folder already exists + + <_primary>Evolution requires a restart to load the subscribed user's mailbox + + <_primary>Folder does not exist -- cgit v1.2.3 From 5948c36901a66021c7d3ded3acaf9bde18be17d2 Mon Sep 17 00:00:00 2001 From: Bharath Acharya Date: Sun, 20 Jul 2008 18:26:42 +0000 Subject: ** Fixes Bug #200147 2008-07-18 Bharath Acharya ** Fixes Bug #200147 Basic functionality implemented by Diego Escalante Urrelo Everyone owes him a big mug of Beer for that. ** Added Templates plugin * Makefile.am: * apps-evolution-template-placeholders.schemas.in: * org-gnome-templates.eplug.xml: * templates.c: * templates.glade: svn path=/trunk/; revision=35780 --- plugins/templates/ChangeLog | 13 + plugins/templates/Makefile.am | 40 ++ ...apps-evolution-template-placeholders.schemas.in | 26 + plugins/templates/org-gnome-templates.eplug.xml | 36 + plugins/templates/templates.c | 764 +++++++++++++++++++++ plugins/templates/templates.glade | 126 ++++ 6 files changed, 1005 insertions(+) create mode 100644 plugins/templates/ChangeLog create mode 100644 plugins/templates/Makefile.am create mode 100644 plugins/templates/apps-evolution-template-placeholders.schemas.in create mode 100644 plugins/templates/org-gnome-templates.eplug.xml create mode 100644 plugins/templates/templates.c create mode 100644 plugins/templates/templates.glade (limited to 'plugins') diff --git a/plugins/templates/ChangeLog b/plugins/templates/ChangeLog new file mode 100644 index 0000000000..edba4e2d99 --- /dev/null +++ b/plugins/templates/ChangeLog @@ -0,0 +1,13 @@ +2008-07-18 Bharath Acharya + + ** Fixes Bug #200147 + + Basic functionality implemented by Diego Escalante Urrelo + Everyone owes him a big mug of Beer for that. + + ** Added Templates plugin + * Makefile.am: + * apps-evolution-template-placeholders.schemas.in: + * org-gnome-templates.eplug.xml: + * templates.c: + * templates.glade: diff --git a/plugins/templates/Makefile.am b/plugins/templates/Makefile.am new file mode 100644 index 0000000000..91da6c1ed9 --- /dev/null +++ b/plugins/templates/Makefile.am @@ -0,0 +1,40 @@ +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_builddir)/composer \ + $(EVOLUTION_MAIL_CFLAGS) \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DEVOLUTION_PLUGINDIR="\"$(plugindir)\"" + +@EVO_PLUGIN_RULE@ + +plugin_DATA = \ + org-gnome-templates.eplug \ + templates.glade + +plugin_LTLIBRARIES = liborg-gnome-templates.la + +liborg_gnome_templates_la_SOURCES = templates.c +liborg_gnome_templates_la_LDFLAGS = -module -avoid-version + +schemadir = $(GCONF_SCHEMA_FILE_DIR) +schema_in_files = apps-evolution-template-placeholders.schemas.in +schema_DATA = $(schema_in_files:.schemas.in=.schemas) + +@INTLTOOL_SCHEMAS_RULE@ + +install-data-local: + if test -z "$(DESTDIR)" ; then \ + for p in $(schema_DATA) ; do \ + GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p; \ + done \ + fi + +EXTRA_DIST = org-gnome-templates.eplug.xml \ + $(schema_in_files) \ + templates.glade + +BUILT_SOURCES = org-gnome-templates.eplug + +CLEANFILES = $(BUILT_SOURCES) + +DISTCLEANFILES = $(schema_DATA) diff --git a/plugins/templates/apps-evolution-template-placeholders.schemas.in b/plugins/templates/apps-evolution-template-placeholders.schemas.in new file mode 100644 index 0000000000..c6a1f4d07d --- /dev/null +++ b/plugins/templates/apps-evolution-template-placeholders.schemas.in @@ -0,0 +1,26 @@ + + + + /schemas/apps/evolution/mail/template_placeholders + /apps/evolution/mail/template_placeholders + evolution-mail + list + string + + + + [myphone=012345,myplace=Abcd,myname=Alice] + + List of keyword/value pairs for the Templates plugin to + substitute in a message body. + + List of keyword/value pairs for the Templates plugin to + substitute in a message body. + + + + + + diff --git a/plugins/templates/org-gnome-templates.eplug.xml b/plugins/templates/org-gnome-templates.eplug.xml new file mode 100644 index 0000000000..02b14148ad --- /dev/null +++ b/plugins/templates/org-gnome-templates.eplug.xml @@ -0,0 +1,36 @@ + + + + <_description>Drafts based template plugin + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c new file mode 100644 index 0000000000..d06224c6a7 --- /dev/null +++ b/plugins/templates/templates.c @@ -0,0 +1,764 @@ +/* + * templates.c + * This file is part of Draft Templates plugin for Evolution + * + * Authors: + * Diego Escalante Urrelo + * Bharath Acharya + * Copyright (C) 2008 - Diego Escalante Urrelo + * Bharath Acharya + * + * Draft Templates is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Draft Templates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Draft Templates; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define GCONF_KEY_TEMPLATE_PLACEHOLDERS "/apps/evolution/mail/template_placeholders" + +typedef struct { + GladeXML *xml; + GConfClient *gconf; + GtkWidget *treeview; + GtkWidget *clue_add; + GtkWidget *clue_edit; + GtkWidget *clue_remove; + GtkListStore *store; +} UIData; + +enum { + CLUE_KEYWORD_COLUMN, + CLUE_VALUE_COLUMN, + CLUE_N_COLUMNS, +}; + +typedef struct { + CamelMimeMessage *msg; + EMPopupTargetSelect *t; +} UserData; + +static char* get_content (CamelMimeMessage *message); + +static void reply_with_template (EPopup *ep, EPopupItem *item, void *data); + +static void popup_free (EPopup *ep, GSList *l, void *data); + +static GSList *fill_submenu (CamelStore *store, + CamelFolderInfo *info, + GSList *list, + EMPopupTargetSelect *t); + +static GSList *append_to_menu (CamelFolder *folder, + GPtrArray *uids, + GSList *list, + EMPopupTargetSelect *t); + +void org_gnome_templates_popup (EPlugin *ep, EMPopupTargetSelect *t); + +GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl); + +gboolean e_plugin_ui_init (GtkUIManager *manager, EMsgComposer *composer); + + +/* Thanks to attachment reminder plugin for this*/ +static void commit_changes (UIData *ui); + +static void key_cell_edited_callback (GtkCellRendererText *cell, gchar *path_string, + gchar *new_text,UIData *ui); + +static void value_cell_edited_callback (GtkCellRendererText *cell, gchar *path_string, + gchar *new_text,UIData *ui); + +static gboolean clue_foreach_check_isempty (GtkTreeModel *model, GtkTreePath + *path, GtkTreeIter *iter, UIData *ui); + +static void +selection_changed (GtkTreeSelection *selection, UIData *ui) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + if (gtk_tree_selection_get_selected (selection, &model, &iter)) { + gtk_widget_set_sensitive (ui->clue_edit, TRUE); + gtk_widget_set_sensitive (ui->clue_remove, TRUE); + } else { + gtk_widget_set_sensitive (ui->clue_edit, FALSE); + gtk_widget_set_sensitive (ui->clue_remove, FALSE); + } +} + +static void +destroy_ui_data (gpointer data) +{ + UIData *ui = (UIData *) data; + + if (!ui) + return; + + g_object_unref (ui->xml); + g_object_unref (ui->gconf); + g_free (ui); +} + +static void +commit_changes (UIData *ui) +{ + GtkTreeModel *model = NULL; + GSList *clue_list = NULL; + GtkTreeIter iter; + gboolean valid; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview)); + valid = gtk_tree_model_get_iter_first (model, &iter); + + while (valid) { + char *keyword, *value; + char *key; + + gtk_tree_model_get (model, &iter, CLUE_KEYWORD_COLUMN, &keyword, -1); + gtk_tree_model_get (model, &iter, CLUE_VALUE_COLUMN, &value, -1); + + /* Check if the keyword and value are not empty */ + if ((keyword) && (value) && (g_utf8_strlen(g_strstrip(keyword), -1) > 0) + && (g_utf8_strlen(g_strstrip(value), -1) > 0)) { + key = g_strdup_printf("%s=%s", keyword, value); + clue_list = g_slist_append (clue_list, key); + } + valid = gtk_tree_model_iter_next (model, &iter); + } + + gconf_client_set_list (ui->gconf, GCONF_KEY_TEMPLATE_PLACEHOLDERS, GCONF_VALUE_STRING, clue_list, NULL); + + g_slist_foreach (clue_list, (GFunc) g_free, NULL); + g_slist_free (clue_list); +} + +static void +clue_check_isempty (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, UIData *ui) +{ + GtkTreeSelection *selection; + char *keyword = NULL; + gboolean valid; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); + /* move to the previous node */ + valid = gtk_tree_path_prev (path); + + gtk_tree_model_get (model, iter, CLUE_KEYWORD_COLUMN, &keyword, -1); + if ((keyword) && !(g_utf8_strlen (g_strstrip (keyword), -1) > 0)) + gtk_list_store_remove (ui->store, iter); + + /* Check if we have a valid row to select. If not, then select + * the previous row */ + if (gtk_list_store_iter_is_valid (GTK_LIST_STORE (model), iter)) { + gtk_tree_selection_select_iter (selection, iter); + } else { + if (path && valid) { + gtk_tree_model_get_iter (model, iter, path); + gtk_tree_selection_select_iter (selection, iter); + } + } + + gtk_widget_grab_focus (ui->treeview); + g_free (keyword); +} + +static gboolean +clue_foreach_check_isempty (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, UIData *ui) +{ + gboolean valid; + + valid = gtk_tree_model_get_iter_first (model, iter); + while (valid && gtk_list_store_iter_is_valid (ui->store, iter)) { + char *keyword = NULL; + gtk_tree_model_get (model, iter, CLUE_KEYWORD_COLUMN, &keyword, -1); + /* Check if the keyword is not empty and then emit the row-changed + signal (if we delete the row, then the iter gets corrupted) */ + if ((keyword) && !(g_utf8_strlen (g_strstrip (keyword), -1) > 0)) + gtk_tree_model_row_changed (model, path, iter); + + g_free (keyword); + valid = gtk_tree_model_iter_next (model, iter); + } + + return FALSE; +} + +static void +key_cell_edited_callback (GtkCellRendererText *cell, + gchar *path_string, + gchar *new_text, + UIData *ui) +{ + GtkTreeModel *model; + GtkTreeIter iter; + char *value; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview)); + + gtk_tree_model_get_iter_from_string (model, &iter, path_string); + + gtk_tree_model_get (model, &iter, CLUE_VALUE_COLUMN, &value, -1); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + CLUE_KEYWORD_COLUMN, new_text, CLUE_VALUE_COLUMN, value, -1); + + commit_changes (ui); +} + +static void +value_cell_edited_callback (GtkCellRendererText *cell, + gchar *path_string, + gchar *new_text, + UIData *ui) +{ + GtkTreeModel *model; + GtkTreeIter iter; + char *keyword; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview)); + + gtk_tree_model_get_iter_from_string (model, &iter, path_string); + + gtk_tree_model_get (model, &iter, CLUE_KEYWORD_COLUMN, &keyword, -1); + + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + CLUE_KEYWORD_COLUMN, keyword, CLUE_VALUE_COLUMN, new_text, -1); + + commit_changes (ui); +} + +static void +clue_add_clicked (GtkButton *button, UIData *ui) +{ + GtkTreeModel *model; + GtkTreeIter iter; + gchar *new_clue = NULL; + GtkTreeViewColumn *focus_col; + GtkTreePath *path; + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview)); + gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc) clue_foreach_check_isempty, ui); + + /* Disconnect from signal so that we can create an empty row */ + g_signal_handlers_disconnect_matched(G_OBJECT(model), G_SIGNAL_MATCH_FUNC, 0, 0, NULL, clue_check_isempty, ui); + + /* TODO : Trim and check for blank strings */ + new_clue = g_strdup (""); + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + CLUE_KEYWORD_COLUMN, new_clue, CLUE_VALUE_COLUMN, new_clue, -1); + + focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (ui->treeview), CLUE_KEYWORD_COLUMN); + path = gtk_tree_model_get_path (model, &iter); + + if (path) { + gtk_tree_view_set_cursor (GTK_TREE_VIEW (ui->treeview), path, focus_col, TRUE); + gtk_tree_view_row_activated(GTK_TREE_VIEW(ui->treeview), path, focus_col); + gtk_tree_path_free (path); + } + + /* We have done our job, connect back to the signal */ + g_signal_connect(G_OBJECT(model), "row-changed", G_CALLBACK(clue_check_isempty), ui); +} + +static void +clue_remove_clicked (GtkButton *button, UIData *ui) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + GtkTreePath *path; + gboolean valid; + gint len; + + valid = FALSE; + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return; + + /* Get the path and move to the previous node :) */ + path = gtk_tree_model_get_path (model, &iter); + if (path) + valid = gtk_tree_path_prev(path); + + gtk_list_store_remove (GTK_LIST_STORE (model), &iter); + + len = gtk_tree_model_iter_n_children (model, NULL); + if (len > 0) { + if (gtk_list_store_iter_is_valid (GTK_LIST_STORE(model), &iter)) { + gtk_tree_selection_select_iter (selection, &iter); + } else { + if (path && valid) { + gtk_tree_model_get_iter(model, &iter, path); + gtk_tree_selection_select_iter (selection, &iter); + } + } + } else { + gtk_widget_set_sensitive (ui->clue_edit, FALSE); + gtk_widget_set_sensitive (ui->clue_remove, FALSE); + } + + gtk_widget_grab_focus(ui->treeview); + gtk_tree_path_free (path); + + commit_changes (ui); +} + +static void +clue_edit_clicked (GtkButton *button, UIData *ui) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreePath *path; + GtkTreeIter iter; + GtkTreeViewColumn *focus_col; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return; + + focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (ui->treeview), CLUE_KEYWORD_COLUMN); + path = gtk_tree_model_get_path (model, &iter); + + if (path) { + gtk_tree_view_set_cursor (GTK_TREE_VIEW (ui->treeview), path, focus_col, TRUE); + gtk_tree_path_free (path); + } +} + +GtkWidget * +e_plugin_lib_get_configure_widget (EPlugin *epl) +{ + GtkCellRenderer *renderer_key, *renderer_value; + GtkTreeSelection *selection; + GtkTreeIter iter; + GConfClient *gconf = gconf_client_get_default(); + GtkWidget *hbox; + GSList *clue_list = NULL, *list; + GtkTreeModel *model; + + UIData *ui = g_new0 (UIData, 1); + + char *gladefile; + + gladefile = g_build_filename (EVOLUTION_PLUGINDIR, + "templates.glade", + NULL); + ui->xml = glade_xml_new (gladefile, "templates_configuration_box", NULL); + g_free (gladefile); + + ui->gconf = gconf_client_get_default (); + + ui->treeview = glade_xml_get_widget (ui->xml, "clue_treeview"); + + ui->store = gtk_list_store_new (CLUE_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING); + + gtk_tree_view_set_model (GTK_TREE_VIEW (ui->treeview), GTK_TREE_MODEL (ui->store)); + + renderer_key = gtk_cell_renderer_text_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"), + renderer_key, "text", CLUE_KEYWORD_COLUMN, NULL); + g_object_set (G_OBJECT (renderer_key), "editable", TRUE, NULL); + g_signal_connect(renderer_key, "edited", (GCallback) key_cell_edited_callback, ui); + + renderer_value = gtk_cell_renderer_text_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Values"), + renderer_value, "text", CLUE_VALUE_COLUMN, NULL); + g_object_set (G_OBJECT (renderer_value), "editable", TRUE, NULL); + g_signal_connect(renderer_value, "edited", (GCallback) value_cell_edited_callback, ui); + + 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); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ui->treeview), TRUE); + + ui->clue_add = glade_xml_get_widget (ui->xml, "clue_add"); + g_signal_connect (G_OBJECT (ui->clue_add), "clicked", G_CALLBACK (clue_add_clicked), ui); + + ui->clue_remove = glade_xml_get_widget (ui->xml, "clue_remove"); + g_signal_connect (G_OBJECT (ui->clue_remove), "clicked", G_CALLBACK (clue_remove_clicked), ui); + gtk_widget_set_sensitive (ui->clue_remove, FALSE); + + ui->clue_edit = glade_xml_get_widget (ui->xml, "clue_edit"); + g_signal_connect (G_OBJECT (ui->clue_edit), "clicked", G_CALLBACK (clue_edit_clicked), ui); + gtk_widget_set_sensitive (ui->clue_edit, FALSE); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview)); + g_signal_connect(G_OBJECT(model), "row-changed", G_CALLBACK(clue_check_isempty), ui); + + /* Populate tree view with values from gconf */ + clue_list = gconf_client_get_list ( gconf, GCONF_KEY_TEMPLATE_PLACEHOLDERS, GCONF_VALUE_STRING, NULL ); + + for (list = clue_list; list; list = g_slist_next (list)) { + char **temp = g_strsplit (list->data, "=", 2); + gtk_list_store_append (ui->store, &iter); + gtk_list_store_set (ui->store, &iter, CLUE_KEYWORD_COLUMN, temp[0], CLUE_VALUE_COLUMN, temp[1], -1); + g_strfreev(temp); + } + + if (clue_list) { + g_slist_foreach (clue_list, (GFunc) g_free, NULL); + g_slist_free (clue_list); + } + + /* Add the list here */ + + hbox = gtk_vbox_new (FALSE, 0); + + gtk_box_pack_start (GTK_BOX (hbox), glade_xml_get_widget (ui->xml, "templates_configuration_box"), TRUE, TRUE, 0); + + /* to let free data properly on destroy of configuration widget */ + g_object_set_data_full (G_OBJECT (hbox), "myui-data", ui, destroy_ui_data); + + return hbox; +} + +/* borrowed from plugins/mail-to-task/ */ +static char * +get_content (CamelMimeMessage *message) +{ + CamelDataWrapper *content; + CamelStream *mem; + CamelContentType *type; + CamelMimePart *mime_part = CAMEL_MIME_PART (message); + char *str, *convert_str = NULL; + gsize bytes_read, bytes_written; + gint count = 2; + + content = camel_medium_get_content_object ((CamelMedium *) message); + if (!content) + return NULL; + + /* Get non-multipart content from multipart message. */ + while (CAMEL_IS_MULTIPART (content) && count > 0) { + mime_part = camel_multipart_get_part (CAMEL_MULTIPART (content), 0); + content = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); + count--; + } + + if (!mime_part) + return NULL; + + type = camel_mime_part_get_content_type (mime_part); + if (!camel_content_type_is (type, "text", "plain")) + return NULL; + + mem = camel_stream_mem_new (); + camel_data_wrapper_decode_to_stream (content, mem); + + str = g_strndup ((const gchar*)((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len); + camel_object_unref (mem); + + /* convert to UTF-8 string */ + if (str && content->mime_type->params && content->mime_type->params->value) { + convert_str = g_convert (str, strlen (str), + "UTF-8", content->mime_type->params->value, + &bytes_read, &bytes_written, NULL); + } + + if (convert_str) { + g_free (str); + return convert_str; + } + else + return str; + +} + +static void +reply_with_template (EPopup *ep, EPopupItem *item, void *data) +{ + CamelMimeMessage *new, *template, *reply_to; + CamelStore *store; + CamelFolder *templates_folder; + struct _camel_header_raw *header; + UserData *userdata = item->user_data; + char *cont, *basedir, *url; + + /* We get the templates folder and all the uids of the messages in there */ + basedir = g_build_filename (g_get_home_dir (), ".evolution", "mail", "local", NULL); + url = g_strdup_printf ("mbox://%s", basedir); + g_free (basedir); + + store = (CamelStore *) camel_session_get_service (session, url, CAMEL_PROVIDER_STORE, NULL); + g_free (url); + + templates_folder = camel_store_get_folder (store, _("Templates"), CAMEL_STORE_FOLDER_CREATE, NULL); + + /* Get from the currently selected folder, the currently selected message */ + reply_to = camel_folder_get_message (userdata->t->folder, + g_ptr_array_index (userdata->t->uids, 0), + NULL); + + /* The message we'll be using has been stored when building the menu */ + template = userdata->msg; + + /* The new message we are creating */ + new = camel_mime_message_new(); + + /* Add the headers from the message we are replying to, so CC and that + * stuff is preserved. + */ + header = ((CamelMimePart *)reply_to)->headers; + while (header) { + if (g_ascii_strncasecmp (header->name, "content-", 8) != 0) { + camel_medium_add_header((CamelMedium *) new, + header->name, + header->value); + } + header = header->next; + } + + camel_mime_part_set_encoding((CamelMimePart *) new, CAMEL_TRANSFER_ENCODING_8BIT); + + /* Get the template content. */ + cont = get_content (template); + + /* Set the To: field to the same To: field of the message we are replying to. */ + camel_mime_message_set_recipients (new, CAMEL_RECIPIENT_TYPE_TO, + camel_mime_message_get_from (reply_to)); + + + /* Copy the CC and BCC from the template.*/ + camel_mime_message_set_recipients (new, CAMEL_RECIPIENT_TYPE_CC, + camel_mime_message_get_recipients (template, CAMEL_RECIPIENT_TYPE_CC)); + + camel_mime_message_set_recipients (new, CAMEL_RECIPIENT_TYPE_BCC, + camel_mime_message_get_recipients (template, CAMEL_RECIPIENT_TYPE_BCC)); + + camel_mime_part_set_content((CamelMimePart *)new, + cont, (int) g_utf8_strlen(cont, -1), "text"); + + /* Create the composer */ + em_utils_edit_message (new, templates_folder); + + camel_object_unref(new); +} + +static void +popup_free (EPopup *ep, GSList *l, void *data) +{ + g_slist_free (l); +} + +static GSList +*append_to_menu (CamelFolder *folder, GPtrArray *uids, GSList *list, EMPopupTargetSelect *t) +{ + int i; + + for (i = 0; i < uids->len; i++) { + const char *subject; + char *path; + EPopupItem *item; + CamelMimeMessage *message; + const char *uid; + + uid = g_strdup (g_ptr_array_index (uids, i)); + + /* Same as in fill_submenu */ + if (!g_str_has_suffix (folder->name, "Templates")) + path = g_strdup_printf ("80.%s", folder->full_name); + else + path = "80.Templates"; + + /* If this uid is trashed, ignore it */ + if (camel_folder_get_message_flags (folder, uid) & CAMEL_MESSAGE_DELETED) + continue; + + /* Get the message for this uid */ + message = camel_folder_get_message (folder, + uid, + NULL); + + subject = camel_mime_message_get_subject (message); + + /* Create the menu item for it */ + item = g_slice_alloc0(sizeof(*item)); + item->type = E_POPUP_ITEM; + item->path = g_strdup_printf ("%s/%02d", path, i); + item->label = g_strdup ((strlen(subject) > 0) ? subject : _("No title")); + item->visible = EM_POPUP_SELECT_MANY | EM_POPUP_SELECT_ONE; + + /* Make some info available to the callback */ + UserData *user_data; + user_data = g_slice_new(UserData); + user_data->msg = message; + user_data->t = t; + + item->user_data = user_data; + item->activate = reply_with_template; + + list = g_slist_prepend (list, item); + } + + return list; +} + +static GSList +*fill_submenu (CamelStore *store, CamelFolderInfo *info, GSList *list, EMPopupTargetSelect *t) +{ + while (info) { + CamelFolder *folder; + GPtrArray *uids; + EPopupItem *item; + + folder = camel_store_get_folder (store, info->full_name, 0, NULL); + + item = g_slice_alloc0(sizeof(*item)); + item->type = E_POPUP_SUBMENU; + item->label = folder->name; + item->visible = EM_POPUP_SELECT_MANY | EM_POPUP_SELECT_ONE; + + /* To avoid having a Templates dir, we ignore the top level */ + if (!g_str_has_suffix (folder->name, "Templates")) + item->path = g_strdup_printf ("80.%s", folder->full_name); + else + item->path = "80.Templates"; + + list = g_slist_prepend (list, item); + + /* Get the uids for this folder and fill them in the menu */ + uids = camel_folder_get_uids (folder); + list = append_to_menu (folder, uids, list, t); + camel_folder_free_uids (folder, uids); + + /* If the folder has a child, call this function again */ + if (info->child) { + list = fill_submenu (store, info->child, list, t); + } + + info = info->next; + } + + return list; +} + +void +org_gnome_templates_popup (EPlugin *ep, EMPopupTargetSelect *t) +{ + CamelFolder *templates_folder; + CamelFolderInfo *templates_info; + CamelStore *store; + char *basedir; + char *url; + + GSList *list = NULL; + + /* We get the templates folder and all the uids of the messages in there */ + basedir = g_build_filename (g_get_home_dir (), ".evolution", "mail", "local", NULL); + url = g_strdup_printf ("mbox://%s", basedir); + + g_free (basedir); + + store = (CamelStore *) camel_session_get_service (session, url, CAMEL_PROVIDER_STORE, NULL); + g_free (url); + + templates_folder = camel_store_get_folder (store, _("Templates"), CAMEL_STORE_FOLDER_CREATE, NULL); + + templates_info = camel_store_get_folder_info (store, + templates_folder->full_name, + CAMEL_STORE_FOLDER_INFO_RECURSIVE | CAMEL_STORE_FOLDER_INFO_FAST, + NULL); + + /* Get subfolders and fill it */ + list = fill_submenu (store, templates_info, list, t); + + e_popup_add_items (t->target.popup, list, NULL, popup_free, NULL); + + return; +} + +static void +action_template_cb (GtkAction *action, + EMsgComposer *composer) +{ + CamelMessageInfo *info; + CamelMimeMessage *msg; + CamelStore *store; + CamelFolder *templates_folder; + + char *basedir; + char *url; + + /* We get the templates folder and all the uids of the messages in there */ + basedir = g_build_filename (g_get_home_dir (), ".evolution", "mail", "local", NULL); + url = g_strdup_printf ("mbox://%s", basedir); + g_free (basedir); + + store = (CamelStore *) camel_session_get_service (session, url, CAMEL_PROVIDER_STORE, NULL); + g_free (url); + + templates_folder = camel_store_get_folder (store, _("Templates"), CAMEL_STORE_FOLDER_CREATE, NULL); + + msg = e_msg_composer_get_message_draft (composer); + info = camel_message_info_new (NULL); + + /* FIXME: what's the ~0 for? :) */ + camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DRAFT, ~0); + + mail_append_mail (templates_folder, msg, info, NULL, composer); + + return; +} + +static GtkActionEntry entries[] = { + + { "Template", + GTK_STOCK_SAVE, + N_("Save as _Template"), + "t", + N_("Save as Template"), + G_CALLBACK (action_template_cb) } +}; + +gboolean +e_plugin_ui_init (GtkUIManager *manager, + EMsgComposer *composer) +{ + GtkhtmlEditor *editor; + + editor = GTKHTML_EDITOR (composer); + + /* Add actions to the "composer" action group. */ + gtk_action_group_add_actions ( + gtkhtml_editor_get_action_group (editor, "composer"), + entries, G_N_ELEMENTS (entries), composer); + + return TRUE; +} diff --git a/plugins/templates/templates.glade b/plugins/templates/templates.glade new file mode 100644 index 0000000000..60720ef3e0 --- /dev/null +++ b/plugins/templates/templates.glade @@ -0,0 +1,126 @@ + + + + + + + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 385 + 189 + True + False + 5 + + + + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + 1 + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_START + 6 + + + + True + True + True + gtk-add + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + gtk-edit + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + + -- cgit v1.2.3 From e84757b92e0c767f79099d0cf738f1ca998abf5e Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Sun, 20 Jul 2008 19:19:03 +0000 Subject: Committing on behalf of Milan Crha 2008-07-16 Milan Crha ** Fix for bug #543134 * mail-notification.c: (get_cfg_widget), (do_properties), (popup_menu_status), (new_notify_status), (e_plugin_lib_get_configure_widget): Show popup menu when right-click over the status icon. svn path=/trunk/; revision=35782 --- plugins/mail-notification/ChangeLog | 9 ++ plugins/mail-notification/mail-notification.c | 137 +++++++++++++++++++++----- 2 files changed, 120 insertions(+), 26 deletions(-) (limited to 'plugins') diff --git a/plugins/mail-notification/ChangeLog b/plugins/mail-notification/ChangeLog index b14337ce9a..17dc034bee 100644 --- a/plugins/mail-notification/ChangeLog +++ b/plugins/mail-notification/ChangeLog @@ -1,3 +1,12 @@ +2008-07-16 Milan Crha + + ** Fix for bug #543134 + + * mail-notification.c: (get_cfg_widget), (do_properties), + (popup_menu_status), (new_notify_status), + (e_plugin_lib_get_configure_widget): + Show popup menu when right-click over the status icon. + 2008-01-28 Johnny Jacob * mail-notification.c (new_notify_status): Adding proper diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 8af29023b8..3625ecf9ee 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -55,6 +55,7 @@ #define GCONF_KEY_ENABLED_SOUND GCONF_KEY_ROOT "sound-enabled" static gboolean enabled = FALSE; +static GtkWidget *get_cfg_widget (void); /** * each part should "implement" its own "public" functions: @@ -347,6 +348,82 @@ toggled_status_cb (GtkWidget *widget, gpointer data) /* ------------------------------------------------------------------- */ +static void +do_properties (GtkMenuItem *item, gpointer user_data) +{ + GtkWidget *cfg, *dialog, *vbox, *label, *hbox; + char *text; + + cfg = get_cfg_widget (); + if (!cfg) + return; + + text = g_strconcat ("", _("Evolution's Mail Notification"), "", NULL); + + vbox = gtk_vbox_new (FALSE, 10); + label = gtk_label_new (NULL); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_label_set_markup (GTK_LABEL (label), text); + g_free (text); + + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + gtk_widget_show (label); + gtk_widget_show (vbox); + + hbox = gtk_hbox_new (FALSE, 10); + label = gtk_label_new (" "); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + gtk_widget_show_all (hbox); + + gtk_box_pack_start (GTK_BOX (hbox), cfg, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); + + dialog = gtk_dialog_new_with_buttons (_("Mail Notification Properties"), + NULL, + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, + NULL); + + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); + gtk_widget_set_size_request (dialog, 400, -1); + g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); + gtk_widget_show (dialog); +} + +static void +popup_menu_status (GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data) +{ + GtkMenu *menu; + GtkWidget *item; + + menu = GTK_MENU (gtk_menu_new ()); + + item = gtk_image_menu_item_new_from_stock (GTK_STOCK_CLOSE, NULL); + #ifdef HAVE_LIBNOTIFY + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (icon_activated), notify); + #else + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (icon_activated), NULL); + #endif + gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_separator_menu_item_new (); + gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + item = gtk_image_menu_item_new_from_stock (GTK_STOCK_PROPERTIES, NULL); + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (do_properties), NULL); + gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + + g_object_ref_sink (menu); + gtk_menu_popup (menu, NULL, NULL, NULL, NULL, button, activate_time); + g_object_unref (menu); +} + static void new_notify_status (EMEventTargetFolder *t) { @@ -399,6 +476,8 @@ new_notify_status (EMEventTargetFolder *t) #else g_signal_connect (G_OBJECT (status_icon), "activate", G_CALLBACK (icon_activated), NULL); #endif + + g_signal_connect (G_OBJECT (status_icon), "popup-menu", G_CALLBACK (popup_menu_status), NULL); } static void @@ -694,6 +773,37 @@ toggled_only_inbox_cb (GtkWidget *widget, gpointer data) set_part_enabled (GCONF_KEY_NOTIFY_ONLY_INBOX, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))); } +static GtkWidget * +get_cfg_widget (void) +{ + GtkWidget *cfg, *vbox, *check; + + vbox = gtk_vbox_new (FALSE, 6); + check = gtk_check_button_new_with_mnemonic (_("Notify new messages for _Inbox only")); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), is_part_enabled (GCONF_KEY_NOTIFY_ONLY_INBOX)); + g_signal_connect (G_OBJECT (check), "toggled", G_CALLBACK (toggled_only_inbox_cb), NULL); + gtk_widget_show (check); + gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); + +#ifdef HAVE_DBUS + cfg = get_config_widget_dbus (); + if (cfg) + gtk_box_pack_start (GTK_BOX (vbox), cfg, FALSE, FALSE, 0); +#endif + cfg = get_config_widget_status (); + if (cfg) + gtk_box_pack_start (GTK_BOX (vbox), cfg, FALSE, FALSE, 0); + + cfg = get_config_widget_sound (); + if (cfg) + gtk_box_pack_start (GTK_BOX (vbox), cfg, FALSE, FALSE, 0); + + gtk_widget_show (vbox); + + return vbox; +} + void org_gnome_mail_new_notify (EPlugin *ep, EMEventTargetFolder *t); void org_gnome_mail_read_notify (EPlugin *ep, EMEventTargetMessage *t); @@ -779,30 +889,5 @@ e_plugin_lib_enable (EPluginLib *ep, int enable) GtkWidget * e_plugin_lib_get_configure_widget (EPlugin *epl) { - GtkWidget *cfg, *vbox, *check; - - vbox = gtk_vbox_new (FALSE, 6); - check = gtk_check_button_new_with_mnemonic (_("Notify new messages for _Inbox only")); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), is_part_enabled (GCONF_KEY_NOTIFY_ONLY_INBOX)); - g_signal_connect (G_OBJECT (check), "toggled", G_CALLBACK (toggled_only_inbox_cb), NULL); - gtk_widget_show (check); - gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); - -#ifdef HAVE_DBUS - cfg = get_config_widget_dbus (); - if (cfg) - gtk_box_pack_start (GTK_BOX (vbox), cfg, FALSE, FALSE, 0); -#endif - cfg = get_config_widget_status (); - if (cfg) - gtk_box_pack_start (GTK_BOX (vbox), cfg, FALSE, FALSE, 0); - - cfg = get_config_widget_sound (); - if (cfg) - gtk_box_pack_start (GTK_BOX (vbox), cfg, FALSE, FALSE, 0); - - gtk_widget_show (vbox); - - return vbox; + return get_cfg_widget (); } -- cgit v1.2.3 From 2f7cca97077d08faefd8c1b84c1c051401bb0308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rgen=20Scheibengruber?= Date: Mon, 21 Jul 2008 04:10:09 +0000 Subject: =?UTF-8?q?Committing=20on=20behalf=20of=20J=C3=B6rgen=20Scheibeng?= =?UTF-8?q?ruber=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-05-24 Jörgen Scheibengruber * Makefile.am: * google-contacts-source.c (ensure_google_contacts_source_group), (remove_google_contacts_source_group), (on_username_entry_changed), (on_update_cb_toggled), (on_interval_sb_value_changed), (plugin_google_contacts): * google-contacts-source.h: * google-source.c (e_plugin_lib_enable): * org-gnome-evolution-google.eplug.xml: Added a UI for the addressbook part svn path=/trunk/; revision=35797 --- plugins/google-account-setup/ChangeLog | 12 + plugins/google-account-setup/Makefile.am | 5 +- .../google-account-setup/google-contacts-source.c | 264 +++++++++++++++++++++ .../google-account-setup/google-contacts-source.h | 30 +++ plugins/google-account-setup/google-source.c | 5 + .../org-gnome-evolution-google.eplug.xml | 12 +- 6 files changed, 324 insertions(+), 4 deletions(-) create mode 100644 plugins/google-account-setup/google-contacts-source.c create mode 100644 plugins/google-account-setup/google-contacts-source.h (limited to 'plugins') diff --git a/plugins/google-account-setup/ChangeLog b/plugins/google-account-setup/ChangeLog index a1019c05e7..186c224f21 100644 --- a/plugins/google-account-setup/ChangeLog +++ b/plugins/google-account-setup/ChangeLog @@ -1,3 +1,15 @@ +2008-05-24 Jörgen Scheibengruber + + * Makefile.am: + * google-contacts-source.c (ensure_google_contacts_source_group), + (remove_google_contacts_source_group), (on_username_entry_changed), + (on_update_cb_toggled), (on_interval_sb_value_changed), + (plugin_google_contacts): + * google-contacts-source.h: + * google-source.c (e_plugin_lib_enable): + * org-gnome-evolution-google.eplug.xml: + Added a UI for the addressbook part + 2008-03-31 Suman Manjunath ** Fix for bug #346555 diff --git a/plugins/google-account-setup/Makefile.am b/plugins/google-account-setup/Makefile.am index 898083c65a..d1c385b172 100644 --- a/plugins/google-account-setup/Makefile.am +++ b/plugins/google-account-setup/Makefile.am @@ -1,5 +1,6 @@ INCLUDES = \ $(EVOLUTION_CALENDAR_CFLAGS) \ + $(EVOLUTION_ADDRESSBOOK_CFLAGS) \ -I . \ -I$(top_srcdir) \ -DCALDAV_GLADEDIR=\""$(gladedir)"\" @@ -10,7 +11,9 @@ plugin_DATA = org-gnome-evolution-google.eplug plugin_LTLIBRARIES = liborg-gnome-evolution-google.la liborg_gnome_evolution_google_la_SOURCES = \ - google-source.c + google-source.c \ + google-contacts-source.h \ + google-contacts-source.c liborg_gnome_evolution_google_la_LIBADD = \ $(EVOLUTION_CALENDAR_LIBS) \ diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c new file mode 100644 index 0000000000..64d3363ea9 --- /dev/null +++ b/plugins/google-account-setup/google-contacts-source.c @@ -0,0 +1,264 @@ +/* + * Copyright 2008, Joergen Scheibengruber + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "google-contacts-source.h" + + +void +ensure_google_contacts_source_group (void) +{ + ESourceList *source_list; + ESourceGroup *group; + + source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources"); + + if (source_list == NULL) { + return; + } + + group = e_source_list_peek_group_by_name (source_list, _("Google")); + + if (group == NULL) { + gboolean res; + + group = e_source_group_new (_("Google"), "google://"); + res = e_source_list_add_group (source_list, group, -1); + + if (res == FALSE) { + g_warning ("Could not add Google source group!"); + } else { + e_source_list_sync (source_list, NULL); + } + + g_object_unref (group); + } + g_object_unref (source_list); +} + +void +remove_google_contacts_source_group (void) +{ + ESourceList *source_list; + ESourceGroup *group; + + source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources"); + + if (source_list == NULL) { + return; + } + + group = e_source_list_peek_group_by_name (source_list, _("Google")); + + if (group) { + GSList *sources; + + sources = e_source_group_peek_sources (group); + + if (NULL == sources) { + e_source_list_remove_group (source_list, group); + e_source_list_sync (source_list, NULL); + } + } + g_object_unref (source_list); +} + +static void +on_username_entry_changed (GtkEntry *entry, gpointer user_data) +{ + ESource *source = user_data; + const char *text; + char *username; + + text = gtk_entry_get_text (entry); + + if (strstr (text, "@")) { + username = g_strdup (text); + } else { + username = g_strdup_printf ("%s@gmail.com", text); + } + + e_source_set_relative_uri (source, username); + e_source_set_property (source, "username", username); + e_source_set_property (source, "auth", "plain/password"); + g_free (username); +} + +static void +on_update_cb_toggled (GtkToggleButton *tb, gpointer user_data) +{ + ESource *source = user_data; + GtkWidget *sb = g_object_get_data (G_OBJECT (tb), "sb"); + + gtk_widget_set_sensitive (sb, gtk_toggle_button_get_active (tb)); + if (gtk_toggle_button_get_active (tb)) { + gdouble value; + char *value_string; + + value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (sb)); + value_string = g_strdup_printf ("%d", (int)(value * 60.0)); + e_source_set_property (source, "refresh-interval", value_string); + g_free (value_string); + } else { + e_source_set_property (source, "refresh-interval", "-1"); + } +} + +static void +on_interval_sb_value_changed (GtkSpinButton *sb, gpointer user_data) +{ + ESource *source = user_data; + gdouble value; + char *value_string; + + value = gtk_spin_button_get_value (sb); + value_string = g_strdup_printf ("%d", (int)(value * 60.0)); + e_source_set_property (source, "refresh-interval", value_string); + g_free (value_string); +} + +GtkWidget * +plugin_google_contacts (EPlugin *epl, + EConfigHookItemFactoryData *data) +{ + EABConfigTargetSource *t = (EABConfigTargetSource *) data->target; + ESource *source; + ESourceGroup *group; + const char *base_uri; + const char *username; + const char *refresh_interval_str; + int refresh_interval; + GtkWidget *parent; + GtkWidget *vbox; + + GtkWidget *section; + GtkWidget *vbox2; + + GtkWidget *hbox; + GtkWidget *spacer; + GtkWidget *label; + GtkWidget *username_entry; + + GtkWidget *update_cb; + GtkWidget *interval_sb; + + + source = t->source; + group = e_source_peek_group (source); + + base_uri = e_source_group_peek_base_uri (group); + + g_object_set_data_full (G_OBJECT (epl), "widget", NULL, + (GDestroyNotify)gtk_widget_destroy); + + if (strcmp (base_uri, "google://")) { + return NULL; + } + + /* Build up the UI */ + parent = data->parent; + vbox = gtk_widget_get_ancestor (gtk_widget_get_parent (parent), GTK_TYPE_VBOX); + + vbox2 = gtk_vbox_new (FALSE, 6); + gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0); + + section = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (section), _("Server")); + gtk_misc_set_alignment (GTK_MISC (section), 0.0, 0.0); + gtk_box_pack_start (GTK_BOX (vbox2), section, FALSE, FALSE, 0); + + hbox = gtk_hbox_new (FALSE, 10); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, TRUE, 0); + + spacer = gtk_label_new (" "); + gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0); + + label = gtk_label_new (_("Username:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + username_entry = gtk_entry_new (); + username = e_source_get_property (source, "username"); + if (username) { + gtk_entry_set_text (GTK_ENTRY (username_entry), username); + } + gtk_box_pack_start (GTK_BOX (hbox), username_entry, TRUE, TRUE, 0); + + hbox = gtk_hbox_new (FALSE, 10); + gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, TRUE, 0); + + spacer = gtk_label_new (" "); + gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0); + + refresh_interval_str = e_source_get_property (source, "refresh-interval"); + if (refresh_interval_str && + (1 == sscanf (refresh_interval_str, "%d", &refresh_interval))) { + } else { + refresh_interval = -1; + } + update_cb = gtk_check_button_new_with_label (_("Update every")); + gtk_box_pack_start (GTK_BOX (hbox), update_cb, FALSE, FALSE, 0); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (update_cb), + refresh_interval > 0); + + interval_sb = gtk_spin_button_new_with_range (1, 60, 1); + gtk_widget_set_sensitive (interval_sb, + refresh_interval > 0); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (interval_sb), + refresh_interval > 0 ? refresh_interval / 60 : 30); + gtk_box_pack_start (GTK_BOX (hbox), interval_sb, FALSE, FALSE, 0); + + label = gtk_label_new (_("minute(s)")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + gtk_widget_show_all (vbox2); + + g_object_set_data (G_OBJECT (update_cb), "sb", interval_sb); + g_object_set_data_full (G_OBJECT (epl), "widget", vbox2, + (GDestroyNotify)gtk_widget_destroy); + + g_signal_connect (G_OBJECT (username_entry), "changed", + G_CALLBACK (on_username_entry_changed), + source); + g_signal_connect (G_OBJECT (update_cb), "toggled", + G_CALLBACK (on_update_cb_toggled), + source); + g_signal_connect (G_OBJECT (interval_sb), "value-changed", + G_CALLBACK (on_interval_sb_value_changed), + source); + + return NULL; +} + + diff --git a/plugins/google-account-setup/google-contacts-source.h b/plugins/google-account-setup/google-contacts-source.h new file mode 100644 index 0000000000..17421fb232 --- /dev/null +++ b/plugins/google-account-setup/google-contacts-source.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008, Joergen Scheibengruber + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU Lesser General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef __GOOGLE_CONTACTS_SOURCE_H__ +#define __GOOGLE_CONTACTS_SOURCE_H__ + +GtkWidget *plugin_google_contacts (EPlugin *epl, + EConfigHookItemFactoryData *data); + +void ensure_google_contacts_source_group (void); + +void remove_google_contacts_source_group (void); + +#endif diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c index d586b3027e..7e73b5b8ba 100644 --- a/plugins/google-account-setup/google-source.c +++ b/plugins/google-account-setup/google-source.c @@ -41,6 +41,8 @@ #include #include +#include "google-contacts-source.h" + #define CALENDAR_LOCATION "http://www.google.com/calendar/feeds/" #define d(x) @@ -96,6 +98,9 @@ e_plugin_lib_enable (EPluginLib *ep, int enable) if (enable) { d(printf ("\n Google Eplugin starting up ...\n")); ensure_google_source_group (); + ensure_google_contacts_source_group (); + } else { + remove_google_contacts_source_group (); } return 0; diff --git a/plugins/google-account-setup/org-gnome-evolution-google.eplug.xml b/plugins/google-account-setup/org-gnome-evolution-google.eplug.xml index d6087ad748..a172ba8923 100644 --- a/plugins/google-account-setup/org-gnome-evolution-google.eplug.xml +++ b/plugins/google-account-setup/org-gnome-evolution-google.eplug.xml @@ -3,11 +3,17 @@ - <_description>A plugin to setup google calendar. - + + <_description>A plugin to setup google calendar and contacts. + - + + + + + + -- cgit v1.2.3 From 28a805375c43f4d34072c147660d741d1d9c6610 Mon Sep 17 00:00:00 2001 From: Bharath Acharya Date: Mon, 21 Jul 2008 04:22:52 +0000 Subject: Committing on behalf of Ashish Shrivastava Added the missing glade file during previous commit svn path=/trunk/; revision=35798 --- .../email-custom-header/email-custom-header.glade | 176 +++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 plugins/email-custom-header/email-custom-header.glade (limited to 'plugins') diff --git a/plugins/email-custom-header/email-custom-header.glade b/plugins/email-custom-header/email-custom-header.glade new file mode 100644 index 0000000000..14a618f977 --- /dev/null +++ b/plugins/email-custom-header/email-custom-header.glade @@ -0,0 +1,176 @@ + + + + + + + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + False + 0 + + + + True + The format for specifying a Custom Header key value is: +Name of the Custom Header key values separated by ";". + False + False + GTK_JUSTIFY_CENTER + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + 0 + False + False + + + + + + True + False + 5 + + + + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + 1 + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_START + 6 + + + + True + True + True + gtk-add + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + gtk-edit + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + + + + + 0 + False + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + -- cgit v1.2.3 From f0ade74bd16f1642cfd11d357c0d256606a8b5a4 Mon Sep 17 00:00:00 2001 From: Johnny Jacob Date: Mon, 21 Jul 2008 15:13:56 +0000 Subject: Templates EPlugin : Remove unused header files. svn path=/trunk/; revision=35805 --- plugins/templates/ChangeLog | 6 ++++++ plugins/templates/Makefile.am | 1 + plugins/templates/templates.c | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/templates/ChangeLog b/plugins/templates/ChangeLog index edba4e2d99..c559689e43 100644 --- a/plugins/templates/ChangeLog +++ b/plugins/templates/ChangeLog @@ -1,3 +1,9 @@ +2008-07-21 Johnny Jacob + + * templates.c: Remove unused header files. + + * Makefile.am (INCLUDES): Allow includes from top_builddir. + 2008-07-18 Bharath Acharya ** Fixes Bug #200147 diff --git a/plugins/templates/Makefile.am b/plugins/templates/Makefile.am index 91da6c1ed9..f43dce0992 100644 --- a/plugins/templates/Makefile.am +++ b/plugins/templates/Makefile.am @@ -1,5 +1,6 @@ INCLUDES = \ -I$(top_srcdir) \ + -I$(top_builddir) \ -I$(top_builddir)/composer \ $(EVOLUTION_MAIL_CFLAGS) \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index d06224c6a7..c72ae942a9 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -41,7 +41,6 @@ #include #include -#include #include #include #include -- cgit v1.2.3 From 46fd1c12d0e7d0e277cc584d6ffb688fbf067673 Mon Sep 17 00:00:00 2001 From: Johnny Jacob Date: Mon, 21 Jul 2008 15:57:31 +0000 Subject: EPlugin : Python Loader : Add example sources to dist svn path=/trunk/; revision=35807 --- plugins/python/ChangeLog | 5 +++++ plugins/python/Makefile.am | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/python/ChangeLog b/plugins/python/ChangeLog index 43a0bd3482..ca2b9e38b7 100644 --- a/plugins/python/ChangeLog +++ b/plugins/python/ChangeLog @@ -1,3 +1,8 @@ +2008-07-21 Johnny Jacob + + * Makefile.am (example_SOURCES): Add example sources + EXTRA_DIST. + 2008-06-12 Johnny Jacob * example/org-gnome-hello-python-ui.xml: Added. diff --git a/plugins/python/Makefile.am b/plugins/python/Makefile.am index 854c7915f6..69fd437312 100644 --- a/plugins/python/Makefile.am +++ b/plugins/python/Makefile.am @@ -15,7 +15,14 @@ liborg_gnome_evolution_python_la_LIBADD = \ $(PY_LIBS) \ $(E_UTIL_LIBS) -EXTRA_DIST = org-gnome-evolution-python.eplug.xml +example_sources = \ + examples/hello_python.py \ + examples/org-gnome-hello-python-ui.xml \ + examples/org-gnome-hello-python.eplug.xml \ + examples/Makefile.am + +EXTRA_DIST = org-gnome-evolution-python.eplug.xml \ + $(example_sources) BUILT_SOURCES = $(plugin_DATA) CLEANFILES = $(BUILT_SOURCES) -- cgit v1.2.3 From 36d32a3cde1b84f7304db0996394b35918c27b28 Mon Sep 17 00:00:00 2001 From: Johnny Jacob Date: Mon, 21 Jul 2008 17:20:18 +0000 Subject: Another typo fix. Lesson learnt - Don't commit when you are sleepy ! svn path=/trunk/; revision=35812 --- plugins/python/ChangeLog | 4 ++++ plugins/python/Makefile.am | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/python/ChangeLog b/plugins/python/ChangeLog index ca2b9e38b7..063418150e 100644 --- a/plugins/python/ChangeLog +++ b/plugins/python/ChangeLog @@ -1,3 +1,7 @@ +2008-07-21 Johnny Jacob + + * Makefile.am (example_sources): More typo fixes. :( + 2008-07-21 Johnny Jacob * Makefile.am (example_SOURCES): Add example sources diff --git a/plugins/python/Makefile.am b/plugins/python/Makefile.am index 69fd437312..7a65c4586a 100644 --- a/plugins/python/Makefile.am +++ b/plugins/python/Makefile.am @@ -16,10 +16,10 @@ liborg_gnome_evolution_python_la_LIBADD = \ $(E_UTIL_LIBS) example_sources = \ - examples/hello_python.py \ - examples/org-gnome-hello-python-ui.xml \ - examples/org-gnome-hello-python.eplug.xml \ - examples/Makefile.am + example/hello_python.py \ + example/org-gnome-hello-python-ui.xml \ + example/org-gnome-hello-python.eplug.xml \ + example/Makefile.am EXTRA_DIST = org-gnome-evolution-python.eplug.xml \ $(example_sources) -- cgit v1.2.3 From 5e4b6fcb89797b533b9a741c491ec592d2a06721 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 22 Jul 2008 08:43:06 +0000 Subject: ** Fix for bug #544022 2008-07-22 Milan Crha ** Fix for bug #544022 * configure.in: Do not redefine DBUS_VERSION define supplied by dbus itself, rather rename our define to FOUND_DBUS_VERSION. * mail/e-searching-tokenizer.c: (dump_trie): Define function only when required. (Compiler warning cleanup.) * shell/e-shell-window-commands.c: (char *authors[]): Break the escape sequence properly (compiler warning cleanup). * plugins/email-custom-header/email-custom-header.c: Compiler warning cleanup. * plugins/mail-notification/Makefile.am: * plugins/mail-notification/mail-notification.c: (send_dbus_message): Do not redefine DBUS_VERSION define, it's supplied by dbus itself. svn path=/trunk/; revision=35819 --- plugins/email-custom-header/ChangeLog | 6 ++++++ plugins/email-custom-header/email-custom-header.c | 2 ++ plugins/mail-notification/ChangeLog | 8 ++++++++ plugins/mail-notification/Makefile.am | 2 +- plugins/mail-notification/mail-notification.c | 4 ++-- 5 files changed, 19 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/email-custom-header/ChangeLog b/plugins/email-custom-header/ChangeLog index f40af40522..359dc8bbbb 100644 --- a/plugins/email-custom-header/ChangeLog +++ b/plugins/email-custom-header/ChangeLog @@ -1,3 +1,9 @@ +2008-07-22 Milan Crha + + ** Part of fix for bug #544022 + + * email-custom-header.c: Compiler warning cleanup. + 2008-06-25 Ashish Shrivastava * email-custom-header.glade: Marked strings for translation. diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index 5579e9c420..6918a9b43c 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -33,6 +33,7 @@ #include "mail/em-event.h" #include "composer/e-msg-composer.h" #include "libedataserver/e-account.h" +#include "e-util/e-config.h" #include "email-custom-header.h" @@ -81,6 +82,7 @@ static void commit_changes (ConfigData *cd); int e_plugin_lib_enable (EPluginLib *ep, int enable); GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl); gboolean e_plugin_ui_init(GtkUIManager *manager, EMsgComposer *composer); +GtkWidget *org_gnome_email_custom_header_config_option (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data); int e_plugin_lib_enable (EPluginLib *ep, int enable) diff --git a/plugins/mail-notification/ChangeLog b/plugins/mail-notification/ChangeLog index 17dc034bee..0d1c8e60ca 100644 --- a/plugins/mail-notification/ChangeLog +++ b/plugins/mail-notification/ChangeLog @@ -1,3 +1,11 @@ +2008-07-22 Milan Crha + + ** Part of fix for bug #544022 + + * Makefile.am: + * mail-notification.c: (send_dbus_message): Do not redefine + DBUS_VERSION define, it's supplied by dbus itself. + 2008-07-16 Milan Crha ** Fix for bug #543134 diff --git a/plugins/mail-notification/Makefile.am b/plugins/mail-notification/Makefile.am index 38b4f051f7..86fc91cc11 100644 --- a/plugins/mail-notification/Makefile.am +++ b/plugins/mail-notification/Makefile.am @@ -5,7 +5,7 @@ INCLUDES = \ if ENABLE_DBUS INCLUDES += -DDBUS_API_SUBJECT_TO_CHANGE=1 \ - -DDBUS_VERSION=$(DBUS_VERSION) \ + -DFOUND_DBUS_VERSION=$(FOUND_DBUS_VERSION) \ $(NMN_CFLAGS) endif diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 3625ecf9ee..f9bfd4b8dd 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -136,7 +136,7 @@ send_dbus_message (const char *name, const char *data, guint new) /* Appends the data as an argument to the message */ dbus_message_append_args (message, -#if DBUS_VERSION >= 310 +#if FOUND_DBUS_VERSION >= 310 DBUS_TYPE_STRING, &data, #else DBUS_TYPE_STRING, data, @@ -146,7 +146,7 @@ send_dbus_message (const char *name, const char *data, guint new) if (new) { char * display_name = em_utils_folder_name_from_uri (data); dbus_message_append_args (message, -#if DBUS_VERSION >= 310 +#if FOUND_DBUS_VERSION >= 310 DBUS_TYPE_STRING, &display_name, DBUS_TYPE_UINT32, &new, #else DBUS_TYPE_STRING, display_name, DBUS_TYPE_UINT32, new, -- cgit v1.2.3 From db69b559f3423717326f984f290f8ed1ae6c1a61 Mon Sep 17 00:00:00 2001 From: Lucian Langa Date: Mon, 28 Jul 2008 05:17:20 +0000 Subject: ** See bug #504417 2008-07-28 Lucian Langa ** See bug #504417 * bbdb.c: - Preferences window cut off svn path=/trunk/; revision=35846 --- plugins/bbdb/ChangeLog | 6 ++++++ plugins/bbdb/bbdb.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/bbdb/ChangeLog b/plugins/bbdb/ChangeLog index 18b7b6afbc..6f3e48a8d0 100644 --- a/plugins/bbdb/ChangeLog +++ b/plugins/bbdb/ChangeLog @@ -1,3 +1,9 @@ +2008-07-28 Lucian Langa + + ** See bug #504417 + + * bbdb.c: - Preferences window cut off + 2008-01-10 Milan Crha ** Fix for bug #496402 diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c index feac342232..23595be330 100644 --- a/plugins/bbdb/bbdb.c +++ b/plugins/bbdb/bbdb.c @@ -562,7 +562,7 @@ bbdb_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) gtk_box_pack_start (GTK_BOX (hbox), inner_vbox, FALSE, FALSE, 0); /* Enable BBDB checkbox */ - check = gtk_check_button_new_with_mnemonic (_("_Automatically create entries in the addressbook when responding to messages")); + check = gtk_check_button_new_with_mnemonic (_("_Auto-create addressbook entries when replying to messages")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gconf_client_get_bool (target->gconf, GCONF_KEY_ENABLE, NULL)); g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (enable_toggled_cb), stuff); gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0); @@ -598,7 +598,7 @@ bbdb_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) gtk_box_pack_start (GTK_BOX (hbox), inner_vbox, FALSE, FALSE, 0); /* Enable Gaim Checkbox */ - check_gaim = gtk_check_button_new_with_mnemonic (_("Periodically synchronize contact information and images from Pidgin buddy list")); + check_gaim = gtk_check_button_new_with_mnemonic (_("Synchronize contact info and images from Pidgin buddy list")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_gaim), gconf_client_get_bool (target->gconf, GCONF_KEY_ENABLE_GAIM, NULL)); g_signal_connect (GTK_TOGGLE_BUTTON (check_gaim), "toggled", G_CALLBACK (enable_gaim_toggled_cb), stuff); gtk_box_pack_start (GTK_BOX (inner_vbox), check_gaim, FALSE, FALSE, 0); -- cgit v1.2.3 From cd2440f430c449200f36bb73cc2e14b5d2ed9585 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 28 Jul 2008 07:23:03 +0000 Subject: ** Fix for bug #491176 2008-07-28 Milan Crha ** Fix for bug #491176 * itip-view.c: (itip_view_init): Word-wrap the summary if necessary; expand also value-labels in the table, thus the text will be aligned on the left; align action buttons on the left too. svn path=/trunk/; revision=35848 --- plugins/itip-formatter/ChangeLog | 8 ++++++++ plugins/itip-formatter/itip-view.c | 16 +++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog index a59b464bda..6d6d93f1e2 100644 --- a/plugins/itip-formatter/ChangeLog +++ b/plugins/itip-formatter/ChangeLog @@ -1,3 +1,11 @@ +2008-07-28 Milan Crha + + ** Fix for bug #491176 + + * itip-view.c: (itip_view_init): Word-wrap the summary if necessary; + expand also value-labels in the table, thus the text will be aligned + on the left; align action buttons on the left too. + 2008-07-17 Chenthill Palanisamy * itip-formatter.c: (view_response_cb): Added some diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index d130d3a6f1..061e1daf6b 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -995,8 +995,10 @@ itip_view_init (ItipView *view) /* Summary */ priv->summary_label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (priv->summary_label), 0, 0.5); + gtk_label_set_line_wrap_mode (GTK_LABEL (priv->summary_label), PANGO_WRAP_WORD); + gtk_label_set_line_wrap (GTK_LABEL (priv->summary_label), TRUE); gtk_widget_show (priv->summary_label); - gtk_table_attach (GTK_TABLE (table), priv->summary_label, 0, 2, 0, 1, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), priv->summary_label, 0, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Location */ priv->location_header = gtk_label_new (_("Location:")); @@ -1004,7 +1006,7 @@ itip_view_init (ItipView *view) gtk_misc_set_alignment (GTK_MISC (priv->location_header), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (priv->location_label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), priv->location_header, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->location_label, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), priv->location_label, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Start time */ priv->start_header = gtk_label_new (_("Start time:")); @@ -1013,7 +1015,7 @@ itip_view_init (ItipView *view) gtk_misc_set_alignment (GTK_MISC (priv->start_label), 0, 0.5); gtk_widget_show (priv->start_header); gtk_table_attach (GTK_TABLE (table), priv->start_header, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->start_label, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), priv->start_label, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* End time */ priv->end_header = gtk_label_new (_("End time:")); @@ -1021,7 +1023,7 @@ itip_view_init (ItipView *view) gtk_misc_set_alignment (GTK_MISC (priv->end_header), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (priv->end_label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), priv->end_header, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->end_label, 1, 2, 3, 4, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), priv->end_label, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Status */ priv->status_header = gtk_label_new (_("Status:")); @@ -1029,7 +1031,7 @@ itip_view_init (ItipView *view) gtk_misc_set_alignment (GTK_MISC (priv->status_header), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (priv->status_label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), priv->status_header, 0, 1, 4, 5, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->status_label, 1, 2, 4, 5, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), priv->status_label, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Comment */ priv->comment_header = gtk_label_new (_("Comment:")); @@ -1037,7 +1039,7 @@ itip_view_init (ItipView *view) gtk_misc_set_alignment (GTK_MISC (priv->comment_header), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (priv->comment_label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), priv->comment_header, 0, 1, 5, 6, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->comment_label, 1, 2, 5, 6, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), priv->comment_label, 1, 2, 5, 6, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Upper Info items */ priv->upper_info_box = gtk_vbox_new (FALSE, 12); @@ -1119,7 +1121,7 @@ itip_view_init (ItipView *view) /* The buttons for actions */ priv->button_box = gtk_hbutton_box_new (); - gtk_button_box_set_layout (GTK_BUTTON_BOX (priv->button_box), GTK_BUTTONBOX_END); + gtk_button_box_set_layout (GTK_BUTTON_BOX (priv->button_box), GTK_BUTTONBOX_START); gtk_box_set_spacing (GTK_BOX (priv->button_box), 12); gtk_widget_show (priv->button_box); gtk_box_pack_start (GTK_BOX (vbox), priv->button_box, FALSE, FALSE, 0); -- cgit v1.2.3 From 764a1b7b002565c7115be0f0087fcf8f867a475e Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 28 Jul 2008 07:32:54 +0000 Subject: ** Fix for bug #543756 2008-07-28 Milan Crha ** Fix for bug #543756 * org-gnome-shared-folder.errors.xml: * process-meeting.c: (process_meeting): Make question better translatable. svn path=/trunk/; revision=35851 --- plugins/groupwise-features/ChangeLog | 8 ++++++++ .../groupwise-features/org-gnome-shared-folder.errors.xml | 12 ++++++++++-- plugins/groupwise-features/process-meeting.c | 8 ++++---- 3 files changed, 22 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/ChangeLog b/plugins/groupwise-features/ChangeLog index f0587b07df..5ac0853112 100644 --- a/plugins/groupwise-features/ChangeLog +++ b/plugins/groupwise-features/ChangeLog @@ -1,3 +1,11 @@ +2008-07-28 Milan Crha + + ** Fix for bug #543756 + + * org-gnome-shared-folder.errors.xml: + * process-meeting.c: (process_meeting): + Make question better translatable. + 2008-06-20 Sankar P * mail-retract.c (retract_mail_settings): diff --git a/plugins/groupwise-features/org-gnome-shared-folder.errors.xml b/plugins/groupwise-features/org-gnome-shared-folder.errors.xml index 85ce4ac156..5e7bfb28e5 100644 --- a/plugins/groupwise-features/org-gnome-shared-folder.errors.xml +++ b/plugins/groupwise-features/org-gnome-shared-folder.errors.xml @@ -15,9 +15,17 @@ You cannot share folder with specified user "{0}" - + <_primary>This is a recurring meeting -<_secondary>What would you like to {0}? +<_secondary>Would you like to accept it? +