[Xfce4-commits] <parole:0.2.2> Added options in the settings dialog to fine tune the playlist behaviour+more options when right click the playlist widget.

Ali Abdallah noreply at xfce.org
Sat Jan 9 11:30:01 CET 2010


Updating branch refs/heads/0.2.2
         to 0c05b40e1a925e6e81b0dbf96ec43f0feed9b230 (commit)
       from ee2b18b852004d0b52656e4364ed0d671a6eda1b (commit)

commit 0c05b40e1a925e6e81b0dbf96ec43f0feed9b230
Author: Ali Abdallah <aliov at xfce.org>
Date:   Sat Jan 9 11:26:59 2010 +0100

    Added options in the settings dialog to fine tune the playlist behaviour+more
    options when right click the playlist widget.

 TODO                               |    5 +-
 configure.ac.in                    |    6 +-
 data/interfaces/parole-settings.ui |  754 +++++++++++++++++++++---------------
 src/gmarshal.list                  |    1 -
 src/parole-conf-dialog.c           |   71 ++++
 src/parole-conf.c                  |   41 ++-
 src/parole-mediachooser.c          |   65 ++--
 src/parole-mediachooser.h          |    6 +-
 src/parole-medialist.c             |  172 ++++++++-
 9 files changed, 754 insertions(+), 367 deletions(-)

diff --git a/TODO b/TODO
index b220056..7608257 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,7 @@
 === Media player ===
+* Have an option for clearing playlist in the prefs, not only in the media chooser.
+* Check for duplicate playlist entries
+* Remove libxfcegui4 dependency and depend on libxfce4ui instead
 * Automatically detect disc type when parole
   is launched with --device=/dev/sr0 without a uri
 * Support scale ratio view.
@@ -9,5 +12,5 @@
 * Write a youtube plugin.
 * Subtitle downloader.
 * Always on top.
-* thumbnail.
+* thumbnails.
 * ...?
diff --git a/configure.ac.in b/configure.ac.in
index ef2c04b..2af00ae 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -3,9 +3,9 @@ m4_define([parole_verinfo],  [0:2:0])
 m4_define([parole_version_api],  [0])
 m4_define([parole_version_major],  [0])
 m4_define([parole_version_minor],  [2])
-m4_define([parole_version_micro],  [0])
-m4_define([parole_version_build],  [])
-m4_define([parole_version_tag], [])
+m4_define([parole_version_micro],  [2])
+m4_define([parole_version_build],  [@REVISION@])
+m4_define([parole_version_tag], [git])
 m4_define([parole_version], [parole_version_major().parole_version_minor().parole_version_micro()ifelse(parole_version_tag(), [git], [parole_version_tag().parole_version_build()], [parole_version_tag()])])
 
 AC_INIT([parole], [parole_version], [aliov at xfce.org])
diff --git a/data/interfaces/parole-settings.ui b/data/interfaces/parole-settings.ui
index b9b39e0..37a001a 100644
--- a/data/interfaces/parole-settings.ui
+++ b/data/interfaces/parole-settings.ui
@@ -17,392 +17,522 @@
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
         <child>
-          <object class="GtkVBox" id="vbox1">
+          <object class="GtkNotebook" id="notebook1">
             <property name="visible">True</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">10</property>
+            <property name="can_focus">True</property>
             <child>
-              <object class="GtkFrame" id="frame-display">
+              <object class="GtkAlignment" id="alignment1">
                 <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
+                <property name="top_padding">5</property>
                 <child>
-                  <object class="GtkAlignment" id="alignment2">
+                  <object class="GtkVBox" id="vbox1">
                     <property name="visible">True</property>
-                    <property name="left_padding">12</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">10</property>
                     <child>
-                      <object class="GtkVBox" id="vbox4">
+                      <object class="GtkFrame" id="frame-display">
                         <property name="visible">True</property>
-                        <property name="orientation">vertical</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
                         <child>
-                          <object class="GtkTable" id="table">
+                          <object class="GtkAlignment" id="alignment2">
                             <property name="visible">True</property>
-                            <property name="n_rows">4</property>
-                            <property name="n_columns">2</property>
-                            <property name="column_spacing">5</property>
-                            <property name="row_spacing">5</property>
+                            <property name="left_padding">12</property>
                             <child>
-                              <object class="GtkLabel" id="label7">
+                              <object class="GtkVBox" id="vbox4">
                                 <property name="visible">True</property>
