Merge lp:~guitarhunter92/unity-window-quicklists/small-titles into lp:unity-window-quicklists

Proposed by Hunter VanHorn
Status: Needs review
Proposed branch: lp:~guitarhunter92/unity-window-quicklists/small-titles
Merge into: lp:unity-window-quicklists
Diff against target: 55 lines (+10/-3)
2 files modified
quicklists (+9/-2)
unity-window-quicklists.desktop (+1/-1)
To merge this branch: bzr merge lp:~guitarhunter92/unity-window-quicklists/small-titles
Reviewer Review Type Date Requested Status
Alan Bell Approve
Review via email: mp+110912@code.launchpad.net

Description of the change

Truncates length of titles in the quicklist to show <first 15 char> ... <last 15 char>. For instance,
Propose branch ... Mozilla Firefox

It might be better to package this seperately, that way those who want the whole title
can have it.

To post a comment you must log in.
Revision history for this message
Alan Bell (alanbell) wrote :

can you set your editor to use 4 spaces instead of tab characters please, that is the python standard. I will accept the merge with the spacing fixed.

review: Needs Fixing
Revision history for this message
Hunter VanHorn (guitarhunter92) wrote :

> can you set your editor to use 4 spaces instead of tab characters please, that
> is the python standard. I will accept the merge with the spacing fixed.

For some reason thought it was 4-space length tabs, rather than 4 spaces. Fixed now.

Revision history for this message
Alan Bell (alanbell) wrote :

yeah, that looks good

review: Approve
2. By Hunter VanHorn

Change to new local directory,
Changed .desktop to read as Unity, not UNITY

3. By Hunter VanHorn

More local housekeeping

Unmerged revisions

3. By Hunter VanHorn

More local housekeeping

2. By Hunter VanHorn

Change to new local directory,
Changed .desktop to read as Unity, not UNITY

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'quicklists'
2--- quicklists 2012-06-15 23:14:12 +0000
3+++ quicklists 2012-06-20 13:41:19 +0000
4@@ -12,6 +12,7 @@
5 bamf = bus.get_object('org.ayatana.bamf','/org/ayatana/bamf/matcher')
6 loop = GObject.MainLoop()
7 timestamp = int(time.time())
8+name_length = 35
9
10 launcher={}
11 sighandlers={}
12@@ -38,7 +39,7 @@
13 sighandlers[desktoppath+'windowadd']=bus.add_signal_receiver(window_add,"WindowAdded",dbus_interface='org.ayatana.bamf.application',path=path,path_keyword='applicationpath')
14 sighandlers[desktoppath+'windowremove']=bus.add_signal_receiver(window_remove,"WindowRemoved",dbus_interface='org.ayatana.bamf.application',path=path,path_keyword='applicationpath')
15 for w in windows:
16- window_add(w,applicationpath=path)
17+ window_add(w,applicationpath=path)
18 for desktoppath in removed_apps:
19 #we need to listen for new or removed windows in this app
20 #path=launcher[desktoppath]
21@@ -58,7 +59,10 @@
22 ql = Dbusmenu.Menuitem.new ()
23 launcher[applicationpath].set_property("quicklist", ql)
24 windowitem = Dbusmenu.Menuitem.new ()
25- windowitem.property_set (Dbusmenu.MENUITEM_PROP_LABEL, window.Name(dbus_interface='org.ayatana.bamf.view'))
26+ window_name = window.Name(dbus_interface='org.ayatana.bamf.view')
27+ if len(window_name) > name_length:
28+ window_name = window_name[:(name_length-5)/2] + ' ... ' + window_name[-(name_length-5)/2:]
29+ windowitem.property_set (Dbusmenu.MENUITEM_PROP_LABEL, window_name)
30 windowitem.property_set_int('xid',window.GetXid(dbus_interface='org.ayatana.bamf.window'))#store this for later
31 windowitem.property_set('windowpath',windowpath)#store this for later
32 windowitem.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)
33@@ -91,6 +95,9 @@
34 application = bus.get_object('org.ayatana.bamf',applicationpath)
35 #lets see if we can get an existing quicklist
36 ql = launcher[applicationpath].get_property("quicklist")
37+ #make sure the new window name is not too long
38+ if len(newname) > name_length:
39+ newname = newname[:(name_length-5)/2] + ' ... ' + newname[-(name_length-5)/2:]
40 if not ql:
41 #well, not much to do really, kind of surprised to be here
42 return
43
44=== modified file 'unity-window-quicklists.desktop'
45--- unity-window-quicklists.desktop 2012-06-15 23:14:12 +0000
46+++ unity-window-quicklists.desktop 2012-06-20 13:41:19 +0000
47@@ -6,7 +6,7 @@
48 Terminal=false
49 Type=Application
50 Categories=
51-OnlyShowIn=UNITY;
52+OnlyShowIn=Unity;
53 AutostartCondition=
54 NoDisplay=true
55 X-Ubuntu-Gettext-Domain=unity-window-quicklists

Subscribers

People subscribed via source and target branches

to all changes: