37
37
super(AnimatedImage, self).__init__()
38
38
self._progressN = 0
39
if isinstance(globexp, gtk.gdk.Pixbuf):
40
self.images = [globexp]
41
self.set_from_pixbuf(globexp)
42
elif isinstance(globexp, str):
43
self._imagefiles = sorted(glob.glob(globexp))
39
if isinstance(icon, gtk.gdk.Pixbuf):
41
self.set_from_pixbuf(icon)
42
elif isinstance(icon, str):
43
self._imagefiles = icon
45
45
if not self._imagefiles:
46
raise IOError, "no images for the animation found in '%s'" % globexp
47
for f in self._imagefiles:
48
self.images.append(gtk.gdk.pixbuf_new_from_file(f))
46
raise IOError, "no images for the animation found in '%s'" % icon
48
pixbuf_orig = gtk.gdk.pixbuf_new_from_file(icon)
51
pixbuf_buffer = pixbuf_orig.copy()
53
for f in range((pixbuf_orig.get_width() / 24) * (pixbuf_orig.get_height() / 24)):
54
pixbuf_buffer = pixbuf_orig.subpixbuf(x, y, 24, 24)
55
self.images.append(pixbuf_buffer)
56
if x == pixbuf_orig.get_width() - 24:
49
65
self.set_from_pixbuf(self.images[self._progressN])
50
66
self.connect("show", self.start)
51
67
self.connect("hide", self.stop)
117
133
elif os.path.exists("./data"):
118
134
datadir = "./data"
120
datadir = "/usr/share/software-center"
136
datadir = "/usr/share/software-center/data"
122
image = AnimatedImage(datadir+"/icons/32x32/status/software-center-progress-*.png")
123
image1 = AnimatedImage(datadir+"/icons/32x32/status/software-center-progress-*.png")
138
image = AnimatedImage(datadir+"/icons/24x24/status/softwarecenter-progress.png")
139
image1 = AnimatedImage(datadir+"/icons/24x24/status/softwarecenter-progress.png")
125
image2 = AnimatedImage(datadir+"/icons/32x32/status/software-center-progress-01.png")
126
pixbuf = gtk.gdk.pixbuf_new_from_file(datadir+"/icons/32x32/status/software-center-progress-07.png")
141
image2 = AnimatedImage(datadir+"/icons/24x24/status/softwarecenter-progress.png")
142
pixbuf = gtk.gdk.pixbuf_new_from_file(datadir+"/icons/24x24/status/softwarecenter-progress.png")
127
143
image3 = AnimatedImage(pixbuf)