Revision: 1878
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1878&view=rev
Author:   Sikon
Date:     2007-12-30 04:04:55 -0800 (Sun, 30 Dec 2007)

Log Message:
-----------
Comversion preferences

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog
    gtkpod/trunk/data/gtkpod.glade
    gtkpod/trunk/src/file_convert.c
    gtkpod/trunk/src/prefsdlg.c

Modified: gtkpod/trunk/ChangeLog
===================================================================
--- gtkpod/trunk/ChangeLog      2007-12-30 11:23:52 UTC (rev 1877)
+++ gtkpod/trunk/ChangeLog      2007-12-30 12:04:55 UTC (rev 1878)
@@ -24,6 +24,8 @@
   * src/prefsdlg.c:
   
     Conversion preferences.
+       Fixed a bug that prevented the dialog from being shown again if closed
+       using the X button.
 
 2007-12-30 P.G. Richardson <phantom_sf at users.sourceforge.net>
 

Modified: gtkpod/trunk/data/gtkpod.glade
===================================================================
--- gtkpod/trunk/data/gtkpod.glade      2007-12-30 11:23:52 UTC (rev 1877)
+++ gtkpod/trunk/data/gtkpod.glade      2007-12-30 12:04:55 UTC (rev 1878)
@@ -13701,7 +13701,7 @@
     <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
     <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
     <property name="has_separator">False</property>
-    <signal name="close" handler="on_prefs_dialog_close"/>
+    <signal name="delete_event" handler="on_prefs_dialog_close"/>
     <child internal-child="vbox">
       <widget class="GtkVBox" id="dialog-vbox5">
         <property name="visible">True</property>
@@ -14365,6 +14365,7 @@
                                     <property name="items" 
translatable="yes">MP3
 AAC
 </property>
+                                    <signal name="changed" 
handler="on_target_format_changed"/>
                                   </widget>
                                   <packing>
                                     <property name="position">1</property>
@@ -14583,7 +14584,7 @@
                                       <packing>
                                         <property 
name="left_attach">1</property>
                                         <property 
name="right_attach">2</property>
-                                        <property name="x_options"></property>
+                                        <property 
name="x_options">GTK_FILL</property>
                                         <property name="y_options"></property>
                                       </packing>
                                     </child>
@@ -14602,7 +14603,7 @@
                                         <property 
name="right_attach">2</property>
                                         <property 
name="top_attach">1</property>
                                         <property 
name="bottom_attach">2</property>
-                                        <property name="x_options"></property>
+                                        <property 
name="x_options">GTK_FILL</property>
                                         <property name="y_options"></property>
                                       </packing>
                                     </child>
@@ -14619,7 +14620,7 @@
                                       <packing>
                                         <property 
name="left_attach">2</property>
                                         <property 
name="right_attach">3</property>
-                                        <property name="x_options"></property>
+                                        <property 
name="x_options">GTK_FILL</property>
                                         <property name="y_options"></property>
                                       </packing>
                                     </child>
@@ -14635,7 +14636,7 @@
                                         <signal name="toggled" 
handler="on_tag_checkbox_toggled"/>
                                       </widget>
                                       <packing>
-                                        <property name="x_options"></property>
+                                        <property 
name="x_options">GTK_FILL</property>
                                         <property name="y_options"></property>
                                       </packing>
                                     </child>
@@ -14652,7 +14653,7 @@
                                       <packing>
                                         <property 
name="top_attach">1</property>
                                         <property 
name="bottom_attach">2</property>
-                                        <property name="x_options"></property>
+                                        <property 
name="x_options">GTK_FILL</property>
                                         <property name="y_options"></property>
                                       </packing>
                                     </child>

Modified: gtkpod/trunk/src/file_convert.c
===================================================================
--- gtkpod/trunk/src/file_convert.c     2007-12-30 11:23:52 UTC (rev 1877)
+++ gtkpod/trunk/src/file_convert.c     2007-12-30 12:04:55 UTC (rev 1878)
@@ -1120,28 +1120,28 @@
            debug ("added track to finished %p\n", track);
             return TRUE;
         case FILE_TYPE_M4A:
