~ubuntu-branches/ubuntu/maverick/gnome-media/maverick

« back to all changes in this revision

Viewing changes to profiles/audio-profile-edit.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-02-23 11:48:04 UTC
  • mfrom: (0.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20100223114804-ou6lhloq9kc11fu8
Tags: 2.29.91-0ubuntu1
* New upstream version:
  - gnome-volume-control
  + bug 599663 - make changing the volume unmute (lp: #460390)
  + bug 606325 - show unamplified volume on outputs as well
  + bug 606914 - applet should not set volume on startup (lp: #498550)
  + bug 598921 - handle the last input source being removed
  + bug 605694 - fix GvcChannelMap leak (lp: #485923)
  + bug 607681 - set default scroll-wheel delta to 5% (lp: #358131)
  + other misc fixes
  - gstreamer-profiles:
  + bug 524364 - libglade -> gtkbuilder (lp: #508227)
  - general
  + bug 609933 - fix linking with pedantic linkers
  + bug 101811 - remove unnecessary markup from glade message
  - added/updated translations
* debian/control.in:
  - build-depends on libgladeui-1-dev and not on libglade2-dev
* debian/gnome-media-common.install,
  debian/libgnome-media0.install:
  - new version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <string.h>
27
27
#include <glib/gi18n.h>
28
28
#include <gtk/gtk.h>
29
 
#include <glade/glade-xml.h>
30
29
#include <gst/gst.h>
31
30
 
32
31
#include "gmp-util.h"
37
36
struct _GMAudioProfileEditPrivate
38
37
{
39
38
  GConfClient *conf;
40
 
  GladeXML *xml;
 
39
  GtkBuilder *builder;
41
40
  GMAudioProfile *profile;
42
41
  GtkWidget *content;
43
42
};
70
69
 
71
70
/* ui callbacks */
72
71
 
73
 
/* initialize a dialog widget from the glade xml file */
 
72
/* initialize a dialog widget from the ui builder file */
74
73
static void
75
74
gm_audio_profile_edit_init (GMAudioProfileEdit *dialog)
76
75
{
125
124
 
126
125
      return;
127
126
    }
128
 
      
 
127
 
129
128
  /* FIXME: hide or destroy ? */
130
129
  gtk_widget_hide (GTK_WIDGET (dialog));
131
130
}
223
222
gm_audio_profile_edit_new (GConfClient *conf, const char *id)
224
223
{
225
224
  GMAudioProfileEdit *dialog;
226
 
  GladeXML *xml;
 
225
  GtkBuilder *builder;
227
226
  GtkWidget *w;
228
227
  GtkTextBuffer *tb;
 
228
  GError *error = NULL;
229
229
 
230
230
  /* get the dialog */
231
 
  xml = gmp_util_load_glade_file (GM_AUDIO_GLADE_FILE,
232
 
                                  "profile-edit-dialog", NULL);
233
 
  dialog = (GMAudioProfileEdit *) glade_xml_get_widget (xml, "profile-edit-dialog");
 
231
  builder = gmp_util_load_builder_file ("gnome-audio-profile-edit.ui", NULL, &error);
 
232
  if (error != NULL) {
 
233
    g_warning (error->message);
 
234
    g_error_free (error);
 
235
    return NULL;
 
236
  }
 
237
 
 
238
  dialog = GM_AUDIO_PROFILE_EDIT (gtk_builder_get_object (builder, "profile-edit-dialog"));
 
239
  g_return_val_if_fail (dialog != NULL, NULL);
234
240
 
235
241
  /* make sure we have priv */
236
242
  if (dialog->priv == NULL)
243
249
     * smell to good to me */
244
250
    dialog->priv = g_new0 (GMAudioProfileEditPrivate, 1);
245
251
  }
246
 
  dialog->priv->xml = xml;
 
252
  dialog->priv->builder = builder;
247
253
 
248
254
  /* save the GConf stuff and get the profile belonging to this id */
249
255
  dialog->priv->conf = g_object_ref (conf);
252
258
  g_assert (dialog->priv->profile);
253
259
 
254
260
  /* autoconnect doesn't handle data pointers, sadly, so do by hand */
255
 
  w = glade_xml_get_widget (xml, "profile-name-entry");
 
261
  w = GTK_WIDGET (gtk_builder_get_object (builder, "profile-name-entry"));
256
262
  gm_audio_profile_edit_update_name (dialog, dialog->priv->profile);
257
263
  g_signal_connect (G_OBJECT (w), "changed",
258
264
                    G_CALLBACK (on_profile_name_changed), dialog->priv->profile);
259
 
  w = glade_xml_get_widget (xml, "profile-description-textview");
 
265
  w = GTK_WIDGET (gtk_builder_get_object (builder, "profile-description-textview"));
260
266
  gm_audio_profile_edit_update_description (dialog, dialog->priv->profile);
261
267
  tb = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w));
262
268
  g_signal_connect (G_OBJECT (tb), "changed",
263
269
                    G_CALLBACK (on_profile_description_changed), dialog->priv->profile);
264
 
   w = glade_xml_get_widget (xml, "profile-pipeline-entry");
 
270
  w = GTK_WIDGET (gtk_builder_get_object (builder, "profile-pipeline-entry"));
265
271
  gm_audio_profile_edit_update_pipeline (dialog, dialog->priv->profile);
266
272
  g_signal_connect (G_OBJECT (w), "changed",
267
273
                    G_CALLBACK (on_profile_pipeline_changed), dialog->priv->profile);
268
 
  w = glade_xml_get_widget (xml, "profile-extension-entry");
 
274
  w = GTK_WIDGET (gtk_builder_get_object (builder, "profile-extension-entry"));
269
275
  gm_audio_profile_edit_update_extension (dialog, dialog->priv->profile);
270
276
  g_signal_connect (G_OBJECT (w), "changed",
271
277
                    G_CALLBACK (on_profile_extension_changed), dialog->priv->profile);
272
 
  w = glade_xml_get_widget (xml, "profile-active-button");
 
278
  w = GTK_WIDGET (gtk_builder_get_object (builder, "profile-active-button"));
273
279
  gm_audio_profile_edit_update_active (dialog, dialog->priv->profile);
274
280
  g_signal_connect (G_OBJECT (w), "toggled",
275
281
                    G_CALLBACK (on_profile_active_toggled), dialog->priv->profile);
403
409
gm_audio_profile_edit_get_widget (GMAudioProfileEdit *dialog,
404
410
                             const char *widget_name)
405
411
{
406
 
  GladeXML *xml;
 
412
  GtkBuilder *builder;
407
413
  GtkWidget *w;
408
414
 
409
 
  xml = dialog->priv->xml;
410
 
 
411
 
  g_return_val_if_fail (xml, NULL);
412
 
 
413
 
  w = glade_xml_get_widget (xml, widget_name);
 
415
  builder = dialog->priv->builder;
 
416
 
 
417
  g_return_val_if_fail (builder, NULL);
 
418
 
 
419
  w = GTK_WIDGET (gtk_builder_get_object (builder, widget_name));
414
420
 
415
421
  if (w == NULL)
416
422
    g_error ("No such widget %s", widget_name);