-                                <property name="label" translatable="yes">Brightness:</property>
-                              </object>
-                              <packing>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label8">
-                                <property name="visible">True</property>
-                                <property name="label" translatable="yes">Contrast:</property>
-                              </object>
-                              <packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHScale" id="brightness">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="update_policy">discontinuous</property>
-                                <property name="draw_value">False</property>
-                                <signal name="value_changed" handler="brightness_value_changed_cb"/>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHScale" id="contrast">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="update_policy">discontinuous</property>
-                                <property name="draw_value">False</property>
-                                <signal name="value_changed" handler="contrast_value_changed_cb"/>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label9">
-                                <property name="visible">True</property>
-                                <property name="label" translatable="yes">Hue:</property>
-                              </object>
-                              <packing>
-                                <property name="top_attach">2</property>
-                                <property name="bottom_attach">3</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label10">
-                                <property name="visible">True</property>
-                                <property name="label" translatable="yes">Saturation:</property>
-                              </object>
-                              <packing>
-                                <property name="top_attach">3</property>
-                                <property name="bottom_attach">4</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHScale" id="hue">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="update_policy">discontinuous</property>
-                                <property name="draw_value">False</property>
-                                <signal name="value_changed" handler="hue_value_changed_cb"/>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">2</property>
-                                <property name="bottom_attach">3</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHScale" id="saturation">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="update_policy">discontinuous</property>
-                                <property name="draw_value">False</property>
-                                <signal name="value_changed" handler="saturation_value_changed_cb"/>
+                                <property name="orientation">vertical</property>
+                                <child>
+                                  <object class="GtkTable" id="table">
+                                    <property name="visible">True</property>
+                                    <property name="n_rows">4</property>
+                                    <property name="n_columns">2</property>
+                                    <property name="column_spacing">5</property>
+                                    <property name="row_spacing">5</property>
+                                    <child>
+                                      <object class="GtkLabel" id="label7">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">Brightness:</property>
+                                      </object>
+                                      <packing>
+                                        <property name="x_options"></property>
+                                        <property name="y_options"></property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="label8">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">Contrast:</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                        <property name="x_options"></property>
+                                        <property name="y_options"></property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHScale" id="brightness">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="update_policy">discontinuous</property>
+                                        <property name="draw_value">False</property>
+                                        <signal name="value_changed" handler="brightness_value_changed_cb"/>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHScale" id="contrast">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="update_policy">discontinuous</property>
+                                        <property name="draw_value">False</property>
+                                        <signal name="value_changed" handler="contrast_value_changed_cb"/>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="label9">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">Hue:</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                        <property name="x_options"></property>
+                                        <property name="y_options"></property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="label10">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">Saturation:</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">3</property>
+                                        <property name="bottom_attach">4</property>
+                                        <property name="x_options"></property>
+                                        <property name="y_options"></property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHScale" id="hue">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="update_policy">discontinuous</property>
+                                        <property name="draw_value">False</property>
+                                        <signal name="value_changed" handler="hue_value_changed_cb"/>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHScale" id="saturation">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="update_policy">discontinuous</property>
+                                        <property name="draw_value">False</property>
+                                        <signal name="value_changed" handler="saturation_value_changed_cb"/>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">3</property>
+                                        <property name="bottom_attach">4</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkHButtonBox" id="hbuttonbox1">
+                                    <property name="visible">True</property>
+                                    <property name="layout_style">end</property>
+                                    <child>
+                                      <object class="GtkButton" id="reset-color">
+                                        <property name="label" translatable="yes">Reset To Defaults</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="image">image1</property>
+                                        <signal name="clicked" handler="reset_color_clicked_cb"/>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
                               </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">3</property>
-                                <property name="bottom_attach">4</property>
-                              </packing>
                             </child>
                           </object>
-                          <packing>
-                            <property name="position">0</property>
-                          </packing>
                         </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label4">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes"><b>Display</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkFrame" id="frame2">
+                        <property name="visible">True</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
                         <child>
-                          <object class="GtkHButtonBox" id="hbuttonbox1">
+                          <object class="GtkAlignment" id="alignment4">
                             <property name="visible">True</property>
-                            <property name="layout_style">end</property>
+                            <property name="left_padding">12</property>
                             <child>
-                              <object class="GtkButton" id="reset-color">
-                                <property name="label" translatable="yes">Reset To Defaults</property>
+                              <object class="GtkCheckButton" id="reset-saver">
+                                <property name="label" translatable="yes">Disable screen saver while playing movies</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="receives_default">True</property>
-                                <property name="image">image1</property>
-                                <signal name="clicked" handler="reset_color_clicked_cb"/>
+                                <property name="receives_default">False</property>
+                                <property name="draw_indicator">True</property>
+                                <signal name="toggled" handler="parole_conf_dialog_reset_saver_changed_cb"/>
                               </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
                             </child>
                           </object>
-                          <packing>
-                            <property name="position">1</property>
-                          </packing>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label12">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes"><b>Video</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
                         </child>
                       </object>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
                     </child>
-                  </object>
-                </child>
-                <child type="label">
-                  <object class="GtkLabel" id="label2">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes"><b>Display</b></property>
-                    <property name="use_markup">True</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkFrame" id="frame2">
-                <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
-                <child>
-                  <object class="GtkAlignment" id="alignment4">
-                    <property name="visible">True</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <object class="GtkCheckButton" id="reset-saver">
-                        <property name="label" translatable="yes">Disable screen saver while playing movies</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="parole_conf_dialog_reset_saver_changed_cb"/>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-                <child type="label">
-                  <object class="GtkLabel" id="label12">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes"><b>Video</b></property>
-                    <property name="use_markup">True</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkFrame" id="frame1">
-                <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
-                <child>
-                  <object class="GtkAlignment" id="alignment1">
-                    <property name="visible">True</property>
-                    <property name="left_padding">12</property>
                     <child>
-                      <object class="GtkVBox" id="vbox2">
+                      <object class="GtkFrame" id="frame1">
                         <property name="visible">True</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">5</property>
-                        <child>
-                          <object class="GtkCheckButton" id="enable-vis">
-                            <property name="label" translatable="yes">Enable visualization when playing audio file</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="draw_indicator">True</property>
-                            <signal name="toggled" handler="parole_conf_dialog_enable_vis_changed_cb"/>
-                          </object>
-                          <packing>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
                         <child>
-                          <object class="GtkHBox" id="hbox1">
+                          <object class="GtkAlignment" id="alignment3">
                             <property name="visible">True</property>
