Merge lp:~psquid/heybuddy/maemo_tweaks into lp:heybuddy

Proposed by Psychedelic Squid
Status: Needs review
Proposed branch: lp:~psquid/heybuddy/maemo_tweaks
Merge into: lp:heybuddy
Diff against target: 352 lines (+136/-45)
4 files modified
ContextPage.py (+0/-7)
GroupPage.py (+41/-12)
UserPage.py (+42/-18)
heybuddy.py (+53/-8)
To merge this branch: bzr merge lp:~psquid/heybuddy/maemo_tweaks
Reviewer Review Type Date Requested Status
jezra Approve
Review via email: mp+60008@code.launchpad.net

This proposal supersedes a proposal from 2011-05-04.

Description of the change

This branch contains the fix for actually making submitting work on Maemo.

Also, as of this resubmitted proposal:

Some new Maemo tweaks: collapsible info sections for groups/users, and close buttons in tab titles (for closeable tabs only), rather than a separate button at the bottom of the tab.

Only possible issue I can see is with the close buttons; they do make the tab bar a few pixels taller when a closeable tab is open. Haven't figured out how/if it's possible to have it keep a constant height.

To post a comment you must log in.
Revision history for this message
jezra (jezra) wrote : Posted in a previous version of this proposal

shit yea, boyeeeeee!

review: Approve
lp:~psquid/heybuddy/maemo_tweaks updated
272. By Psychedelic Squid

Do some hackery to keep the tabbar height from fluctuating.

Revision history for this message
jezra (jezra) :
review: Approve

Unmerged revisions

272. By Psychedelic Squid

Do some hackery to keep the tabbar height from fluctuating.

271. By Psychedelic Squid

Close buttons in tab header for all closeable tabs, rather than at the bottom of the tab. Saves a lot of space.

270. By Psychedelic Squid

Collapsible info-area for groups/users. This makes it possible to actually see a sensible amount of dents on small screens (e.g., maemo) when the bio is long.

269. By Psychedelic Squid

Restore Maemo devices' ability to submit dents.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ContextPage.py'
--- ContextPage.py 2010-10-09 06:14:56 +0000
+++ ContextPage.py 2011-05-05 04:39:25 +0000
@@ -14,13 +14,6 @@
14 }14 }
15 def __init__(self):15 def __init__(self):
16 ScrollPage.__init__(self)16 ScrollPage.__init__(self)
17 #we do need a close button
18 close_button=gtk.Button(_("Close"))
19 hbox = gtk.HBox(False)
20 hbox.pack_start(close_button,False,False,0)
21 close_button.connect('clicked',self.close)
22 self.pack_end(hbox,False,False,0)
23
24 17
25 def close(self,button):18 def close(self,button):
26 #we can just hid ourself19 #we can just hid ourself
2720
=== modified file 'GroupPage.py'
--- GroupPage.py 2011-04-11 18:31:17 +0000
+++ GroupPage.py 2011-05-05 04:39:25 +0000
@@ -3,6 +3,7 @@
3copyright 2010 jezra lickter http://www.jezra.net3copyright 2010 jezra lickter http://www.jezra.net
4'''4'''
5from DentScroller import DentScroller5from DentScroller import DentScroller
6from DentButton import DentButton
6import gtk,gobject7import gtk,gobject
7from PlatformSpecific import links_unavailable8from PlatformSpecific import links_unavailable
8class GroupPage(gtk.VBox,gobject.GObject):9class GroupPage(gtk.VBox,gobject.GObject):
@@ -32,11 +33,11 @@
32 imagevbox.pack_start(self.image,False,False,0)33 imagevbox.pack_start(self.image,False,False,0)
3334
34 #make an hbox to hold image and group info35 #make an hbox to hold image and group info
35 grouphbox=gtk.HBox(False,5)36 self.grouphbox=gtk.HBox(False,5)
36 self.pack_start(grouphbox,False,False,0)37 self.pack_start(self.grouphbox,False,False,0)
37 grouphbox.pack_start(imagevbox,False,False,0)38 self.grouphbox.pack_start(imagevbox,False,False,0)
38 infovbox = gtk.VBox(False)39 infovbox = gtk.VBox(False)
39 grouphbox.pack_start(infovbox,False,False)40 self.grouphbox.pack_start(infovbox,False,False)
40 41
41 self.name_label = gtk.Label()42 self.name_label = gtk.Label()
42 infovbox.pack_start(self.name_label,False,False,0)43 infovbox.pack_start(self.name_label,False,False,0)
@@ -53,27 +54,45 @@
53 self.location_label = gtk.Label()54 self.location_label = gtk.Label()
54 infovbox.pack_start(self.location_label,False,False,0)55 infovbox.pack_start(self.location_label,False,False,0)
55 56
57 #widget box for the horizontal stuff
58 self.widgetbox = gtk.HBox(False)
59 self.pack_start(self.widgetbox,False,False,0)
60
56 #make a checkbutton if we are following61 #make a checkbutton if we are following
57 self.joined_checkbutton = gtk.CheckButton(_("joined"))62 self.joined_checkbutton = gtk.CheckButton(_("joined"))
58 self.joined_checkbutton.connect('toggled', self.joined_toggled)63 self.joined_checkbutton.connect('toggled', self.joined_toggled)
59 infovbox.pack_start(self.joined_checkbutton,False,False,0)64 self.widgetbox.pack_start(self.joined_checkbutton,False,False,0)
65
66 #collapse button
67 collapsebox = gtk.Alignment(xalign=1.0)
68 self.collapse_button = DentButton(u'\u25b2')
69 self.collapse_button.connect('clicked',self.collapse_clicked)
70 collapsebox.add(self.collapse_button)
71 self.widgetbox.pack_end(collapsebox,True,True,0)
72
73 #collapsed widget box and name label
74 self.widgetbox_collapsed = gtk.HBox(False)
75 self.name_label_collapsed = gtk.Label()
76 self.widgetbox_collapsed.pack_start(self.name_label_collapsed,False,False,0)
77 #its expand button
78 expandbox = gtk.Alignment(xalign=1.0)
79 self.expand_button = DentButton(u'\u25bc')
80 self.expand_button.connect('clicked',self.expand_clicked)
81 expandbox.add(self.expand_button)
82 self.widgetbox_collapsed.pack_end(expandbox,True,True,0)
83 #pack it up
84 self.pack_start(self.widgetbox_collapsed,False,False,0)
60 85
61 #create a group dent scroller and add it to the group page86 #create a group dent scroller and add it to the group page
62 self.dentScroller = DentScroller()87 self.dentScroller = DentScroller()
63 self.pack_start(self.dentScroller)88 self.pack_start(self.dentScroller)
64 89
65 #make a "close" button
66 hbox = gtk.HBox(False)
67 user_close_button=gtk.Button(_("Close"))
68 hbox.pack_start(user_close_button,False,False,0)
69 user_close_button.connect('clicked',self.close)
70 self.pack_end(hbox,False,False,0)
71
72 def set_group_data(self,data):90 def set_group_data(self,data):
73 self.joined_checkbutton.set_sensitive(True)91 self.joined_checkbutton.set_sensitive(True)
74 self.group_id= data['id']92 self.group_id= data['id']
75 self.group_name = data['fullname']93 self.group_name = data['fullname']
76 self.name_label.set_text("%s" %(data['fullname']) )94 self.name_label.set_text("%s" %(data['fullname']) )
95 self.name_label_collapsed.set_text("%s" %(data['fullname']) )
77 if data['location']!=None:96 if data['location']!=None:
78 self.location_label.set_text("%s: %s" %(_("Location"), data['location']) )97 self.location_label.set_text("%s: %s" %(_("Location"), data['location']) )
79 self.location_label.show()98 self.location_label.show()
@@ -122,6 +141,16 @@
122 #self.hide()141 #self.hide()
123 self.emit('group-page-hide')142 self.emit('group-page-hide')
124 143
144 def collapse_clicked(self,widget):
145 self.grouphbox.hide()
146 self.widgetbox.hide()
147 self.widgetbox_collapsed.show()
148
149 def expand_clicked(self,widget):
150 self.grouphbox.show()
151 self.widgetbox.show()
152 self.widgetbox_collapsed.hide()
153
125 def process_link(self, label, uri ):154 def process_link(self, label, uri ):
126 self.emit('open-link', uri )155 self.emit('open-link', uri )
127 return True156 return True
128157
=== modified file 'UserPage.py'
--- UserPage.py 2011-04-11 18:31:17 +0000
+++ UserPage.py 2011-05-05 04:39:25 +0000
@@ -61,47 +61,60 @@
61 labelvbox.pack_start(self.location_label,False,False,0)61 labelvbox.pack_start(self.location_label,False,False,0)
62 labelvbox.pack_start(self.url_label,False,False,0)62 labelvbox.pack_start(self.url_label,False,False,0)
63 #make an hbox to hold the image and labels63 #make an hbox to hold the image and labels
64 userhbox=gtk.HBox(False,5)64 self.userhbox=gtk.HBox(False,5)
65 #make an hbox to hold widgets65 #make an hbox to hold widgets
66 widgetbox = gtk.HBox(False)66 self.widgetbox = gtk.HBox(False)
67 #add the imagevbox67 #add the imagevbox
68 userhbox.pack_start(imagevbox,False,False,0)68 self.userhbox.pack_start(imagevbox,False,False,0)
69 userhbox.pack_start(labelvbox,False,False,0)69 self.userhbox.pack_start(labelvbox,False,False,0)
70 self.pack_start(userhbox,False,False,0)70 self.pack_start(self.userhbox,False,False,0)
71 self.pack_start(widgetbox,False,False,0)71 self.pack_start(self.widgetbox,False,False,0)
72 #make a checkbutton if we are following72 #make a checkbutton if we are following
73 self.following_checkbutton = gtk.CheckButton(_("Following"))73 self.following_checkbutton = gtk.CheckButton(_("Following"))
74 self.following_checkbutton.connect('toggled', self.following_toggled)74 self.following_checkbutton.connect('toggled', self.following_toggled)
75 widgetbox.pack_start(self.following_checkbutton,False,False,0)75 self.widgetbox.pack_start(self.following_checkbutton,False,False,0)
76 #how about a 'direct' button?76 #how about a 'direct' button?
77 self.direct_button = DentButton('direct')77 self.direct_button = DentButton('direct')
78 self.direct_button.connect('clicked',self.direct_clicked)78 self.direct_button.connect('clicked',self.direct_clicked)
79 widgetbox.pack_start(self.direct_button,False,False,0)79 self.widgetbox.pack_start(self.direct_button,False,False,0)
80 #create stuff for blocking -- commented out 9.3.10 x110180 #create stuff for blocking -- commented out 9.3.10 x1101
81 blockbox=gtk.HBox()81 blockbox=gtk.HBox()
82 #enabler82 #enabler
83 self.enable_block_checkbutton = gtk.CheckButton(_("Enable Blocking"))83 self.enable_block_checkbutton = gtk.CheckButton(_("Enable Blocking"))
84 self.enable_block_checkbutton.connect('toggled', self.block_enable_toggled)84 self.enable_block_checkbutton.connect('toggled', self.block_enable_toggled)
8585
86 #the blocking buttons86 #the blocking buttons
87 self.block_button = DentButton('block')87 self.block_button = DentButton('block')
88 self.block_button.connect('clicked',self.block_clicked)88 self.block_button.connect('clicked',self.block_clicked)
89 self.block_button.set_sensitive(False)89 self.block_button.set_sensitive(False)
90 blockbox.pack_start(self.block_button,False,False,0)90 blockbox.pack_start(self.block_button,False,False,0)
91 blockbox.pack_start(self.enable_block_checkbutton,False,False,0)91 blockbox.pack_start(self.enable_block_checkbutton,False,False,0)
92 92 self.widgetbox.pack_start(blockbox,False,False,0)
93 widgetbox.pack_end(blockbox)93
94 #the collapse button
95 collapsebox = gtk.Alignment(xalign=1.0)
96 self.collapse_button = DentButton(u'\u25b2')
97 self.collapse_button.connect('clicked',self.collapse_clicked)
98 collapsebox.add(self.collapse_button)
99 self.widgetbox.pack_end(collapsebox,True,True,0)
100
101 #the collapsed widget box and name label
102 self.widgetbox_collapsed = gtk.HBox(False)
103 self.name_label_collapsed = gtk.Label()
104 self.widgetbox_collapsed.pack_start(self.name_label_collapsed,False,False,0)
105 #its expand button
106 expandbox = gtk.Alignment(xalign=1.0)
107 self.expand_button = DentButton(u'\u25bc')
108 self.expand_button.connect('clicked',self.expand_clicked)
109 expandbox.add(self.expand_button)
110 self.widgetbox_collapsed.pack_end(expandbox,True,True,0)
111 #pack it up
112 self.pack_start(self.widgetbox_collapsed,False,False,0)
113
94 #create a user dent scroller and add it to the user page114 #create a user dent scroller and add it to the user page
95 self.dentScroller = DentScroller()115 self.dentScroller = DentScroller()
96 self.pack_start(self.dentScroller)116 self.pack_start(self.dentScroller)
97 117
98 #make a "close" button
99 hbox = gtk.HBox(False)
100 user_close_button=gtk.Button(_("Close"))
101 hbox.pack_start(user_close_button,False,False,0)
102 user_close_button.connect('clicked',self.close)
103 self.pack_end(hbox,False,False,0)
104
105 def set_image(self,image):118 def set_image(self,image):
106 self.image.set_from_file(image)119 self.image.set_from_file(image)
107 self.image.show()120 self.image.show()
@@ -110,6 +123,7 @@
110 self.screen_name = data['screen_name']123 self.screen_name = data['screen_name']
111 self.user_id=data['id']124 self.user_id=data['id']
112 self.name_label.set_text("%s (%s)" %(data['name'],data['screen_name']) )125 self.name_label.set_text("%s (%s)" %(data['name'],data['screen_name']) )
126 self.name_label_collapsed.set_text("%s (%s)" %(data['name'],data['screen_name']) )
113 if data['location']!=None:127 if data['location']!=None:
114 self.location_label.set_text("%s: %s" % (_("Location"),data['location']) )128 self.location_label.set_text("%s: %s" % (_("Location"),data['location']) )
115 self.location_label.show()129 self.location_label.show()
@@ -177,6 +191,16 @@
177 #disable the button191 #disable the button
178 widget.set_sensitive(False)192 widget.set_sensitive(False)
179 self.emit('block-create',self.user_id)193 self.emit('block-create',self.user_id)
194
195 def collapse_clicked(self,widget):
196 self.userhbox.hide()
197 self.widgetbox.hide()
198 self.widgetbox_collapsed.show()
199
200 def expand_clicked(self,widget):
201 self.userhbox.show()
202 self.widgetbox.show()
203 self.widgetbox_collapsed.hide()
180 204
181 def process_link(self, label, uri ):205 def process_link(self, label, uri ):
182 self.emit('open-link', uri )206 self.emit('open-link', uri )
183207
=== modified file 'heybuddy.py'
--- heybuddy.py 2011-05-04 21:57:08 +0000
+++ heybuddy.py 2011-05-05 04:39:25 +0000
@@ -192,21 +192,59 @@
192 #self.mainwindow.connect('window-state-event', self.mainwindow_state_event)192 #self.mainwindow.connect('window-state-event', self.mainwindow_state_event)
193 self.mainwindow.connect('delete-event', self.mainwindow_delete_event)193 self.mainwindow.connect('delete-event', self.mainwindow_delete_event)
194 194
195 # local function to create a closeable tab label for closeable tabs
196 def closeable_tab_label(caption, tab):
197 tablabel = gtk.HBox(False)
198 tablabel.pack_start(gtk.Label(caption),True,True,0)
199 closebutton = gtk.Button()
200 closeicon = gtk.Image()
201 closeicon.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU)
202 closebutton.set_image(closeicon)
203 closebutton.set_relief(gtk.RELIEF_NONE)
204 tinybutton_style = gtk.RcStyle()
205 tinybutton_style.xthickness = 0
206 tinybutton_style.ythickness = 0
207 closebutton.modify_style(tinybutton_style)
208 if tab != None: # if this isn't a mock-add
209 closebutton.connect('clicked',tab.close)
210 closebutton.set_tooltip_text(_("Close"))
211 tablabel.pack_start(closebutton,False,False,0)
212 tablabel.show_all()
213 return tablabel
214
215 # do a mock add of dentspage, with a close label, so as to determine height needed for uncloseable tabs' labels, then break it all down again
216 # this is ridiculously hacky, but it works, and doesn't leave anything behind
217 self.dentspage = ScrollPage()
218 self.mock_label = closeable_tab_label(_("Dents"),None)
219 self.mainwindow.notebook.append_page(self.dentspage,self.mock_label)
220 self.mainwindow.show_all() # we have to do this so the tab gets actualised, and thus gets a height
221 min_tab_height = self.mock_label.allocation.height
222 self.mainwindow.hide_all()
223 self.mainwindow.notebook.remove_page(-1)
224 del self.mock_label
225
226 # local function to create a label the same height as the closeable tabs' labels
227 def uncloseable_tab_label(caption):
228 tablabel = gtk.Label(caption)
229 tablabel.set_size_request(-1,min_tab_height)
230 tablabel.show()
231 return tablabel
232
195 # create and add all of the pages233 # create and add all of the pages
196 self.dentspage = ScrollPage()234 self.dentspage = ScrollPage()
197 self.mainwindow.notebook.append_page(self.dentspage,gtk.Label(_("Dents") ) )235 self.mainwindow.notebook.append_page(self.dentspage,uncloseable_tab_label(_("Dents") ) )
198 236
199 self.mentionspage = ScrollPage()237 self.mentionspage = ScrollPage()
200 self.mainwindow.notebook.append_page(self.mentionspage,gtk.Label(_("Mentions")) )238 self.mainwindow.notebook.append_page(self.mentionspage,uncloseable_tab_label(_("Mentions")) )
201 239
202 self.directspage = ScrollPage()240 self.directspage = ScrollPage()
203 self.mainwindow.notebook.append_page(self.directspage,gtk.Label(_("Directs")) )241 self.mainwindow.notebook.append_page(self.directspage,uncloseable_tab_label(_("Directs")) )
204 242
205 #make the conversation page243 #make the conversation page
206 self.contextpage=ContextPage()244 self.contextpage=ContextPage()
207 self.contextpage.connect('context-page-hide',self.hide_contextpage)245 self.contextpage.connect('context-page-hide',self.hide_contextpage)
208 #add the contextpage246 #add the contextpage
209 self.mainwindow.notebook.append_page(self.contextpage,gtk.Label("Context") )247 self.mainwindow.notebook.append_page(self.contextpage,closeable_tab_label("Context",self.contextpage))
210 248
211 #create a user page249 #create a user page
212 self.userpage=UserPage()250 self.userpage=UserPage()
@@ -218,15 +256,16 @@
218 self.userpage.connect('block-destroy',self.block_destroy)256 self.userpage.connect('block-destroy',self.block_destroy)
219 257
220 #add the userpage258 #add the userpage
221 self.mainwindow.notebook.append_page(self.userpage,gtk.Label(_("User") ) )259 self.mainwindow.notebook.append_page(self.userpage,closeable_tab_label(_("User"),self.userpage ) )
222 260
223 #create a Group page261 #create a Group page
224 self.grouppage=GroupPage()262 self.grouppage=GroupPage()
225 self.grouppage.connect('group-page-hide',self.hide_grouppage)263 self.grouppage.connect('group-page-hide',self.hide_grouppage)
226 self.grouppage.connect('join-group',self.join_group)264 self.grouppage.connect('join-group',self.join_group)
227 self.grouppage.connect('open-link',self.open_link)265 self.grouppage.connect('open-link',self.open_link)
266
228 #add the Grouppage267 #add the Grouppage
229 self.mainwindow.notebook.append_page(self.grouppage,gtk.Label(_("Group") ) )268 self.mainwindow.notebook.append_page(self.grouppage,closeable_tab_label(_("Group"),self.grouppage ) )
230 269
231 #create and add the account page270 #create and add the account page
232 self.settingspage = SettingsPage(has_hildon,has_pynotify)271 self.settingspage = SettingsPage(has_hildon,has_pynotify)
@@ -264,11 +303,11 @@
264 self.settingspage.connect('add-user-filter', self.add_user_filter )303 self.settingspage.connect('add-user-filter', self.add_user_filter )
265 self.settingspage.connect('remove-user-filter', self.remove_user_filter )304 self.settingspage.connect('remove-user-filter', self.remove_user_filter )
266 #add the settings to the mainwindow305 #add the settings to the mainwindow
267 self.mainwindow.add_notebook_page(self.settingspage,gtk.Label(_("Settings") ) )306 self.mainwindow.add_notebook_page(self.settingspage,uncloseable_tab_label(_("Settings") ) )
268 #create and add the about page307 #create and add the about page
269 about = About(version,branch,self.standard_icon_path,self.readme_file)308 about = About(version,branch,self.standard_icon_path,self.readme_file)
270 about.connect('open-link',self.open_link)309 about.connect('open-link',self.open_link)
271 self.mainwindow.add_notebook_page( about, gtk.Label(_("About") ) )310 self.mainwindow.add_notebook_page( about, uncloseable_tab_label(_("About") ) )
272 self.mainwindow.show_some()311 self.mainwindow.show_some()
273 #hide some stuff312 #hide some stuff
274 self.grouppage.hide_all()313 self.grouppage.hide_all()
@@ -693,6 +732,8 @@
693 self.userpage.disable()732 self.userpage.disable()
694 #show the page 733 #show the page
695 self.userpage.show_all()734 self.userpage.show_all()
735 #rehide its collapsed widgetbox, that doesn't need to be visible yet
736 self.userpage.widgetbox_collapsed.hide()
696 #clear the userpage stuff737 #clear the userpage stuff
697 self.userpage.clear()738 self.userpage.clear()
698 #change to the user page739 #change to the user page
@@ -706,6 +747,8 @@
706 self.userpage.disable()747 self.userpage.disable()
707 #show the page 748 #show the page
708 self.userpage.show_all()749 self.userpage.show_all()
750 #rehide its collapsed widgetbox, that doesn't need to be visible yet
751 self.userpage.widgetbox_collapsed.hide()
709 #clear the userpage stuff752 #clear the userpage stuff
710 self.userpage.clear()753 self.userpage.clear()
711 #change to the user page754 #change to the user page
@@ -959,6 +1002,8 @@
959 self.grouppage.joined_checkbutton.set_sensitive(False)1002 self.grouppage.joined_checkbutton.set_sensitive(False)
960 #make the grouppage visible1003 #make the grouppage visible
961 self.grouppage.show_all()1004 self.grouppage.show_all()
1005 #rehide its collapsed widgetbox, that doesn't need to be visible yet
1006 self.grouppage.widgetbox_collapsed.hide()
962 #clear the grouppage1007 #clear the grouppage
963 self.grouppage.clear()1008 self.grouppage.clear()
964 #switch to the group page1009 #switch to the group page

Subscribers

People subscribed via source and target branches