diff options
author | Not Zed <NotZed@Ximian.com> | 2002-11-12 22:59:35 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-11-12 22:59:35 +0800 |
commit | f9804e11931411358ce98ad5a7726de6d68f2115 (patch) | |
tree | a8fb046c3abbc7c0e07147c21557a3e22504dbda /mail/mail-signature-editor.c | |
parent | 83f816df158441ca750b0bc12b7ccab2d43c0e43 (diff) | |
download | gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.tar.gz gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.tar.zst gsoc2013-evolution-f9804e11931411358ce98ad5a7726de6d68f2115.zip |
Commented out stuff that doesn't build yet. Also fixed idl build rule.
2002-11-13 Not Zed <NotZed@Ximian.com>
* Makefile.am: Commented out stuff that doesn't build yet. Also
fixed idl build rule. importers still not built.
* main.c (main): bonobactivationise. remove push visual/colormap.
(main): no longer activate activation, let bonobo_init do it.
* mail-signature-editor.c (menu_help): Change help api.
* mail-session.c (user_message_destroy_noreply): removed. Not
used?
* mail-local.c (load_metainfo): xml root->children.
* mail-format.c (g_string_append_len): Removed, it exists now.
2002-11-12 Not Zed <NotZed@Ximian.com>
* subscribe-dialog.c: gnome2ised, use gtkdialog.
(subscribe_get_global_extras): use a weak ref rather than destroy signal.
* message-tag-followup.c: gnome2ised.
* message-tag-editor.c: gnome2ised & converted to gtkdialog.
* message-list.c: gnome2ised.
(message_list_finalise): From destroy method. maybe should be
destroy still.
* message-browser.c: port to gnome2
(message_browser_finalise): renamed from destroy method.
* mail-stream-gtkhtml.c: removed redundant
camel_class_get_global_classfuncs() call.
* mail-signature-editor.c: gtkdialogised, & bonobo api changes.
* mail-search-dialogue.c: gtkdialogised.
* mail-folder-cache.c: cleaned up camel ref/hook casts.
* mail-composer-prefs.c (mail_composer_prefs_get_type): convert to
gtype.
* mail-font-prefs.c (mail_font_prefs_destroy): from finalise.
* mail-config.c: s/bonobo_config/e_config_listener/
Added /apps/Evolution prefix to the evolution keys.
Changed to use e_config_listener, etc.
(mail_config_init): remove bonobo_config stuff.
(mail_config_check_service): gtk dialogise.
(check_response): from check_cancelled.
* mail-config-druid.c (mail_config_druid_destroy): renamed from
_finalize, turned into destroy handler.
(construct): set type to toplevel, GTK_WINDOW_DIALOG no longer exists.
* mail-config-factory.c (mail_config_register_factory): bonobo api
changes.
* mail-crypto.c (mail_crypto_get_pgp_cipher_context): cleaned up
unref casts.
* mail-display.c (write_data_to_file): gnome->gtkdialog.
(on_link_clicked): use ascii_str*cmp on url.
(save_part): g_path stuff.
(launch_cb): gtk dialog.
(pixmap_press): de-oafify.
(pixbuf_for_mime_type): gnome-vfs api changes.
(do_attachment_header): Change the pixmap to a gtkimage.
(do_signature): "
(pixbuf_gen_idle): "
(do_attachment_header): ascii_str*cmp
(do_attachment_header): gnome pixmap->gtkimage.
(mail_display_destroy): protect against gtk mentalness.
(html_button_press_event): ascii_str*cmp
(drag_data_get_cb): added comment for translators of filename.
* mail-format.c (component_supports): de-oafise.
(is_anonymous): ascii_strncmp
(attachment_header): remove utf8<>locale stuff, and gnomevfs api
changes.
(format_mime_part): fix g_strdown call.
(write_field_row_begin): kill utf8->gtk stuff.
(write_address): "
(default_header_index): ascii_strcasecmp
(handle_text_plain): "
(handle_text_enriched): "
(handle_multipart_encrypted): remove utf/gtk stuff.
(handle_message_external_body): ascii_str*cmp
* mail-identify.c (mail_identify_mime_part):
(identify_by_magic): gnome vfs api changes.
* mail-importer.c: Converted.
* mail-local.c (load_metainfo): xml childs -> children.
(mls_get_folder): g_strerror.
(mls_delete_folder): g_strerror.
(reconfigure_got_folder): Gnome->GtkDialog
(reconfigure_response): from reconfigure_clicked.
* mail-mt.c (mail_msg_check_error): gnome -> gtk dialog
(error_response): renmae from error_gone. destroy widget on any
response.
* mail-offline-handler.c (impl_finalise): renamed from
impl_destroy since thats what it should be anyway.
* mail-ops.c: removed utf8 widget conversion & camel_object_un/ref
casts.
* mail-preferences.c (mail_preferences_get_type): glib2'ised.
* mail-search.c (mail_search_finalise): renmaed from destroy &
properly chain.
(mail_search_get_type): glib2 & make gtkdialog parent.
(entry_run_search): run search when entry activated. not sure if
gtkdialog has anohter way to do this on an arbitrary widget.
* mail-send-recv.c (dialogue_response): renamed from clicked. Use
gtkdialog.
* mail-session.c (request_password_deleted): removed, redundant.
(pass_response): rename from pass_got, changed for gtkdialog.
(user_message_destroy): Removed, redundant.
(user_message_response): Renamed from user_message_clicked.
2002-11-11 Not Zed <NotZed@Ximian.com>
* mail-stream-gtkhtml.c (mail_stream_gtkhtml_class_init): dont use
get_global_classfuncs, just get the type
* mail-tools.c: converted gnome2 api's.
* mail-vfolder.c (vfolder_editor_response): clicked->response.
(vfolder_editor_destroy): Removed.
(vfolder_edit): gtk dialog api
(edit_rule_response): clicked->response.
(vfolder_edit_rule): gnomedialog->gtkdialog.
(vfolder_gui_add_rule): "
(new_rule_clicked): clicked->response
svn path=/trunk/; revision=18723
Diffstat (limited to 'mail/mail-signature-editor.c')
-rw-r--r-- | mail/mail-signature-editor.c | 118 |
1 files changed, 54 insertions, 64 deletions
diff --git a/mail/mail-signature-editor.c b/mail/mail-signature-editor.c index d2f0df303d..c6bdf5a53c 100644 --- a/mail/mail-signature-editor.c +++ b/mail/mail-signature-editor.c @@ -90,45 +90,47 @@ menu_file_save_cb (BonoboUIComponent *uic, { ESignatureEditor *editor; CORBA_Environment ev; - char *filename; + char *filename, *base; char *dirname; editor = E_SIGNATURE_EDITOR (data); printf ("editor->sig->filename = %s\n", editor->sig->filename); - dirname = g_dirname (editor->sig->filename); + dirname = g_path_get_dirname (editor->sig->filename); printf ("dirname = %s\n", dirname); - filename = g_basename (editor->sig->filename); - printf ("basename = %s\n", filename); - filename = g_strdup_printf ("%s/.#%s", dirname, filename); + base = g_path_get_basename (editor->sig->filename); + printf ("basename = %s\n", base); + filename = g_strdup_printf ("%s/.#%s", dirname, base); printf ("filename = %s\n", filename); g_free (dirname); - + g_free(base); + CORBA_exception_init (&ev); if (editor->html) { Bonobo_PersistFile pfile_iface; - pfile_iface = bonobo_object_client_query_interface (bonobo_widget_get_server (BONOBO_WIDGET (editor->control)), - "IDL:Bonobo/PersistFile:1.0", NULL); + pfile_iface = Bonobo_Unknown_queryInterface(bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), + "IDL:Bonobo/PersistFile:1.0", NULL); Bonobo_PersistFile_save (pfile_iface, filename, &ev); } else { Bonobo_PersistStream pstream_iface; - BonoboStream *stream; - - stream = bonobo_stream_open (BONOBO_IO_DRIVER_FS, filename, - Bonobo_Storage_WRITE | Bonobo_Storage_CREATE, 0644); - BONOBO_STREAM_CLASS (GTK_OBJECT (stream)->klass)->truncate (stream, 0, &ev); + Bonobo_Stream stream; + char *uri; + + uri = g_strdup_printf("file://%s", uri); + stream = bonobo_get_object (uri, "IDL:Bonobo/Stream:1.0", NULL); + g_free(uri); + + /* FIXME: truncate? */ - pstream_iface = bonobo_object_client_query_interface - (bonobo_widget_get_server (BONOBO_WIDGET (editor->control)), + pstream_iface = Bonobo_Unknown_queryInterface + (bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), "IDL:Bonobo/PersistStream:1.0", NULL); - Bonobo_PersistStream_save (pstream_iface, - (Bonobo_Stream) bonobo_object_corba_objref (BONOBO_OBJECT (stream)), - "text/plain", &ev); - - bonobo_object_unref (BONOBO_OBJECT (stream)); + Bonobo_PersistStream_save (pstream_iface, stream, "text/plain", &ev); + + bonobo_object_release_unref(stream, NULL); } if (ev._major != CORBA_NO_EXCEPTION || rename (filename, editor->sig->filename) == -1) { @@ -148,16 +150,12 @@ static void exit_dialog_cb (int reply, ESignatureEditor *editor) { switch (reply) { - case REPLY_YES: + case GTK_RESPONSE_YES: menu_file_save_cb (NULL, editor, NULL); - destroy_editor (editor); break; - case REPLY_NO: + case GTK_RESPONSE_NO: destroy_editor (editor); break; - case REPLY_CANCEL: - default: - break; } } @@ -169,23 +167,22 @@ do_exit (ESignatureEditor *editor) CORBA_exception_init (&ev); if (GNOME_GtkHTML_Editor_Engine_hasUndo (editor->engine, &ev)) { GtkWidget *dialog; - GtkWidget *label; gint button; - dialog = gnome_dialog_new (_("Save signature"), - GNOME_STOCK_BUTTON_YES, /* Save */ - GNOME_STOCK_BUTTON_NO, /* Don't save */ - GNOME_STOCK_BUTTON_CANCEL, /* Cancel */ - NULL); - - label = gtk_label_new (_("This signature has been changed, but hasn't been saved.\n" - "\nDo you wish to save your changes?")); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 0); - gtk_widget_show (label); - gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (editor->win)); - gnome_dialog_set_default (GNOME_DIALOG (dialog), 0); - button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); - + dialog = gtk_message_dialog_new(GTK_WINDOW (editor->win), + GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_YES_NO, + _("This signature has been changed, but hasn't been saved.\n" + "\nDo you wish to save your changes?")); + gtk_dialog_add_button((GtkDialog *)dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); + gtk_window_set_title((GtkWindow *)dialog, _("Save signature")); + gtk_dialog_set_default_response((GtkDialog *)dialog, GTK_RESPONSE_YES); + + button = gtk_dialog_run((GtkDialog *)dialog); + gtk_widget_destroy(dialog); + g_object_unref(dialog); + exit_dialog_cb (button, editor); } else destroy_editor (editor); @@ -223,11 +220,7 @@ menu_file_save_close_cb (BonoboUIComponent *uic, gpointer data, const gchar *pat static void menu_help (BonoboUIComponent *uih, void *data, const char *path) { - GnomeHelpMenuEntry he; - - he.name = PACKAGE; - he.path = "usage-mail-getnsend-send.html#HTML-SIGNATURE-HOWTO"; - gnome_help_display (NULL, &he); + gnome_help_display ("usage-mail-getnsend-send.html", "HTML-SIGNATURE-HOWTO", NULL); } static BonoboUIVerb verbs [] = { @@ -248,8 +241,8 @@ load_signature (ESignatureEditor *editor) if (editor->html) { Bonobo_PersistFile pfile_iface; - pfile_iface = bonobo_object_client_query_interface (bonobo_widget_get_server (BONOBO_WIDGET (editor->control)), - "IDL:Bonobo/PersistFile:1.0", NULL); + pfile_iface = Bonobo_Unknown_queryInterface(bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), + "IDL:Bonobo/PersistFile:1.0", NULL); CORBA_exception_init (&ev); Bonobo_PersistFile_load (pfile_iface, editor->sig->filename, &ev); CORBA_exception_free (&ev); @@ -262,8 +255,8 @@ load_signature (ESignatureEditor *editor) html = g_strdup_printf ("<PRE>\n%s", data); g_free (data); - pstream_iface = bonobo_object_client_query_interface - (bonobo_widget_get_server (BONOBO_WIDGET (editor->control)), + pstream_iface = Bonobo_Unknown_queryInterface + (bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), "IDL:Bonobo/PersistStream:1.0", NULL); CORBA_exception_init (&ev); stream = bonobo_stream_mem_create (html, strlen (html), TRUE, FALSE); @@ -292,7 +285,7 @@ load_signature (ESignatureEditor *editor) static void sig_name_changed (GtkWidget *w, ESignatureEditor *editor) { - mail_config_signature_set_name (editor->sig, e_utf8_gtk_entry_get_text (GTK_ENTRY (editor->name_entry))); + mail_config_signature_set_name (editor->sig, gtk_entry_get_text(GTK_ENTRY (editor->name_entry))); } static void @@ -320,7 +313,6 @@ mail_signature_editor (MailConfigSignature *sig) BonoboUIComponent *component; BonoboUIContainer *container; GtkWidget *vbox, *hbox, *label, *frame, *vbox1; - gchar *title; if (!sig->filename || !*sig->filename) return; @@ -330,19 +322,17 @@ mail_signature_editor (MailConfigSignature *sig) editor->sig = sig; editor->html = sig->html; - title = g_strdup_printf (_("Edit signature")); - editor->win = bonobo_window_new ("e-sig-editor", title); + editor->win = bonobo_window_new ("e-sig-editor", _("Edit signature")); gtk_window_set_default_size (GTK_WINDOW (editor->win), DEFAULT_WIDTH, DEFAULT_HEIGHT); - gtk_window_set_policy (GTK_WINDOW (editor->win), FALSE, TRUE, FALSE); - g_free (title); + g_object_set(editor->win, "allow_shrink", FALSE, "allow_grow", TRUE, NULL); container = bonobo_ui_container_new (); bonobo_ui_container_set_win (container, BONOBO_WINDOW (editor->win)); component = bonobo_ui_component_new_default (); - bonobo_ui_component_set_container (component, bonobo_object_corba_objref (BONOBO_OBJECT (container))); + bonobo_ui_component_set_container (component, bonobo_object_corba_objref (BONOBO_OBJECT (container)), NULL); bonobo_ui_component_add_verb_list_with_data (component, verbs, editor); - bonobo_ui_util_set_ui (component, EVOLUTION_DATADIR, "evolution-signature-editor.xml", "evolution-signature-editor"); + bonobo_ui_util_set_ui (component, EVOLUTION_DATADIR, "evolution-signature-editor.xml", "evolution-signature-editor", NULL); editor->control = bonobo_widget_new_control ("OAFIID:GNOME_GtkHTML_Editor:1.1", bonobo_ui_component_get_container (component)); @@ -354,16 +344,16 @@ mail_signature_editor (MailConfigSignature *sig) return; } - editor->engine = (GNOME_GtkHTML_Editor_Engine) bonobo_object_client_query_interface - (bonobo_widget_get_server (BONOBO_WIDGET (editor->control)), "IDL:GNOME/GtkHTML/Editor/Engine:1.0", NULL); + editor->engine = (GNOME_GtkHTML_Editor_Engine) Bonobo_Unknown_queryInterface + (bonobo_widget_get_objref (BONOBO_WIDGET (editor->control)), "IDL:GNOME/GtkHTML/Editor/Engine:1.0", NULL); load_signature (editor); bonobo_ui_component_set_prop (component, "/commands/FormatHtml", "state", editor->html ? "1" : "0", NULL); bonobo_ui_component_add_listener (component, "FormatHtml", format_html_cb, editor); - gtk_signal_connect (GTK_OBJECT (editor->win), "delete_event", - GTK_SIGNAL_FUNC (delete_event_cb), editor); + g_signal_connect(editor->win, "delete_event", + G_CALLBACK (delete_event_cb), editor); vbox = gtk_vbox_new (FALSE, 0); hbox = gtk_hbox_new (FALSE, 4); @@ -375,8 +365,8 @@ mail_signature_editor (MailConfigSignature *sig) label = gtk_label_new (_("Name:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0); editor->name_entry = gtk_entry_new (); - e_utf8_gtk_entry_set_text (GTK_ENTRY (editor->name_entry), sig->name); - gtk_signal_connect (GTK_OBJECT (editor->name_entry), "changed", GTK_SIGNAL_FUNC (sig_name_changed), editor); + gtk_entry_set_text(GTK_ENTRY (editor->name_entry), sig->name); + g_signal_connect(editor->name_entry, "changed", G_CALLBACK (sig_name_changed), editor); gtk_box_pack_start_defaults (GTK_BOX (hbox), editor->name_entry); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); |