45
45
from appdetailsview import AppDetailsViewBase
47
47
from widgets import mkit
48
from widgets.label import FormattedLabel
48
49
from widgets.imagedialog import ShowImageDialog, GnomeProxyURLopener, Url404Error, Url403Error
50
51
if os.path.exists("./softwarecenter/enums.py"):
316
317
def __init__(self):
317
318
gtk.VBox.__init__(self, spacing=mkit.SPACING_LARGE)
319
self.body = gtk.VBox()
320
self.description = FormattedLabel()
320
321
self.footer = gtk.HBox(spacing=mkit.SPACING_MED)
322
self.pack_start(self.body, False)
323
self.pack_start(self.description, False)
323
324
self.pack_start(self.footer, False)
331
for child in self.body.get_children():
332
self.body.remove(child)
339
def append_paragraph(self, fragment):
341
p.set_markup(fragment)
342
p.set_line_wrap(True)
343
p.set_selectable(True)
346
hb.pack_start(p, False)
348
self.body.pack_start(hb, False)
349
self.paragraphs.append(p)
352
def append_bullet_point(self, fragment):
353
for bullet in self.BULLETS:
354
fragment = fragment.replace(bullet, '')
357
bullet.set_markup(u" <b>\u2022</b>")
359
a = gtk.Alignment(0.5, 0.0)
363
point.set_markup(fragment)
364
point.set_line_wrap(True)
365
point.set_selectable(True)
367
hb = gtk.HBox(spacing=mkit.EM)
368
hb.pack_start(a, False)
369
hb.pack_start(point, False)
371
a = gtk.Alignment(xscale=1.0, yscale=1.0)
372
a.set_padding(4,4,0,0)
375
self.body.pack_start(a, False)
376
self.points.append(point)
329
self.description.clear()
332
def append_paragraph(self, p):
333
self.description.append_paragraph(p.strip())
336
def append_bullet(self, point):
337
self.description.append_bullet(point[2:].strip())
379
340
def set_description(self, desc, appname):
403
364
if part[:2] in self.BULLETS:
404
365
# if there's an existing bullet, append it and start anew
406
self.append_bullet_point(processed_frag)
367
self.append_bullet(processed_frag)
407
368
processed_frag = ''
1078
1039
self.app_info.label.set_size_request(-1, -1)
1080
for p in self.app_desc.paragraphs:
1081
p.set_size_request(w-5*mkit.EM-166, -1)
1083
for pt in self.app_desc.points:
1084
pt.set_size_request(w-7*mkit.EM-166, -1)
1041
desc = self.app_desc.description
1042
size = desc.height_from_width(w-5*mkit.EM-166)
1044
desc.set_size_request(*size)
1086
1046
self.version_info.set_width(w-6*mkit.EM)
1087
1047
self.license_info.set_width(w-6*mkit.EM)
1116
1076
# draw icon frame as well...
1117
1077
self._draw_icon_frame(cr)
1079
self.app_desc.description.draw(widget, event)
1119
1081
if self.action_bar.get_property('visible'):
1120
1082
self.action_bar.draw(cr,
1121
1083
self.action_bar.allocation,
1124
1086
if self.addons_bar.get_property('visible'):
1125
1087
self.addons_bar.draw(cr,
1126
1088
self.addons_bar.allocation,
1243
1205
app_desc_hb.pack_start(self.app_desc, False)
1245
1207
# a11y for description
1246
self.app_desc.body.set_property("can-focus", True)
1247
self.app_desc.body.a11y = self.app_desc.body.get_accessible()
1208
self.app_desc.description.set_property("can-focus", True)
1209
self.app_desc.description.a11y = self.app_desc.description.get_accessible()
1250
1212
self.screenshot = ScreenshotView(self.distro, self.icons)
1352
1314
description = " "
1353
1315
self.app_desc.set_description(description, appname)
1354
1316
# a11y for description
1355
self.app_desc.body.a11y.set_name("Description: " + description)
1317
#self.app_desc.body.a11y.set_name("Description: " + description)
1357
1319
# show or hide the homepage button and set uri if homepage specified
1358
1320
if app_details.website: