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

Proposed by Psychedelic Squid
Status: Superseded
Proposed branch: lp:~psquid/heybuddy/maemo_tweaks
Merge into: lp:heybuddy
Diff against target: 309 lines (+112/-40)
4 files modified
ContextPage.py (+0/-7)
GroupPage.py (+41/-12)
UserPage.py (+42/-18)
heybuddy.py (+29/-3)
To merge this branch: bzr merge lp:~psquid/heybuddy/maemo_tweaks
Reviewer Review Type Date Requested Status
jezra Approve
Review via email: mp+59997@code.launchpad.net

This proposal has been superseded by a proposal from 2011-05-05.

Description of the change

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

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

shit yea, boyeeeeee!

review: Approve
lp:~psquid/heybuddy/maemo_tweaks updated
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.

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.

272. By Psychedelic Squid

Do some hackery to keep the tabbar height from fluctuating.

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
1=== modified file 'ContextPage.py'
2--- ContextPage.py 2010-10-09 06:14:56 +0000
3+++ ContextPage.py 2011-05-05 01:11:22 +0000
4@@ -14,13 +14,6 @@
5 }
6 def __init__(self):
7 ScrollPage.__init__(self)
8- #we do need a close button
9- close_button=gtk.Button(_("Close"))
10- hbox = gtk.HBox(False)
11- hbox.pack_start(close_button,False,False,0)
12- close_button.connect('clicked',self.close)
13- self.pack_end(hbox,False,False,0)
14-
15
16 def close(self,button):
17 #we can just hid ourself
18
19=== modified file 'GroupPage.py'
20--- GroupPage.py 2011-04-11 18:31:17 +0000
21+++ GroupPage.py 2011-05-05 01:11:22 +0000
22@@ -3,6 +3,7 @@
23 copyright 2010 jezra lickter http://www.jezra.net
24 '''
25 from DentScroller import DentScroller
26+from DentButton import DentButton
27 import gtk,gobject
28 from PlatformSpecific import links_unavailable
29 class GroupPage(gtk.VBox,gobject.GObject):
30@@ -32,11 +33,11 @@
31 imagevbox.pack_start(self.image,False,False,0)
32
33 #make an hbox to hold image and group info
34- grouphbox=gtk.HBox(False,5)
35- self.pack_start(grouphbox,False,False,0)
36- grouphbox.pack_start(imagevbox,False,False,0)
37+ self.grouphbox=gtk.HBox(False,5)
38+ self.pack_start(self.grouphbox,False,False,0)
39+ self.grouphbox.pack_start(imagevbox,False,False,0)
40 infovbox = gtk.VBox(False)
41- grouphbox.pack_start(infovbox,False,False)
42+ self.grouphbox.pack_start(infovbox,False,False)
43
44 self.name_label = gtk.Label()
45 infovbox.pack_start(self.name_label,False,False,0)
46@@ -53,27 +54,45 @@
47 self.location_label = gtk.Label()
48 infovbox.pack_start(self.location_label,False,False,0)
49
50+ #widget box for the horizontal stuff
51+ self.widgetbox = gtk.HBox(False)
52+ self.pack_start(self.widgetbox,False,False,0)
53+
54 #make a checkbutton if we are following
55 self.joined_checkbutton = gtk.CheckButton(_("joined"))
56 self.joined_checkbutton.connect('toggled', self.joined_toggled)
57- infovbox.pack_start(self.joined_checkbutton,False,False,0)
58+ self.widgetbox.pack_start(self.joined_checkbutton,False,False,0)
59+
60+ #collapse button
61+ collapsebox = gtk.Alignment(xalign=1.0)
62+ self.collapse_button = DentButton(u'\u25b2')
63+ self.collapse_button.connect('clicked',self.collapse_clicked)
64+ collapsebox.add(self.collapse_button)
65+ self.widgetbox.pack_end(collapsebox,True,True,0)
66+
67+ #collapsed widget box and name label
68+ self.widgetbox_collapsed = gtk.HBox(False)
69+ self.name_label_collapsed = gtk.Label()
70+ self.widgetbox_collapsed.pack_start(self.name_label_collapsed,False,False,0)
71+ #its expand button
72+ expandbox = gtk.Alignment(xalign=1.0)
73+ self.expand_button = DentButton(u'\u25bc')
74+ self.expand_button.connect('clicked',self.expand_clicked)
75+ expandbox.add(self.expand_button)
76+ self.widgetbox_collapsed.pack_end(expandbox,True,True,0)
77+ #pack it up
78+ self.pack_start(self.widgetbox_collapsed,False,False,0)
79
80 #create a group dent scroller and add it to the group page
81 self.dentScroller = DentScroller()
82 self.pack_start(self.dentScroller)
83
84- #make a "close" button
85- hbox = gtk.HBox(False)
86- user_close_button=gtk.Button(_("Close"))
87- hbox.pack_start(user_close_button,False,False,0)
88- user_close_button.connect('clicked',self.close)
89- self.pack_end(hbox,False,False,0)
90-
91 def set_group_data(self,data):
92 self.joined_checkbutton.set_sensitive(True)
93 self.group_id= data['id']
94 self.group_name = data['fullname']
95 self.name_label.set_text("%s" %(data['fullname']) )
96+ self.name_label_collapsed.set_text("%s" %(data['fullname']) )
97 if data['location']!=None:
98 self.location_label.set_text("%s: %s" %(_("Location"), data['location']) )
99 self.location_label.show()
100@@ -122,6 +141,16 @@
101 #self.hide()
102 self.emit('group-page-hide')
103
104+ def collapse_clicked(self,widget):
105+ self.grouphbox.hide()
106+ self.widgetbox.hide()
107+ self.widgetbox_collapsed.show()
108+
109+ def expand_clicked(self,widget):
110+ self.grouphbox.show()
111+ self.widgetbox.show()
112+ self.widgetbox_collapsed.hide()
113+
114 def process_link(self, label, uri ):
115 self.emit('open-link', uri )
116 return True
117
118=== modified file 'UserPage.py'
119--- UserPage.py 2011-04-11 18:31:17 +0000
120+++ UserPage.py 2011-05-05 01:11:22 +0000
121@@ -61,47 +61,60 @@
122 labelvbox.pack_start(self.location_label,False,False,0)
123 labelvbox.pack_start(self.url_label,False,False,0)
124 #make an hbox to hold the image and labels
125- userhbox=gtk.HBox(False,5)
126+ self.userhbox=gtk.HBox(False,5)
127 #make an hbox to hold widgets
128- widgetbox = gtk.HBox(False)
129+ self.widgetbox = gtk.HBox(False)
130 #add the imagevbox
131- userhbox.pack_start(imagevbox,False,False,0)
132- userhbox.pack_start(labelvbox,False,False,0)
133- self.pack_start(userhbox,False,False,0)
134- self.pack_start(widgetbox,False,False,0)
135+ self.userhbox.pack_start(imagevbox,False,False,0)
136+ self.userhbox.pack_start(labelvbox,False,False,0)
137+ self.pack_start(self.userhbox,False,False,0)
138+ self.pack_start(self.widgetbox,False,False,0)
139 #make a checkbutton if we are following
140 self.following_checkbutton = gtk.CheckButton(_("Following"))
141 self.following_checkbutton.connect('toggled', self.following_toggled)
142- widgetbox.pack_start(self.following_checkbutton,False,False,0)
143+ self.widgetbox.pack_start(self.following_checkbutton,False,False,0)
144 #how about a 'direct' button?
145 self.direct_button = DentButton('direct')
146 self.direct_button.connect('clicked',self.direct_clicked)
147- widgetbox.pack_start(self.direct_button,False,False,0)
148+ self.widgetbox.pack_start(self.direct_button,False,False,0)
149 #create stuff for blocking -- commented out 9.3.10 x1101
150 blockbox=gtk.HBox()
151 #enabler
152 self.enable_block_checkbutton = gtk.CheckButton(_("Enable Blocking"))
153 self.enable_block_checkbutton.connect('toggled', self.block_enable_toggled)
154-
155+
156 #the blocking buttons
157 self.block_button = DentButton('block')
158 self.block_button.connect('clicked',self.block_clicked)
159 self.block_button.set_sensitive(False)
160 blockbox.pack_start(self.block_button,False,False,0)
161 blockbox.pack_start(self.enable_block_checkbutton,False,False,0)
162-
163- widgetbox.pack_end(blockbox)
164+ self.widgetbox.pack_start(blockbox,False,False,0)
165+
166+ #the collapse button
167+ collapsebox = gtk.Alignment(xalign=1.0)
168+ self.collapse_button = DentButton(u'\u25b2')
169+ self.collapse_button.connect('clicked',self.collapse_clicked)
170+ collapsebox.add(self.collapse_button)
171+ self.widgetbox.pack_end(collapsebox,True,True,0)
172+
173+ #the collapsed widget box and name label
174+ self.widgetbox_collapsed = gtk.HBox(False)
175+ self.name_label_collapsed = gtk.Label()
176+ self.widgetbox_collapsed.pack_start(self.name_label_collapsed,False,False,0)
177+ #its expand button
178+ expandbox = gtk.Alignment(xalign=1.0)
179+ self.expand_button = DentButton(u'\u25bc')
180+ self.expand_button.connect('clicked',self.expand_clicked)
181+ expandbox.add(self.expand_button)
182+ self.widgetbox_collapsed.pack_end(expandbox,True,True,0)
183+ #pack it up
184+ self.pack_start(self.widgetbox_collapsed,False,False,0)
185+
186 #create a user dent scroller and add it to the user page
187 self.dentScroller = DentScroller()
188 self.pack_start(self.dentScroller)
189
190- #make a "close" button
191- hbox = gtk.HBox(False)
192- user_close_button=gtk.Button(_("Close"))
193- hbox.pack_start(user_close_button,False,False,0)
194- user_close_button.connect('clicked',self.close)
195- self.pack_end(hbox,False,False,0)
196-
197 def set_image(self,image):
198 self.image.set_from_file(image)
199 self.image.show()
200@@ -110,6 +123,7 @@
201 self.screen_name = data['screen_name']
202 self.user_id=data['id']
203 self.name_label.set_text("%s (%s)" %(data['name'],data['screen_name']) )
204+ self.name_label_collapsed.set_text("%s (%s)" %(data['name'],data['screen_name']) )
205 if data['location']!=None:
206 self.location_label.set_text("%s: %s" % (_("Location"),data['location']) )
207 self.location_label.show()
208@@ -177,6 +191,16 @@
209 #disable the button
210 widget.set_sensitive(False)
211 self.emit('block-create',self.user_id)
212+
213+ def collapse_clicked(self,widget):
214+ self.userhbox.hide()
215+ self.widgetbox.hide()
216+ self.widgetbox_collapsed.show()
217+
218+ def expand_clicked(self,widget):
219+ self.userhbox.show()
220+ self.widgetbox.show()
221+ self.widgetbox_collapsed.hide()
222
223 def process_link(self, label, uri ):
224 self.emit('open-link', uri )
225
226=== modified file 'heybuddy.py'
227--- heybuddy.py 2011-05-04 21:57:08 +0000
228+++ heybuddy.py 2011-05-05 01:11:22 +0000
229@@ -192,6 +192,25 @@
230 #self.mainwindow.connect('window-state-event', self.mainwindow_state_event)
231 self.mainwindow.connect('delete-event', self.mainwindow_delete_event)
232
233+ # local function to create a closeable tab label for closeable tabs
234+ def closeable_tab_label(caption, tab):
235+ tablabel = gtk.HBox(False)
236+ tablabel.pack_start(gtk.Label(caption),True,True,0)
237+ closebutton = gtk.Button()
238+ closeicon = gtk.Image()
239+ closeicon.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU)
240+ closebutton.set_image(closeicon)
241+ closebutton.set_relief(gtk.RELIEF_NONE)
242+ tinybutton_style = gtk.RcStyle()
243+ tinybutton_style.xthickness = 0
244+ tinybutton_style.ythickness = 0
245+ closebutton.modify_style(tinybutton_style)
246+ closebutton.connect('clicked',tab.close)
247+ closebutton.set_tooltip_text(_("Close"))
248+ tablabel.pack_start(closebutton,False,False,0)
249+ tablabel.show_all()
250+ return tablabel
251+
252 # create and add all of the pages
253 self.dentspage = ScrollPage()
254 self.mainwindow.notebook.append_page(self.dentspage,gtk.Label(_("Dents") ) )
255@@ -206,7 +225,7 @@
256 self.contextpage=ContextPage()
257 self.contextpage.connect('context-page-hide',self.hide_contextpage)
258 #add the contextpage
259- self.mainwindow.notebook.append_page(self.contextpage,gtk.Label("Context") )
260+ self.mainwindow.notebook.append_page(self.contextpage,closeable_tab_label("Context",self.contextpage))
261
262 #create a user page
263 self.userpage=UserPage()
264@@ -218,15 +237,16 @@
265 self.userpage.connect('block-destroy',self.block_destroy)
266
267 #add the userpage
268- self.mainwindow.notebook.append_page(self.userpage,gtk.Label(_("User") ) )
269+ self.mainwindow.notebook.append_page(self.userpage,closeable_tab_label(_("User"),self.userpage ) )
270
271 #create a Group page
272 self.grouppage=GroupPage()
273 self.grouppage.connect('group-page-hide',self.hide_grouppage)
274 self.grouppage.connect('join-group',self.join_group)
275 self.grouppage.connect('open-link',self.open_link)
276+
277 #add the Grouppage
278- self.mainwindow.notebook.append_page(self.grouppage,gtk.Label(_("Group") ) )
279+ self.mainwindow.notebook.append_page(self.grouppage,closeable_tab_label(_("Group"),self.grouppage ) )
280
281 #create and add the account page
282 self.settingspage = SettingsPage(has_hildon,has_pynotify)
283@@ -693,6 +713,8 @@
284 self.userpage.disable()
285 #show the page
286 self.userpage.show_all()
287+ #rehide its collapsed widgetbox, that doesn't need to be visible yet
288+ self.userpage.widgetbox_collapsed.hide()
289 #clear the userpage stuff
290 self.userpage.clear()
291 #change to the user page
292@@ -706,6 +728,8 @@
293 self.userpage.disable()
294 #show the page
295 self.userpage.show_all()
296+ #rehide its collapsed widgetbox, that doesn't need to be visible yet
297+ self.userpage.widgetbox_collapsed.hide()
298 #clear the userpage stuff
299 self.userpage.clear()
300 #change to the user page
301@@ -959,6 +983,8 @@
302 self.grouppage.joined_checkbutton.set_sensitive(False)
303 #make the grouppage visible
304 self.grouppage.show_all()
305+ #rehide its collapsed widgetbox, that doesn't need to be visible yet
306+ self.grouppage.widgetbox_collapsed.hide()
307 #clear the grouppage
308 self.grouppage.clear()
309 #switch to the group page

Subscribers

People subscribed via source and target branches