diff options
Diffstat (limited to 'mail/em-composer-prefs.c')
-rw-r--r-- | mail/em-composer-prefs.c | 290 |
1 files changed, 145 insertions, 145 deletions
diff --git a/mail/em-composer-prefs.c b/mail/em-composer-prefs.c index 15944bad72..4839e4e1f6 100644 --- a/mail/em-composer-prefs.c +++ b/mail/em-composer-prefs.c @@ -87,7 +87,7 @@ GType em_composer_prefs_get_type (void) { static GType type = 0; - + if (!type) { static const GTypeInfo info = { sizeof (EMComposerPrefsClass), @@ -98,10 +98,10 @@ em_composer_prefs_get_type (void) 0, (GInstanceInitFunc) em_composer_prefs_init, }; - + type = g_type_register_static (gtk_vbox_get_type (), "EMComposerPrefs", &info, 0); } - + return type; } @@ -110,9 +110,9 @@ em_composer_prefs_class_init (EMComposerPrefsClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); - + parent_class = g_type_class_ref (gtk_vbox_get_type ()); - + object_class->destroy = em_composer_prefs_destroy; gobject_class->finalize = em_composer_prefs_finalise; } @@ -131,12 +131,12 @@ static void em_composer_prefs_finalise (GObject *obj) { EMComposerPrefs *prefs = (EMComposerPrefs *) obj; - + g_object_unref (prefs->gui); g_object_unref (prefs->enabled_pixbuf); - + g_hash_table_destroy (prefs->sig_hash); - + G_OBJECT_CLASS (parent_class)->finalize (obj); } @@ -145,24 +145,24 @@ em_composer_prefs_destroy (GtkObject *obj) { EMComposerPrefs *prefs = (EMComposerPrefs *) obj; ESignatureList *signatures; - + signatures = mail_config_get_signatures (); - + if (prefs->sig_added_id != 0) { g_signal_handler_disconnect (signatures, prefs->sig_added_id); prefs->sig_added_id = 0; } - + if (prefs->sig_removed_id != 0) { g_signal_handler_disconnect (signatures, prefs->sig_removed_id); prefs->sig_removed_id = 0; } - + if (prefs->sig_changed_id != 0) { g_signal_handler_disconnect (signatures, prefs->sig_changed_id); prefs->sig_changed_id = 0; } - + GTK_OBJECT_CLASS (parent_class)->destroy (obj); } @@ -171,26 +171,26 @@ static void sig_load_preview (EMComposerPrefs *prefs, ESignature *sig) { char *str; - + if (!sig) { gtk_html_load_from_string (GTK_HTML (prefs->sig_preview), " ", 1); return; } - + if (sig->script) str = mail_config_signature_run_script (sig->filename); else str = e_msg_composer_get_sig_file_content (sig->filename, sig->html); if (!str) str = g_strdup (""); - + /* printf ("HTML: %s\n", str); */ if (sig->html) { gtk_html_load_from_string (GTK_HTML (prefs->sig_preview), str, strlen (str)); } else { GtkHTMLStream *stream; int len; - + len = strlen (str); stream = gtk_html_begin_content (GTK_HTML (prefs->sig_preview), "text/html; charset=utf-8"); gtk_html_write (GTK_HTML (prefs->sig_preview), stream, "<PRE>", 5); @@ -199,7 +199,7 @@ sig_load_preview (EMComposerPrefs *prefs, ESignature *sig) gtk_html_write (GTK_HTML (prefs->sig_preview), stream, "</PRE>", 6); gtk_html_end (GTK_HTML (prefs->sig_preview), stream, GTK_HTML_STREAM_OK); } - + g_free (str); } @@ -210,19 +210,19 @@ signature_added (ESignatureList *signatures, ESignature *sig, EMComposerPrefs *p GtkTreeModel *model; GtkTreePath *path; GtkTreeIter iter; - + /* autogen signature is special */ if (sig->autogen) return; - + model = gtk_tree_view_get_model (prefs->sig_list); gtk_list_store_append ((GtkListStore *) model, &iter); gtk_list_store_set ((GtkListStore *) model, &iter, 0, sig->name, 1, sig, -1); - + path = gtk_tree_model_get_path (model, &iter); row = gtk_tree_row_reference_new (model, path); gtk_tree_path_free (path); - + g_hash_table_insert (prefs->sig_hash, sig, row); } @@ -233,19 +233,19 @@ signature_removed (ESignatureList *signatures, ESignature *sig, EMComposerPrefs GtkTreeModel *model; GtkTreePath *path; GtkTreeIter iter; - + if (!(row = g_hash_table_lookup (prefs->sig_hash, sig))) return; - + model = gtk_tree_view_get_model (prefs->sig_list); path = gtk_tree_row_reference_get_path (row); g_hash_table_remove (prefs->sig_hash, sig); - + if (!gtk_tree_model_get_iter (model, &iter, path)) { gtk_tree_path_free (path); return; } - + gtk_list_store_remove ((GtkListStore *) model, &iter); } @@ -258,22 +258,22 @@ signature_changed (ESignatureList *signatures, ESignature *sig, EMComposerPrefs GtkTreePath *path; GtkTreeIter iter; ESignature *cur; - + if (!(row = g_hash_table_lookup (prefs->sig_hash, sig))) return; - + model = gtk_tree_view_get_model (prefs->sig_list); path = gtk_tree_row_reference_get_path (row); - + if (!gtk_tree_model_get_iter (model, &iter, path)) { gtk_tree_path_free (path); return; } - + gtk_tree_path_free (path); - + gtk_list_store_set ((GtkListStore *) model, &iter, 0, sig->name, -1); - + selection = gtk_tree_view_get_selection (prefs->sig_list); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (model, &iter, 1, &cur, -1); @@ -290,36 +290,36 @@ sig_edit_cb (GtkWidget *widget, EMComposerPrefs *prefs) GtkWidget *parent; GtkTreeIter iter; ESignature *sig; - + selection = gtk_tree_view_get_selection (prefs->sig_list); if (!gtk_tree_selection_get_selected (selection, &model, &iter)) return; - + gtk_tree_model_get (model, &iter, 1, &sig, -1); - + if (!sig->script) { /* normal signature */ if (!sig->filename || *sig->filename == '\0') { g_free (sig->filename); sig->filename = g_strdup (_("Unnamed")); } - + parent = gtk_widget_get_toplevel ((GtkWidget *) prefs); parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; - + mail_signature_editor (sig, (GtkWindow *) parent, FALSE); } else { /* signature script */ GtkWidget *entry; - + entry = glade_xml_get_widget (prefs->sig_script_gui, "filechooserbutton_add_script"); gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (entry), sig->filename); - + entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name"); gtk_entry_set_text (GTK_ENTRY (entry), sig->name); - + g_object_set_data ((GObject *) entry, "sig", sig); - + gtk_window_present ((GtkWindow *) prefs->sig_script_dialog); } } @@ -328,12 +328,12 @@ void em_composer_prefs_new_signature (GtkWindow *parent, gboolean html) { ESignature *sig; - + sig = mail_config_signature_new (NULL, FALSE, html); mail_signature_editor (sig, parent, TRUE); } -static void +static void sig_delete_cb (GtkWidget *widget, EMComposerPrefs *prefs) { GtkTreeSelection *selection; @@ -356,13 +356,13 @@ sig_add_cb (GtkWidget *widget, EMComposerPrefs *prefs) GConfClient *gconf; gboolean send_html; GtkWidget *parent; - + gconf = mail_config_get_gconf_client (); send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL); - + parent = gtk_widget_get_toplevel ((GtkWidget *) prefs); parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; - + em_composer_prefs_new_signature ((GtkWindow *) parent, send_html); gtk_widget_grab_focus ((GtkWidget *)prefs->sig_list); } @@ -374,19 +374,19 @@ sig_add_script_response (GtkWidget *widget, int button, EMComposerPrefs *prefs) GtkWidget *entry; const char *name; int argc; - + if (button == GTK_RESPONSE_ACCEPT) { entry = glade_xml_get_widget (prefs->sig_script_gui, "filechooserbutton_add_script"); script = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (entry)); - + entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name"); name = gtk_entry_get_text (GTK_ENTRY (entry)); if (script && *script && g_shell_parse_argv (script, &argc, &argv, NULL)) { struct stat st; - + if (g_stat (argv[0], &st) == 0 && S_ISREG (st.st_mode) && g_access (argv[0], X_OK) == 0) { ESignature *sig; - + if ((sig = g_object_get_data ((GObject *) entry, "sig"))) { /* we're just editing an existing signature script */ g_free (sig->name); @@ -397,27 +397,27 @@ sig_add_script_response (GtkWidget *widget, int button, EMComposerPrefs *prefs) } else { sig = mail_config_signature_new (script, TRUE, TRUE); sig->name = g_strdup (name); - + e_signature_list_add (mail_config_get_signatures (), sig); g_object_unref (sig); } - + mail_config_save_signatures(); gtk_widget_hide (prefs->sig_script_dialog); g_strfreev (argv); g_free (script); - + return; } } - + e_error_run((GtkWindow *)prefs->sig_script_dialog, "mail:signature-notscript", argv ? argv[0] : script, NULL); g_strfreev (argv); g_free (script); return; } - + gtk_widget_hide (widget); } @@ -425,12 +425,12 @@ static void sig_add_script_cb (GtkWidget *widget, EMComposerPrefs *prefs) { GtkWidget *entry; - + entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name"); gtk_entry_set_text (GTK_ENTRY (entry), _("Unnamed")); - + g_object_set_data ((GObject *) entry, "sig", NULL); - + gtk_window_present ((GtkWindow *) prefs->sig_script_dialog); } @@ -441,14 +441,14 @@ sig_selection_changed (GtkTreeSelection *selection, EMComposerPrefs *prefs) GtkTreeIter iter; ESignature *sig; int state; - + state = gtk_tree_selection_get_selected (selection, &model, &iter); if (state) { gtk_tree_model_get (model, &iter, 1, &sig, -1); sig_load_preview (prefs, sig); } else sig_load_preview (prefs, NULL); - + gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, state); gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, state); } @@ -459,27 +459,27 @@ sig_fill_list (EMComposerPrefs *prefs) ESignatureList *signatures; GtkListStore *model; EIterator *it; - + model = (GtkListStore *) gtk_tree_view_get_model (prefs->sig_list); gtk_list_store_clear (model); - + signatures = mail_config_get_signatures (); it = e_list_get_iterator ((EList *) signatures); - + while (e_iterator_is_valid (it)) { ESignature *sig; - + sig = (ESignature *) e_iterator_get (it); signature_added (signatures, sig, prefs); - + e_iterator_next (it); } - + g_object_unref (it); - + gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, FALSE); gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, FALSE); - + prefs->sig_added_id = g_signal_connect (signatures, "signature-added", G_CALLBACK (signature_added), prefs); prefs->sig_removed_id = g_signal_connect (signatures, "signature-removed", G_CALLBACK (signature_removed), prefs); prefs->sig_changed_id = g_signal_connect (signatures, "signature-changed", G_CALLBACK (signature_changed), prefs); @@ -493,7 +493,7 @@ url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle) ssize_t size; int fd; char *filename; - + if (!strncmp (url, "file:", 5)) filename = g_filename_from_uri (url, NULL, NULL); else @@ -512,7 +512,7 @@ url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle) } } else status = GTK_HTML_STREAM_ERROR; - + gtk_html_end (html, handle, status); if (fd > 0) close (fd); @@ -542,37 +542,37 @@ spell_set_ui (EMComposerPrefs *prefs) gboolean go; char *lang; int i; - + prefs->spell_active = FALSE; - + /* setup the language list */ if (!(lang = gconf_client_get_string (prefs->gconf, GNOME_SPELL_GCONF_DIR "/language", &err)) || err) { g_free (lang); g_clear_error (&err); lang = g_strdup (e_iconv_locale_language ()); } - + present = g_hash_table_new (g_str_hash, g_str_equal); if (lang && (strv = g_strsplit (lang, " ", 0))) { for (i = 0; strv[i]; i++) g_hash_table_insert (present, strv[i], strv[i]); } - + g_free (lang); - + model = (GtkListStore *) gtk_tree_view_get_model (prefs->language); for (go = gtk_tree_model_get_iter_first ((GtkTreeModel *) model, &iter); go; go = gtk_tree_model_iter_next ((GtkTreeModel *) model, &iter)) { char *abbr; - + gtk_tree_model_get ((GtkTreeModel *) model, &iter, 2, &abbr, -1); gtk_list_store_set (model, &iter, 0, g_hash_table_lookup (present, abbr) != NULL, -1); } - + g_hash_table_destroy (present); if (strv != NULL) g_strfreev (strv); - + color.red = gconf_client_get_int (prefs->gconf, GNOME_SPELL_GCONF_DIR "/spell_error_color_red", NULL); color.green = gconf_client_get_int (prefs->gconf, @@ -580,7 +580,7 @@ spell_set_ui (EMComposerPrefs *prefs) color.blue = gconf_client_get_int (prefs->gconf, GNOME_SPELL_GCONF_DIR "/spell_error_color_blue", NULL); gtk_color_button_set_color (GTK_COLOR_BUTTON (prefs->color), &color); - + prefs->spell_active = TRUE; } @@ -609,36 +609,36 @@ spell_get_language_str (EMComposerPrefs *prefs) GtkTreeIter iter; GString *str; char *rv; - + model = (GtkListStore *) gtk_tree_view_get_model (prefs->language); if (!gtk_tree_model_get_iter_first ((GtkTreeModel *) model, &iter)) return NULL; - + str = g_string_new (""); - + do { gboolean state; char *abbr; - + gtk_tree_model_get ((GtkTreeModel *) model, &iter, 0, &state, 2, &abbr, -1); - + if (state) { if (str->len) g_string_append_c (str, ' '); g_string_append (str, abbr); } - + if (!gtk_tree_model_iter_next ((GtkTreeModel *) model, &iter)) break; } while (1); - + rv = str->str; g_string_free (str, FALSE); - + return rv; } -static void +static void spell_language_toggled (GtkCellRendererToggle *renderer, const char *path_string, EMComposerPrefs *prefs) { GtkTreePath *path = gtk_tree_path_new_from_string (path_string); @@ -646,12 +646,12 @@ spell_language_toggled (GtkCellRendererToggle *renderer, const char *path_string GtkTreeIter iter; gboolean enabled; char *str; - + model = gtk_tree_view_get_model (prefs->language); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get (model, &iter, 0, &enabled, -1); gtk_list_store_set ((GtkListStore *) model, &iter, 0, !enabled, -1); - + str = spell_get_language_str (prefs); gconf_client_set_string (prefs->gconf, GNOME_SPELL_GCONF_DIR "/language", str ? str : "", NULL); g_free (str); @@ -666,9 +666,9 @@ spell_setup (EMComposerPrefs *prefs) GtkTreeIter iter; GtkWidget *widget; int i; - + model = (GtkListStore *) gtk_tree_view_get_model (prefs->language); - + if (prefs->language_seq) { for (i = 0; i < prefs->language_seq->_length; i++) { gtk_list_store_append (model, &iter); @@ -678,9 +678,9 @@ spell_setup (EMComposerPrefs *prefs) -1); } } - + spell_set_ui (prefs); - + widget = glade_xml_get_widget (prefs->gui, "colorButtonSpellCheckColor"); g_signal_connect (widget, "color_set", G_CALLBACK (spell_color_set), prefs); } @@ -691,28 +691,28 @@ spell_setup_check_options (EMComposerPrefs *prefs) GNOME_Spell_Dictionary dict; CORBA_Environment ev; char *dictionary_id; - + dictionary_id = "OAFIID:GNOME_Spell_Dictionary:" SPELL_API_VERSION; dict = bonobo_activation_activate_from_id (dictionary_id, 0, NULL, NULL); if (dict == CORBA_OBJECT_NIL) { g_warning ("Cannot activate %s", dictionary_id); - + return FALSE; } - + CORBA_exception_init (&ev); prefs->language_seq = GNOME_Spell_Dictionary_getLanguages (dict, &ev); if (ev._major != CORBA_NO_EXCEPTION) prefs->language_seq = NULL; CORBA_exception_free (&ev); - + if (prefs->language_seq == NULL) return FALSE; - + gconf_client_add_dir (prefs->gconf, GNOME_SPELL_GCONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL); - + spell_setup (prefs); - + return TRUE; } @@ -725,9 +725,9 @@ static void attach_style_info (GtkWidget *item, gpointer user_data) { int *style = user_data; - + g_object_set_data ((GObject *) item, "style", GINT_TO_POINTER (*style)); - + (*style)++; } @@ -735,7 +735,7 @@ static void toggle_button_toggled (GtkToggleButton *toggle, EMComposerPrefs *prefs) { const char *key; - + key = g_object_get_data ((GObject *) toggle, "key"); gconf_client_set_bool (prefs->gconf, key, gtk_toggle_button_get_active (toggle), NULL); } @@ -745,10 +745,10 @@ style_activate (GtkWidget *item, EMComposerPrefs *prefs) { const char *key; int style; - + key = g_object_get_data ((GObject *) item, "key"); style = GPOINTER_TO_INT (g_object_get_data ((GObject *) item, "style")); - + gconf_client_set_int (prefs->gconf, key, style, NULL); } @@ -757,11 +757,11 @@ charset_activate (GtkWidget *item, EMComposerPrefs *prefs) { GtkWidget *menu; char *string; - + menu = gtk_option_menu_get_menu (prefs->charset); if (!(string = e_charset_picker_get_charset (menu))) string = g_strdup (e_iconv_locale_charset ()); - + gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/composer/charset", string, NULL); g_free (string); } @@ -771,9 +771,9 @@ option_menu_connect (EMComposerPrefs *prefs, GtkOptionMenu *omenu, GCallback cal { GtkWidget *menu, *item; GList *items; - + menu = gtk_option_menu_get_menu (omenu); - + items = GTK_MENU_SHELL (menu)->children; while (items) { item = items->data; @@ -781,7 +781,7 @@ option_menu_connect (EMComposerPrefs *prefs, GtkOptionMenu *omenu, GCallback cal g_signal_connect (item, "activate", callback, prefs); items = items->next; } - + if (!gconf_client_key_is_writable (prefs->gconf, key, NULL)) gtk_widget_set_sensitive ((GtkWidget *) omenu, FALSE); } @@ -790,13 +790,13 @@ static void toggle_button_init (EMComposerPrefs *prefs, GtkToggleButton *toggle, int not, const char *key) { gboolean bool; - + bool = gconf_client_get_bool (prefs->gconf, key, NULL); gtk_toggle_button_set_active (toggle, not ? !bool : bool); - + g_object_set_data ((GObject *) toggle, "key", (void *) key); g_signal_connect (toggle, "toggled", G_CALLBACK (toggle_button_toggled), prefs); - + if (!gconf_client_key_is_writable (prefs->gconf, key, NULL)) gtk_widget_set_sensitive ((GtkWidget *) toggle, FALSE); } @@ -832,8 +832,8 @@ emcp_free(EConfig *ec, GSList *items, void *data) } static gboolean -signature_key_press (GtkTreeView *tree_view, GdkEventKey *event, EMComposerPrefs *prefs) -{ +signature_key_press (GtkTreeView *tree_view, GdkEventKey *event, EMComposerPrefs *prefs) +{ gboolean ret = FALSE; /* No need to care about anything other than DEL key */ @@ -845,16 +845,16 @@ signature_key_press (GtkTreeView *tree_view, GdkEventKey *event, EMComposerPrefs return ret; } -static gboolean +static gboolean sig_tree_event_cb (GtkTreeView *tree_view, GdkEvent *event, EMComposerPrefs *prefs) { gboolean ret = FALSE; - + if (event->type == GDK_2BUTTON_PRESS) { sig_edit_cb ((GtkWidget *)tree_view, prefs); ret = TRUE; - } - + } + return ret; } @@ -874,9 +874,9 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) GSList *l; int i; char *gladefile; - + prefs->gconf = mail_config_get_gconf_client (); - + gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); @@ -900,24 +900,24 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) e_config_add_items((EConfig *)ec, l, NULL, NULL, emcp_free, prefs); /* General tab */ - + /* Default Behavior */ prefs->send_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkSendHTML")); toggle_button_init (prefs, prefs->send_html, FALSE, "/apps/evolution/mail/composer/send_html"); - + prefs->prompt_empty_subject = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptEmptySubject")); toggle_button_init (prefs, prefs->prompt_empty_subject, FALSE, "/apps/evolution/mail/prompts/empty_subject"); - + prefs->prompt_bcc_only = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptBccOnly")); toggle_button_init (prefs, prefs->prompt_bcc_only, FALSE, "/apps/evolution/mail/prompts/only_bcc"); - + prefs->auto_smileys = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkAutoSmileys")); toggle_button_init (prefs, prefs->auto_smileys, FALSE, "/apps/evolution/mail/composer/magic_smileys"); - + prefs->top_signature = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkTopSignature")); toggle_button_init (prefs, prefs->top_signature, FALSE, "/apps/evolution/mail/composer/top_signature"); @@ -925,7 +925,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) prefs->spell_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEnableSpellChecking")); toggle_button_init (prefs, prefs->spell_check, FALSE, "/apps/evolution/mail/composer/inline_spelling"); - + prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset")); buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/composer/charset", NULL); menu = e_charset_picker_new (buf && *buf ? buf : e_iconv_locale_charset ()); @@ -933,7 +933,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) option_menu_connect (prefs, prefs->charset, G_CALLBACK (charset_activate), "/apps/evolution/mail/composer/charset"); g_free (buf); - + /* Spell Checking: GNOME Spell part */ prefs->color = GTK_COLOR_BUTTON (glade_xml_get_widget (gui, "colorButtonSpellCheckColor")); prefs->language = GTK_TREE_VIEW (glade_xml_get_widget (gui, "listSpellCheckLanguage")); @@ -945,7 +945,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) "active", 0, NULL); g_signal_connect (cell_renderer, "toggled", G_CALLBACK (spell_language_toggled), prefs); - + gtk_tree_view_insert_column_with_attributes (prefs->language, -1, _("Language(s)"), gtk_cell_renderer_text_new (), "text", 1, @@ -958,7 +958,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) gtk_widget_hide (GTK_WIDGET (prefs->color)); gtk_widget_hide (GTK_WIDGET (prefs->language)); } - + /* Forwards and Replies */ prefs->forward_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuForwardStyle")); style = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/format/forward_style", NULL); @@ -968,7 +968,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) attach_style_info, &style); option_menu_connect (prefs, prefs->forward_style, G_CALLBACK (style_activate), "/apps/evolution/mail/format/forward_style"); - + prefs->reply_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuReplyStyle")); style = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/format/reply_style", NULL); gtk_option_menu_set_history (prefs->reply_style, style); @@ -977,14 +977,14 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) attach_style_info, &style); option_menu_connect (prefs, prefs->reply_style, G_CALLBACK (style_activate), "/apps/evolution/mail/format/reply_style"); - + /* Signatures */ dialog = (GtkDialog *) gtk_dialog_new (); - + gtk_widget_realize ((GtkWidget *) dialog); gtk_container_set_border_width ((GtkContainer *)dialog->action_area, 12); gtk_container_set_border_width ((GtkContainer *)dialog->vbox, 0); - + prefs->sig_script_dialog = (GtkWidget *) dialog; gtk_dialog_add_buttons (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); @@ -993,19 +993,19 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) g_signal_connect (dialog, "response", G_CALLBACK (sig_add_script_response), prefs); widget = glade_xml_get_widget (prefs->sig_script_gui, "vbox_add_script_signature"); gtk_box_pack_start ((GtkBox *) dialog->vbox, widget, TRUE, TRUE, 0); - + prefs->sig_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureAdd")); g_signal_connect (prefs->sig_add, "clicked", G_CALLBACK (sig_add_cb), prefs); - + prefs->sig_add_script = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureAddScript")); g_signal_connect (prefs->sig_add_script, "clicked", G_CALLBACK (sig_add_script_cb), prefs); - + prefs->sig_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureEdit")); g_signal_connect (prefs->sig_edit, "clicked", G_CALLBACK (sig_edit_cb), prefs); - + prefs->sig_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureDelete")); g_signal_connect (prefs->sig_delete, "clicked", G_CALLBACK (sig_delete_cb), prefs); - + prefs->sig_list = GTK_TREE_VIEW (glade_xml_get_widget (gui, "listSignatures")); model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); gtk_tree_view_set_model (prefs->sig_list, (GtkTreeModel *)model); @@ -1017,9 +1017,9 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); g_signal_connect (selection, "changed", G_CALLBACK (sig_selection_changed), prefs); g_signal_connect (prefs->sig_list, "event", G_CALLBACK (sig_tree_event_cb), prefs); - + sig_fill_list (prefs); - + /* preview GtkHTML widget */ widget = glade_xml_get_widget (gui, "scrolled-sig"); prefs->sig_preview = (GtkHTML *) gtk_html_new (); @@ -1032,7 +1032,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) e_config_set_target((EConfig *)ec, (EConfigTarget *)target); toplevel = e_config_create_widget((EConfig *)ec); gtk_container_add (GTK_CONTAINER (prefs), toplevel); - + g_signal_connect (prefs->sig_list, "key-press-event", G_CALLBACK(signature_key_press), prefs); } @@ -1040,9 +1040,9 @@ GtkWidget * em_composer_prefs_new (void) { EMComposerPrefs *new; - + new = (EMComposerPrefs *) g_object_new (em_composer_prefs_get_type (), NULL); em_composer_prefs_construct (new); - + return (GtkWidget *) new; } |