aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/cal-attachment-select-file.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-11-15 06:04:21 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-11-15 06:04:21 +0800
commit9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch)
tree2e1e96f33404781354c422a7e9beaf458ebeb655 /calendar/gui/dialogs/cal-attachment-select-file.c
parent7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff)
downloadgsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.bz2
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.lz
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.xz
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 'calendar/gui/dialogs/cal-attachment-select-file.c')
-rw-r--r--calendar/gui/dialogs/cal-attachment-select-file.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/calendar/gui/dialogs/cal-attachment-select-file.c b/calendar/gui/dialogs/cal-attachment-select-file.c
index aa57f95dc7..c8f5e89057 100644
--- a/calendar/gui/dialogs/cal-attachment-select-file.c
+++ b/calendar/gui/dialogs/cal-attachment-select-file.c
@@ -58,9 +58,9 @@ run_selector(CompEditor *editor, const char *title, guint32 flags, gboolean *sho
GtkWidget *showinline = NULL;
char *path;
GList *icon_list;
-
+
path = g_object_get_data ((GObject *) editor, "attach_path");
-
+
if (flags & SELECTOR_MODE_SAVE)
selection = gtk_file_chooser_dialog_new (title,
NULL,
@@ -75,49 +75,49 @@ run_selector(CompEditor *editor, const char *title, guint32 flags, gboolean *sho
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
NULL);
-
+
gtk_dialog_set_default_response (GTK_DIALOG (selection), GTK_RESPONSE_OK);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (selection), FALSE);
-
+
if ((flags & SELECTOR_MODE_SAVE) == 0)
gtk_file_chooser_set_select_multiple ((GtkFileChooser *) selection, (flags & SELECTOR_MODE_MULTI));
-
+
/* restore last path used */
if (!path)
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (selection), g_get_home_dir ());
else
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (selection), path);
-
+
if (showinline_p) {
showinline = gtk_check_button_new_with_mnemonic (_("_Suggest automatic display of attachment"));
gtk_widget_show (showinline);
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (selection), showinline);
}
-
+
gtk_window_set_transient_for ((GtkWindow *) selection, (GtkWindow *) editor);
gtk_window_set_wmclass ((GtkWindow *) selection, "fileselection", "Evolution:editor");
gtk_window_set_modal ((GtkWindow *) selection, TRUE);
-
+
icon_list = e_icon_factory_get_icon_list ("mail-message-new");
if (icon_list) {
gtk_window_set_icon_list (GTK_WINDOW (selection), icon_list);
g_list_foreach (icon_list, (GFunc) g_object_unref, NULL);
g_list_free (icon_list);
}
-
+
if (gtk_dialog_run ((GtkDialog *) selection) == GTK_RESPONSE_OK) {
if (showinline_p)
*showinline_p = gtk_toggle_button_get_active ((GtkToggleButton *) showinline);
-
+
path = g_path_get_dirname (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selection)));
-
+
g_object_set_data_full ((GObject *) editor, "attach_path", g_strdup_printf ("%s/", path), g_free);
g_free (path);
} else {
gtk_widget_destroy (selection);
selection = NULL;
}
-
+
return selection;
}
@@ -139,7 +139,7 @@ comp_editor_select_file (CompEditor *editor, const char *title, gboolean save_mo
guint32 flags = save_mode ? SELECTOR_MODE_SAVE : SELECTOR_MODE_MULTI;
GtkWidget *selection;
char *name = NULL;
-
+
selection = run_selector (editor, title, flags, NULL);
if (selection) {
name = g_strdup (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selection)));
@@ -154,15 +154,15 @@ comp_editor_select_file_attachments (CompEditor *editor, gboolean *showinline_p)
{
GtkWidget *selection;
GPtrArray *list = NULL;
-
+
selection = run_selector (editor, _("Attach file(s)"), SELECTOR_MODE_MULTI, showinline_p);
-
+
if (selection) {
GSList *l, *n;
-
+
if ((l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (selection)))) {
list = g_ptr_array_new ();
-
+
while (l) {
n = l->next;
g_ptr_array_add (list, l->data);
@@ -170,10 +170,10 @@ comp_editor_select_file_attachments (CompEditor *editor, gboolean *showinline_p)
l = n;
}
}
-
+
gtk_widget_destroy (selection);
}
-
+
return list;
}