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
=== modified file 'quicklists'
--- quicklists 2012-06-15 23:14:12 +0000
+++ quicklists 2012-06-20 13:41:19 +0000
@@ -12,6 +12,7 @@
12bamf = bus.get_object('org.ayatana.bamf','/org/ayatana/bamf/matcher')12bamf = bus.get_object('org.ayatana.bamf','/org/ayatana/bamf/matcher')
13loop = GObject.MainLoop()13loop = GObject.MainLoop()
14timestamp = int(time.time())14timestamp = int(time.time())
15name_length = 35
1516
16launcher={}17launcher={}
17sighandlers={}18sighandlers={}
@@ -38,7 +39,7 @@
38 sighandlers[desktoppath+'windowadd']=bus.add_signal_receiver(window_add,"WindowAdded",dbus_interface='org.ayatana.bamf.application',path=path,path_keyword='applicationpath')39 sighandlers[desktoppath+'windowadd']=bus.add_signal_receiver(window_add,"WindowAdded",dbus_interface='org.ayatana.bamf.application',path=path,path_keyword='applicationpath')
39 sighandlers[desktoppath+'windowremove']=bus.add_signal_receiver(window_remove,"WindowRemoved",dbus_interface='org.ayatana.bamf.application',path=path,path_keyword='applicationpath')40 sighandlers[desktoppath+'windowremove']=bus.add_signal_receiver(window_remove,"WindowRemoved",dbus_interface='org.ayatana.bamf.application',path=path,path_keyword='applicationpath')
40 for w in windows:41 for w in windows:
41 window_add(w,applicationpath=path)42 window_add(w,applicationpath=path)
42 for desktoppath in removed_apps:43 for desktoppath in removed_apps:
43 #we need to listen for new or removed windows in this app44 #we need to listen for new or removed windows in this app
44 #path=launcher[desktoppath]45 #path=launcher[desktoppath]
@@ -58,7 +59,10 @@
58 ql = Dbusmenu.Menuitem.new ()59 ql = Dbusmenu.Menuitem.new ()
59 launcher[applicationpath].set_property("quicklist", ql)60 launcher[applicationpath].set_property("quicklist", ql)
60 windowitem = Dbusmenu.Menuitem.new ()61 windowitem = Dbusmenu.Menuitem.new ()
61 windowitem.property_set (Dbusmenu.MENUITEM_PROP_LABEL, window.Name(dbus_interface='org.ayatana.bamf.view'))62 window_name = window.Name(dbus_interface='org.ayatana.bamf.view')
63 if len(window_name) > name_length:
64 window_name = window_name[:(name_length-5)/2] + ' ... ' + window_name[-(name_length-5)/2:]
65 windowitem.property_set (Dbusmenu.MENUITEM_PROP_LABEL, window_name)
62 windowitem.property_set_int('xid',window.GetXid(dbus_interface='org.ayatana.bamf.window'))#store this for later66 windowitem.property_set_int('xid',window.GetXid(dbus_interface='org.ayatana.bamf.window'))#store this for later
63 windowitem.property_set('windowpath',windowpath)#store this for later67 windowitem.property_set('windowpath',windowpath)#store this for later
64 windowitem.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)68 windowitem.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)
@@ -91,6 +95,9 @@
91 application = bus.get_object('org.ayatana.bamf',applicationpath)95 application = bus.get_object('org.ayatana.bamf',applicationpath)
92 #lets see if we can get an existing quicklist96 #lets see if we can get an existing quicklist
93 ql = launcher[applicationpath].get_property("quicklist")97 ql = launcher[applicationpath].get_property("quicklist")
98 #make sure the new window name is not too long
99 if len(newname) > name_length:
100 newname = newname[:(name_length-5)/2] + ' ... ' + newname[-(name_length-5)/2:]
94 if not ql:101 if not ql:
95 #well, not much to do really, kind of surprised to be here102 #well, not much to do really, kind of surprised to be here
96 return103 return
97104
=== modified file 'unity-window-quicklists.desktop'
--- unity-window-quicklists.desktop 2012-06-15 23:14:12 +0000
+++ unity-window-quicklists.desktop 2012-06-20 13:41:19 +0000
@@ -6,7 +6,7 @@
6Terminal=false6Terminal=false
7Type=Application7Type=Application
8Categories=8Categories=
9OnlyShowIn=UNITY;9OnlyShowIn=Unity;
10AutostartCondition=10AutostartCondition=
11NoDisplay=true11NoDisplay=true
12X-Ubuntu-Gettext-Domain=unity-window-quicklists12X-Ubuntu-Gettext-Domain=unity-window-quicklists

Subscribers

People subscribed via source and target branches

to all changes: