Hi,
I was missing functionality that enabled the reading to keep track of which page each comic in currently on.
In case more people want this functionality, I am sending it back as a patch.
I apologize, it seems that I was unable to attach more than one file, so only the file containing the new functionality got submitted. Here comes the actual diff file as text:
+ self.page_tracker = cw.PageTracker(self)
+
# ----------------------------------------------------------------
# Setup
# ----------------------------------------------------------------
@@ -530,6 +533,7 @@
"""Draw a *new* page correctly (as opposed to redrawing the same
image with a new size or whatever).
"""
+ self.page_tracker.notify_new_page()
if not prefs['keep transformation']:
prefs['rotation'] = 0
prefs['horizontal flip'] = False
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
from what I understand, this basically creates a database of opened files, and stores the last activated page per file. If the file is ever opened again, it will automatically go to said page.
Maybe there should be a preference item to enable or disable this feature?
That being said, is there any particular reason why the module is called "cw"?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Yes, this is correct. There should probably be a maximum number of files that are stored in the pickle, too.
The reason that the module is called cw is that I am in the process of integrating the mcomix reader with a project of mine called "comicweb", basically a comic cloud :-)
Sofar this is pretty specific to my personal needs, so it seemed silly to include this is the patch. The whole "my personal needs" is the reason that I have not made this configurable in the preferences - you are of course totally right.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>I would be interested to read more about comicweb
Sure, think "plex" (http://plexapp.com) for comics. The goal is to, regardless of which device I am on, I should be able to my entire comiclibrary. This is accomplished by having a webinterface that gives the user a choice of either downloading the cbz/cbr file to disk (in case I will be offline, or would prefer using a native comic reader such as mcomix or comiczeal etc) or reading online in a web based reader that I have written.
Earlier I was only able to track which page I was currently reading, as well as a list of recent comics, if I acceced the comic library through the web reader. Now though, thanks to some changes to mcomix, I am able to keep track of all this if I am reading of my computer as well. I have also integrated a library browser into mcomix, to the user it looks like the usual library browser (ctrl-L), but is actually retrieving all information via http from the comicweb server.
I hope this gives you more of an idea what I was talking about :)
Cheers,
/Jonas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The
I apologize, it seems that I was unable to attach more than one file, so only the file containing the new functionality got submitted. Here comes the actual diff file as text:
Index: file_handler.py
--- file_handler.py (revision 382)
+++ file_handler.py (working copy)
@@ -108,6 +108,9 @@
image_files = []
current_image_index = 0
+ print 'Getting start_page for %s' %path
+ start_page = self._window.page_tracker.get_last_page(path)
+
# Actually open the file(s)/archive passed in path.
if self.archive_type is not None:
image_files, current_image_index = \
Index: main.py
===================================================================
--- main.py (revision 382)
+++ main.py (working copy)
@@ -26,6 +26,7 @@
import thumbbar
import clipboard
import pageselect
+import cw
class MainWindow(gtk.Window):
@@ -85,6 +86,8 @@
self._vscroll = gtk.VScrollbar(self._vadjust)
self._hscroll = gtk.HScrollbar(self._hadjust)
+ self.page_tracker = cw.PageTracker(self)
+
# ----------------------------------------------------------------
# Setup
# ----------------------------------------------------------------
@@ -530,6 +533,7 @@
"""Draw a *new* page correctly (as opposed to redrawing the same
image with a new size or whatever).
"""
+ self.page_tracker.notify_new_page()
if not prefs['keep transformation']:
prefs['rotation'] = 0
prefs['horizontal flip'] = False
Hello,
from what I understand, this basically creates a database of opened files, and stores the last activated page per file. If the file is ever opened again, it will automatically go to said page.
Maybe there should be a preference item to enable or disable this feature?
That being said, is there any particular reason why the module is called "cw"?
Hi,
Yes, this is correct. There should probably be a maximum number of files that are stored in the pickle, too.
The reason that the module is called cw is that I am in the process of integrating the mcomix reader with a project of mine called "comicweb", basically a comic cloud :-)
Sofar this is pretty specific to my personal needs, so it seemed silly to include this is the patch. The whole "my personal needs" is the reason that I have not made this configurable in the preferences - you are of course totally right.
I would be interested to read more about comicweb
>I would be interested to read more about comicweb
Sure, think "plex" (http://plexapp.com) for comics. The goal is to, regardless of which device I am on, I should be able to my entire comiclibrary. This is accomplished by having a webinterface that gives the user a choice of either downloading the cbz/cbr file to disk (in case I will be offline, or would prefer using a native comic reader such as mcomix or comiczeal etc) or reading online in a web based reader that I have written.
Earlier I was only able to track which page I was currently reading, as well as a list of recent comics, if I acceced the comic library through the web reader. Now though, thanks to some changes to mcomix, I am able to keep track of all this if I am reading of my computer as well. I have also integrated a library browser into mcomix, to the user it looks like the usual library browser (ctrl-L), but is actually retrieving all information via http from the comicweb server.
I hope this gives you more of an idea what I was talking about :)
Cheers,
/Jonas
Remembering the last read page in archive files has been available since MComix 0.97.
Last edit: Benoit Pierre 2015-12-03