From 8d7130fe72c760ecfdc0041c43acca66598e84e7 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 7 Feb 2003 21:51:51 +0000 Subject: Use g_object_new() instead of gtk_type_new(). 2003-02-07 Jeffrey Stedfast * filter-editor.c (filter_editor_new): Use g_object_new() instead of gtk_type_new(). * vfolder-editor.c (vfolder_editor_new): Use g_object_new() instead of gtk_type_new(). * score-editor.c (score_editor_new): Use g_object_new() instead of gtk_type_new(). * rule-editor.c (rule_editor_new): Use g_object_new() instead of gtk_type_new(). (rule_add): Use gtk_window_set_resizable() instead of the deprecated gtk_window_set_policy(). (rule_edit): Same here. (rule_editor_construct): Here too. * rule-context.c (rule_context_add_rule_gui): Use gtk_window_set_resizable() instead of the deprecated gtk_window_set_policy(). svn path=/trunk/; revision=19847 --- filter/ChangeLog | 22 ++++++++++++++++++++++ filter/filter-editor.c | 5 ++--- filter/filter-folder.c | 2 ++ filter/filter-source.c | 2 ++ filter/rule-context.c | 2 +- filter/rule-editor.c | 9 ++++----- filter/score-editor.c | 2 +- filter/vfolder-editor.c | 3 +-- filter/vfolder-rule.c | 7 +++---- 9 files changed, 38 insertions(+), 16 deletions(-) (limited to 'filter') diff --git a/filter/ChangeLog b/filter/ChangeLog index cfbe50ef4f..6e7f9c8629 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,25 @@ +2003-02-07 Jeffrey Stedfast + + * filter-editor.c (filter_editor_new): Use g_object_new() + instead of gtk_type_new(). + + * vfolder-editor.c (vfolder_editor_new): Use g_object_new() + instead of gtk_type_new(). + + * score-editor.c (score_editor_new): Use g_object_new() instead of + gtk_type_new(). + + * rule-editor.c (rule_editor_new): Use g_object_new() instead of + gtk_type_new(). + (rule_add): Use gtk_window_set_resizable() instead of the + deprecated gtk_window_set_policy(). + (rule_edit): Same here. + (rule_editor_construct): Here too. + + * rule-context.c (rule_context_add_rule_gui): Use + gtk_window_set_resizable() instead of the deprecated + gtk_window_set_policy(). + 2003-02-05 Dan Winship * Makefile.am (gladedir): Defined in configure.in now diff --git a/filter/filter-editor.c b/filter/filter-editor.c index 4a23d2f3d2..57c848d361 100644 --- a/filter/filter-editor.c +++ b/filter/filter-editor.c @@ -71,10 +71,9 @@ static void filter_editor_class_init (FilterEditorClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GtkObjectClass *object_class = (GtkObjectClass *) klass; RuleEditorClass *re_class = (RuleEditorClass *) klass; - parent_class = g_type_class_ref(rule_editor_get_type ()); + parent_class = g_type_class_ref (rule_editor_get_type ()); gobject_class->finalize = filter_editor_finalise; @@ -104,7 +103,7 @@ filter_editor_finalise (GObject *obj) FilterEditor * filter_editor_new (FilterContext *fc, const char **source_names) { - FilterEditor *fe = (FilterEditor *) gtk_type_new (filter_editor_get_type ()); + FilterEditor *fe = (FilterEditor *) g_object_new (FILTER_TYPE_EDITOR, NULL); GladeXML *gui; GtkWidget *w; diff --git a/filter/filter-folder.c b/filter/filter-folder.c index a74b7e82ff..e074c31f6c 100644 --- a/filter/filter-folder.c +++ b/filter/filter-folder.c @@ -25,6 +25,8 @@ #include #endif +#include + #include #include diff --git a/filter/filter-source.c b/filter/filter-source.c index c9fc232a7e..b52dd027b0 100644 --- a/filter/filter-source.c +++ b/filter/filter-source.c @@ -26,6 +26,8 @@ #include #endif +#include + #include "filter-source.h" #include diff --git a/filter/rule-context.c b/filter/rule-context.c index 9882ec899f..b376bb73d4 100644 --- a/filter/rule-context.c +++ b/filter/rule-context.c @@ -686,7 +686,7 @@ rule_context_add_rule_gui (RuleContext *rc, FilterRule *rule, const char *title, gtk_window_set_title ((GtkWindow *) dialog, title); gtk_window_set_default_size ((GtkWindow *) dialog, 600, 400); - gtk_window_set_policy ((GtkWindow *) dialog, FALSE, TRUE, FALSE); + gtk_window_set_resizable ((GtkWindow *) dialog, TRUE); gtk_box_pack_start ((GtkBox *) dialog->vbox, widget, TRUE, TRUE, 0); diff --git a/filter/rule-editor.c b/filter/rule-editor.c index fbda6e0141..903eab8cec 100644 --- a/filter/rule-editor.c +++ b/filter/rule-editor.c @@ -159,7 +159,7 @@ rule_editor_destroy (GtkObject *obj) RuleEditor * rule_editor_new (RuleContext *rc, const char *source) { - RuleEditor *re = (RuleEditor *) gtk_type_new (rule_editor_get_type ()); + RuleEditor *re = (RuleEditor *) g_object_new (RULE_TYPE_EDITOR, NULL); GladeXML *gui; GtkWidget *w; @@ -290,7 +290,7 @@ rule_add (GtkWidget *widget, RuleEditor *re) gtk_window_set_title ((GtkWindow *) re->dialog, _("Add Rule")); gtk_window_set_default_size (GTK_WINDOW (re->dialog), 650, 400); - gtk_window_set_policy (GTK_WINDOW (re->dialog), FALSE, TRUE, FALSE); + gtk_window_set_resizable (GTK_WINDOW (re->dialog), TRUE); gtk_window_set_transient_for ((GtkWindow *) re->dialog, (GtkWindow *) re); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0); @@ -371,7 +371,7 @@ rule_edit (GtkWidget *widget, RuleEditor *re) gtk_window_set_title ((GtkWindow *) re->dialog, _("Edit Rule")); gtk_window_set_default_size (GTK_WINDOW (re->dialog), 650, 400); - gtk_window_set_policy (GTK_WINDOW (re->dialog), FALSE, TRUE, FALSE); + gtk_window_set_resizable (GTK_WINDOW (re->dialog), TRUE); gtk_widget_set_parent_window (GTK_WIDGET (re->dialog), GTK_WIDGET (re)->window); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0); @@ -706,14 +706,13 @@ rule_editor_treeview_new (char *widget_name, char *string1, char *string2, int i void rule_editor_construct (RuleEditor *re, RuleContext *context, GladeXML *gui, const char *source) { - GtkTreeSelection *selection; GtkWidget *w; int i; re->context = context; g_object_ref (context); - gtk_window_set_policy ((GtkWindow *) re, FALSE, TRUE, FALSE); + gtk_window_set_resizable ((GtkWindow *) re, TRUE); w = glade_xml_get_widget (gui, "rule_editor"); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re)->vbox), w, TRUE, TRUE, 0); diff --git a/filter/score-editor.c b/filter/score-editor.c index 064272f321..9a8c0a626c 100644 --- a/filter/score-editor.c +++ b/filter/score-editor.c @@ -103,7 +103,7 @@ score_editor_finalise (GObject *obj) ScoreEditor * score_editor_new (ScoreContext *sc) { - ScoreEditor *se = (ScoreEditor *) gtk_type_new (score_editor_get_type ()); + ScoreEditor *se = (ScoreEditor *) g_object_new (SCORE_TYPE_EDITOR, NULL); GladeXML *gui; GtkWidget *w; diff --git a/filter/vfolder-editor.c b/filter/vfolder-editor.c index 31c6f103f0..8653d1542f 100644 --- a/filter/vfolder-editor.c +++ b/filter/vfolder-editor.c @@ -71,7 +71,6 @@ static void vfolder_editor_class_init (VfolderEditorClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GtkObjectClass *object_class = (GtkObjectClass *) klass; RuleEditorClass *re_class = (RuleEditorClass *) klass; parent_class = g_type_class_ref (rule_editor_get_type ()); @@ -104,7 +103,7 @@ vfolder_editor_finalise (GObject *obj) VfolderEditor * vfolder_editor_new (VfolderContext *vc) { - VfolderEditor *ve = (VfolderEditor *) gtk_type_new (vfolder_editor_get_type ()); + VfolderEditor *ve = (VfolderEditor *) g_object_new (VFOLDER_TYPE_EDITOR, NULL); GladeXML *gui; GtkWidget *w; diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c index 65c1050a5d..1126cb9871 100644 --- a/filter/vfolder-rule.c +++ b/filter/vfolder-rule.c @@ -25,6 +25,8 @@ #include #endif +#include + #include #include #include @@ -397,7 +399,6 @@ source_add (GtkWidget *widget, struct _source_data *data) GtkTreeSelection *selection; GtkTreeIter iter; char *def, *uri; - GList *l; gtk_widget_set_sensitive (widget, FALSE); def = ""; @@ -438,7 +439,6 @@ source_remove (GtkWidget *widget, struct _source_data *data) GtkTreePath *path; GtkTreeIter iter; int index = 0; - GList *l; int len; source = NULL; @@ -526,9 +526,8 @@ static GtkWidget * get_widget (FilterRule *fr, RuleContext *rc) { VfolderRule *vr = (VfolderRule *) fr; - GtkTreeSelection *selection; - struct _source_data *data; GtkWidget *widget, *frame, *list; + struct _source_data *data; GtkOptionMenu *omenu; const char *source; GtkTreeIter iter; -- cgit