-           convert = prefs_get_int ("convert_m4a");
             conversion_cmd = prefs_get_string ("path_conv_m4a");
+                       convert = conversion_cmd && conversion_cmd[0] && 
prefs_get_int ("convert_m4a");
             break;
         case FILE_TYPE_WAV:
-           convert = prefs_get_int ("convert_wav");
             conversion_cmd = prefs_get_string ("path_conv_wav");
+                       convert = conversion_cmd && conversion_cmd[0] && 
prefs_get_int ("convert_wav");
             break;
         case FILE_TYPE_MP3:
-           convert = prefs_get_int ("convert_mp3");
             conversion_cmd = prefs_get_string ("path_conv_mp3");
+                       convert = conversion_cmd && conversion_cmd[0] && 
prefs_get_int ("convert_mp3");
             break;
         case FILE_TYPE_OGG:
-           convert = prefs_get_int ("convert_ogg");
-           conversion_cmd = prefs_get_string ("path_conv_ogg");
-           must_convert = TRUE;
-           typestr = _("Ogg Vorbis");
+                       conversion_cmd = prefs_get_string ("path_conv_ogg");
+                       convert = conversion_cmd && conversion_cmd[0] && 
prefs_get_int ("convert_ogg");
+                       must_convert = TRUE;
+                       typestr = _("Ogg Vorbis");
             break;
         case FILE_TYPE_FLAC:
-           convert = prefs_get_int ("convert_flac");
-           conversion_cmd = prefs_get_string ("path_conv_flac");
-           must_convert = TRUE;
-           typestr = _("FLAC");
+                       conversion_cmd = prefs_get_string ("path_conv_flac");
+                       convert = conversion_cmd && conversion_cmd[0] && 
prefs_get_int ("convert_flac");
+                       must_convert = TRUE;
+                       typestr = _("FLAC");
             break;
     }
 

Modified: gtkpod/trunk/src/prefsdlg.c
===================================================================
--- gtkpod/trunk/src/prefsdlg.c 2007-12-30 11:23:52 UTC (rev 1877)
+++ gtkpod/trunk/src/prefsdlg.c 2007-12-30 12:04:55 UTC (rev 1878)
@@ -120,6 +120,14 @@
        "convert-2m4a.sh",
 };
 
+ind_string conv_paths[] = {
+       { -1, "path_conv_ogg" },
+    { -1, "path_conv_flac" },
+    { TARGET_FORMAT_AAC, "path_conv_m4a" },
+    { TARGET_FORMAT_MP3, "path_conv_mp3" },
+    { -1, "path_conv_wav" },
+};
+
 static GladeXML *prefs_xml = NULL;
 static GtkWidget *prefs_dialog = NULL;
 
@@ -335,6 +343,8 @@
        GdkColor *color = coverart_get_background_display_colour();
        gtk_color_button_set_color 
(GTK_COLOR_BUTTON(coverart_colorselect_button), color);
        
+       gtk_combo_box_set_active (GTK_COMBO_BOX (gtkpod_xml_get_widget (xml, 
"toolbar_style")),
+                                                         prefs_get_int 
("conversion_target_format"));
 }
 
 void open_prefs_dlg ()
@@ -1031,3 +1041,29 @@
 {
     prefs_set_int ("file_convert_maxdirsize", gtk_spin_button_get_value_as_int 
(sender));
 }
+
+/*
+       glade callback
+*/
+G_MODULE_EXPORT void on_target_format_changed (GtkComboBox *sender, gpointer e)
+{
+       gint index = gtk_combo_box_get_active (sender);
+       gchar *script = g_build_filename (SCRIPTDIR, conv_scripts[index], NULL);
+       gint i;
+       
+       for (i = 0; i < COUNTOF (conv_paths); i++)
+       {
+               if (conv_paths[i].index == index)
+               {
+                       /*
+                               The source format is the same as the target 
format -
+                               we set "null conversion" without touching the 
boolean preference
+                       */
+                       prefs_set_string (conv_paths[i].string, "");
+               }
+               else
+                       prefs_set_string (conv_paths[i].string, script);
+       }
+       
+       g_free (script);
+}


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to