Ark - 2015-04-11

Proposed new behavior:

Speaking in terms of variables available in the "Open with" feature, %S and %s should stay the same no matter how you switch to the "next" or "previous" book (i.e. directory or archive) using the "Go" menu. Changing the current shelf is possible only via using commands like File → Open.

More detailed:

  • If you launch mcomix /some/shelfA/book1/page01.jpg and /some/shelfA/book1/page01.jpg denotes an image file, then /some/shelfA will be identified as the current shelf and /some/shelfA/book1 will be identified as the current book.
  • If you launch mcomix /some/shelfA/book1 and /some/shelfA/book1 denotes an archive file or a directory, then /some/shelfA will be identified as the current shelf and /some/shelfA/book1 will be identified as the current book. This interpretation does not depend on whether book1 denotes a directory or an archive file.
  • If /some/shelfA/book1 denotes a book implemented as a directory, then:
    • Only image files that are directly located in /some/shelfA/book1 are identified as "pages" of this book.
    • No recursion is applied, that is, all directories and archive files in /some/shelfA/book1 are completely ignored.
  • If /some/shelfA/book1 denotes a book implemented as an archive file, then:
    • Recursion is applied to all directories and archives within this archive file to collect image files ("pages").
    • Image files directly located in /some/shelfA are ignored.
  • If you use any of the actions in the "Go" menu, you can only switch to other books in the same shelf. You cannot change the shelf itself. For example, you might switch to /some/shelfA/book2 or /some/shelfA/book0, but you cannot switch to anything located in /some/shelfB and you cannot switch to /some/shelfA/subshelf/hiddenbook.

In other words, whether the current book is implemented as an archive file or a directory does not influence the way you navigate to other books.

Furthermore, since the shelf is fixed, switching to another book is only possible if the target book is located in the same shelf. There are several steps needed to determine the order and number of books as they appear in a given shelf:

  1. In the first step, the books in this shelf are filtered and ordered by the way they are implemented. Possible options might be "Mix archives and directories", "Archives first, directories last", "Directories first, archives last", "Only archives", "Only directories".
  2. In the second step, the one or two sets determined in the first step are sorted independently by attributes like "Name", "Last modified" or similar attributes. Allowing the user to choose only one of these attributes should be sufficient for now. (Allowing the user to arbitrarily choose the order in which several arbitrarily chosen attributes are used for sorting might be too complicated.) As a last-resort criterion, the Unicode points of the names of otherwise "equal" books are used.
  3. The user can reverse this order.
  4. This order is completely independent from the order in which the images ("pages") within a book do appear.

@Benoit Pierre: What do you think about this approach? Any suggestions or other approaches?

EDIT: Proposal made a bit clearer.

 

Last edit: Ark 2015-04-11