|
Link Here
|
| 29 |
|
29 |
|
| 30 |
gnome_datadir = gnome.program_init(APP_NAME, VERSION).get_property(gnome.PARAM_GNOME_DATADIR) |
30 |
gnome_datadir = gnome.program_init(APP_NAME, VERSION).get_property(gnome.PARAM_GNOME_DATADIR) |
| 31 |
|
31 |
|
|
|
32 |
ICON_NAME = "epiphany-bookmarks" |
| 33 |
for location in [gnome_datadir + "/pixmaps", "/usr/share/epiphany/art"]: |
| 34 |
try: |
| 35 |
gtk.icon_theme_add_builtin_icon(ICON_NAME, gtk.ICON_SIZE_DIALOG, gtk.gdk.pixbuf_new_from_file_at_size("%s/%s.png" % (location, ICON_NAME), *gtk.icon_size_lookup(gtk.ICON_SIZE_DIALOG))) |
| 36 |
except: |
| 37 |
pass |
| 32 |
|
38 |
|
| 33 |
# We do not support "javascript:" URL bookmarks. |
39 |
# We do not support "javascript:" URL bookmarks. |
| 34 |
global_unsupported_url_pattern = re.compile("^javascript:", re.IGNORECASE) |
40 |
global_unsupported_url_pattern = re.compile("^javascript:", re.IGNORECASE) |
|
Link Here
|
| 506 |
(bookmarks_file, bookmarks_func, bookmarks_editor_text, bookmarks_editor_cmd, favicons_call) = info |
512 |
(bookmarks_file, bookmarks_func, bookmarks_editor_text, bookmarks_editor_cmd, favicons_call) = info |
| 507 |
if bookmarks_editor_cmd is not None: |
513 |
if bookmarks_editor_cmd is not None: |
| 508 |
menu_item = gtk.ImageMenuItem(bookmarks_editor_text) |
514 |
menu_item = gtk.ImageMenuItem(bookmarks_editor_text) |
| 509 |
# little hack to scale the PNG file to the menu item height - there |
515 |
image = gtk.image_new_from_icon_name(ICON_NAME, gtk.ICON_SIZE_MENU) |
| 510 |
# is probably an easier (and more efficient) way to do this. |
|
|
| 511 |
height = menu.render_icon(gtk.STOCK_CUT, gtk.ICON_SIZE_MENU).get_height() |
| 512 |
image = gtk.Image() |
| 513 |
image.set_from_file(gnome_datadir + "/pixmaps/epiphany-bookmarks.png") |
| 514 |
pixbuf = image.get_pixbuf().scale_simple(height, height, gtk.gdk.INTERP_BILINEAR) |
| 515 |
image.set_from_pixbuf(pixbuf) |
| 516 |
# end of hack |
| 517 |
menu_item.set_image(image) |
516 |
menu_item.set_image(image) |
| 518 |
menu_item.connect("activate", run_command, bookmarks_editor_cmd) |
517 |
menu_item.connect("activate", run_command, bookmarks_editor_cmd) |
| 519 |
menu.append(menu_item) |
518 |
menu.append(menu_item) |
|
Link Here
|
| 612 |
|
611 |
|
| 613 |
|
612 |
|
| 614 |
def on_about(component, verb, applet): |
613 |
def on_about(component, verb, applet): |
| 615 |
icon = gtk.Image() |
|
|
| 616 |
icon.set_from_file(gnome_datadir + "/pixmaps/epiphany-bookmarks.png") |
| 617 |
|
| 618 |
fullname = "Browser Bookmarks Menu" |
614 |
fullname = "Browser Bookmarks Menu" |
| 619 |
copyright = "Copyright (C) 2004-2005 Nigel Tao" |
615 |
copyright = "Copyright (C) 2004-2005 Nigel Tao" |
| 620 |
description = "A menu for your web bookmarks." |
616 |
description = "A menu for your web bookmarks." |
|
Link Here
|
| 623 |
"David Fritzsche", "Toshio Kuratomi", "Reinout van Schouwen", \ |
619 |
"David Fritzsche", "Toshio Kuratomi", "Reinout van Schouwen", \ |
| 624 |
"Ricardo Veguilla", "Brett Viren",] |
620 |
"Ricardo Veguilla", "Brett Viren",] |
| 625 |
|
621 |
|
| 626 |
about = gnome.ui.About(fullname, VERSION, copyright, description, authors, None, None, icon.get_pixbuf()) |
622 |
about = gnome.ui.About(fullname, VERSION, copyright, description, authors, None, None, gtk.icon_theme_get_default().load_icon(ICON_NAME, gtk.icon_size_lookup(gtk.ICON_SIZE_DIALOG)[0], 0)) |
| 627 |
about.set_icon(icon.get_pixbuf()) |
623 |
about.set_icon_name(ICON_NAME) |
| 628 |
about.show() |
624 |
about.show() |
| 629 |
|
625 |
|
| 630 |
|
626 |
|