From e4afd3f9fb962ea1295a0657ec9f83a427829171 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 26 May 2009 23:21:02 -0400 Subject: Remove trailing whitespace, again. --- plugins/groupwise-features/install-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index bfe295447f..29c5ed2855 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -10,7 +10,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see + * License along with the program; if not, see * * * Authors: -- cgit v1.2.3 From 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 27 May 2009 10:29:19 -0400 Subject: Prefer GLib basic types over C types. --- plugins/groupwise-features/install-shared.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 29c5ed2855..c9d4ad54e4 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -57,17 +57,17 @@ struct AcceptData { void org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target); static void -install_folder_response (EMFolderSelector *emfs, int response, gpointer *data) +install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) { struct AcceptData *accept_data = (struct AcceptData *)data; EMFolderTreeModel *model; - const char *uri, *path; - int parts = 0; + const gchar *uri, *path; + gint parts = 0; gchar **names; gchar *folder_name; gchar *parent_name; gchar *container_id; - const char *item_id; + const gchar *item_id; CamelException ex; CamelStore *store; CamelFolder *folder; @@ -106,12 +106,12 @@ install_folder_response (EMFolderSelector *emfs, int response, gpointer *data) if(E_IS_GW_CONNECTION (cnc)) { container_id = get_container_id (cnc, parent_name); - if(e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (char *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { + if(e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { folder = camel_store_get_folder (store, "Mailbox", 0, NULL); /*changes = camel_folder_change_info_new (); - camel_folder_change_info_remove_uid (changes, (char *) item_id); + camel_folder_change_info_remove_uid (changes, (gchar *) item_id); camel_folder_summary_remove_uid (folder->summary, item_id);*/ /* camel_folder_delete_message (folder, item_id); */ camel_folder_set_message_flags (folder, item_id, CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED); @@ -146,7 +146,7 @@ install_folder_response (EMFolderSelector *emfs, int response, gpointer *data) } static void -accept_free(void *data) +accept_free(gpointer data) { struct AcceptData *accept_data = data; @@ -161,7 +161,7 @@ accept_clicked(GnomeDruidPage *page, GtkWidget *druid, CamelMimeMessage *msg) EMFolderTree *folder_tree; GtkWidget *dialog; struct AcceptData *accept_data; - char *uri; + gchar *uri; accept_data = g_new0(struct AcceptData, 1); model = mail_component_peek_tree_model (NULL); @@ -186,20 +186,20 @@ void org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) { const CamelInternetAddress *from_addr = NULL; - const char *name; - const char *email; + const gchar *name; + const gchar *email; GtkWidget *window; GnomeDruid *wizard; GnomeDruidPageEdge *title_page; CamelMimeMessage *msg = (CamelMimeMessage *) target->message; CamelStreamMem *content; CamelDataWrapper *dw; - char *start_message; + gchar *start_message; if (!msg) return; - if (((char *)camel_medium_get_header (CAMEL_MEDIUM(msg),"X-notification")) == NULL + if (((gchar *)camel_medium_get_header (CAMEL_MEDIUM(msg),"X-notification")) == NULL || (from_addr = camel_mime_message_get_from ((CamelMimeMessage *)target->message)) == NULL || !camel_internet_address_get(from_addr, 0, &name, &email) || (dw = camel_medium_get_content_object (CAMEL_MEDIUM (msg))) == NULL) { -- cgit v1.2.3 From 14f8eee012382f04090ea9277e9567d5f32e8bf0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 28 May 2009 13:06:29 -0400 Subject: Whitespace cleanup. --- plugins/groupwise-features/install-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index c9d4ad54e4..67b1b5bdee 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -174,7 +174,7 @@ accept_clicked(GnomeDruidPage *page, GtkWidget *druid, CamelMimeMessage *msg) camel_object_ref(msg); accept_data->model = model; g_object_set_data_full((GObject *)dialog, "accept-data", accept_data, accept_free); - g_signal_connect (dialog, "response", G_CALLBACK (install_folder_response), accept_data); + g_signal_connect (dialog, "response", G_CALLBACK (install_folder_response), accept_data); g_object_set_data_full((GObject *)dialog, "druid", druid, (GDestroyNotify)gtk_widget_destroy); gtk_window_set_title (GTK_WINDOW (dialog), "Install Shared Folder"); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); -- cgit v1.2.3 From be8ee5393471a83b24aed4de1669afd723cb3168 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 9 Jun 2009 23:15:20 -0400 Subject: Use key files for tracking widget states. Each EShellView now maintains a GKeyFile for recording disposable widget state such as tree view path expansion, scroll bar positions, combo box selections, etc. The EShellView records changes to the key file to ~/.evolution//config/state, and automatically restores the GKeyFile at startup. Currently only the mailer uses the key file, but it's intended to serve all shell views. It replaces the use of Camel "cmeta" files, as well as "et-expanded-*" and "folder-tree-expand-state.xml" files. Also, the mailer's folder tree model now includes a column for tracking which sidebar folders are expanded. Folder tree widgets appearing in dialog windows can copy the sidebar's expanded state using em_folder_tree_clone_expanded(). --- plugins/groupwise-features/install-shared.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 67b1b5bdee..e9fd927894 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -166,6 +166,8 @@ accept_clicked(GnomeDruidPage *page, GtkWidget *druid, CamelMimeMessage *msg) accept_data = g_new0(struct AcceptData, 1); model = mail_component_peek_tree_model (NULL); folder_tree = (EMFolderTree *) em_folder_tree_new_with_model (model); + em_folder_tree_clone_expanded (folder_tree); + dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:")); uri = em_folder_tree_get_selected_uri(folder_tree); em_folder_selector_set_selected ((EMFolderSelector *) dialog, uri); -- cgit v1.2.3 From ab27aff72c64183166fc6207d2ef0142e1ab8c83 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 13 Jun 2009 15:07:00 -0400 Subject: Thought of a better way to copy folder tree state. Revert the expanded tree model column and add a "selection"property to EMFolderTreeModel, which the sidebar sets. If set, all new EMFolderTree instances will automatically mimic its expanded and selected state. --- plugins/groupwise-features/install-shared.c | 1 - 1 file changed, 1 deletion(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index e9fd927894..d770afa2d4 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -166,7 +166,6 @@ accept_clicked(GnomeDruidPage *page, GtkWidget *druid, CamelMimeMessage *msg) accept_data = g_new0(struct AcceptData, 1); model = mail_component_peek_tree_model (NULL); folder_tree = (EMFolderTree *) em_folder_tree_new_with_model (model); - em_folder_tree_clone_expanded (folder_tree); dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:")); uri = em_folder_tree_get_selected_uri(folder_tree); -- cgit v1.2.3 From 374bd42f69aca2e132fd854c9619f3d7491f1f96 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 12 Jul 2009 23:33:07 -0400 Subject: Fix excessive whitespace. --- plugins/groupwise-features/install-shared.c | 1 - 1 file changed, 1 deletion(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index d770afa2d4..7ecccdf532 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -108,7 +108,6 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) if(e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { - folder = camel_store_get_folder (store, "Mailbox", 0, NULL); /*changes = camel_folder_change_info_new (); camel_folder_change_info_remove_uid (changes, (gchar *) item_id); -- cgit v1.2.3 From fa360fde289f9b850191f89059d1a5e6d67c07c7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 18 Jul 2009 14:07:42 -0400 Subject: More whitespace cleanup. --- plugins/groupwise-features/install-shared.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 7ecccdf532..d78a73f5a2 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -75,7 +75,7 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) CamelProvider *provider; EGwConnection *cnc; - if (response == GTK_RESPONSE_CANCEL){ + if (response == GTK_RESPONSE_CANCEL) { gtk_widget_destroy (GTK_WIDGET (emfs)); } else { model = accept_data->model; @@ -83,7 +83,7 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) uri = em_folder_selector_get_selected_uri (emfs); path = em_folder_selector_get_selected_path (emfs); names = g_strsplit (path, "/", -1); - if(names == NULL){ + if (names == NULL) { folder_name = (gchar *)path; parent_name = NULL; } else { @@ -103,10 +103,10 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) } cnc = get_cnc (store); - if(E_IS_GW_CONNECTION (cnc)) { + if (E_IS_GW_CONNECTION (cnc)) { container_id = get_container_id (cnc, parent_name); - if(e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { + if (e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { folder = camel_store_get_folder (store, "Mailbox", 0, NULL); /*changes = camel_folder_change_info_new (); -- cgit v1.2.3 From 260c0c8e1eabeefd3d364f62114b4aa8d2b0028e Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 13 Aug 2009 18:52:21 -0400 Subject: =?UTF-8?q?Bug=20567260=20=E2=80=93=20Migrate=20from=20GnomeDruid?= =?UTF-8?q?=20to=20GtkAssistant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/groupwise-features/install-shared.c | 45 ++++++++++++++++++----------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index d78a73f5a2..1725835b5f 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -27,8 +27,6 @@ #include #include #include -#include -#include #include #include #include @@ -154,7 +152,7 @@ accept_free(gpointer data) } static void -accept_clicked(GnomeDruidPage *page, GtkWidget *druid, CamelMimeMessage *msg) +apply_clicked (GtkAssistant *assistant, CamelMimeMessage *msg) { EMFolderTreeModel *model; EMFolderTree *folder_tree; @@ -175,11 +173,10 @@ accept_clicked(GnomeDruidPage *page, GtkWidget *druid, CamelMimeMessage *msg) accept_data->model = model; g_object_set_data_full((GObject *)dialog, "accept-data", accept_data, accept_free); g_signal_connect (dialog, "response", G_CALLBACK (install_folder_response), accept_data); - g_object_set_data_full((GObject *)dialog, "druid", druid, (GDestroyNotify)gtk_widget_destroy); + g_object_set_data_full((GObject *)dialog, "assistant", assistant, (GDestroyNotify)gtk_widget_destroy); gtk_window_set_title (GTK_WINDOW (dialog), "Install Shared Folder"); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_widget_show (dialog); - } void @@ -189,8 +186,6 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) const gchar *name; const gchar *email; GtkWidget *window; - GnomeDruid *wizard; - GnomeDruidPageEdge *title_page; CamelMimeMessage *msg = (CamelMimeMessage *) target->message; CamelStreamMem *content; CamelDataWrapper *dw; @@ -217,20 +212,36 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) from_addr = camel_mime_message_get_from ((CamelMimeMessage *)target->message); if (from_addr && camel_internet_address_get(from_addr, 0, &name, &email)) { + GtkWidget *page; + GtkAssistant *assistant = GTK_ASSISTANT (gtk_assistant_new ()); + start_message = g_strdup_printf (_("The user '%s' has shared a folder with you\n\n" "Message from '%s'\n\n\n" "%s\n\n\n" - "Click 'Forward' to install the shared folder\n\n"), + "Click 'Apply' to install the shared folder\n\n"), name, name, content->buffer->data); - title_page = GNOME_DRUID_PAGE_EDGE (gnome_druid_page_edge_new_with_vals(GNOME_EDGE_START, TRUE, _("Install the shared folder"), start_message, NULL, NULL, NULL)); - g_free(start_message); - wizard = GNOME_DRUID (gnome_druid_new_with_window (_("Shared Folder Installation"), NULL, TRUE, (GtkWidget**)(&window))); - gtk_window_set_position (GTK_WINDOW (window) , GTK_WIN_POS_CENTER_ALWAYS); - gnome_druid_append_page(wizard, GNOME_DRUID_PAGE(title_page)); - gtk_widget_show_all (GTK_WIDGET (title_page)); - camel_object_ref(msg); - g_object_set_data_full((GObject *)title_page, "msg", msg, camel_object_unref); - g_signal_connect (title_page, "next", G_CALLBACK(accept_clicked), msg); + + page = gtk_label_new (start_message); + gtk_label_set_line_wrap (GTK_LABEL (page), TRUE); + gtk_misc_set_alignment (GTK_MISC (page), 0.0, 0.0); + gtk_misc_set_padding (GTK_MISC (page), 10, 10); + + gtk_assistant_append_page (assistant, page); + gtk_assistant_set_page_title (assistant, page, _("Install the shared folder")); + gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONFIRM); + gtk_assistant_set_page_complete (assistant, page, TRUE); + + gtk_window_set_title (GTK_WINDOW (assistant), _("Shared Folder Installation")); + gtk_window_set_position (GTK_WINDOW (assistant) , GTK_WIN_POS_CENTER_ALWAYS); + + camel_object_ref (msg); + g_object_set_data_full((GObject *)page, "msg", msg, camel_object_unref); + + g_signal_connect (assistant, "apply", G_CALLBACK (apply_clicked), msg); + + gtk_widget_show_all (GTK_WIDGET (assistant)); + + g_free (start_message); } else g_warning ("Could not get the sender name"); -- cgit v1.2.3 From 0f7f4cfe38b3c4cd83efbe9922ae15c5aee00317 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 30 Aug 2009 00:48:57 -0400 Subject: Coding style and whitespace cleanup. --- plugins/groupwise-features/install-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 1725835b5f..a208116f0a 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -220,7 +220,7 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) "%s\n\n\n" "Click 'Apply' to install the shared folder\n\n"), name, name, content->buffer->data); - + page = gtk_label_new (start_message); gtk_label_set_line_wrap (GTK_LABEL (page), TRUE); gtk_misc_set_alignment (GTK_MISC (page), 0.0, 0.0); -- cgit v1.2.3