supports_alpha = False
# LOGGING!
-# sys.stdout = open('/home/user/.comic-widget/output_log.txt', 'a')
-# sys.stderr = open('/home/user/.comic-widget/error_log.txt', 'a')
+# sys.stdout = open('/home/user/.comic-widget/output_log.txt', 'a', 0)
+sys.stderr = open('/home/user/.comic-widget/error_log.txt', 'a', 0)
# print "Start logging!"
# constants. dbfile is the location of the csv
# comiccache is the location of the images
-APP_VERSION = "0.4.2"
+APP_VERSION = "0.4.3"
basedbdir = "/opt/comic-widget/db/"
imagedir = "/opt/comic-widget/images/"
except:
return 0
+
def store_last(self, sid = 0):
try:
idf = open(self.dbfile + ".last", 'w')
self.e_goweb.add(self.label)
self.e_goweb.set_events(gtk.gdk.BUTTON_RELEASE_MASK)
- self.e_goweb.connect("button-release-event", self.view_comic)
+ self.e_goweb.connect("button-release-event", self.view_comic_web)
self.e_open.add(self.comic_image)
+ self.e_open.set_events(gtk.gdk.BUTTON_PRESS_MASK)
+ self.e_open.connect("button-press-event", self.view_comic)
# self.e_switch.add(self.switch)
self.e_switch.set_events(gtk.gdk.BUTTON_PRESS_MASK|gtk.gdk.BUTTON_RELEASE_MASK|gtk.gdk.LEAVE_NOTIFY)
self.draw(widget, "0")
# no fancy cairo stuff here. simply launches url in browser.
- def view_comic(self, widget, event):
+ def view_comic_web(self, widget, event):
if not event.type == gtk.gdk.BUTTON_RELEASE:
return False
link = self.db.get_link()
self.osso_rpc.rpc_run_with_defaults("osso_browser", "open_new_window", (link,))
+ # simply launches image in browser.
+ def view_comic(self, widget, event):
+ if not event.type == gtk.gdk._2BUTTON_PRESS:
+ return False
+ #link = self.db.get_link()
+ link = 'file:///home/user/MyDocs/.comics/' + self.db.comic + '/' + self.db.db[self.db.currentcomic]['filename']
+ self.osso_rpc.rpc_run_with_defaults("osso_browser", "open_new_window", (link,))
+
# this function modifies the image to fit the widget and then returns it.
height = int(self.sizes['height'])
picwidth = width - 2
maxheight = height - 48
-
+ if os.path.isfile(filename) == False:
+ filename = "/opt/comic-widget/images/next0-48x48.png"
pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
parent_buf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, pixbuf.get_has_alpha(), 8, width, maxheight)
parent_buf.fill(0xffffffff)