~ubuntu-branches/ubuntu/trusty/sound-juicer/trusty

« back to all changes in this revision

Viewing changes to src/sj-prefs.c

  • Committer: Bazaar Package Importer
  • Author(s): Bilal Akhtar
  • Date: 2010-08-20 14:02:25 UTC
  • mfrom: (1.1.44 upstream)
  • Revision ID: james.westby@ubuntu.com-20100820140225-cj8w9u6uj4ml19or
Tags: 2.31.6-0ubuntu1
New upstream release. (LP: #621065)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
#include <string.h>
26
26
#include <gtk/gtk.h>
27
 
#include <glade/glade-xml.h>
28
27
#include <gconf/gconf-client.h>
29
28
#include <profiles/gnome-media-profiles.h>
30
29
#include <brasero-drive-selection.h>
34
33
#include "sj-extracting.h"
35
34
#include "sj-prefs.h"
36
35
 
37
 
extern GladeXML *glade;
 
36
extern GtkBuilder *builder;
38
37
extern GtkWidget *main_window;
39
38
 
40
39
static GtkWidget *audio_profile;
114
113
/**
115
114
 * Changed folder in the Prefs dialog
116
115
 */
117
 
void prefs_base_folder_changed (GtkWidget *chooser, gpointer user_data)
 
116
G_MODULE_EXPORT void prefs_base_folder_changed (GtkWidget *chooser, gpointer user_data)
118
117
{
119
118
  char *new_uri, *current_uri;
120
119
  
143
142
  }
144
143
}
145
144
 
146
 
void prefs_file_option_changed (GtkComboBox *combo, gpointer user_data)
 
145
G_MODULE_EXPORT void prefs_file_option_changed (GtkComboBox *combo, gpointer user_data)
147
146
{
148
147
  gint active;
149
148
  const char* pattern;
160
159
/**
161
160
 * The Edit Profiles button was pressed.
162
161
 */
163
 
void prefs_edit_profile_clicked (GtkButton *button, gpointer user_data)
 
162
G_MODULE_EXPORT void prefs_edit_profile_clicked (GtkButton *button, gpointer user_data)
164
163
{
165
164
  GtkWidget *dialog;
166
165
  dialog = gm_audio_profiles_edit_new (gconf_client, GTK_WINDOW (main_window));
403
402
/**
404
403
 * Clicked on Preferences in the UI
405
404
 */
406
 
void on_edit_preferences_cb (GtkMenuItem *item, gpointer user_data)
 
405
G_MODULE_EXPORT void on_edit_preferences_cb (GtkMenuItem *item, gpointer user_data)
407
406
{
408
407
  static GtkWidget *prefs_dialog = NULL;
409
408
 
413
412
    const char *labels[] = { "cd_label", "path_label", "folder_label", "file_label", "profile_label" };
414
413
    guint i;
415
414
    GtkSizeGroup *group;
 
415
    GtkWidget    *box;
416
416
    GConfBridge *bridge = gconf_bridge_get ();
417
417
 
418
 
    prefs_dialog = glade_xml_get_widget (glade, "prefs_dialog");
 
418
    prefs_dialog = GET_WIDGET ("prefs_dialog");
 
419
    box          = GET_WIDGET ("hack_hbox");
419
420
    g_assert (prefs_dialog != NULL);
420
421
    g_object_add_weak_pointer (G_OBJECT (prefs_dialog), (gpointer)&prefs_dialog);
421
422
 
424
425
    group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
425
426
    for (i = 0; i < G_N_ELEMENTS (labels); i++) {
426
427
      GtkWidget *widget;
427
 
      widget = glade_xml_get_widget (glade, labels[i]);
 
428
      widget = GET_WIDGET (labels[i]);
428
429
      if (widget) {
429
430
        gtk_size_group_add_widget (group, widget);
430
431
      } else {
433
434
    }
434
435
    g_object_unref (group);
435
436
 
436
 
    cd_option = glade_xml_get_widget (glade, "cd_option");
437
 
    basepath_fcb = glade_xml_get_widget (glade, "path_chooser");
 
437
    cd_option          = GET_WIDGET ("cd_option");
 
438
    basepath_fcb       = GET_WIDGET ("path_chooser");
 
439
    path_option        = GET_WIDGET ("path_option");
 
440
    file_option        = GET_WIDGET ("file_option");
 
441
#if 0
 
442
    /* FIXME: This cannot be currently used, because aufio profile selector
 
443
     *        from gnome-media-profiles package is not fully qualified widget.
 
444
     *        Once gnome-media package is updated, this widget can be created
 
445
     *        using GtkBuilder. */
 
446
    audio_profile      = GET_WIDGET ("audio_profile");
 
447
#else
 
448
    audio_profile = gm_audio_profile_choose_new();
 
449
    g_signal_connect (G_OBJECT (audio_profile), "changed",
 
450
                      G_CALLBACK (prefs_profile_changed), NULL);
 
451
        gtk_box_pack_start (GTK_BOX (box), audio_profile, TRUE, TRUE, 0);
 
452
        gtk_widget_show (audio_profile);
 
453
#endif
 
454
    check_strip        = GET_WIDGET ("check_strip");
 
455
    check_eject        = GET_WIDGET ("check_eject");
 
456
    check_open         = GET_WIDGET ("check_open");
 
457
    path_example_label = GET_WIDGET ("path_example_label");
 
458
 
438
459
    sj_add_default_dirs (GTK_FILE_CHOOSER (basepath_fcb));
439
 
    path_option = glade_xml_get_widget (glade, "path_option");
440
 
    file_option = glade_xml_get_widget (glade, "file_option");
441
 
    audio_profile = glade_xml_get_widget (glade, "audio_profile");
442
 
    check_strip = glade_xml_get_widget (glade, "check_strip");
443
 
    check_eject = glade_xml_get_widget (glade, "check_eject");
444
 
    check_open = glade_xml_get_widget (glade, "check_open");
445
 
    path_example_label = glade_xml_get_widget (glade, "path_example_label");
446
 
 
447
460
    populate_pattern_combo (GTK_COMBO_BOX (path_option), path_patterns);
448
461
    g_signal_connect (path_option, "changed", G_CALLBACK (prefs_path_option_changed), NULL);
449
462
    populate_pattern_combo (GTK_COMBO_BOX (file_option), file_patterns);