Skip to content

Commit

Permalink
Revert "previewer: use the appointment-soon icon as the default thumb…
Browse files Browse the repository at this point in the history
… icon."

This reverts commit cb1eccc.
Revert this since it adds a dependency on python-rsvg. Ideally we should do the
same with the gdk-pixbuf API.
  • Loading branch information
alessandrod committed Sep 8, 2010
1 parent 4ac4353 commit 628bb9c
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions pitivi/ui/previewer.py
Expand Up @@ -28,8 +28,6 @@
import gst import gst
import cairo import cairo
import os import os
import gtk
import rsvg
from gettext import gettext as _ from gettext import gettext as _
import pitivi.utils as utils import pitivi.utils as utils
from pitivi.configure import get_pixmap_dir from pitivi.configure import get_pixmap_dir
Expand Down Expand Up @@ -152,25 +150,8 @@ class Previewer(Signallable, Loggable):
def __init__(self, instance, factory, stream_): def __init__(self, instance, factory, stream_):
Loggable.__init__(self) Loggable.__init__(self)
# create default thumbnail # create default thumbnail
icon_theme = gtk.icon_theme_get_default() path = os.path.join(get_pixmap_dir(), self.__DEFAULT_THUMB__)
icon = icon_theme.lookup_icon("appointment-soon", 48, ()) self.default_thumb = cairo.ImageSurface.create_from_png(path)
# If we can't find the appointment-soon icon, use our own
if icon is None:
path = os.path.join(get_pixmap_dir(), self.__DEFAULT_THUMB__)
else:
path = icon.get_filename()

# If it is an SVG, we have to render to cairo using librsvg
if path.endswith(".svg"):
handle = rsvg.Handle(file=path)
(width, height, width_fl, height_fl) = handle.get_dimension_data()
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
cr = cairo.Context(surface)
handle.render_cairo(cr)
self.default_thumb = surface
else:
# Easy for PNGs
self.default_thumb = cairo.ImageSurface.create_from_png(path)
self._connectSettings(instance.settings) self._connectSettings(instance.settings)


def render_cairo(self, cr, bounds, element, y1): def render_cairo(self, cr, bounds, element, y1):
Expand Down

0 comments on commit 628bb9c

Please sign in to comment.