summaryrefslogtreecommitdiffstats
path: root/audio/gnome-media/files/patch-profiles_gnome-audio-profiles-properties.c
blob: c0903ed5ebe7a8a6a4f222687c6fe006ef5cc73f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
--- profiles/gnome-audio-profiles-properties.c.orig Mon Sep 20 20:51:20 2004
+++ profiles/gnome-audio-profiles-properties.c  Fri Feb 11 23:40:04 2005
@@ -21,6 +21,9 @@
 
 #include <gtk/gtkmain.h>
 #include "gnome-media-profiles.h"
+#include <glade/glade.h>
+#include <glade/glade-build.h>
+#include <string.h>
 
 static void
 on_dialog_destroy (GtkWidget *dialog, gpointer *user_data)
@@ -29,6 +32,52 @@
   gtk_main_quit ();
 }
 
+static void
+gtk_dialog_build_children(GladeXML *self, GtkWidget *w,
+             GladeWidgetInfo *info)
+
+{
+    GtkDialog *dialog = GTK_DIALOG (w);
+    GList *children, *list;
+
+    glade_standard_build_children (self, w, info);
+
+    if (dialog->action_area == NULL)
+   return;
+
+    /* repack children of action_area */
+    children = gtk_container_get_children(GTK_CONTAINER(dialog->action_area));
+    for (list = children; list; list = list->next) {
+   GtkWidget *child = GTK_WIDGET(list->data);
+
+   g_object_ref(child);
+   gtk_container_remove (GTK_CONTAINER (dialog->action_area), child);
+    }
+    for (list = children; list; list = list->next) {
+   GtkWidget *child = GTK_WIDGET(list->data);
+   gint response_id;
+
+   response_id = GPOINTER_TO_INT(g_object_steal_data(G_OBJECT(child),
+                             "response_id"));
+   gtk_dialog_add_action_widget(dialog, child, response_id);
+   g_object_unref(child);
+
+    }
+    g_list_free (children);
+}
+
+static GtkWidget *
+dialog_find_internal_child(GladeXML *xml, GtkWidget *parent,
+              const gchar *childname)
+{
+    if (!strcmp(childname, "vbox"))
+   return GTK_DIALOG(parent)->vbox;
+    if (!strcmp(childname, "action_area"))
+   return GTK_DIALOG(parent)->action_area;
+
+    return NULL;
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -39,6 +88,10 @@
   /* FIXME: add a comment why we need this at all, until then
      we comment it out
   gm_audio_profile_edit_get_type (); */
+  glade_register_widget (gm_audio_profile_edit_get_type (),
+            NULL,
+            gtk_dialog_build_children,
+            dialog_find_internal_child);
   conf = gconf_client_get_default ();
   gnome_media_profiles_init (conf);