-                            <property name="spacing">2</property>
+                            <property name="left_padding">12</property>
                             <child>
-                              <object class="GtkLabel" id="label4">
+                              <object class="GtkVBox" id="vbox2">
                                 <property name="visible">True</property>
-                                <property name="label" translatable="yes">Visualization type:</property>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">5</property>
+                                <child>
+                                  <object class="GtkCheckButton" id="enable-vis">
+                                    <property name="label" translatable="yes">Enable visualization when playing audio file</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="parole_conf_dialog_enable_vis_changed_cb"/>
+                                  </object>
+                                  <packing>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkHBox" id="hbox1">
+                                    <property name="visible">True</property>
+                                    <property name="spacing">2</property>
+                                    <child>
+                                      <object class="GtkLabel" id="label5">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">Visualization type:</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkComboBox" id="vis-combobox">
+                                        <property name="visible">True</property>
+                                        <property name="model">liststore1</property>
+                                        <signal name="changed" handler="parole_conf_dialog_vis_plugin_changed_cb"/>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                                          <attributes>
+                                            <attribute name="text">0</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
                               </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
                             </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label6">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes"><b>Audio</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkFrame" id="frame3">
+                        <property name="visible">True</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
+                        <child>
+                          <object class="GtkAlignment" id="alignment6">
+                            <property name="visible">True</property>
+                            <property name="left_padding">12</property>
                             <child>
-                              <object class="GtkComboBox" id="vis-combobox">
+                              <object class="GtkVBox" id="vbox3">
                                 <property name="visible">True</property>
-                                <property name="model">liststore1</property>
-                                <signal name="changed" handler="parole_conf_dialog_vis_plugin_changed_cb"/>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">5</property>
                                 <child>
-                                  <object class="GtkCellRendererText" id="cellrenderertext1"/>
-                                  <attributes>
-                                    <attribute name="text">0</attribute>
-                                  </attributes>
+                                  <object class="GtkCheckButton" id="enable-subtitle">
+                                    <property name="label" translatable="yes">Automatically load subtitles when playing movie file</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="parole_conf_dialog_enable_subtitle_changed_cb"/>
+                                  </object>
+                                  <packing>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkTable" id="table1">
+                                    <property name="visible">True</property>
+                                    <property name="n_rows">2</property>
+                                    <property name="n_columns">2</property>
+                                    <property name="column_spacing">2</property>
+                                    <property name="row_spacing">2</property>
+                                    <child>
+                                      <object class="GtkLabel" id="label11">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">Font:</property>
+                                      </object>
+                                      <packing>
+                                        <property name="x_options">GTK_FILL</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkFontButton" id="fontbutton">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <signal name="font_set" handler="parole_conf_dialog_font_set_cb"/>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="label13">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes">Encoding: </property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                        <property name="x_options">GTK_FILL</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkComboBox" id="encoding">
+                                        <property name="visible">True</property>
+                                        <signal name="changed" handler="parole_conf_dialog_subtitle_encoding_changed_cb"/>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
                                 </child>
                               </object>
-                              <packing>
-                                <property name="position">1</property>
-                              </packing>
                             </child>
                           </object>
-                          <packing>
-                            <property name="position">1</property>
-                          </packing>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label14">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes"><b>Subtitles</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
                         </child>
                       </object>
+                      <packing>
+                        <property name="position">3</property>
+                      </packing>
                     </child>
                   </object>
                 </child>
-                <child type="label">
-                  <object class="GtkLabel" id="label1">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes"><b>Audio</b></property>
-                    <property name="use_markup">True</property>
-                  </object>
-                </child>
+              </object>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">General</property>
               </object>
               <packing>
-                <property name="position">2</property>
+                <property name="tab_fill">False</property>
               </packing>
             </child>
             <child>
-              <object class="GtkFrame" id="frame3">
+              <object class="GtkAlignment" id="alignment5">
                 <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
+                <property name="top_padding">5</property>
                 <child>
-                  <object class="GtkAlignment" id="alignment3">
+                  <object class="GtkVBox" id="vbox5">
                     <property name="visible">True</property>
-                    <property name="left_padding">12</property>
+                    <property name="orientation">vertical</property>
                     <child>
-                      <object class="GtkVBox" id="vbox3">
+                      <object class="GtkFrame" id="frame-playlist">
                         <property name="visible">True</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">5</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
                         <child>
-                          <object class="GtkCheckButton" id="enable-subtitle">
-                            <property name="label" translatable="yes">Automatically load subtitles when playing movie file</property>
+                          <object class="GtkAlignment" id="alignment7">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="draw_indicator">True</property>
-                            <signal name="toggled" handler="parole_conf_dialog_enable_subtitle_changed_cb"/>
-                          </object>
-                          <packing>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkTable" id="table1">
-                            <property name="visible">True</property>
-                            <property name="n_rows">2</property>
-                            <property name="n_columns">2</property>
-                            <property name="column_spacing">2</property>
-                            <property name="row_spacing">2</property>
+                            <property name="left_padding">12</property>
                             <child>
-                              <object class="GtkLabel" id="label5">
+                              <object class="GtkVBox" id="vbox6">
                                 <property name="visible">True</property>
