aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-12-12 08:56:51 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-12-12 08:56:51 +0800
commit49546f4de20b49563afddc6b344ba55c26aa1eaa (patch)
treec33623009bcaba062a7ab0036f7ef6e2e1932b39 /composer
parentd91cf0898122e1bac8742665b439fd98ceaa015f (diff)
downloadgsoc2013-evolution-49546f4de20b49563afddc6b344ba55c26aa1eaa.tar.gz
gsoc2013-evolution-49546f4de20b49563afddc6b344ba55c26aa1eaa.tar.zst
gsoc2013-evolution-49546f4de20b49563afddc6b344ba55c26aa1eaa.zip
If multiple-selection is enabled but nothing is slected, fall back to
2001-12-11 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-select-file.c (confirm): If multiple-selection is enabled but nothing is slected, fall back to using the filename in the entry box as the "selected" file. (create_file_selection): If the composer gets hidden (ie it's being "sent") then cancel the file selection dialog. svn path=/trunk/; revision=14999
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog2
-rw-r--r--composer/e-msg-composer-select-file.c34
2 files changed, 22 insertions, 14 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index e33769832c..577eb84dc6 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -3,6 +3,8 @@
* e-msg-composer-select-file.c (confirm): If multiple-selection is
enabled but nothing is slected, fall back to using the filename in
the entry box as the "selected" file.
+ (create_file_selection): If the composer gets hidden (ie it's
+ being "sent") then cancel the file selection dialog.
2001-12-11 Jeffrey Stedfast <fejj@ximian.com>
diff --git a/composer/e-msg-composer-select-file.c b/composer/e-msg-composer-select-file.c
index 173664aace..593fe256cc 100644
--- a/composer/e-msg-composer-select-file.c
+++ b/composer/e-msg-composer-select-file.c
@@ -32,14 +32,13 @@
#include <gtk/gtksignal.h>
#include "e-msg-composer-select-file.h"
-
-struct _FileSelectionInfo {
+
+typedef struct _FileSelectionInfo {
GtkWidget *widget;
GtkToggleButton *inline_checkbox;
gboolean multiple;
GPtrArray *selected_files;
-};
-typedef struct _FileSelectionInfo FileSelectionInfo;
+} FileSelectionInfo;
static void
confirm (FileSelectionInfo *info)
@@ -94,12 +93,11 @@ cancel (FileSelectionInfo *info)
gtk_main_quit ();
}
-
+
/* Callbacks. */
static void
-ok_clicked_cb (GtkWidget *widget,
- void *data)
+ok_clicked_cb (GtkWidget *widget, void *data)
{
FileSelectionInfo *info;
@@ -108,8 +106,7 @@ ok_clicked_cb (GtkWidget *widget,
}
static void
-cancel_clicked_cb (GtkWidget *widget,
- void *data)
+cancel_clicked_cb (GtkWidget *widget, void *data)
{
FileSelectionInfo *info;
@@ -118,9 +115,7 @@ cancel_clicked_cb (GtkWidget *widget,
}
static int
-delete_event_cb (GtkWidget *widget,
- GdkEventAny *event,
- void *data)
+delete_event_cb (GtkWidget *widget, GdkEventAny *event, void *data)
{
FileSelectionInfo *info;
@@ -130,7 +125,15 @@ delete_event_cb (GtkWidget *widget,
return TRUE;
}
-
+static void
+composer_hide_cb (GtkWidget *widget, gpointer user_data)
+{
+ FileSelectionInfo *info;
+
+ info = (FileSelectionInfo *) user_data;
+ cancel (info);
+}
+
/* Setup. */
static FileSelectionInfo *
@@ -170,6 +173,9 @@ create_file_selection (EMsgComposer *composer, gboolean multiple)
gtk_signal_connect (GTK_OBJECT (widget), "delete_event",
GTK_SIGNAL_FUNC (delete_event_cb), info);
+ gtk_signal_connect (GTK_OBJECT (composer), "hide",
+ GTK_SIGNAL_FUNC (composer_hide_cb), info);
+
inline_checkbox = gtk_check_button_new_with_label (_("Suggest automatic display of attachment"));
box = gtk_widget_get_ancestor (GTK_FILE_SELECTION (widget)->selection_entry, GTK_TYPE_BOX);
gtk_box_pack_end (GTK_BOX (box), inline_checkbox, FALSE, FALSE, 4);
@@ -191,7 +197,7 @@ file_selection_info_destroy_notify (void *data)
info = (FileSelectionInfo *) data;
if (info->widget != NULL)
- gtk_widget_destroy (GTK_OBJECT (info->widget));
+ gtk_widget_destroy (GTK_WIDGET (info->widget));
if (info->selected_files) {
for (i = 0; i < info->selected_files->len; i++)