Donate Share

Comix

Tracker: Patches

5 Minimum win32 patch - ID: 2421337
Last Update: Comment added ( ssokolow )

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.


Oddegamra ( oddegamra ) - 2008-12-12 14:57

5

Open

Accepted

Pontus Ekberg

None

None

Public


Comments ( 11 )




Date: 2009-02-11 18:17
Sender: ssokolowAccepting Donations

The GPL requires that any code you link against be re-licensable under the
GPL to ensure that people cannot cripple or restrict your code by adding a
dependency on something less free.

The unrar.dll license is not a compatible subset of the GPL like
BSD/MIT/X11 licenses are and does not include a clause which allows license
conversion.


Date: 2009-02-11 13:22
Sender: oddegamra

I must admit that I never bothered much with legal aspects of writing
software, but the unrar license doesn't seem to put any restrictions on
using it in any kind of application.

This is from license.txt:
> 2. The unrar.dll library may be used in any software to handle RAR
archives without limitations free of charge.


Date: 2009-02-11 10:27
Sender: ssokolowAccepting Donations

Unfortunately, you can't use unrar.dll/libunrar.so because the license is
GPL-incompatible.

As for making it work on Windows, I've never tried it, but the proper
solution for RAR would be to use the appropriate module from win32all to
look up the install locations for WinRAR's batch file scriptable utility or
7-zip in the registry.


Date: 2008-12-17 20:27
Sender: oddegamra

Probably my last attempt at this to get it `right'. Added some code to use
unrar.dll/libunrar.so for RAR file extracting (from rarlab.com), which
falls back to rar/unrar if the library could not be found. This should take
care of all quirks rar.exe has on Windows, and maybe add some additional
performance to extraction.

Personally I use a little C .exe wrapper I placed in the root directory of
my SVN checkout which starts Python and passes on all command line
arguments to src/comix.py. This way Comix can integrate nicely into the
Windows shell menu as well. With this, Comix is perfectly usable and - in
my opinion - quite surpasses some other native comic viewers on this
platform.


Date: 2008-12-14 22:44
Sender: oddegamra

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


Date: 2008-12-14 16:50
Sender: herrekbergProject AdminAccepting Donations

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).


Date: 2008-12-14 11:46
Sender: oddegamra

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.


Date: 2008-12-13 13:54
Sender: oddegamra

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.


Date: 2008-12-13 13:45
Sender: herrekbergProject AdminAccepting Donations

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.


Date: 2008-12-13 10:57
Sender: oddegamra

File Added: Comix-4.0-Clickevents.patch


Date: 2008-12-12 16:05
Sender: herrekbergProject AdminAccepting Donations

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.


Log in to comment.




Attached Files ( 3 )

Filename Description Download
Comix-4.0-Win32.patch Download
Comix-4.0-Clickevents.patch Click events aren't processed on win32. Download
Comix-4.0-Unicode-v4.patch Download

Changes ( 11 )

Field Old Value Date By
File Added 311994: Comix-4.0-Unicode-v4.patch 2009-02-04 11:00 oddegamra
File Deleted 305758: 2009-02-04 11:00 oddegamra
File Added 305758: Comix-4.0-Unicode-v3.patch 2008-12-17 20:26 oddegamra
File Deleted 305299: 2008-12-17 20:25 oddegamra
File Added 305299: Comix-4.0-Unicode-v2.patch 2008-12-14 22:42 oddegamra
File Deleted 305236: 2008-12-14 22:42 oddegamra
File Added 305236: Comix-4.0-Unicode.patch 2008-12-14 11:47 oddegamra
File Added 305142: Comix-4.0-Clickevents.patch 2008-12-13 10:57 oddegamra
resolution_id None 2008-12-12 16:07 herrekberg
assigned_to nobody 2008-12-12 16:07 herrekberg
File Added 305058: Comix-4.0-Win32.patch 2008-12-12 14:57 oddegamra