-                                <property name="label" translatable="yes">Font:</property>
-                              </object>
-                              <packing>
-                                <property name="x_options">GTK_FILL</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkFontButton" id="fontbutton">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">True</property>
-                                <signal name="font_set" handler="parole_conf_dialog_font_set_cb"/>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label6">
-                                <property name="visible">True</property>
-                                <property name="label" translatable="yes">Encoding: </property>
-                              </object>
-                              <packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                                <property name="x_options">GTK_FILL</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkComboBox" id="encoding">
-                                <property name="visible">True</property>
-                                <signal name="changed" handler="parole_conf_dialog_subtitle_encoding_changed_cb"/>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">5</property>
+                                <child>
+                                  <object class="GtkCheckButton" id="replace-playlist">
+                                    <property name="label" translatable="yes">Always replace playlist with opened files</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="replace_playlist_toggled_cb"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" id="remove-duplicated">
+                                    <property name="label" translatable="yes">Check and remove duplicated media entries</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="remove_duplicated_toggled_cb"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" id="start-playing-opened">
+                                    <property name="label" translatable="yes">Start playing opened files</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="tooltip_text" translatable="yes">start playling opened files, for example when media files are opened with a file manager or on drag and drop.
+</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="start_playing_opened_toggled_cb"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                              </packing>
                             </child>
                           </object>
-                          <packing>
-                            <property name="position">1</property>
-                          </packing>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label19">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes"><b>Playlist options</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
                         </child>
                       </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
                     </child>
                   </object>
                 </child>
-                <child type="label">
-                  <object class="GtkLabel" id="label3">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes"><b>Subtitles</b></property>
-                    <property name="use_markup">True</property>
-                  </object>
-                </child>
               </object>
               <packing>
-                <property name="position">3</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Playlist</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <placeholder/>
+            </child>
           </object>
           <packing>
+            <property name="padding">1</property>
             <property name="position">1</property>
           </packing>
         </child>
diff --git a/src/gmarshal.list b/src/gmarshal.list
index 87ac80e..72f9937 100644
--- a/src/gmarshal.list
+++ b/src/gmarshal.list
@@ -1,2 +1 @@
 VOID:STRING,STRING
-VOID:BOOL,BOOL,POINTER
diff --git a/src/parole-conf-dialog.c b/src/parole-conf-dialog.c
index 81ba185..d7558c7 100644
--- a/src/parole-conf-dialog.c
+++ b/src/parole-conf-dialog.c
@@ -75,6 +75,15 @@ void		saturation_value_changed_cb			(GtkRange *range,
 
 void 	        reset_color_clicked_cb 			        (GtkButton *button, 
 								 ParoleConfDialog *self);
+								 
+void		replace_playlist_toggled_cb			(GtkToggleButton *widget,
+								 ParoleConfDialog *self);
+								 
+void		remove_duplicated_toggled_cb			(GtkToggleButton *widget,
+								 ParoleConfDialog *self);
+
+void		start_playing_opened_toggled_cb			(GtkToggleButton *widget,
+								 ParoleConfDialog *self);
 /*
  * End of GtkBuilder callbacks
  */
@@ -108,6 +117,27 @@ parole_conf_dialog_destroy (GtkWidget *widget, ParoleConfDialog *self)
     g_object_unref (self);
 }
 
+void replace_playlist_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *self)
+{
+    g_object_set (G_OBJECT (self->priv->conf),
+		  "replace-playlist", gtk_toggle_button_get_active (widget),
+		  NULL);
+}
+								 
+void remove_duplicated_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *self)
+{
+    g_object_set (G_OBJECT (self->priv->conf),
+		  "remove-duplicated", gtk_toggle_button_get_active (widget),
+		  NULL);
+}
+
+void start_playing_opened_toggled_cb (GtkToggleButton *widget, ParoleConfDialog *self)
+{
+    g_object_set (G_OBJECT (self->priv->conf),
+		  "play-opened-files", gtk_toggle_button_get_active (widget),
+		  NULL);
+}
+
 void reset_color_clicked_cb (GtkButton *button, ParoleConfDialog *self)
 {
     gtk_range_set_value (GTK_RANGE (self->priv->brightness), 0);
@@ -302,6 +332,46 @@ parole_conf_dialog_set_default_vis_plugin (GtkTreeModel *model, GtkTreePath *pat
 }
 
 static void
+parole_conf_dialog_set_defaults_playlist (ParoleConfDialog  *self, GtkBuilder *builder)
+{
+    GtkWidget *widget;
+    gboolean option;
+    
+    /**
+     * Replace playlist with opened files.
+     **/
+    widget = GTK_WIDGET (gtk_builder_get_object (builder, "replace-playlist"));
+    
+    g_object_get (G_OBJECT (self->priv->conf),
+		  "replace-playlist", &option,
+		  NULL);
+		  
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), option);
+    
+     /**
+     * Start playing opened files
+     **/
+    widget = GTK_WIDGET (gtk_builder_get_object (builder, "start-playing-opened"));
+    
+    g_object_get (G_OBJECT (self->priv->conf),
+		  "play-opened-files", &option,
+		  NULL);
+		  
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), option);
+    
+     /**
+     * Remove duplicated playlist entries
+     **/
+    widget = GTK_WIDGET (gtk_builder_get_object (builder, "remove-duplicated"));
+    
+    g_object_get (G_OBJECT (self->priv->conf),
+		  "remove-duplicated", &option,
+		  NULL);
+		  
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), option);
+}
+
+static void
 parole_conf_dialog_set_defaults (ParoleConfDialog *self)
 {
     GtkTreeModel *model;
@@ -372,6 +442,7 @@ void parole_conf_dialog_open (ParoleConfDialog *self, GtkWidget *parent)
     self->priv->vis_combox = combox;
 
     parole_conf_dialog_set_defaults (self);
+    parole_conf_dialog_set_defaults_playlist (self, builder);
     
     g_object_get (G_OBJECT (self->priv->conf),
 		  "reset-saver", &reset_saver,
diff --git a/src/parole-conf.c b/src/parole-conf.c
index 04bfce4..3c19f48 100644
--- a/src/parole-conf.c
+++ b/src/parole-conf.c
@@ -65,6 +65,11 @@ enum
     PROP_ASPECT_RATIO,
     PROP_WINDOW_WIDTH,
     PROP_WINDOW_HEIGHT,
+    /*Playlist*/
+    PROP_REPLACE_PLAYLIST,
+    PROP_SCAN_FOLDER_RECURSIVELY,
+    PROP_START_PLAYING_OPENED_FILES,
+    PROP_REMOVE_DUPLICATED_PLAYLIST_ENTRIES,
     N_PROP
 };
 
@@ -322,7 +327,41 @@ parole_conf_class_init (ParoleConfClass *klass)
 						       G_MAXINT16,
 						       480,
                                                        G_PARAM_READWRITE));
