diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2008-04-03 02:37:22 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-04-03 02:37:22 +0800 |
commit | 16068d9b4191ea142a9e75a50eb8d260ed2bb406 (patch) | |
tree | 835a7909cd8b352d8c414986f1f5e27697b4de98 /composer/e-msg-composer-select-file.c | |
parent | ee50e5d68e4f1a793541f1ee4979818ed4940173 (diff) | |
download | gsoc2013-evolution-16068d9b4191ea142a9e75a50eb8d260ed2bb406.tar.gz gsoc2013-evolution-16068d9b4191ea142a9e75a50eb8d260ed2bb406.tar.zst gsoc2013-evolution-16068d9b4191ea142a9e75a50eb8d260ed2bb406.zip |
** Merge the mbarnes-composer branch
2008-04-02 Matthew Barnes <mbarnes@redhat.com>
** Merge the mbarnes-composer branch
* configure.in:
Bump libgtkhtml requirement to 3.19.1.
Add gtkhtml-editor dependency for addressbook, calendar and mail.
Remove print-message plugin; new composer implements this natively.
* tools/Makefile.am:
Remove CORBA rules for the old composer.
* addressbook/gui/widgets/Makefile.am:
Remove CORBA rules for the old composer.
* addressbook/gui/widgets/eab-gui-util.c
(eab_send_to_contact_and_email_num_list),
(eab_send_contact_list_as_attachment):
Adapt to new Bonobo-less composer widget.
* calendar/gui/Makefile.am:
Remove CORBA rules for the old composer.
* calendar/gui/itip-utils.c (comp_from), (comp_to_list),
(comp_subject), (comp_content_type), (comp_filename),
(comp_description), (append_cal_attachments), (itip_send_comp),
(reply_to_calendar_comp):
Adapt to new Bonobo-less composer widget.
* composer/Makefile.am:
Remove CORBA rules for the old composer.
* composer/e-msg-composer.c:
* composer/e-msg-composer.h:
EMsgComposer is now a subclass of GtkhtmlEditor.
Extensive refactoring and cleanup, too much to list in detail.
* composer/e-composer-header.c:
* composer/e-composer-header.h:
Add "sensitive" property along with get/set functions.
* composer/e-composer-from-header.c:
* composer/e-composer-from-header.h:
Propagate "refreshed" signal from EAccountComboBox.
Add function e_composer_from_header_get_account_list().
* composer/e-composer-private.c:
* composer/e-composer-private.h:
New files manage composer's private data.
Allows other composer files to manipulate private data.
* composer/e-msg-composer-hdrs.c:
* composer/e-msg-composer-hdrs.h:
Remove these files; replaced by EComposerHeaderTable widget.
* composer/evolution-composer.c:
* composer/evolution-composer.h:
Remove these files; composer is now a subclass of GtkhtmlEditor.
* composer/e-msg-composer-select-file.c:
* composer/e-msg-composer-select-file.h:
Remove these files; logic moved to e-msg-composer.c.
* composer/listener.c:
* composer/listener.h:
Remove these files; event handlers moved to e-msg-composer.c.
* composer/Composer.idl:
* composer/Evolution-Composer.idl:
Remove these files; composer is no longer a Bonobo object.
* mail/em-composer-prefs (sig_edit_cb),
(em_composer_prefs_new_signature):
Adapt to new Bonobo-less signature editor.
* mail/mail-signature-editor.c:
* mail/mail-signature-editor.h:
Rewrite the signature editor as a subclass of GtkhtmlEditor.
Eliminates Bonobo from the equation.
* mail/em-composer-utils.c (composer_get_message),
(em_utils_composer_send_cb), (save_draft_done),
(em_utils_composer_save_draft_cb), (create_new_composer),
(em_utils_compose_new_message),
(em_utils_compose_new_message_with_mailto), (em_utils_post_to_folder),
(em_utils_post_to_url), (edit_message), (forward_attached),
(forward_non_attached), (reply_get_composer), (composer_set_body),
(em_utils_reply_to_message), (post_reply_to_message):
Adapt to new Bonobo-less composer.
* mail/mail-component-factory.c:
Composer is no longer needs a Bonobo factory.
* mail/mail-config.c:
Fix style pattern for EMsgComposer widgets.
* plugins/groupwise/mail-send-options.c
(org_gnome_composer_send_options):
Adapt to streamlined EMsgComposer API.
* plugins/exchange-operations/Makefile.am:
Add EVOLUTION_MAIL_CFLAGS and EVOLUTION_MAIL_LIBS.
* plugins/exchange-operations/exchange-mail-send-options.c
(append_to_header), (org_gnome_exchange_send_options):
Adapt to streamlined EMsgComposer API.
* plugins/mailing-list-actions/mailing-list-actions.c
(emla_list_action_do):
Adapt to streamlined EMsgComposer API.
* po/POTFILES.in: Update file list for new composer.
* ui/evolution-composer-entries.xml:
Remove this file; obsoleted by new composer.
* widgets/misc/Makefile.am:
Add EVOLUTION_MAIL_LIBS.
* widgets/misc/e-account-combo-box.c:
* widgets/misc/e-account-combo-box.h:
New function e_account_combo_box_get_account_list().
Emit a "refreshed" signal when the EAccountList changes.
Add an internal reverse-lookup index.
* widgets/misc/e-charset-picker.c (e_charser_add_radio_actions):
New function adds radio actions to an action group.
Will eventually replace e_charset_picker_bonobo_ui_populate().
* widgets/misc/e-signature-combo-box.c:
* widgets/misc/e-signature-combo-box.h:
New function e_signature_combo_box_get_signature_list().
... separate issue ...
* configure.in:
Bump eds_minimum_version to 2.23.1 for
CAMEL_FOLDER_JUNKED_NOT_DELETED symbol.
svn path=/trunk/; revision=35313
Diffstat (limited to 'composer/e-msg-composer-select-file.c')
-rw-r--r-- | composer/e-msg-composer-select-file.c | 203 |
1 files changed, 0 insertions, 203 deletions
diff --git a/composer/e-msg-composer-select-file.c b/composer/e-msg-composer-select-file.c deleted file mode 100644 index f0e5b767c9..0000000000 --- a/composer/e-msg-composer-select-file.c +++ /dev/null @@ -1,203 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * Authors: Ettore Perazzoli <ettore@ximian.com> - * Jeffrey Stedfast <fejj@ximian.com> - * Michael Zucchi <notzed@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtkbox.h> -#include <gtk/gtkcheckbutton.h> -#include <gtk/gtkmain.h> -#include <gtk/gtksignal.h> -#include <gtk/gtkversion.h> - -#include <gtk/gtkfilechooser.h> -#include <gtk/gtkfilechooserdialog.h> -#include <gtk/gtkstock.h> - -#include <libgnomeui/gnome-uidefs.h> -#include <glib/gi18n.h> - -#include "e-msg-composer-select-file.h" -#include <e-util/e-icon-factory.h> -#include "e-msg-composer.h" -#include "e-attachment-bar.h" - -enum { - SELECTOR_MODE_MULTI = (1 << 0), - SELECTOR_MODE_SAVE = (1 << 1), - SELECTOR_SHOW_INLINE = 1<<2 -}; - -/* this is a mess */ - -static GtkWidget* -get_selector(struct _EMsgComposer *composer, const char *title, guint32 flags) -{ - GtkWidget *selection; - GtkWidget *showinline = NULL; - GList *icon_list; - const char *path; - - path = e_msg_composer_get_attach_path (composer); - - if (flags & SELECTOR_MODE_SAVE) - selection = gtk_file_chooser_dialog_new (title, - NULL, - GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, GTK_RESPONSE_OK, - NULL); - else - selection = gtk_file_chooser_dialog_new (title, - NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - _("A_ttach"), 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 (flags & SELECTOR_SHOW_INLINE) { - 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); - g_object_set_data((GObject *)selection, "show-inline", showinline); - } - - gtk_window_set_transient_for ((GtkWindow *) selection, (GtkWindow *) composer); - gtk_window_set_wmclass ((GtkWindow *) selection, "fileselection", "Evolution:composer"); - gtk_window_set_modal ((GtkWindow *) selection, FALSE); - - 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); - } - - return selection; -} - -static void -select_file_response(GtkWidget *selector, guint response, struct _EMsgComposer *composer) -{ - if (response == GTK_RESPONSE_OK) { - const char *name; - char *path; - EMsgComposerSelectFileFunc func = g_object_get_data((GObject *)selector, "callback"); - - name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selector)); - path = g_path_get_dirname (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selector))); - e_msg_composer_set_attach_path (composer, path); - g_free (path); - - func(composer, name); - } - - gtk_widget_destroy(selector); -} - -/** - * e_msg_composer_select_file: - * @composer: a composer - * @w: widget pointer, so same dialog is not re-shown - * @func: callback invoked if the user selected a file - * @title: the title for the file selection dialog box - * @save: whether the file selection box should be shown in save mode or not - * - * This pops up a file selection dialog box with the given title - * and allows the user to select a single file. - * - **/ -void e_msg_composer_select_file(struct _EMsgComposer *composer, GtkWidget **w, EMsgComposerSelectFileFunc func, const char *title, int save) -{ - if (*w) { - gtk_window_present((GtkWindow *)*w); - return; - } - - *w = get_selector (composer, title, save ? SELECTOR_MODE_SAVE : 0); - g_signal_connect(*w, "response", G_CALLBACK(select_file_response), composer); - g_signal_connect(*w, "destroy", G_CALLBACK(gtk_widget_destroyed), w); - g_object_set_data((GObject *)*w, "callback", func); - gtk_widget_show(*w); -} - - -static void -select_attach_response(GtkWidget *selector, guint response, struct _EMsgComposer *composer) -{ - if (response == GTK_RESPONSE_OK) { - GSList *names; - EMsgComposerSelectAttachFunc func = g_object_get_data((GObject *)selector, "callback"); - GtkToggleButton *showinline = g_object_get_data((GObject *)selector, "show-inline"); - char *path = NULL; - - char *filename = NULL; - names = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (selector)); - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selector)); - if (filename) { - path = g_path_get_dirname (filename); - g_free (filename); - } - if (path) - e_msg_composer_set_attach_path (composer, path); - g_free (path); - - func(composer, names, gtk_toggle_button_get_active(showinline)); - - e_msg_composer_show_attachments_ui (composer); - - - g_slist_foreach(names, (GFunc)g_free, NULL); - g_slist_free(names); - } - - gtk_widget_destroy(selector); -} - -void e_msg_composer_select_file_attachments(struct _EMsgComposer *composer, GtkWidget **w, EMsgComposerSelectAttachFunc func) -{ - if (*w) { - gtk_window_present((GtkWindow *)*w); - return; - } - - *w = get_selector (composer, _("Insert Attachment"), SELECTOR_MODE_MULTI|SELECTOR_SHOW_INLINE); - g_signal_connect(*w, "response", G_CALLBACK(select_attach_response), composer); - g_signal_connect(*w, "destroy", G_CALLBACK(gtk_widget_destroyed), w); - g_object_set_data((GObject *)*w, "callback", func); - gtk_widget_show(*w); -} |