Updating branch refs/heads/master
         to dba1cef1f3d10ff13cd73732969a7f2ef49892af (commit)
       from 3aef3fc78d5a7d43c8cb77bc0cbfb1cab822ae05 (commit)

commit dba1cef1f3d10ff13cd73732969a7f2ef49892af
Author: Mike Massonnet <[email protected]>
Date:   Wed Sep 12 22:23:00 2012 +0200

    playlist: Set position of song optional (bug 9271)
    
    New preference "playlist-show-position" which is currently a hidden option 
and set
    by default to false. The position of the track is not very important.

 src/playlist.vala    |   20 ++++++++++++--------
 src/preferences.vala |    6 ++++++
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/playlist.vala b/src/playlist.vala
index adf20f9..1ed9a5e 100644
--- a/src/playlist.vala
+++ b/src/playlist.vala
@@ -75,18 +75,22 @@ namespace Xfmpc {
 
                        var cell = new Gtk.CellRendererText ();
                        cell.xalign = 1;
-                       this.treeview.insert_column_with_attributes (-1, 
"Length", cell,
-                                                                    "text", 
Columns.COLUMN_POSITION,
-                                                                    "weight", 
Columns.COLUMN_WEIGHT,
-                                                                    null);
+                       var column = new Gtk.TreeViewColumn.with_attributes 
("Position", cell,
+                                                                            
"text", Columns.COLUMN_POSITION,
+                                                                            
"weight", Columns.COLUMN_WEIGHT,
+                                                                            
null);
+                       column.visible = 
this.preferences.playlist_show_position;
+                       this.treeview.append_column (column);
+
                        cell = new Gtk.CellRendererText ();
                        cell.ellipsize = Pango.EllipsizeMode.END;
-                       var column = new Gtk.TreeViewColumn.with_attributes 
("Song", cell,
-                                                                            
"text", Columns.COLUMN_SONG,
-                                                                            
"weight", Columns.COLUMN_WEIGHT,
-                                                                            
null);
+                       column = new Gtk.TreeViewColumn.with_attributes 
("Song", cell,
+                                                                        
"text", Columns.COLUMN_SONG,
+                                                                        
"weight", Columns.COLUMN_WEIGHT,
+                                                                        null);
                        column.expand = true;
                        this.treeview.append_column (column);
+
                        cell = new Gtk.CellRendererText ();
                        cell.xalign = 1;
                        this.treeview.insert_column_with_attributes (-1, 
"Length", cell,
diff --git a/src/preferences.vala b/src/preferences.vala
index 1656e75..2c6cc74 100644
--- a/src/preferences.vala
+++ b/src/preferences.vala
@@ -66,6 +66,11 @@ namespace Xfmpc {
                        get { return _playlist_autocenter; }
                        set { _playlist_autocenter = value; store (); }
                }
+               private bool _playlist_show_position;
+               public bool playlist_show_position {
+                       get { return _playlist_show_position; }
+                       set { _playlist_show_position = value; store (); }
+               }
                private string _mpd_hostname;
                public string mpd_hostname {
                        get { return _mpd_hostname; }
@@ -114,6 +119,7 @@ namespace Xfmpc {
                        _last_window_height = 330;
                        _last_window_state_sticky = false;
                        _playlist_autocenter = true;
+                       _playlist_show_position = false;
                        _mpd_hostname = "localhost";
                        _mpd_port = 6600;
                        _mpd_password = "";
_______________________________________________
Xfce4-commits mailing list
[email protected]
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to