diff options
author | Vivek Jain <jvivek@novell.com> | 2005-01-11 18:57:25 +0800 |
---|---|---|
committer | Jain Vivek <jvivek@src.gnome.org> | 2005-01-11 18:57:25 +0800 |
commit | bea2b628759cedf8734e8e540c8e2537e12c8fec (patch) | |
tree | 3cd24ac1d0fa0428fd81516235399ae5b033ca45 /plugins | |
parent | 7537c2bc1b8f35369019b915eb8d69ab28cedcbd (diff) | |
download | gsoc2013-evolution-bea2b628759cedf8734e8e540c8e2537e12c8fec.tar.gz gsoc2013-evolution-bea2b628759cedf8734e8e540c8e2537e12c8fec.tar.zst gsoc2013-evolution-bea2b628759cedf8734e8e540c8e2537e12c8fec.zip |
killed compile time warnings by including suitable definitions and type
2005-01-11 Vivek Jain <jvivek@novell.com>
killed compile time warnings by including suitable definitions
and type casting widgets
svn path=/trunk/; revision=28356
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/shared-folder/ChangeLog | 3 | ||||
-rw-r--r-- | plugins/shared-folder/install-shared.c | 37 | ||||
-rw-r--r-- | plugins/shared-folder/share-folder-common.c | 29 | ||||
-rw-r--r-- | plugins/shared-folder/share-folder.c | 30 |
4 files changed, 56 insertions, 43 deletions
diff --git a/plugins/shared-folder/ChangeLog b/plugins/shared-folder/ChangeLog index b2c95845ba..5d411b0214 100644 --- a/plugins/shared-folder/ChangeLog +++ b/plugins/shared-folder/ChangeLog @@ -1,3 +1,6 @@ +2005-01-11 Vivek Jain <jvivek@novell.com> +killed compile time warnings by including suitable definitions +and type casting widgets 2005-01-10 Vivek Jain <jvivek@novell.com> Included diff --git a/plugins/shared-folder/install-shared.c b/plugins/shared-folder/install-shared.c index b25b1953a0..7eb1191e95 100644 --- a/plugins/shared-folder/install-shared.c +++ b/plugins/shared-folder/install-shared.c @@ -33,26 +33,28 @@ #include <e-util/e-config.h> #include <mail/em-config.h> #include <mail/em-event.h> +#include <mail/mail-component.h> #include <camel/camel-mime-message.h> #include <camel/camel-stream.h> +#include <camel/camel-session.h> #include <camel/camel-stream-mem.h> #include <camel/camel-data-wrapper.h> #include <mail/em-folder-tree.h> +#include <mail/mail-config.h> #include <mail/em-folder-selector.h> #include <camel/camel-medium.h> #include <e-gw-connection.h> #include <share-folder.h> -#include <glade/glade.h> - -static GladeXML *xml; extern CamelSession *session; struct AcceptData { - gchar *item_id; + const char *item_id; EMFolderTreeModel *model; }; +void org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target); + static void install_folder_response (EMFolderSelector *emfs, int response, gpointer *data) { @@ -71,7 +73,7 @@ install_folder_response (EMFolderSelector *emfs, int response, gpointer *data) EGwConnection *cnc; if (response == GTK_RESPONSE_CANCEL){ - gtk_widget_destroy (emfs); + gtk_widget_destroy (GTK_WIDGET (emfs)); } else { model = accept_data->model; item_id = accept_data->item_id; @@ -82,7 +84,7 @@ install_folder_response (EMFolderSelector *emfs, int response, gpointer *data) printf ("Creating new folder: %s (%s)\n", path, uri); names = g_strsplit (path, "/", -1); if(names == NULL){ - folder_name = path; + folder_name = (gchar *)path; parent_name = NULL; } else { while (names [parts]) @@ -128,7 +130,7 @@ install_folder_response (EMFolderSelector *emfs, int response, gpointer *data) } static void -accept_clicked(GnomeDruidPage *page, GtkWidget *druid, gchar *id) +accept_clicked(GnomeDruidPage *page, GtkWidget *druid, const char *id) { g_print("\n\naccepting\n\n"); EMFolderTreeModel *model; @@ -149,14 +151,13 @@ accept_clicked(GnomeDruidPage *page, GtkWidget *druid, gchar *id) gtk_window_set_title (GTK_WINDOW (dialog), "Install Shared Folder"); gtk_widget_destroy (druid); gtk_widget_show (dialog); - //gnome_druid_page_next (page); } void org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) { - CamelInternetAddress *from_addr = NULL; + const CamelInternetAddress *from_addr = NULL; const char *name, *item_id; const char *email; const char *subject; @@ -171,10 +172,10 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) char *notification; char *start_message; char *buffer = NULL; + char *uri; EMFolderTreeModel *model; EMFolderTree *folder_tree; GtkWidget *selector_dialog ; - char *uri; struct AcceptData *accept_data; notification = (char *)camel_medium_get_header (CAMEL_MEDIUM(msg),"X-notification") ; @@ -183,16 +184,16 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) } else { - g_print ("shared folder notification\n") ; + dw = camel_data_wrapper_new () ; + camel_medium_remove_header (CAMEL_MEDIUM (mime_part), "Content-Transfer-Encoding") ; + camel_medium_remove_header (CAMEL_MEDIUM (mime_part), "Content-Type") ; dw = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); content = (CamelStreamMem *)camel_stream_mem_new(); - camel_data_wrapper_decode_to_stream(dw, (CamelStream *)content); + camel_data_wrapper_write_to_stream(dw, (CamelStream *)content); buffer = g_malloc0 (content->buffer->len+1) ; buffer = memcpy (buffer, content->buffer->data, content->buffer->len) ; - g_print ("\nThe mesg is :%s", buffer); from_addr = camel_mime_message_get_from ((CamelMimeMessage *)target->message); if (camel_internet_address_get (from_addr,0, &name, &email)) - g_print ("\ncomes :%s", name); subject = camel_mime_message_get_subject (target->message) ; start_message = g_strconcat (" The User ", "'", name, "'" ," has shared a folder with you\n\n", " Message from ", "'" , name, "'\n", buffer, "Click 'Forward' to install the shared folder\n\n",NULL); @@ -200,10 +201,10 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) 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)); middle_page = g_object_new (GNOME_TYPE_DRUID_PAGE_STANDARD, "title", "vivek", NULL); finish_page = GNOME_DRUID_PAGE_EDGE (gnome_druid_page_edge_new_with_vals(GNOME_EDGE_FINISH, TRUE, "finished Install the shared folder", "said", NULL,NULL, NULL)); - wizard = GNOME_DRUID (gnome_druid_new_with_window ("Wizard check", NULL, TRUE, (GtkWidget**)(&window))); + wizard = GNOME_DRUID (gnome_druid_new_with_window ("Shared Folder Installation", NULL, TRUE, (GtkWidget**)(&window))); gnome_druid_append_page(wizard, GNOME_DRUID_PAGE(title_page)); gtk_widget_show_all (GTK_WIDGET (title_page)); - gnome_druid_append_page(wizard, GNOME_DRUID_PAGE(middle_page)); + gnome_druid_append_page(wizard, GNOME_DRUID_PAGE(middle_page)); gtk_widget_show_all (GTK_WIDGET (middle_page)); gnome_druid_append_page(wizard, GNOME_DRUID_PAGE(finish_page)); gtk_widget_show_all (GTK_WIDGET (finish_page)); @@ -215,10 +216,6 @@ org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) gtk_widget_destroy (GTK_DIALOG (selector_dialog)->action_area); gtk_widget_show_all (GTK_WIDGET (middle_page)); item_id = camel_mime_message_get_message_id (msg); - accept_data = g_new0(struct AcceptData, 1); - accept_data->item_id = item_id; - accept_data->model = model; - g_print ("\n\nitem_id :%s\n\n",item_id); g_signal_connect (title_page, "next", G_CALLBACK(accept_clicked), item_id); } diff --git a/plugins/shared-folder/share-folder-common.c b/plugins/shared-folder/share-folder-common.c index 9f1c46ca31..fa1f36eab7 100644 --- a/plugins/shared-folder/share-folder-common.c +++ b/plugins/shared-folder/share-folder-common.c @@ -22,8 +22,6 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif -#include <camel/camel-store.h> -#include <camel/camel-vee-store.h> #include <string.h> #include <glib.h> #include <gtk/gtk.h> @@ -35,9 +33,14 @@ #include <mail/em-folder-tree.h> #include <mail/em-folder-selector.h> #include <mail/mail-mt.h> +#include <mail/mail-component.h> +#include <mail/mail-config.h> #include <mail/em-vfolder-rule.h> #include <filter/filter-rule.h> #include <camel/camel-store.h> +#include <camel/camel-session.h> +#include <camel/camel-store.h> +#include <camel/camel-vee-store.h> #include <camel/camel-folder.h> #include <e-gw-container.h> #include <e-gw-connection.h> @@ -55,6 +58,13 @@ struct ShareInfo { EMFolderSelector *emfs; }; +GtkWidget * org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data); +void org_gnome_create_option(EPlugin *ep, EMPopupTargetFolder *target); +void shared_folder_commit (EPlugin *ep, EConfigTarget *tget); +void shared_folder_abort (EPlugin *ep, EConfigTarget *target); + +static void refresh_folder_tree (EMFolderTreeModel *model, CamelStore *store); + static void refresh_folder_tree (EMFolderTreeModel *model, CamelStore *store) { @@ -89,7 +99,7 @@ shared_folder_commit (EPlugin *ep, EConfigTarget *tget) if (common) { share_folder (common); refresh_folder_tree (model, store); - g_object_run_dispose (common); + g_object_run_dispose ((GObject *)common); common = NULL; } } @@ -155,7 +165,6 @@ create_folder__created (struct _mail_msg *mm) (ssi->sf)->cnc = ccnc; (ssi->sf)->container_id = g_strdup (get_container_id ((ssi->sf)->cnc, m->name)); - g_print("\n\n\name :%s\n\nid: %s", m->name, (ssi->sf)->container_id); share_folder(ssi->sf); } @@ -349,7 +358,6 @@ org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_d if(sub == NULL) sub = g_strrstr(folderuri, "/"); sub++; - g_print ("\n\n%s\n\n", sub); if ( !( strcmp (sub, "Mailbox") && strcmp (sub, "Calendar") && strcmp (sub, "Contacts") && strcmp (sub, "Documents") && strcmp (sub, "Authored") && strcmp (sub, "Default Library") && strcmp (sub, "Work In Progress") && strcmp (sub, "Cabinet") && strcmp (sub, "Sent Items") && strcmp (sub, "Trash") && strcmp (sub, "Checklist"))) { g_free (folderuri); @@ -371,10 +379,10 @@ org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_d return NULL; g_free (folderuri); - gtk_notebook_append_page((GtkNotebook *) hook_data->parent, sharing_tab->vbox, gtk_label_new_with_mnemonic N_("Sharing")); + gtk_notebook_append_page((GtkNotebook *) hook_data->parent, (GtkWidget *) sharing_tab->vbox, gtk_label_new_with_mnemonic N_("Sharing")); common = sharing_tab; - return sharing_tab; + return GTK_WIDGET (sharing_tab); } else return NULL; } @@ -383,7 +391,7 @@ EGwConnection * get_cnc (CamelStore *store) { EGwConnection *cnc; - char *uri, *property_value, *use_ssl, *server_name, *user, *port; + const char *uri, *property_value, *use_ssl, *server_name, *user, *port; CamelService *service; CamelURL *url; @@ -391,8 +399,6 @@ get_cnc (CamelStore *store) url = service->url; server_name = g_strdup (url->host); user = g_strdup (url->user); - - g_print("\n\nserver : %s, user : %s\n\n", server_name, user); property_value = camel_url_get_param (url, "soap_port"); use_ssl = g_strdup (camel_url_get_param (url, "soap_ssl")); if(property_value == NULL) @@ -406,7 +412,6 @@ get_cnc (CamelStore *store) uri = g_strconcat ("https://", server_name, ":", port, "/soap", NULL); else uri = g_strconcat ("http://", server_name, ":", port, "/soap", NULL); - g_print("\n\nurl : %s, user : %s\n\n", uri, user); cnc = e_gw_connection_new (uri, user, service->url->passwd); return cnc; @@ -418,7 +423,7 @@ get_container_id(EGwConnection *cnc, gchar *fname) { GList *container_list = NULL; gchar *id = NULL; - gchar *name; + const char *name; /* get list of containers */ if (e_gw_connection_get_container_list (cnc, "folders", &(container_list)) == E_GW_CONNECTION_STATUS_OK) { GList *container = NULL; diff --git a/plugins/shared-folder/share-folder.c b/plugins/shared-folder/share-folder.c index 3e142cebc2..2ed4b41cec 100644 --- a/plugins/shared-folder/share-folder.c +++ b/plugins/shared-folder/share-folder.c @@ -42,6 +42,7 @@ #include <e-gw-container.h> #include <e-gw-connection.h> #define ROOTNODE "vboxSharing" +#define NROOTNODE "vbox191" #define d(x) static void share_folder_class_init (ShareFolderClass *class); @@ -366,8 +367,8 @@ user_selected(GtkTreeSelection *selection, ShareFolder *sf) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sf->add), FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sf->del), FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sf->edit), FALSE); - gtk_tree_model_get (GTK_LIST_STORE (sf->model), &(sf->iter), 0, &email, -1); - index = (gint)g_ascii_strtod(gtk_tree_model_get_string_from_iter(GTK_LIST_STORE (sf->model), &(sf->iter)), NULL); + gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, -1); + index = (gint)g_ascii_strtod(gtk_tree_model_get_string_from_iter(( GtkTreeModel *)sf->model, &(sf->iter)), NULL); gtk_label_set_text (GTK_LABEL (sf->user_rights), email); @@ -431,12 +432,13 @@ not_shared_clicked (GtkRadioButton *button, ShareFolder *sf) sf->flag_for_ok = 2; } gtk_widget_set_sensitive (GTK_WIDGET (sf->table), FALSE); + } static void add_clicked(GtkButton *button, ShareFolder *sf) { - gchar *email = NULL; + const char *email = NULL; EShUsers *user = NULL; GList *list = NULL; gint rights = 0; @@ -509,7 +511,7 @@ remove_clicked(GtkButton *button, ShareFolder *sf) gchar *email; /*check whether this is required*/ - gtk_tree_model_get (GTK_LIST_STORE(sf->model), &(sf->iter), 0, &email, -1); + gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, -1); list = g_list_last (sf->update_list); usr = g_list_nth_data (list, 0); sf->duplicate = find_node (sf->new_list, usr->email); @@ -567,6 +569,8 @@ share_folder (ShareFolder *sf) if (sf->update_list) { sf->sub = "Shared Folder rights updated"; + + printf ("\n\nthe message is :%s\n\n", sf->mesg); if (e_gw_connection_share_folder (sf->cnc, sf->container_id, sf->update_list, sf->sub, sf->mesg, 2) == E_GW_CONNECTION_STATUS_OK); } } @@ -587,7 +591,7 @@ not_ok_clicked(GtkButton *button, ShareFolder *sf) GtkTextIter *start, *end; GtkTextBuffer *buffer; - buffer=g_new0(GtkTextBuffer,1); + buffer = gtk_text_buffer_new (NULL); start = g_new0 (GtkTextIter, 1); end = g_new0 (GtkTextIter, 1); subj = g_strdup (gtk_entry_get_text (sf->subject)); @@ -596,7 +600,7 @@ not_ok_clicked(GtkButton *button, ShareFolder *sf) buffer = gtk_text_view_get_buffer (sf->message); gtk_text_buffer_get_start_iter (buffer, start); gtk_text_buffer_get_end_iter (buffer, end); - msg = g_strdup(gtk_text_buffer_get_text (buffer, start, end, FALSE)); + msg = gtk_text_buffer_get_text (buffer, start, end, FALSE); if(msg) sf->mesg = msg; gtk_widget_destroy (GTK_WIDGET (sf->window)); @@ -617,17 +621,21 @@ notification_clicked(GtkButton *button, ShareFolder *sf) static GladeXML *xmln; GtkButton *not_ok; GtkButton *not_cancel; + GtkWidget *vbox; - xmln = glade_xml_new (EVOLUTION_GLADEDIR "/properties.glade" ,"window1", NULL); - sf->window = GTK_WIDGET (glade_xml_get_widget (xmln, "window1")); + sf->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + xmln = glade_xml_new (EVOLUTION_GLADEDIR "/properties.glade", NROOTNODE , NULL); + vbox = GTK_WIDGET (glade_xml_get_widget (xmln, "vbox191")); + gtk_container_add (GTK_CONTAINER (sf->window), vbox); sf->subject = GTK_ENTRY (glade_xml_get_widget (xmln, "entry3")); gtk_entry_set_text(GTK_ENTRY (sf->subject) , sf->sub); - sf->message = GTK_TEXT_VIEW (glade_xml_get_widget (xmln, "textview1")); not_ok = GTK_BUTTON (glade_xml_get_widget (xmln, "nOK")); g_signal_connect ((gpointer) not_ok, "clicked", G_CALLBACK (not_ok_clicked), sf); not_cancel = GTK_BUTTON (glade_xml_get_widget (xmln, "nCancel")); g_signal_connect ((gpointer) not_cancel, "clicked", G_CALLBACK (not_cancel_clicked), sf->window); + gtk_window_set_position (GTK_WINDOW (sf->window) , GTK_WIN_POS_CENTER_ALWAYS); + gtk_widget_show_all (sf->window); } static void @@ -704,7 +712,7 @@ share_folder_construct (ShareFolder *sf) sf->name = GTK_ENTRY (glade_xml_get_widget (sf->xml, "entry2")); /*TODO:connect name and label*/ gtk_widget_hide (GTK_WIDGET(sf->name)); - gtk_table_attach ((GtkWidget *) sf->table, (GtkWidget *) name_selector_entry, 1, 2, 0, 1, GTK_FILL, GTK_EXPAND, 8, 0); + gtk_table_attach ((GtkTable *) sf->table, (GtkWidget *) name_selector_entry, 1, 2, 0, 1, GTK_FILL, GTK_EXPAND, 8, 0); gtk_widget_show ((GtkWidget *) name_selector_entry); sf->frame = GTK_FRAME (glade_xml_get_widget(sf->xml, "frame1")); gtk_widget_set_sensitive(GTK_WIDGET (sf->frame), FALSE); @@ -724,7 +732,7 @@ share_folder_construct (ShareFolder *sf) sf->model = gtk_list_store_new (1, G_TYPE_STRING); sf->user_list = gtk_tree_view_new (); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sf->scrolled_window), sf->user_list); + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sf->scrolled_window), (GtkWidget *)sf->user_list); gtk_tree_view_set_model (GTK_TREE_VIEW (sf->user_list), GTK_TREE_MODEL (sf->model)); gtk_widget_show (GTK_WIDGET (sf->user_list)); |