Hi,
Last change request, I promise. Small patch to change the label+Browse
button to a GtkFileChooserButton. I'll update the documentation during
the week, it's not been touched for a long time and will probably need
some work.
Ross
--
Ross Burton mail: ross burtonini com
jabber: ross burtonini com
www: http://www.burtonini.com./
PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
Index: data/sound-juicer.glade
===================================================================
RCS file: /cvs/gnome/sound-juicer/data/sound-juicer.glade,v
retrieving revision 1.36
diff -u -r1.36 sound-juicer.glade
--- data/sound-juicer.glade 7 Feb 2005 17:34:25 -0000 1.36
+++ data/sound-juicer.glade 7 Feb 2005 17:49:32 -0000
@@ -1181,7 +1181,7 @@
<property name="spacing">12</property>
<child>
- <widget class="GtkFrame" id="frame6">
+ <widget class="GtkFrame" id="frame_device">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
@@ -1314,7 +1314,7 @@
</child>
<child>
- <widget class="GtkFrame" id="frame7">
+ <widget class="GtkFrame" id="frame_folder">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
@@ -1336,14 +1336,14 @@
<widget class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="path_label">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">label</property>
- <property name="use_underline">False</property>
+ <property name="label" translatable="yes">_Folder:</property>
+ <property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
@@ -1352,6 +1352,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="mnemonic_widget">path_chooser</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
@@ -1359,87 +1360,26 @@
</widget>
<packing>
<property name="padding">0</property>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="prefs_browse">
+ <widget class="GtkFileChooserButton" id="path_chooser">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="prefs_browse_clicked" last_modification_time="Thu, 27 Mar 2003 08:48:05 GMT"/>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image26">
- <property name="visible">True</property>
- <property name="stock">gtk-open</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Browse...</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
+ <property name="title" translatable="yes">Select A Folder</property>
+ <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+ <property name="local_only">True</property>
+ <property name="show_hidden">False</property>
+ <property name="width_chars">-1</property>
+ <signal name="current_folder_changed" handler="prefs_base_folder_changed" last_modification_time="Mon, 07 Feb 2005 17:45:23 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
</packing>
</child>
</widget>
@@ -1478,7 +1418,7 @@
</child>
<child>
- <widget class="GtkFrame" id="frame8">
+ <widget class="GtkFrame" id="frame_names">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
@@ -1708,7 +1648,7 @@
</child>
<child>
- <widget class="GtkFrame" id="frame9">
+ <widget class="GtkFrame" id="frame_format">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
Index: src/sj-prefs.c
===================================================================
RCS file: /cvs/gnome/sound-juicer/src/sj-prefs.c,v
retrieving revision 1.32
diff -u -r1.32 sj-prefs.c
--- src/sj-prefs.c 6 Feb 2005 18:34:13 -0000 1.32
+++ src/sj-prefs.c 7 Feb 2005 17:49:32 -0000
@@ -37,7 +37,7 @@
static GtkWidget *audio_profile;
static GtkWidget *prefs_dialog;
-static GtkWidget *cd_option, *path_option, *file_option, *basepath_label, *check_strip, *check_eject;
+static GtkWidget *cd_option, *path_option, *file_option, *basepath_fcb, *check_strip, *check_eject;
static GtkWidget *path_example_label;
static GList *cdroms = NULL;
@@ -147,27 +147,16 @@
}
/**
- * Clicked on Browse in the Prefs dialog
+ * Changed folder in the Prefs dialog
*/
-void prefs_browse_clicked (GtkButton *button, gpointer user_data)
+void prefs_base_folder_changed (GtkWidget *chooser, gpointer user_data)
{
- GtkWidget *dialog;
- dialog = gtk_file_chooser_dialog_new (_("Select Output Location"),
- GTK_WINDOW (main_window),
- GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
- NULL);
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), base_path);
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
- char *filename, *path;
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
- path = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); /* TODO: GError */
- gconf_client_set_string (gconf_client, GCONF_BASEPATH, path, NULL);
- g_free (path);
- g_free (filename);
- }
- gtk_widget_destroy (dialog);
+ char *filename, *path;
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
+ path = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); /* TODO: GError */
+ gconf_client_set_string (gconf_client, GCONF_BASEPATH, path, NULL);
+ g_free (path);
+ g_free (filename);
}
void prefs_path_option_changed (GtkComboBox *combo, gpointer user_data)
@@ -248,14 +237,14 @@
g_return_if_fail (strcmp (entry->key, GCONF_BASEPATH) == 0);
if (entry->value == NULL) {
- base_path = g_get_home_dir ();
+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (basepath_fcb), g_get_home_dir());
} else {
g_return_if_fail (entry->value->type == GCONF_VALUE_STRING);
base_path = gconf_value_get_string (entry->value);
+ if (strcmp (gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (basepath_fcb)), base_path) != 0) {
+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (basepath_fcb), base_path);
+ }
}
- /* TODO: sanity check the path somewhat */
- /* TODO: use an ellipsising label? */
- gtk_label_set_text (GTK_LABEL (basepath_label), base_path);
}
static void strip_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
@@ -285,7 +274,7 @@
static void pattern_label_update (void)
{
char *file_pattern, *path_pattern;
- char *file_value, *path_value, *example;
+ char *file_value, *path_value, *example, *format;
gboolean strip;
static AlbumDetails sample_album = {
N_("Album Title"),
@@ -330,8 +319,11 @@
g_free (path_value);
g_free (path_pattern);
- gtk_label_set_text (GTK_LABEL (path_example_label), example+1);
+ format = g_strconcat ("<i><small>", example, "</small></i>", NULL);
g_free (example);
+
+ gtk_label_set_markup (GTK_LABEL (path_example_label), format);
+ g_free (format);
}
static void path_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
@@ -408,7 +400,7 @@
cd_option = glade_xml_get_widget (glade, "cd_option");
- basepath_label = glade_xml_get_widget (glade, "path_label");
+ basepath_fcb = glade_xml_get_widget (glade, "path_chooser");
path_option = glade_xml_get_widget (glade, "path_option");
file_option = glade_xml_get_widget (glade, "file_option");
audio_profile = glade_xml_get_widget (glade, "audio_profile");
Attachment:
signature.asc
Description: This is a digitally signed message part