[gnome-music] disclistboxwidget: Make song label length non-optional



commit 38dd53fb6a62bafd99ee83db86d4056646279368
Author: Marinus Schraal <mschraal src gnome org>
Date:   Tue Oct 25 15:16:17 2016 +0200

    disclistboxwidget: Make song label length non-optional
    
    Music had a gsettings option for the label length of individual songs,
    which was a bit random.
    With the rewrite of the album widgets we are more flexible and can set a
    saner default, making the gsetting no longer needed.

 data/org.gnome.Music.gschema.xml        |    5 -----
 gnomemusic/widgets/disclistboxwidget.py |   14 ++------------
 2 files changed, 2 insertions(+), 17 deletions(-)
---
diff --git a/data/org.gnome.Music.gschema.xml b/data/org.gnome.Music.gschema.xml
index 246aa75..49817c4 100644
--- a/data/org.gnome.Music.gschema.xml
+++ b/data/org.gnome.Music.gschema.xml
@@ -38,11 +38,6 @@
             <summary>Notifications mode</summary>
             <description>Enables or disables playback notifications</description>
         </key>
-        <key type="i" name="max-width-chars">
-            <default>20</default>
-            <summary>Max chars to display in track name on Artist view</summary>
-            <description>This setting modifies the amount of chars for track title on Artist view before its 
been ellipsized. Set this to -1 to disable</description>
-        </key>
         <key type="b" name="replaygain">
             <default>false</default>
             <summary>Enable ReplayGain</summary>
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index e5d81c9..f950c03 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -22,27 +22,17 @@
 # code, but you are not obligated to do so.  If you do not wish to do so,
 # delete this exception statement from your version.
 
-import logging
 
 from gettext import gettext as _
-from gi.repository import Gdk, Gio, GObject, Gtk
+from gi.repository import Gdk, GObject, Gtk
 
 from gnomemusic import log
 from gnomemusic.grilo import grilo
 import gnomemusic.utils as utils
 
-logger = logging.getLogger(__name__)
-
 NOW_PLAYING_ICON_NAME = 'media-playback-start-symbolic'
 ERROR_ICON_NAME = 'dialog-error-symbolic'
 
-try:
-    settings = Gio.Settings.new('org.gnome.Music')
-    MAX_TITLE_WIDTH = settings.get_int('max-width-chars')
-except Exception as e:
-    MAX_TITLE_WIDTH = 20
-    logger.error("Error on setting widget max-width-chars: %s", str(e))
-
 
 class StarStack(Gtk.Stack):
     """Stackwidget for starring songs"""
@@ -309,7 +299,7 @@ class DiscBox(Gtk.Box):
 
         song_widget.title = builder.get_object('title')
         song_widget.title.set_text(title)
-        song_widget.title.set_max_width_chars(MAX_TITLE_WIDTH)
+        song_widget.title.set_max_width_chars(50)
 
         song_widget.duration = builder.get_object('duration')
         time = utils.seconds_to_string(track.get_duration())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]