-						       
+    /**
+     *Playlist options
+     **/
+    g_object_class_install_property (object_class,
+                                     PROP_REPLACE_PLAYLIST,
+                                     g_param_spec_boolean ("replace-playlist",
+                                                           NULL, NULL,
+                                                           FALSE,
+                                                           G_PARAM_READWRITE));
+    
+    g_object_class_install_property (object_class,
+                                     PROP_SCAN_FOLDER_RECURSIVELY,
+                                     g_param_spec_boolean ("scan-recursive",
+                                                           NULL, NULL,
+                                                           TRUE,
+                                                           G_PARAM_READWRITE));
+    
+    g_object_class_install_property (object_class,
+                                     PROP_START_PLAYING_OPENED_FILES,
+                                     g_param_spec_boolean ("play-opened-files",
+                                                           NULL, NULL,
+                                                           TRUE,
+                                                           G_PARAM_READWRITE));
+
+    /**
+     * 
+     * Remove duplicated entries from the playlist.
+     **/
+    g_object_class_install_property (object_class,
+                                     PROP_REMOVE_DUPLICATED_PLAYLIST_ENTRIES,
+                                     g_param_spec_boolean ("remove-duplicated",
+                                                           NULL, NULL,
+                                                           FALSE,
+                                                           G_PARAM_READWRITE));
+    
     g_type_class_add_private (klass, sizeof (ParoleConfPrivate));
 }
 
diff --git a/src/parole-mediachooser.c b/src/parole-mediachooser.c
index c51fb79..ba6c086 100644
--- a/src/parole-mediachooser.c
+++ b/src/parole-mediachooser.c
@@ -44,8 +44,6 @@
 
 #include "common/parole-common.h"
 
-#include "gmarshal.h"
-
 /*
  * GtkBuilder Callbacks
  */
@@ -82,6 +80,7 @@ G_DEFINE_TYPE (ParoleMediaChooser, parole_media_chooser, GTK_TYPE_DIALOG)
 
 void parole_media_chooser_close	(GtkWidget *widget, ParoleMediaChooser *chooser)
 {
+    g_object_unref (chooser->conf);
     gtk_widget_destroy (GTK_WIDGET (chooser));
 }
 
@@ -105,11 +104,7 @@ parole_media_chooser_add (ParoleMediaChooser *chooser, GtkWidget *file_chooser)
     GSList *files;
     GtkFileFilter *filter;
     GtkWidget *recursive;
-    GtkWidget *replace;
-    GtkWidget *play_opened;
     gboolean scan_recursive;
-    gboolean replace_playlist;
-    gboolean play;
     gchar *file;
     guint    i;
     guint len;
@@ -121,12 +116,8 @@ parole_media_chooser_add (ParoleMediaChooser *chooser, GtkWidget *file_chooser)
 	return;
 	
     recursive = g_object_get_data (G_OBJECT (chooser), "recursive");
-    replace = g_object_get_data (G_OBJECT (chooser), "replace-playlist");
-    play_opened = g_object_get_data (G_OBJECT (chooser), "play");
     
     scan_recursive = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (recursive));
-    replace_playlist = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (replace));
-    play = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (play_opened));
     
     len = g_slist_length (files);
     
@@ -136,7 +127,7 @@ parole_media_chooser_add (ParoleMediaChooser *chooser, GtkWidget *file_chooser)
 	parole_get_media_files (filter, file, scan_recursive, &media_files);
     }
     
-    g_signal_emit (G_OBJECT (chooser), signals [MEDIA_FILES_OPENED], 0, play, replace_playlist, media_files);
+    g_signal_emit (G_OBJECT (chooser), signals [MEDIA_FILES_OPENED], 0, media_files);
     g_slist_free (media_files);
     
     g_slist_foreach (files, (GFunc) g_free, NULL);
