diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-11-15 06:04:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-11-15 06:04:21 +0800 |
commit | 9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch) | |
tree | 2e1e96f33404781354c422a7e9beaf458ebeb655 /mail/em-folder-selector.c | |
parent | 7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff) | |
download | gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.zst gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.zip |
** Remove trailing whitespace from source code.
2007-11-14 Matthew Barnes <mbarnes@redhat.com>
** Remove trailing whitespace from source code.
svn path=/trunk/; revision=34537
Diffstat (limited to 'mail/em-folder-selector.c')
-rw-r--r-- | mail/em-folder-selector.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c index 3294c4fa5a..eb1cfa19bd 100644 --- a/mail/em-folder-selector.c +++ b/mail/em-folder-selector.c @@ -67,7 +67,7 @@ GType em_folder_selector_get_type (void) { static GType type = 0; - + if (!type) { static const GTypeInfo info = { sizeof (EMFolderSelectorClass), @@ -80,10 +80,10 @@ em_folder_selector_get_type (void) 0, /* n_preallocs */ (GInstanceInitFunc) em_folder_selector_init, }; - + type = g_type_register_static (GTK_TYPE_DIALOG, "EMFolderSelector", &info, 0); } - + return type; } @@ -92,9 +92,9 @@ em_folder_selector_class_init (EMFolderSelectorClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass); - + parent_class = g_type_class_ref (GTK_TYPE_DIALOG); - + object_class->finalize = em_folder_selector_finalize; gtk_object_class->destroy = em_folder_selector_destroy; } @@ -111,13 +111,13 @@ em_folder_selector_destroy (GtkObject *obj) { EMFolderSelector *emfs = (EMFolderSelector *) obj; EMFolderTreeModel *model; - + if (emfs->created_id != 0) { model = em_folder_tree_get_model (emfs->emft); g_signal_handler_disconnect (model, emfs->created_id); emfs->created_id = 0; } - + GTK_OBJECT_CLASS (parent_class)->destroy (obj); } @@ -125,11 +125,11 @@ static void em_folder_selector_finalize (GObject *obj) { EMFolderSelector *emfs = (EMFolderSelector *) obj; - + g_free (emfs->selected_path); g_free (emfs->selected_uri); g_free (emfs->created_uri); - + G_OBJECT_CLASS (parent_class)->finalize (obj); } @@ -138,10 +138,10 @@ emfs_response (GtkWidget *dialog, int response, EMFolderSelector *emfs) { if (response != EM_FOLDER_SELECTOR_RESPONSE_NEW) return; - + g_object_set_data ((GObject *)emfs->emft, "select", GUINT_TO_POINTER (1)); em_folder_utils_create_folder(NULL, emfs->emft); - + g_signal_stop_emission_by_name (emfs, "response"); } @@ -151,10 +151,10 @@ emfs_create_name_changed (GtkEntry *entry, EMFolderSelector *emfs) char *path; const char *text = NULL; gboolean active; - + if (emfs->name_entry->text_length > 0) text = gtk_entry_get_text (emfs->name_entry); - + path = em_folder_tree_get_selected_uri(emfs->emft); active = text && path && !strchr (text, '/'); g_free(path); @@ -181,42 +181,42 @@ void em_folder_selector_construct (EMFolderSelector *emfs, EMFolderTree *emft, guint32 flags, const char *title, const char *text, const char *oklabel) { GtkWidget *label; - + gtk_window_set_modal (GTK_WINDOW (emfs), FALSE); gtk_window_set_default_size (GTK_WINDOW (emfs), 350, 300); gtk_window_set_title (GTK_WINDOW (emfs), title); gtk_container_set_border_width (GTK_CONTAINER (emfs), 6); - + gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (emfs)->vbox), 6); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (emfs)->vbox), 6); - + emfs->flags = flags; if (flags & EM_FOLDER_SELECTOR_CAN_CREATE) { gtk_dialog_add_button (GTK_DIALOG (emfs), GTK_STOCK_NEW, EM_FOLDER_SELECTOR_RESPONSE_NEW); g_signal_connect (emfs, "response", G_CALLBACK (emfs_response), emfs); } - + gtk_dialog_add_buttons (GTK_DIALOG (emfs), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, oklabel?oklabel:GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - + gtk_dialog_set_response_sensitive (GTK_DIALOG (emfs), GTK_RESPONSE_OK, FALSE); gtk_dialog_set_default_response (GTK_DIALOG (emfs), GTK_RESPONSE_OK); - + emfs->emft = emft; gtk_widget_show ((GtkWidget *) emft); - + g_signal_connect (emfs->emft, "folder-selected", G_CALLBACK (folder_selected_cb), emfs); g_signal_connect (emfs->emft, "folder-activated", G_CALLBACK (folder_activated_cb), emfs); gtk_box_pack_end (GTK_BOX (GTK_DIALOG (emfs)->vbox), (GtkWidget *)emft, TRUE, TRUE, 6); - + if (text != NULL) { label = gtk_label_new (text); - gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_widget_show (label); - + gtk_box_pack_end (GTK_BOX (GTK_DIALOG (emfs)->vbox), label, FALSE, TRUE, 6); } - + gtk_widget_grab_focus ((GtkWidget *) emfs->emft); } @@ -224,10 +224,10 @@ GtkWidget * em_folder_selector_new (EMFolderTree *emft, guint32 flags, const char *title, const char *text, const char *oklabel) { EMFolderSelector *emfs; - + emfs = g_object_new (em_folder_selector_get_type (), NULL); em_folder_selector_construct (emfs, emft, flags, title, text, oklabel); - + return (GtkWidget *) emfs; } @@ -238,10 +238,10 @@ emfs_create_name_activate (GtkEntry *entry, EMFolderSelector *emfs) if (emfs->name_entry->text_length > 0) { char *path; const char *text; - + text = gtk_entry_get_text (emfs->name_entry); path = em_folder_tree_get_selected_uri(emfs->emft); - + if (text && path && !strchr (text, '/')) g_signal_emit_by_name (emfs, "response", GTK_RESPONSE_OK); g_free(path); @@ -253,15 +253,15 @@ em_folder_selector_create_new (EMFolderTree *emft, guint32 flags, const char *ti { EMFolderSelector *emfs; GtkWidget *hbox, *w; - + /* remove the CREATE flag if it is there since that's the * whole purpose of this dialog */ flags &= ~EM_FOLDER_SELECTOR_CAN_CREATE; - + emfs = g_object_new (em_folder_selector_get_type (), NULL); em_folder_selector_construct (emfs, emft, flags, title, text, _("Create")); em_folder_tree_set_excluded(emft, EMFT_EXCLUDE_NOINFERIORS); - + hbox = gtk_hbox_new (FALSE, 0); w = gtk_label_new_with_mnemonic (_("Folder _name:")); gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, FALSE, 6); @@ -271,11 +271,11 @@ em_folder_selector_create_new (EMFolderTree *emft, guint32 flags, const char *ti g_signal_connect (emfs->name_entry, "activate", G_CALLBACK (emfs_create_name_activate), emfs); gtk_box_pack_start ((GtkBox *) hbox, (GtkWidget *) emfs->name_entry, TRUE, FALSE, 6); gtk_widget_show_all (hbox); - + gtk_box_pack_start ((GtkBox *) ((GtkDialog *) emfs)->vbox, hbox, FALSE, TRUE, 0); - + gtk_widget_grab_focus ((GtkWidget *) emfs->name_entry); - + return (GtkWidget *) emfs; } @@ -297,28 +297,28 @@ em_folder_selector_get_selected_uri (EMFolderSelector *emfs) { char *uri; const char *name; - + if (!(uri = em_folder_tree_get_selected_uri (emfs->emft))) { d(printf ("no selected folder?\n")); return NULL; } - + if (uri && emfs->name_entry) { CamelProvider *provider; CamelURL *url; char *newpath; - + provider = camel_provider_get(uri, NULL); - + name = gtk_entry_get_text (emfs->name_entry); - + url = camel_url_new (uri, NULL); if (provider && (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)) { if (url->fragment) newpath = g_strdup_printf ("%s/%s", url->fragment, name); else newpath = g_strdup (name); - + camel_url_set_fragment (url, newpath); } else { char *path; @@ -331,17 +331,17 @@ em_folder_selector_get_selected_uri (EMFolderSelector *emfs) } else newpath = path; } - + g_free (emfs->selected_path); emfs->selected_path = newpath; - + g_free (emfs->selected_uri); emfs->selected_uri = camel_url_to_string (url, 0); - + camel_url_free (url); uri = emfs->selected_uri; } - + return uri; } @@ -361,7 +361,7 @@ const char * em_folder_selector_get_selected_path (EMFolderSelector *emfs) { char *uri, *path; - + if (emfs->selected_path) { /* already did the work in a previous call */ return emfs->selected_path; @@ -377,7 +377,7 @@ em_folder_selector_get_selected_path (EMFolderSelector *emfs) if (emfs->name_entry) { const char *name; char *newpath; - + name = gtk_entry_get_text (emfs->name_entry); newpath = g_strdup_printf ("%s/%s", path?path:"", name); |