aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-search.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-12 22:59:35 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-12 22:59:35 +0800
commitf9804e11931411358ce98ad5a7726de6d68f2115 (patch)
treea8fb046c3abbc7c0e07147c21557a3e22504dbda /mail/mail-search.c
parent83f816df158441ca750b0bc12b7ccab2d43c0e43 (diff)
downloadgsoc2013-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-search.c')
-rw-r--r--mail/mail-search.c102
1 files changed, 54 insertions, 48 deletions
diff --git a/mail/mail-search.c b/mail/mail-search.c
index 4611ece6d2..4ca999bb9c 100644
--- a/mail/mail-search.c
+++ b/mail/mail-search.c
@@ -38,26 +38,27 @@
static GtkObjectClass *parent_class;
static void
-mail_search_destroy (GtkObject *obj)
+mail_search_finalise (GObject *obj)
{
MailSearch *ms = MAIL_SEARCH (obj);
- gtk_signal_disconnect (GTK_OBJECT (ms->mail->html->engine->ht),
- ms->match_handler);
- gtk_signal_disconnect (GTK_OBJECT (ms->mail->html->engine->ht),
- ms->begin_handler);
+ g_signal_handler_disconnect(ms->mail->html->engine->ht, ms->match_handler);
+ g_signal_handler_disconnect(ms->mail->html->engine->ht, ms->begin_handler);
g_free (ms->last_search);
- gtk_object_unref (GTK_OBJECT (ms->mail));
+ g_object_unref((ms->mail));
+
+ ((GObjectClass *)parent_class)->finalize(obj);
}
static void
mail_search_class_init (MailSearchClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
- parent_class = GTK_OBJECT_CLASS (gtk_type_class (gnome_dialog_get_type ()));
+ GObjectClass *object_class = (GObjectClass *) klass;
+
+ parent_class = GTK_OBJECT_CLASS (g_type_class_ref(gtk_dialog_get_type ()));
- object_class->destroy = mail_search_destroy;
+ object_class->finalize = mail_search_finalise;
}
static void
@@ -69,20 +70,20 @@ mail_search_init (MailSearch *ms)
GtkType
mail_search_get_type (void)
{
- static GtkType mail_search_type = 0;
+ static GType mail_search_type = 0;
if (! mail_search_type) {
- GtkTypeInfo mail_search_info = {
- "MailSearch",
- sizeof (MailSearch),
+ GTypeInfo mail_search_info = {
sizeof (MailSearchClass),
- (GtkClassInitFunc) mail_search_class_init,
- (GtkObjectInitFunc) mail_search_init,
- NULL, NULL, /* mysteriously reserved */
- (GtkClassInitFunc) NULL
+ NULL, NULL,
+ (GClassInitFunc) mail_search_class_init,
+ NULL, NULL,
+ sizeof (MailSearch),
+ 0,
+ (GInstanceInitFunc) mail_search_init,
};
- mail_search_type = gtk_type_unique (gnome_dialog_get_type (), &mail_search_info);
+ mail_search_type = g_type_register_static (GTK_TYPE_DIALOG, "MailSearch", &mail_search_info, 0);
}
return mail_search_type;
@@ -129,9 +130,10 @@ mail_search_set_subject (MailSearch *ms, const gchar *subject)
utf8_subject = NULL;
}
- if (utf8_subject)
- gtk_subject = e_utf8_to_gtk_string (GTK_WIDGET (ms->msg_frame), utf8_subject);
-
+ if (utf8_subject) {
+ gtk_subject = utf8_subject;
+ utf8_subject = NULL;
+ }
} else {
gtk_subject = g_strdup (_("(Untitled Message)"));
@@ -257,14 +259,16 @@ match_cb (ESearchingTokenizer *st, MailSearch *ms)
gtk_label_set_text (GTK_LABEL (ms->count_label), buf);
}
+static void
+entry_run_search(GtkWidget *w, MailSearch *ms)
+{
+ /* run search when enter pressed on widget */
+ gtk_dialog_response((GtkDialog *)ms, GTK_RESPONSE_ACCEPT);
+}
+
void
mail_search_construct (MailSearch *ms, MailDisplay *mail)
{
- const gchar *buttons[] = { _("Search"),
- GNOME_STOCK_BUTTON_CLOSE,
- NULL };
- gchar *title = NULL;
-
GtkWidget *find_hbox;
GtkWidget *matches_hbox;
GtkWidget *toggles_hbox;
@@ -276,7 +280,7 @@ mail_search_construct (MailSearch *ms, MailDisplay *mail)
#if 0
GtkWidget *fwd_check;
#endif
-
+ GtkWidget *button;
GtkWidget *msg_hbox;
GtkWidget *msg_frame;
@@ -286,23 +290,26 @@ mail_search_construct (MailSearch *ms, MailDisplay *mail)
/* Basic set-up */
ms->mail = mail;
- gtk_object_ref (GTK_OBJECT (mail));
+ g_object_ref((mail));
- title = g_strdup (_("Find in Message"));
-
- gnome_dialog_constructv (GNOME_DIALOG (ms), title, buttons);
- g_free (title);
+ gtk_window_set_title((GtkWindow *)ms, _("Find in Message"));
+
+ button = gtk_button_new_from_stock(GTK_STOCK_FIND);
+ gtk_button_set_label((GtkButton *)button, _("Search"));
+ gtk_dialog_add_action_widget((GtkDialog*)ms, button, GTK_RESPONSE_ACCEPT);
+ gtk_dialog_add_button((GtkDialog *)ms, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ gtk_dialog_set_default_response((GtkDialog *)ms, GTK_RESPONSE_ACCEPT);
ms->search_forward = TRUE;
ms->case_sensitive = FALSE;
- ms->begin_handler = gtk_signal_connect (GTK_OBJECT (ms->mail->html->engine->ht),
+ ms->begin_handler = g_signal_connect((ms->mail->html->engine->ht),
"begin",
- GTK_SIGNAL_FUNC (begin_cb),
+ G_CALLBACK (begin_cb),
ms);
- ms->match_handler = gtk_signal_connect (GTK_OBJECT (ms->mail->html->engine->ht),
+ ms->match_handler = g_signal_connect((ms->mail->html->engine->ht),
"match",
- GTK_SIGNAL_FUNC (match_cb),
+ G_CALLBACK (match_cb),
ms);
/* Construct the dialog contents. */
@@ -366,11 +373,10 @@ mail_search_construct (MailSearch *ms, MailDisplay *mail)
gtk_container_add (GTK_CONTAINER (msg_frame), GTK_WIDGET (frame_vbox));
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ms)->vbox), msg_hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (ms)->vbox), msg_hbox, TRUE, TRUE, 0);
gtk_widget_grab_focus (entry); /* Give focus to entry by default */
- gnome_dialog_set_default (GNOME_DIALOG (ms), 0);
- gnome_dialog_editable_enters (GNOME_DIALOG (ms), GTK_EDITABLE(entry)); /* Make <enter> run the search */
+ g_signal_connect(entry, "activate", G_CALLBACK(entry_run_search), ms);
gnome_window_icon_set_from_file (GTK_WINDOW (ms), EVOLUTION_ICONSDIR "/find-message.xpm");
gtk_widget_show_all (msg_hbox);
@@ -380,29 +386,29 @@ mail_search_construct (MailSearch *ms, MailDisplay *mail)
/* Hook up signals */
- gtk_signal_connect (GTK_OBJECT (case_check),
+ g_signal_connect((case_check),
"toggled",
- GTK_SIGNAL_FUNC (toggled_case_cb),
+ G_CALLBACK (toggled_case_cb),
ms);
#if 0
- gtk_signal_connect (GTK_OBJECT (fwd_check),
+ g_signal_connect((fwd_check),
"toggled",
- GTK_SIGNAL_FUNC (toggled_fwd_cb),
+ G_CALLBACK (toggled_fwd_cb),
ms);
#endif
- gtk_signal_connect (GTK_OBJECT (ms),
+ g_signal_connect((ms),
"clicked",
- GTK_SIGNAL_FUNC (dialog_clicked_cb),
+ G_CALLBACK (dialog_clicked_cb),
ms);
gtk_signal_connect_object (GTK_OBJECT (ms),
"destroy",
- GTK_SIGNAL_FUNC (dialog_destroy_cb),
+ G_CALLBACK (dialog_destroy_cb),
GTK_OBJECT (ms));
gtk_signal_connect_object (GTK_OBJECT (ms->mail),
"destroy",
- GTK_SIGNAL_FUNC (gtk_widget_destroy),
+ G_CALLBACK (gtk_widget_destroy),
GTK_OBJECT (ms));
}
@@ -413,7 +419,7 @@ mail_search_new (MailDisplay *mail)
g_return_val_if_fail (mail && IS_MAIL_DISPLAY (mail), NULL);
- ptr = gtk_type_new (mail_search_get_type ());
+ ptr = g_object_new(mail_search_get_type (), NULL);
mail_search_construct (MAIL_SEARCH (ptr), mail);
return GTK_WIDGET (ptr);