@@ -163,25 +154,37 @@ void media_chooser_file_activate_cb (GtkFileChooser *filechooser, ParoleMediaCho
 void	parole_media_chooser_recursive_toggled_cb (GtkToggleButton *recursive,
 						   gpointer data)
 {
-    parole_rc_write_entry_bool ("scan-recursive", 
-			        PAROLE_RC_GROUP_GENERAL, 
-				gtk_toggle_button_get_active (recursive));
+    ParoleMediaChooser *chooser;
+
+    chooser = PAROLE_MEDIA_CHOOSER (data);
+    
+    g_object_set (G_OBJECT (chooser->conf),
+		  "scan-recursive", gtk_toggle_button_get_active (recursive),
+		  NULL);
 }
 
 void    parole_media_chooser_replace_toggled_cb (GtkToggleButton *button,
 						 gpointer data)
 {
-    parole_rc_write_entry_bool ("replace-playlist", 
-			        PAROLE_RC_GROUP_GENERAL, 
-				gtk_toggle_button_get_active (button));
+    ParoleMediaChooser *chooser;
+
+    chooser = PAROLE_MEDIA_CHOOSER (data);
+    
+    g_object_set (G_OBJECT (chooser->conf),
+		  "replace-playlist", gtk_toggle_button_get_active (button),
+		  NULL);
 }
 
 void start_playing_toggled_cb (GtkToggleButton *button,
 			       gpointer data)
 {
-    parole_rc_write_entry_bool ("play-opened-files", 
-			        PAROLE_RC_GROUP_GENERAL, 
-				gtk_toggle_button_get_active (button));
+    ParoleMediaChooser *chooser;
+
+    chooser = PAROLE_MEDIA_CHOOSER (data);
+    
+    g_object_set (G_OBJECT (chooser->conf),
+		  "play-opened-files", gtk_toggle_button_get_active (button),
+		  NULL);
 }
 
 static void
@@ -224,17 +227,17 @@ parole_media_chooser_open_internal (GtkWidget *chooser)
 	gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_chooser), folder);
     
     gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (file_chooser), TRUE);
-    
-    scan_recursive = parole_rc_read_entry_bool ("scan-recursive", PAROLE_RC_GROUP_GENERAL, TRUE);
+
+    g_object_get (G_OBJECT (media_chooser->conf),
+		  "scan-recursive", &scan_recursive,
+		  "replace-playlist", &replace_playlist,
+		  "play-opened-files", &play,
+		  NULL);
     
     recursive = GTK_WIDGET (gtk_builder_get_object (builder, "recursive"));
     replace = GTK_WIDGET (gtk_builder_get_object (builder, "replace"));
     play_opened = GTK_WIDGET (gtk_builder_get_object (builder, "play-added-files"));
     
-    scan_recursive = parole_rc_read_entry_bool ("scan-recursive", PAROLE_RC_GROUP_GENERAL, TRUE);
-    replace_playlist = parole_rc_read_entry_bool ("replace-playlist", PAROLE_RC_GROUP_GENERAL, FALSE);
-    play = parole_rc_read_entry_bool ("play-opened-files", PAROLE_RC_GROUP_GENERAL, TRUE);
-    
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (recursive), scan_recursive);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (replace), replace_playlist);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (play_opened), play);
@@ -248,8 +251,6 @@ parole_media_chooser_open_internal (GtkWidget *chooser)
     
     g_object_set_data (G_OBJECT (chooser), "file-chooser", file_chooser);
     g_object_set_data (G_OBJECT (chooser), "recursive", recursive);
-    g_object_set_data (G_OBJECT (chooser), "replace-playlist", replace);
-    g_object_set_data (G_OBJECT (chooser), "play", play_opened);
     
     gtk_container_add (GTK_CONTAINER (GTK_DIALOG (media_chooser)->vbox), vbox);
     gtk_builder_connect_signals (builder, chooser);
@@ -276,10 +277,8 @@ parole_media_chooser_class_init (ParoleMediaChooserClass *klass)
                       G_SIGNAL_RUN_LAST,
                       G_STRUCT_OFFSET (ParoleMediaChooserClass, media_files_opened),
                       NULL, NULL,
-		      _gmarshal_VOID__BOOLEAN_BOOLEAN_POINTER,
-                      G_TYPE_NONE, 3, 
-		      G_TYPE_BOOLEAN,
-		      G_TYPE_BOOLEAN,
+		      g_cclosure_marshal_VOID__POINTER,
+                      G_TYPE_NONE, 1, 
 		      G_TYPE_POINTER);
 
     object_class->finalize = parole_media_chooser_finalize;
@@ -289,6 +288,8 @@ static void
 parole_media_chooser_init (ParoleMediaChooser *chooser)
 {
     gtk_window_set_modal (GTK_WINDOW (chooser), TRUE);
+    
+    chooser->conf = parole_conf_new ();
 }
 
 GtkWidget *parole_media_chooser_open_local (GtkWidget *parent)
diff --git a/src/parole-mediachooser.h b/src/parole-mediachooser.h
index 46718f0..60abb1a 100644
--- a/src/parole-mediachooser.h
+++ b/src/parole-mediachooser.h
@@ -24,6 +24,8 @@
 #include <glib-object.h>
 #include <gtk/gtk.h>
 
+#include "parole-conf.h"
+
 G_BEGIN_DECLS
 
 #define PAROLE_TYPE_MEDIA_CHOOSER        (parole_media_chooser_get_type () )
@@ -36,6 +38,8 @@ typedef struct
 {
     GtkDialog         		 parent;
     
+    ParoleConf                  *conf;
+    
 } ParoleMediaChooser;
 
 typedef struct
@@ -43,8 +47,6 @@ typedef struct
     GtkDialogClass 		 parent_class;
     
     void			 (*media_files_opened)		    (ParoleMediaChooser *chooser,
-								     gboolean play,
-								     gboolean replace,
 								     GSList *list);
 								     
 } ParoleMediaChooserClass;
diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index 6c0707f..c56e816 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -1,4 +1,4 @@
-/*
+/*f
  * * Copyright (C) 2009 Ali <aliov at xfce.org>
  *
  * Licensed under the GNU General Public License Version 2
@@ -44,6 +44,7 @@
 #include "parole-medialist.h"
 #include "parole-mediachooser.h"
 #include "parole-open-location.h"
+#include "parole-conf.h"
 
 #include "parole-filters.h"
 #include "parole-pl-parser.h"
@@ -152,6 +153,7 @@ void		parole_media_list_save_playlist_cb     (GtkButton *button,
 struct ParoleMediaListPrivate
 {
     DBusGConnection     *bus;
+    ParoleConf          *conf;
     GtkWidget 	  	*view;
     GtkWidget		*box;
     GtkListStore	*store;
@@ -203,14 +205,15 @@ parole_media_list_add (ParoleMediaList *list, ParoleFile *file, gboolean emit, g
 			DATA_COL, file,
 			-1);
     
-    if ( emit )
+    if ( emit || select_row )
     {
 	path = gtk_tree_model_get_path (GTK_TREE_MODEL (list_store), &iter);
 	row = gtk_tree_row_reference_new (GTK_TREE_MODEL (list_store), path);
 	if ( select_row )
 	    parole_media_list_select_path (list, path);
 	gtk_tree_path_free (path);
-	g_signal_emit (G_OBJECT (list), signals [MEDIA_ACTIVATED], 0, row);
+	if ( emit )
+	    g_signal_emit (G_OBJECT (list), signals [MEDIA_ACTIVATED], 0, row);
 	gtk_tree_row_reference_free (row);
     }
   
@@ -235,13 +238,17 @@ parole_media_list_add (ParoleMediaList *list, ParoleFile *file, gboolean emit, g
 }
 
 static void
-parole_media_list_files_open (ParoleMediaList *list, GSList *files, 
-			      gboolean replace, gboolean emit)
+parole_media_list_files_open (ParoleMediaList *list, GSList *files, gboolean emit)
 {
     ParoleFile *file;
+    gboolean replace;
     guint len;
     guint i;
     
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "replace-playlist", &replace,
+		  NULL);
+    
     len = g_slist_length (files);
     TRACE ("Adding files");
     
@@ -262,12 +269,16 @@ parole_media_list_files_open (ParoleMediaList *list, GSList *files,
 
 static void
 parole_media_list_files_opened_cb (ParoleMediaChooser *chooser, 
-				   gboolean play,
-				   gboolean replace,
 				   GSList *files, 
 				   ParoleMediaList *list)
 {
-    parole_media_list_files_open (list, files, replace, play);
+    gboolean play;
+    
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "play-opened-files", &play,
+		  NULL);
+    
+    parole_media_list_files_open (list, files, play);
 }
 
 static void
@@ -347,15 +358,20 @@ void	parole_media_list_drag_data_received_cb (GtkWidget *widget,
     gchar *path;
     guint i;
     guint added = 0;
+    gboolean play;
     
     parole_window_busy_cursor (GTK_WIDGET (list)->window);
     
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "play-opened-files", &play,
+		  NULL);
+    
     uri_list = g_uri_list_extract_uris ((const gchar *)data->data);
     
     for ( i = 0; uri_list[i] != NULL; i++)
     {
 	path = g_filename_from_uri (uri_list[i], NULL, NULL);
-	added += parole_media_list_add_by_path (list, path, i == 0 ? TRUE : FALSE);
+	added += parole_media_list_add_by_path (list, path, i == 0 ? play : FALSE);
 
 	g_free (path);
     }
@@ -841,6 +857,24 @@ parole_media_list_clear_list (ParoleMediaList *list)
 }
 
 static void
+replace_list_activated_cb (GtkWidget *mi, ParoleConf *conf)
+{
+    g_object_set (G_OBJECT (conf),
+		  "replace-playlist", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (mi)),
+		  NULL);
+		
+}
+
+static void
+play_opened_files_activated_cb (GtkWidget *mi, ParoleConf *conf)
+{
+    g_object_set (G_OBJECT (conf),
+		  "play-opened-files", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (mi)),
+		  NULL);
+		
+}
+
+static void
 save_list_activated_cb (GtkWidget *mi)
 {
     gboolean active;
@@ -851,12 +885,103 @@ save_list_activated_cb (GtkWidget *mi)
 }
 
 static void
+repeat_activated_cb (GtkWidget *mi, ParoleConf *conf)
+{
+    g_object_set (G_OBJECT (conf),
+		  "repeat", gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (mi)),
+		  NULL);
+}
+
+static void
+shuffle_activated_cb (GtkWidget *mi, ParoleConf *conf)
+{
+    g_object_set (G_OBJECT (conf),
+		  "shuffle", gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (mi)),
+		  NULL);
+}
+
+static void
 parole_media_list_show_menu (ParoleMediaList *list, guint button, guint activate_time)
 {
     GtkWidget *menu, *mi;
+    gboolean val;
 
     menu = gtk_menu_new ();
+
+    /**
+     * Repeat playing.
+     **/
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "repeat", &val,
+		  NULL);
+
+    mi = gtk_check_menu_item_new_with_label (_("Repeat"));
+    gtk_widget_set_sensitive (mi, TRUE);
+    gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), val);
+    g_signal_connect (mi, "activate",
+                      G_CALLBACK (repeat_activated_cb), list->priv->conf);
+			      
+    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+    gtk_widget_show (mi);
+
+    /**
+     * Shuffle playing.
+     **/
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "shuffle", &val,
+		  NULL);
+
+    mi = gtk_check_menu_item_new_with_label (_("Shuffle"));
+    gtk_widget_set_sensitive (mi, TRUE);
+    gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), val);
+    g_signal_connect (mi, "activate",
+                      G_CALLBACK (shuffle_activated_cb), list->priv->conf);
+			      
+    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+    gtk_widget_show (mi);
+
+    /**
+     * Separator
+     **/
+    mi = gtk_separator_menu_item_new ();
+    gtk_widget_show (mi);
+    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+
+    /**
+     * replace playlist
+     **/
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "replace-playlist", &val,
+		  NULL);
+
+    mi = gtk_check_menu_item_new_with_label (_("Replace playlist with opened files"));
+    gtk_widget_set_sensitive (mi, TRUE);
+    gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), val);
+    g_signal_connect (mi, "activate",
+                      G_CALLBACK (replace_list_activated_cb), list->priv->conf);
+			      
+    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+    gtk_widget_show (mi);
     
