[pitivi] medialibrary: Use the horizontal ellipsis unicode character
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] medialibrary: Use the horizontal ellipsis unicode character
- Date: Sun, 11 Nov 2012 22:19:28 +0000 (UTC)
commit fb25c4fc1d22967ce5de5c0131dfa995b88af2fa
Author: Alex BÄluÈ <alexandru balut gmail com>
Date: Thu Nov 8 21:12:17 2012 +0100
medialibrary: Use the horizontal ellipsis unicode character
pitivi/medialibrary.py | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index dc194aa..19ec42b 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -52,6 +52,8 @@ from pitivi.utils.ui import beautify_info, info_name, SPACING, PADDING
from pitivi.utils.ui import TYPE_PITIVI_FILESOURCE
+MAX_SHORT_NAME_LENGTH = 32
+
# Values used in the settings file.
SHOW_TREEVIEW = 1
SHOW_ICONVIEW = 2
@@ -676,15 +678,15 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
else:
duration = beautify_length(info.get_duration())
- short_text = None
- uni = unicode(info_name(info), 'utf-8')
+ name = info_name(info)
+ short_name = None
+ uni = unicode(name, 'utf-8')
- if len(uni) > 34:
- short_uni = uni[0:29]
- short_uni += unicode('...')
- short_text = short_uni.encode('utf-8')
+ if len(uni) > MAX_SHORT_NAME_LENGTH:
+ short_uni = uni[0:MAX_SHORT_NAME_LENGTH - 1] + u"â"
+ short_name = short_uni.encode('utf-8')
else:
- short_text = info_name(info)
+ short_name = name
self.pending_rows.append((thumbnail,
thumbnail_large,
@@ -692,13 +694,12 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
info,
info.get_uri(),
duration,
- info_name(info),
- short_text))
+ name,
+ short_name))
if len(self.pending_rows) > 50:
self.flush_pending_rows()
def flush_pending_rows(self):
-
for row in self.pending_rows:
self.storemodel.append(row)
del self.pending_rows[:]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]