Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#18 Minimum win32 patch

open-accepted
Pontus Ekberg
None
5
2008-12-12
2008-12-12
Oddegamra
No

This is a minimum working patch against the current SVN HEAD revision to use Comix on Win32.
I decided to place files that would normally be stored in /home/user/.comix in C:\Documents and Settings\User\Comix. Thumbnails are stored in C:\Documents and Settings\User\Comix\.thumbnails.

There still seem to be some problems related to non-ASCII-filenames, but I'm not exactly sure how GTK handles file name encoding on Windows.

Well, apart from that everything seems to be working just fine; the new 4.0 branch really is quite awesome. I had a lot more trouble when I last did this for 3.x.

Discussion

1 2 > >> (Page 1 of 2)
  • Oddegamra
    Oddegamra
    2008-12-12

     
    Attachments
  • Pontus Ekberg
    Pontus Ekberg
    2008-12-12

    Hi,

    thanks for this patch. I have added it (slightly modified) to the SVN. I'll try to test it on Windows as soon as possible.

     
  • Pontus Ekberg
    Pontus Ekberg
    2008-12-12

    • assigned_to: nobody --> herrekberg
    • status: open --> open-accepted
     
  • Oddegamra
    Oddegamra
    2008-12-13

    File Added: Comix-4.0-Clickevents.patch

     
  • Oddegamra
    Oddegamra
    2008-12-13

    Click events aren't processed on win32.

     
  • Pontus Ekberg
    Pontus Ekberg
    2008-12-13

    I assume that the BUTTON_PRESS_MASK is needed on Windows? I have added it to the SVN repository, but haven't tested anything on Windows yet.

     
  • Oddegamra
    Oddegamra
    2008-12-13

    Apparently so. I didn't notice at first since I do not use the mouse much with Comix, but well, EventHandler.mouse_press_event wasn't called at all without that flag.

    There's still the non-ASCII filename problem, which unfortunately isn't that easily fixable with Windows' weird way of handling file encoding.

     
  • Oddegamra
    Oddegamra
    2008-12-14

    Some more work on filename encoding and archives with non-ASCII entries.

    Windows can only handle characters not in the current codepage with its wide character API - which Python only uses when one passes an Unicode object to its various file functions. So, I converted incoming file names (i.e. via the file chooser) to unicode objects.

    Changes made:

    (archive.py)
    Zip: Doesn't handle encodings, so I just convert filenames to unicode and keep an internal list of the original strings.
    Rar: Same here, except that rar replaces characters it cannot display with "?", but still extracts them with their original names. This means that the filenames obtained with "rar vb" will not be usable to access the files once they have been extracted. Replaced "rar x" with "rar p", and read file from pipe instead. This way, the output file name can be choosen manually.

    (filechooser.py)
    Converted glib strings to unicode where necessary.

    (filehandler.py)
    Made tempdir creation return an unicode object - otherwise win32 cannot delete the directory when it contains non-ASCII-characters.

    (thumbnail.py)
    Converted glib strings to unicode where necessary. Made tempdir creation return an unicode object - same as in filehandler.py, basically.

    This shouldn't change the way Comix works on UNIX systems - at least I didn't notice any regressions when I tested it. Anyway, I can now view zip and rar files even when they contain non-standard filename characters on Windows.

     
  • Pontus Ekberg
    Pontus Ekberg
    2008-12-14

    Thanks for the thorough patch. I'm afraid I don't really have free time to put myself into it right now, but I'll try to get Windows running and do so as soon as possible (although every time I write that it seems as if soon becomes not so soon).

     
  • Oddegamra
    Oddegamra
    2008-12-14

    Deleted previous patch since I forgot command line argument handling in comix.py.

     
1 2 > >> (Page 1 of 2)