+    /**
+     * Play when files are open.
+     **/
+    
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "play-opened-files", &val,
+		  NULL);
+    mi = gtk_check_menu_item_new_with_label (_("Play opened files"));
+    gtk_widget_set_sensitive (mi, TRUE);
+    gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), val);
+    g_signal_connect (mi, "activate",
+                      G_CALLBACK (play_opened_files_activated_cb), list->priv->conf);
+			      
+    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+    gtk_widget_show (mi);
+    
+    /**
+     * Remember media list entries
+     **/
     mi = gtk_check_menu_item_new_with_label (_("Remember playlist"));
     gtk_widget_set_sensitive (mi, TRUE);
     gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi),
@@ -870,6 +995,9 @@ parole_media_list_show_menu (ParoleMediaList *list, guint button, guint activate
     
     gtk_widget_show (mi);
     
+    /**
+     * Separator
+     **/
     mi = gtk_separator_menu_item_new ();
     gtk_widget_show (mi);
     gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
@@ -1033,6 +1161,8 @@ parole_media_list_init (ParoleMediaList *list)
     
     list->priv->bus = parole_g_session_bus_get ();
     
+    list->priv->conf = parole_conf_new ();
+    
     builder = parole_builder_new_from_string (playlist_ui, playlist_ui_length);
     
     list->priv->view = GTK_WIDGET (gtk_builder_get_object (builder, "media-list"));
@@ -1078,8 +1208,13 @@ parole_media_list_get (void)
 void parole_media_list_load (ParoleMediaList *list)
 {
     gboolean    load_saved_list;
+    gboolean    play;
     GSList     *fileslist = NULL;
     
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "play-opened-files", &play,
+		  NULL);
+    
     load_saved_list = parole_rc_read_entry_bool ("SAVE_LIST_ON_EXIT", PAROLE_RC_GROUP_GENERAL, FALSE);
     
     if ( load_saved_list )
@@ -1094,7 +1229,7 @@ void parole_media_list_load (ParoleMediaList *list)
 	    fileslist = parole_pl_parser_parse_from_file_by_extension (playlist_file);
 	    g_free (playlist_file);
 	    
-	    parole_media_list_files_opened_cb (NULL, FALSE, FALSE, fileslist, list);
+	    parole_media_list_files_open (list, fileslist, play);
 	    g_slist_free (fileslist);
 	}
     }
@@ -1116,7 +1251,7 @@ parole_media_list_add_by_path (ParoleMediaList *list, const gchar *path, gboolea
     
     parole_get_media_files (filter, path, TRUE, &files_list);
     
-    parole_media_list_files_open (list, files_list, FALSE, emit);
+    parole_media_list_files_open (list, files_list, emit);
     
     len = g_slist_length (files_list);
     ret = len == 0 ? FALSE : TRUE;
@@ -1299,24 +1434,31 @@ gboolean parole_media_list_add_files (ParoleMediaList *list, gchar **filenames)
 {
     guint i;
     guint added = 0;
+    gboolean play;
     
+    g_object_get (G_OBJECT (list->priv->conf),
+		  "play-opened-files", &play,
+		  NULL);
     for ( i = 0; filenames && filenames[i] != NULL; i++)
     {
-	if ( g_file_test (filenames[i], G_FILE_TEST_IS_REGULAR ) )
+	/*
+	 * File on disk?
+	 */
+	if ( g_file_test (filenames[i], G_FILE_TEST_EXISTS ) )
 	{
-	    added += parole_media_list_add_by_path (list, filenames[i], i == 0 ? TRUE : FALSE);
+	    added += parole_media_list_add_by_path (list, filenames[i], i == 0 ? play : FALSE);
 	}
 	else
 	{
 	    ParoleFile *file;
 	    TRACE ("File=%s", filenames[i]);
 	    file = parole_file_new (filenames[i]);
-	    parole_media_list_add (list, file, i == 0 ? TRUE : FALSE, i == 0 ? TRUE : FALSE);
+	    parole_media_list_add (list, file, i == 0 ? TRUE : FALSE, i == 0 ? play : FALSE);
 	    added++;
 	}
     }
     
-    return added == i;
+    return added > 0;
 }
 
 void parole_media_list_save_list (ParoleMediaList *list)



More information about the Xfce4-commits mailing list