aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-26 19:25:51 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-26 19:25:51 +0800
commit93723877699c0a64fd25d8dcb11289359710bc6e (patch)
treee89cc76be1d472f2ca763140db6b8c75baa6c1c3
parentfb5e3d7237caed2397643f7e3d1e89572567bc64 (diff)
downloadgsoc2013-evolution-93723877699c0a64fd25d8dcb11289359710bc6e.tar.gz
gsoc2013-evolution-93723877699c0a64fd25d8dcb11289359710bc6e.tar.zst
gsoc2013-evolution-93723877699c0a64fd25d8dcb11289359710bc6e.zip
FILTER_RULE_CLASS -> _GET_CLASS
2002-11-26 Not Zed <NotZed@Ximian.com> * filter-rule.c (filter_rule_validate): FILTER_RULE_CLASS -> _GET_CLASS * rule-context.c (rule_context_save): RULE_CONTEXT_CLASS -> RULE_CONTEXT_GET_CLASS (rule_context_revert): " * *.[ch]: Ran fix.sh over all files. * rule-editor.c (rule_add): widget:set_parent -> window:set_transient_for (editor_response): renamed from editor_clicked, handle gtk dialog response codes. (rule_edit): connect to response rather than clicked. (rule_editor_construct): Setup a text column in the tree view. Not sure if this can be handled via glade. svn path=/trunk/; revision=18922
-rw-r--r--filter/ChangeLog19
-rw-r--r--filter/filter-colour.c3
-rw-r--r--filter/filter-datespec.c8
-rw-r--r--filter/filter-editor.c8
-rw-r--r--filter/filter-editor.h8
-rw-r--r--filter/filter-file.c2
-rw-r--r--filter/filter-filter.c10
-rw-r--r--filter/filter-folder.c2
-rw-r--r--filter/filter-input.c2
-rw-r--r--filter/filter-int.c2
-rw-r--r--filter/filter-option.c4
-rw-r--r--filter/filter-rule.c22
-rw-r--r--filter/filter-source.c4
-rw-r--r--filter/rule-context.c6
-rw-r--r--filter/rule-editor.c33
-rw-r--r--filter/rule-editor.h8
-rw-r--r--filter/score-editor.c2
-rw-r--r--filter/score-editor.h8
-rw-r--r--filter/score-rule.c2
-rw-r--r--filter/vfolder-editor.c2
-rw-r--r--filter/vfolder-editor.h8
-rw-r--r--filter/vfolder-rule.c8
22 files changed, 97 insertions, 74 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index c2d3ec49f5..6ff5f2192b 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,22 @@
+2002-11-26 Not Zed <NotZed@Ximian.com>
+
+ * filter-rule.c (filter_rule_validate): FILTER_RULE_CLASS ->
+ _GET_CLASS
+
+ * rule-context.c (rule_context_save): RULE_CONTEXT_CLASS ->
+ RULE_CONTEXT_GET_CLASS
+ (rule_context_revert): "
+
+ * *.[ch]: Ran fix.sh over all files.
+
+ * rule-editor.c (rule_add): widget:set_parent ->
+ window:set_transient_for
+ (editor_response): renamed from editor_clicked, handle gtk dialog
+ response codes.
+ (rule_edit): connect to response rather than clicked.
+ (rule_editor_construct): Setup a text column in the tree view.
+ Not sure if this can be handled via glade.
+
2002-11-20 Jeffrey Stedfast <fejj@ximian.com>
* filter-label.c (xml_create): gconfify.
diff --git a/filter/filter-colour.c b/filter/filter-colour.c
index c2de04f8a4..63d1d07e03 100644
--- a/filter/filter-colour.c
+++ b/filter/filter-colour.c
@@ -48,7 +48,6 @@ static void filter_colour_finalise (GObject *obj);
static FilterElementClass *parent_class;
-
GType
filter_colour_get_type (void)
{
@@ -207,7 +206,7 @@ get_widget (FilterElement *fe)
cp = (GnomeColorPicker *) gnome_color_picker_new ();
gnome_color_picker_set_i16 (cp, fc->r, fc->g, fc->b, fc->a);
gtk_widget_show ((GtkWidget *) cp);
- g_signal_connect (cp, "color_set", GTK_SIGNAL_FUNC (set_colour), fe);
+ g_signal_connect (cp, "color_set", G_CALLBACK (set_colour), fe);
return (GtkWidget *) cp;
}
diff --git a/filter/filter-datespec.c b/filter/filter-datespec.c
index 8feb6d8024..34f1ba61e7 100644
--- a/filter/filter-datespec.c
+++ b/filter/filter-datespec.c
@@ -427,13 +427,13 @@ button_clicked (GtkButton *button, FilterDatespec *fds)
set_values (fds);
g_signal_connect (GTK_OPTION_MENU (p->option_type)->menu, "deactivate",
- GTK_SIGNAL_FUNC (set_option_type), fds);
+ G_CALLBACK (set_option_type), fds);
g_signal_connect (GTK_OPTION_MENU (p->option_relative)->menu, "deactivate",
- GTK_SIGNAL_FUNC (set_option_relative), fds);
+ G_CALLBACK (set_option_relative), fds);
gtk_box_pack_start ((GtkBox *) dialog->vbox, toplevel, TRUE, TRUE, 3);
- g_signal_connect (dialog, "response", GTK_SIGNAL_FUNC (dialog_response), fds);
+ g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), fds);
gtk_dialog_run (dialog);
}
@@ -450,7 +450,7 @@ get_widget (FilterElement *fe)
button = gtk_button_new();
gtk_container_add (GTK_CONTAINER (button), fds->priv->label_button);
- g_signal_connect (button, "clicked", GTK_SIGNAL_FUNC (button_clicked), fds);
+ g_signal_connect (button, "clicked", G_CALLBACK (button_clicked), fds);
gtk_widget_show (button);
gtk_widget_show (fds->priv->label_button);
diff --git a/filter/filter-editor.c b/filter/filter-editor.c
index a15269b89b..ccd6637411 100644
--- a/filter/filter-editor.c
+++ b/filter/filter-editor.c
@@ -73,7 +73,7 @@ filter_editor_class_init (FilterEditorClass *klass)
GtkObjectClass *object_class = (GtkObjectClass *) klass;
RuleEditorClass *re_class = (RuleEditorClass *) klass;
- parent_class = gtk_type_class (rule_editor_get_type ());
+ parent_class = g_type_class_ref(rule_editor_get_type ());
gobject_class->finalize = filter_editor_finalise;
@@ -123,7 +123,7 @@ select_source (GtkMenuItem *mi, FilterEditor *fe)
{
char *source;
- source = gtk_object_get_data (GTK_OBJECT (mi), "source");
+ source = g_object_get_data(G_OBJECT(mi), "source");
g_assert (source);
rule_editor_set_source ((RuleEditor *)fe, source);
@@ -142,9 +142,9 @@ filter_editor_construct (FilterEditor *fe, FilterContext *fc, GladeXML *gui, con
for (i = 0; source_names[i]; i++) {
item = gtk_menu_item_new_with_label (_(source_names[i]));
g_object_set_data_full (G_OBJECT (item), "source", g_strdup (source_names[i]), g_free);
- gtk_menu_append (GTK_MENU (menu), item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show (item);
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (select_source), fe);
+ g_signal_connect (item, "activate", G_CALLBACK (select_source), fe);
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
gtk_widget_show (omenu);
diff --git a/filter/filter-editor.h b/filter/filter-editor.h
index 7b38418fd4..4b01e3b877 100644
--- a/filter/filter-editor.h
+++ b/filter/filter-editor.h
@@ -28,10 +28,10 @@
#include "filter-context.h"
#define FILTER_TYPE_EDITOR (filter_editor_get_type ())
-#define FILTER_EDITOR(obj) (GTK_CHECK_CAST ((obj), FILTER_TYPE_EDITOR, FilterEditor))
-#define FILTER_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), FILTER_TYPE_EDITOR, FilterEditorClass))
-#define IS_FILTER_EDITOR(obj) (GTK_CHECK_TYPE ((obj), FILTER_TYPE_EDITOR))
-#define IS_FILTER_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), FILTER_TYPE_EDITOR))
+#define FILTER_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILTER_TYPE_EDITOR, FilterEditor))
+#define FILTER_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILTER_TYPE_EDITOR, FilterEditorClass))
+#define IS_FILTER_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILTER_TYPE_EDITOR))
+#define IS_FILTER_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILTER_TYPE_EDITOR))
#define FILTER_EDITOR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), FILTER_TYPE_EDITOR, FilterEditorClass))
typedef struct _FilterEditor FilterEditor;
diff --git a/filter/filter-file.c b/filter/filter-file.c
index 2efb5dd6fa..265f0855dd 100644
--- a/filter/filter-file.c
+++ b/filter/filter-file.c
@@ -297,7 +297,7 @@ get_widget (FilterElement *fe)
entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (fileentry));
gtk_entry_set_text (GTK_ENTRY (entry), file->path);
- g_signal_connect (entry, "changed", GTK_SIGNAL_FUNC (entry_changed), fe);
+ g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), fe);
return fileentry;
}
diff --git a/filter/filter-filter.c b/filter/filter-filter.c
index 1b34425188..eb9ad141c2 100644
--- a/filter/filter-filter.c
+++ b/filter/filter-filter.c
@@ -296,7 +296,7 @@ rule_copy (FilterRule *dest, FilterRule *src)
fsrc = (FilterFilter *) src;
if (fdest->actions) {
- g_list_foreach (fdest->actions, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (fdest->actions, (GFunc) g_object_unref, NULL);
g_list_free (fdest->actions);
fdest->actions = NULL;
}
@@ -380,8 +380,8 @@ get_rule_part_widget (FilterContext *f, FilterPart *newpart, FilterRule *fr)
item = gtk_menu_item_new_with_label (_(part->title));
g_object_set_data ((GObject *) item, "part", part);
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (option_activate), data);
- gtk_menu_append (GTK_MENU (menu), item);
+ g_signal_connect (item, "activate", G_CALLBACK (option_activate), data);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show (item);
if (!strcmp (newpart->title, part->title))
@@ -445,7 +445,7 @@ attach_rule (GtkWidget *rule, struct _rule_data *data, FilterPart *part, int row
g_object_set_data ((GObject *) remove, "rule", rule);
g_object_set_data ((GObject *) rule, "part", part);
/*gtk_button_set_relief (GTK_BUTTON (remove), GTK_RELIEF_NONE);*/
- g_signal_connect (remove, "clicked", GTK_SIGNAL_FUNC (less_parts), data);
+ g_signal_connect (remove, "clicked", G_CALLBACK (less_parts), data);
gtk_table_attach (GTK_TABLE (data->parts), remove, 1, 2, row, row + 1,
0, 0, 0, 0);
gtk_widget_show (remove);
@@ -503,7 +503,7 @@ get_widget (FilterRule *fr, RuleContext *rc)
add = gtk_button_new_from_stock (GTK_STOCK_ADD);
/* gtk_button_set_relief (GTK_BUTTON (add), GTK_RELIEF_NONE); */
- g_signal_connect (add, "clicked", GTK_SIGNAL_FUNC (more_parts), data);
+ g_signal_connect (add, "clicked", G_CALLBACK (more_parts), data);
gtk_box_pack_start (GTK_BOX (hbox), add, FALSE, FALSE, 3);
gtk_box_pack_start (GTK_BOX (inframe), hbox, FALSE, FALSE, 3);
diff --git a/filter/filter-folder.c b/filter/filter-folder.c
index 04dd09e859..a74b7e82ff 100644
--- a/filter/filter-folder.c
+++ b/filter/filter-folder.c
@@ -243,7 +243,7 @@ get_widget (FilterElement *fe)
allowed_types);
gtk_widget_show (button);
- g_signal_connect (button, "selected", GTK_SIGNAL_FUNC (folder_selected), ff);
+ g_signal_connect (button, "selected", G_CALLBACK (folder_selected), ff);
return button;
}
diff --git a/filter/filter-input.c b/filter/filter-input.c
index ddbcfc8dc9..a43156b802 100644
--- a/filter/filter-input.c
+++ b/filter/filter-input.c
@@ -328,7 +328,7 @@ get_widget (FilterElement *fe)
if (fi->values && fi->values->data)
gtk_entry_set_text (GTK_ENTRY (entry), (const char *) fi->values->data);
- g_signal_connect (entry, "changed", GTK_SIGNAL_FUNC (entry_changed), fe);
+ g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), fe);
return entry;
}
diff --git a/filter/filter-int.c b/filter/filter-int.c
index a6e3fb4a74..16d7afa01e 100644
--- a/filter/filter-int.c
+++ b/filter/filter-int.c
@@ -234,7 +234,7 @@ get_widget (FilterElement *fe)
if (fs->val)
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), (gfloat) fs->val);
- g_signal_connect (spin, "changed", GTK_SIGNAL_FUNC (spin_changed), fe);
+ g_signal_connect (spin, "changed", G_CALLBACK (spin_changed), fe);
return spin;
}
diff --git a/filter/filter-option.c b/filter/filter-option.c
index e5acdd7bd0..249e79c98b 100644
--- a/filter/filter-option.c
+++ b/filter/filter-option.c
@@ -299,8 +299,8 @@ get_widget (FilterElement *fe)
op = l->data;
item = gtk_menu_item_new_with_label (_(op->title));
g_object_set_data ((GObject *) item, "option", op);
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (option_changed), fe);
- gtk_menu_append (GTK_MENU (menu), item);
+ g_signal_connect (item, "activate", G_CALLBACK (option_changed), fe);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show (item);
if (op == fo->current) {
current = index;
diff --git a/filter/filter-rule.c b/filter/filter-rule.c
index 66c4d5bf73..75017da19c 100644
--- a/filter/filter-rule.c
+++ b/filter/filter-rule.c
@@ -198,7 +198,7 @@ filter_rule_validate (FilterRule *fr)
{
g_assert (IS_FILTER_RULE (fr));
- return FILTER_RULE_CLASS (fr)->validate (fr);
+ return FILTER_RULE_GET_CLASS (fr)->validate (fr);
}
static int
@@ -610,8 +610,8 @@ get_rule_part_widget (RuleContext *f, FilterPart *newpart, FilterRule *fr)
while ((part = rule_context_next_part (f, part))) {
item = gtk_menu_item_new_with_label (_(part->title));
g_object_set_data ((GObject *) item, "part", part);
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (option_activate), data);
- gtk_menu_append (GTK_MENU (menu), item);
+ g_signal_connect (item, "activate", G_CALLBACK (option_activate), data);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show (item);
if (!strcmp (newpart->title, part->title))
current = index;
@@ -672,7 +672,7 @@ attach_rule (GtkWidget *rule, struct _rule_data *data, FilterPart *part, int row
g_object_set_data ((GObject *) remove, "rule", rule);
g_object_set_data ((GObject *) rule, "part", part);
/*gtk_button_set_relief (GTK_BUTTON (remove), GTK_RELIEF_NONE);*/
- g_signal_connect (remove, "clicked", GTK_SIGNAL_FUNC (less_parts), data);
+ g_signal_connect (remove, "clicked", G_CALLBACK (less_parts), data);
gtk_table_attach (GTK_TABLE (data->parts), remove, 1, 2, row, row + 1,
0, 0, 0, 0);
@@ -760,13 +760,13 @@ get_widget (FilterRule *fr, struct _RuleContext *f)
}
/* evil kludgy hack because gtk sucks */
- g_signal_connect (name, "realize", GTK_SIGNAL_FUNC (grab_focus), name);
+ g_signal_connect (name, "realize", G_CALLBACK (grab_focus), name);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), name, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- g_signal_connect (name, "changed", GTK_SIGNAL_FUNC (name_changed), fr);
+ g_signal_connect (name, "changed", G_CALLBACK (name_changed), fr);
frame = gtk_frame_new (_("If"));
inframe = gtk_vbox_new (FALSE, 3);
@@ -791,13 +791,13 @@ get_widget (FilterRule *fr, struct _RuleContext *f)
menu = gtk_menu_new ();
item = gtk_menu_item_new_with_label (_("if all criteria are met"));
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (match_all), fr);
- gtk_menu_append (GTK_MENU (menu), item);
+ g_signal_connect (item, "activate", G_CALLBACK (match_all), fr);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show (item);
item = gtk_menu_item_new_with_label (_("if any criteria are met"));
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (match_any), fr);
- gtk_menu_append (GTK_MENU (menu), item);
+ g_signal_connect (item, "activate", G_CALLBACK (match_any), fr);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show (item);
omenu = gtk_option_menu_new ();
@@ -806,7 +806,7 @@ get_widget (FilterRule *fr, struct _RuleContext *f)
gtk_widget_show (omenu);
add = gtk_button_new_from_stock (GTK_STOCK_ADD);
- g_signal_connect (add, "clicked", GTK_SIGNAL_FUNC (more_parts), data);
+ g_signal_connect (add, "clicked", G_CALLBACK (more_parts), data);
gtk_box_pack_start (GTK_BOX (hbox), add, FALSE, FALSE, 3);
gtk_box_pack_end (GTK_BOX (hbox), omenu, FALSE, FALSE, 0);
diff --git a/filter/filter-source.c b/filter/filter-source.c
index 83c2f4f831..c9fc232a7e 100644
--- a/filter/filter-source.c
+++ b/filter/filter-source.c
@@ -270,9 +270,9 @@ get_widget (FilterElement *fe)
g_free (label);
g_object_set_data ((GObject *) item, "source", info);
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (source_changed), fs);
+ g_signal_connect (item, "activate", G_CALLBACK (source_changed), fs);
- gtk_menu_append (GTK_MENU (menu), item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show (item);
/* FIXME: don't use e_url_equal */
diff --git a/filter/rule-context.c b/filter/rule-context.c
index fe23831807..bed9045ddb 100644
--- a/filter/rule-context.c
+++ b/filter/rule-context.c
@@ -384,7 +384,7 @@ rule_context_save (RuleContext *rc, const char *user)
g_assert(rc);
g_assert(user);
- return RULE_CONTEXT_CLASS (rc)->save (rc, user);
+ return RULE_CONTEXT_GET_CLASS (rc)->save (rc, user);
}
static int
@@ -441,7 +441,7 @@ rule_context_revert(RuleContext *rc, const char *user)
d(printf("rule_context: restoring %s %s\n", user));
- return RULE_CONTEXT_CLASS (rc)->revert (rc, user);
+ return RULE_CONTEXT_GET_CLASS (rc)->revert (rc, user);
}
struct _revert_data {
@@ -693,7 +693,7 @@ rule_context_add_rule_gui (RuleContext *rc, FilterRule *rule, const char *title,
if (path)
g_object_set_data_full ((GObject *) dialog, "path", g_strdup (path), g_free);
- g_signal_connect (dialog, "response", GTK_SIGNAL_FUNC (new_rule_response), rc);
+ g_signal_connect (dialog, "response", G_CALLBACK (new_rule_response), rc);
g_object_ref (rc);
diff --git a/filter/rule-editor.c b/filter/rule-editor.c
index 60ffa7762d..f86c8718bc 100644
--- a/filter/rule-editor.c
+++ b/filter/rule-editor.c
@@ -98,7 +98,7 @@ rule_editor_class_init (RuleEditorClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkObjectClass *object_class = (GtkObjectClass *) klass;
- parent_class = gtk_type_class (gtk_dialog_get_type ());
+ parent_class = g_type_class_ref(gtk_dialog_get_type ());
gobject_class->finalize = rule_editor_finalise;
object_class->destroy = rule_editor_destroy;
@@ -283,11 +283,11 @@ 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_widget_set_parent_window (GTK_WIDGET (re->dialog), GTK_WIDGET (re)->window);
+ 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);
- g_signal_connect (re->dialog, "response", GTK_SIGNAL_FUNC (add_editor_response), re);
+ g_signal_connect (re->dialog, "response", G_CALLBACK (add_editor_response), re);
g_object_weak_ref ((GObject *)re->dialog, (GWeakNotify) editor_destroy, re);
gtk_widget_set_sensitive (GTK_WIDGET (re), FALSE);
@@ -364,7 +364,7 @@ rule_edit (GtkWidget *widget, RuleEditor *re)
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0);
- g_signal_connect (re->dialog, "clicked", GTK_SIGNAL_FUNC (edit_editor_response), re);
+ g_signal_connect (re->dialog, "response", G_CALLBACK (edit_editor_response), re);
g_object_weak_ref ((GObject *)re->dialog, (GWeakNotify) editor_destroy, re);
gtk_widget_set_sensitive (GTK_WIDGET (re), FALSE);
@@ -471,11 +471,11 @@ static struct {
char *name;
GtkSignalFunc func;
} edit_buttons[] = {
- { "rule_add", GTK_SIGNAL_FUNC (rule_add) },
- { "rule_edit", GTK_SIGNAL_FUNC (rule_edit) },
- { "rule_delete", GTK_SIGNAL_FUNC (rule_delete) },
- { "rule_up", GTK_SIGNAL_FUNC (rule_up) },
- { "rule_down", GTK_SIGNAL_FUNC (rule_down) },
+ { "rule_add", G_CALLBACK (rule_add) },
+ { "rule_edit", G_CALLBACK (rule_edit) },
+ { "rule_delete", G_CALLBACK (rule_delete) },
+ { "rule_up", G_CALLBACK (rule_up) },
+ { "rule_down", G_CALLBACK (rule_down) },
};
static void
@@ -538,6 +538,7 @@ set_source (RuleEditor *re, const char *source)
d(printf("Checking for rules that are of type %s\n", source?source:"<nil>"));
while ((rule = rule_context_next_rule (re->context, rule, source)) != NULL) {
+ d(printf("Adding row '%s'\n", rule->name));
gtk_list_store_append (re->model, &iter);
gtk_list_store_set (re->model, &iter, 0, rule->name, 1, rule, -1);
}
@@ -616,9 +617,9 @@ rule_editor_play_undo (RuleEditor *re)
}
static void
-editor_clicked (GtkWidget *dialog, int button, RuleEditor *re)
+editor_response (GtkWidget *dialog, int button, RuleEditor *re)
{
- if (button != 0) {
+ if (button == GTK_RESPONSE_REJECT) {
if (enable_undo)
rule_editor_play_undo (re);
else {
@@ -659,13 +660,17 @@ rule_editor_construct (RuleEditor *re, RuleContext *context, GladeXML *gui, cons
re->model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
re->list = (GtkTreeView *) glade_xml_get_widget (gui, "rule_list");
gtk_tree_view_set_model (re->list, (GtkTreeModel *) re->model);
+ gtk_tree_view_insert_column_with_attributes(re->list, -1, _("Rule(s)"),
+ gtk_cell_renderer_text_new(),
+ "text", 0,
+ NULL);
selection = gtk_tree_view_get_selection (re->list);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- g_signal_connect (re->list, "cursor-changed", GTK_SIGNAL_FUNC (cursor_changed), re);
- g_signal_connect (re->list, "button_press_event", GTK_SIGNAL_FUNC (double_click), re);
+ g_signal_connect (re->list, "cursor-changed", G_CALLBACK (cursor_changed), re);
+ g_signal_connect (re->list, "button_press_event", G_CALLBACK (double_click), re);
- g_signal_connect (re, "clicked", GTK_SIGNAL_FUNC (editor_clicked), re);
+ g_signal_connect (re, "response", G_CALLBACK(editor_response), re);
rule_editor_set_source (re, source);
if (enable_undo) {
diff --git a/filter/rule-editor.h b/filter/rule-editor.h
index 60185f965e..d2e9797e46 100644
--- a/filter/rule-editor.h
+++ b/filter/rule-editor.h
@@ -31,10 +31,10 @@
#include "filter-rule.h"
#define RULE_TYPE_EDITOR (rule_editor_get_type ())
-#define RULE_EDITOR(obj) (GTK_CHECK_CAST ((obj), RULE_TYPE_EDITOR, RuleEditor))
-#define RULE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), RULE_TYPE_EDITOR, RuleEditorClass))
-#define IS_RULE_EDITOR(obj) (GTK_CHECK_TYPE ((obj), RULE_TYPE_EDITOR))
-#define IS_RULE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), RULE_TYPE_EDITOR))
+#define RULE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RULE_TYPE_EDITOR, RuleEditor))
+#define RULE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RULE_TYPE_EDITOR, RuleEditorClass))
+#define IS_RULE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RULE_TYPE_EDITOR))
+#define IS_RULE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RULE_TYPE_EDITOR))
#define RULE_EDITOR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), RULE_TYPE_EDITOR, RuleEditorClass))
typedef struct _RuleEditor RuleEditor;
diff --git a/filter/score-editor.c b/filter/score-editor.c
index 107a4434ce..f43c5a2c42 100644
--- a/filter/score-editor.c
+++ b/filter/score-editor.c
@@ -72,7 +72,7 @@ score_editor_class_init (ScoreEditorClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
RuleEditorClass *re_class = (RuleEditorClass *) klass;
- parent_class = gtk_type_class (rule_editor_get_type ());
+ parent_class = g_type_class_ref(rule_editor_get_type ());
gobject_class->finalize = score_editor_finalise;
diff --git a/filter/score-editor.h b/filter/score-editor.h
index d0de0434da..85bff02140 100644
--- a/filter/score-editor.h
+++ b/filter/score-editor.h
@@ -28,10 +28,10 @@
#include "score-context.h"
#define SCORE_TYPE_EDITOR (score_editor_get_type ())
-#define SCORE_EDITOR(obj) (GTK_CHECK_CAST ((obj), SCORE_TYPE_EDITOR, ScoreEditor))
-#define SCORE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SCORE_TYPE_EDITOR, ScoreEditorClass))
-#define IS_SCORE_EDITOR(obj) (GTK_CHECK_TYPE ((obj), SCORE_TYPE_EDITOR))
-#define IS_SCORE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SCORE_TYPE_EDITOR))
+#define SCORE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCORE_TYPE_EDITOR, ScoreEditor))
+#define SCORE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCORE_TYPE_EDITOR, ScoreEditorClass))
+#define IS_SCORE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCORE_TYPE_EDITOR))
+#define IS_SCORE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCORE_TYPE_EDITOR))
#define SCORE_EDITOR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), SCORE_TYPE_EDITOR, ScoreEditorClass))
typedef struct _ScoreEditor ScoreEditor;
diff --git a/filter/score-rule.c b/filter/score-rule.c
index 7ba443594c..9865b320cf 100644
--- a/filter/score-rule.c
+++ b/filter/score-rule.c
@@ -187,7 +187,7 @@ get_widget (FilterRule *fr, struct _RuleContext *f)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 3);
adj = (GtkAdjustment *) gtk_adjustment_new ((float) sr->score, -3.0, 3.0, 1.0, 1.0, 1.0);
- g_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (spin_changed), sr);
+ g_signal_connect (adj, "value_changed", G_CALLBACK (spin_changed), sr);
spin = gtk_spin_button_new (adj, 1.0, 0);
gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 3);
diff --git a/filter/vfolder-editor.c b/filter/vfolder-editor.c
index d24ec714e2..ea84300668 100644
--- a/filter/vfolder-editor.c
+++ b/filter/vfolder-editor.c
@@ -73,7 +73,7 @@ vfolder_editor_class_init (VfolderEditorClass *klass)
GtkObjectClass *object_class = (GtkObjectClass *) klass;
RuleEditorClass *re_class = (RuleEditorClass *) klass;
- parent_class = gtk_type_class (rule_editor_get_type ());
+ parent_class = g_type_class_ref(rule_editor_get_type ());
gobject_class->finalize = vfolder_editor_finalise;
diff --git a/filter/vfolder-editor.h b/filter/vfolder-editor.h
index f39a2ccf30..c33f896eb3 100644
--- a/filter/vfolder-editor.h
+++ b/filter/vfolder-editor.h
@@ -28,10 +28,10 @@
#include "vfolder-context.h"
#define VFOLDER_TYPE_EDITOR (vfolder_editor_get_type ())
-#define VFOLDER_EDITOR(obj) (GTK_CHECK_CAST ((obj), VFOLDER_TYPE_EDITOR, VfolderEditor))
-#define VFOLDER_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), VFOLDER_TYPE_EDITOR, VfolderEditorClass))
-#define IS_VFOLDER_EDITOR(obj) (GTK_CHECK_TYPE ((obj), VFOLDER_TYPE_EDITOR))
-#define IS_VFOLDER_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), VFOLDER_TYPE_EDITOR))
+#define VFOLDER_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VFOLDER_TYPE_EDITOR, VfolderEditor))
+#define VFOLDER_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VFOLDER_TYPE_EDITOR, VfolderEditorClass))
+#define IS_VFOLDER_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VFOLDER_TYPE_EDITOR))
+#define IS_VFOLDER_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VFOLDER_TYPE_EDITOR))
#define VFOLDER_EDITOR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), VFOLDER_TYPE_EDITOR, VfolderEditorClass))
typedef struct _VfolderEditor VfolderEditor;
diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c
index 923f24a55b..bf52e825c1 100644
--- a/filter/vfolder-rule.c
+++ b/filter/vfolder-rule.c
@@ -354,8 +354,8 @@ static struct {
char *name;
GtkSignalFunc func;
} edit_buttons[] = {
- { "source_add", GTK_SIGNAL_FUNC (source_add) },
- { "source_remove", GTK_SIGNAL_FUNC (source_remove) },
+ { "source_add", G_CALLBACK (source_add) },
+ { "source_remove", G_CALLBACK (source_remove) },
};
static void
@@ -525,7 +525,7 @@ get_widget (FilterRule *fr, RuleContext *rc)
gtk_list_store_set (data->model, &iter, 0, source, -1);
}
- g_signal_connect (data->list, "cursor-changed", GTK_SIGNAL_FUNC (select_source), data);
+ g_signal_connect (data->list, "cursor-changed", G_CALLBACK (select_source), data);
omenu = (GtkOptionMenu *) glade_xml_get_widget (gui, "source_option");
l = GTK_MENU_SHELL (omenu->menu)->children;
@@ -544,7 +544,7 @@ get_widget (FilterRule *fr, RuleContext *rc)
g_warning ("Glade file " FILTER_GLADEDIR "/filter.glade out of sync with editor code");
}
- g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (select_source_with), data);
+ g_signal_connect (item, "activate", G_CALLBACK (select_source_with), data);
i++;
l = l->next;