mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-25 16:11:39 +00:00
Compare commits
209 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f29fe4c756 | ||
|
|
942e5a3c31 | ||
|
|
43974f9ebd | ||
|
|
0068e7b85a | ||
|
|
23b29eb5c3 | ||
|
|
dba231cf21 | ||
|
|
f25b1f9f46 | ||
|
|
60dd73f634 | ||
|
|
3b6fe992c0 | ||
|
|
6d263215ad | ||
|
|
bba20f4218 | ||
|
|
bb9908abb4 | ||
|
|
e7076bc3bd | ||
|
|
fc16ea8c49 | ||
|
|
0c07046ec4 | ||
|
|
6be927ed8b | ||
|
|
943a6570d8 | ||
|
|
854a253d9f | ||
|
|
4e477104a6 | ||
|
|
79800bc6ed | ||
|
|
6e7b95b2cf | ||
|
|
bf09c4ce8a | ||
|
|
b4a73771c2 | ||
|
|
2166a0996c | ||
|
|
24643a9b5d | ||
|
|
045051ce06 | ||
|
|
7c3728ca47 | ||
|
|
91be1c7336 | ||
|
|
162378bb0a | ||
|
|
4e3cad5702 | ||
|
|
321f8ab406 | ||
|
|
5b3d5f5d1c | ||
|
|
372a682610 | ||
|
|
44266273bf | ||
|
|
ac32305532 | ||
|
|
87c2fa2573 | ||
|
|
db63b63cfd | ||
|
|
6725b2bf0f | ||
|
|
990e73c383 | ||
|
|
9e9e73aa6b | ||
|
|
8434befe1f | ||
|
|
1114ac5613 | ||
|
|
f5f29d775c | ||
|
|
ebd7f1b4ce | ||
|
|
279b7ad10c | ||
|
|
878205fc49 | ||
|
|
b16df32150 | ||
|
|
04b06f7704 | ||
|
|
c6ea1c62d4 | ||
|
|
6ce0f66601 | ||
|
|
ac3a9e3ba8 | ||
|
|
903d2f9183 | ||
|
|
ca709a60cf | ||
|
|
a9b4ce5529 | ||
|
|
9b82ceca67 | ||
|
|
4c7c279dd2 | ||
|
|
79db31685e | ||
|
|
ba13b700b0 | ||
|
|
640561a534 | ||
|
|
e4f81cbf04 | ||
|
|
4be4825112 | ||
|
|
7d107d8efa | ||
|
|
10d1363334 | ||
|
|
b76820ebde | ||
|
|
72b3cfb364 | ||
|
|
8b83ed0e5c | ||
|
|
781f13ae1a | ||
|
|
8193bbae6e | ||
|
|
4cafeaff91 | ||
|
|
95c6a7d41f | ||
|
|
a29e007475 | ||
|
|
d924d7797a | ||
|
|
33c217ecc8 | ||
|
|
c9035046ae | ||
|
|
ad31016825 | ||
|
|
c809066a93 | ||
|
|
60ca27b5e1 | ||
|
|
1104e24408 | ||
|
|
f66db94ffd | ||
|
|
d98b5b22da | ||
|
|
937748e838 | ||
|
|
37ebf36cee | ||
|
|
1c84bdd198 | ||
|
|
4a2fa7cd2c | ||
|
|
7d4110f6d3 | ||
|
|
8497343d7f | ||
|
|
235a2c2904 | ||
|
|
25169cfc20 | ||
|
|
152f5f37ce | ||
|
|
3e42ad8469 | ||
|
|
7ba2e38cd6 | ||
|
|
c7c7a73384 | ||
|
|
46f8984bdc | ||
|
|
c7d306b7d5 | ||
|
|
47e636e949 | ||
|
|
0562729d8b | ||
|
|
4a36227a18 | ||
|
|
28b8b2e415 | ||
|
|
fd82464564 | ||
|
|
418acf6e5e | ||
|
|
d14d076989 | ||
|
|
cb8bb5a70e | ||
|
|
563c9aeff3 | ||
|
|
a0cc1f2e03 | ||
|
|
01403a3f92 | ||
|
|
7116674663 | ||
|
|
b6bc5de79c | ||
|
|
5a275db67d | ||
|
|
31395d8794 | ||
|
|
3734bd6f6c | ||
|
|
da06ef8cad | ||
|
|
0b00171655 | ||
|
|
c1cfa86ad1 | ||
|
|
c34c9562d3 | ||
|
|
0e542577b0 | ||
|
|
42be49da83 | ||
|
|
398ac9b7c6 | ||
|
|
508e9a5d94 | ||
|
|
cc5ea1dbc1 | ||
|
|
3b8d355b9e | ||
|
|
10dbfa9b38 | ||
|
|
e8c42740cf | ||
|
|
4b6c4f048d | ||
|
|
7594cccf8c | ||
|
|
1d9573cf6f | ||
|
|
76f45fb5a6 | ||
|
|
12cf9b800b | ||
|
|
ba7e6494c6 | ||
|
|
72d8160b28 | ||
|
|
6d53511cee | ||
|
|
64d3c211e6 | ||
|
|
fad112f554 | ||
|
|
a563327723 | ||
|
|
096e2bb78a | ||
|
|
5a8cb6f5e3 | ||
|
|
664d630b96 | ||
|
|
a4256d3d2b | ||
|
|
8e65f15e1a | ||
|
|
9ea9f60e92 | ||
|
|
8efefaf0bf | ||
|
|
33d9569427 | ||
|
|
2fdfacb34e | ||
|
|
97fcf1ffa8 | ||
|
|
350b2c64e0 | ||
|
|
dcc57a7afb | ||
|
|
8b510994ad | ||
|
|
4a4d1bbfcd | ||
|
|
78c3c8ec2d | ||
|
|
e99e2b18e0 | ||
|
|
ae1283f2e1 | ||
|
|
cc76f3ca87 | ||
|
|
be8efea081 | ||
|
|
7e8f9036d8 | ||
|
|
8a8ac027f5 | ||
|
|
1d9d09fdf7 | ||
|
|
5dc956870d | ||
|
|
d8f48cbd42 | ||
|
|
39d24817f6 | ||
|
|
2364e44707 | ||
|
|
3e2249bf89 | ||
|
|
38acb6f91c | ||
|
|
9bcb28d5e2 | ||
|
|
d0a3f081da | ||
|
|
d11ec557e7 | ||
|
|
b9124a497c | ||
|
|
502715cfd6 | ||
|
|
e1f532e2fd | ||
|
|
a71033d9d6 | ||
|
|
a15a62f55c | ||
|
|
2fe5cdcf02 | ||
|
|
21c64545e5 | ||
|
|
c93a88f8b0 | ||
|
|
86a81eab4e | ||
|
|
1c779cb3ec | ||
|
|
04949c853d | ||
|
|
ff782a09f5 | ||
|
|
e5ce6680ca | ||
|
|
8e15d89a2e | ||
|
|
d874f26f06 | ||
|
|
80a99ff29e | ||
|
|
b11b97dd7c | ||
|
|
386a5f2c64 | ||
|
|
c13a2f207c | ||
|
|
d36710ef38 | ||
|
|
bbc9b003c6 | ||
|
|
3edba28f0b | ||
|
|
9304f42f69 | ||
|
|
375963ebfd | ||
|
|
7891fb5396 | ||
|
|
bdd5f0a515 | ||
|
|
db0901b1de | ||
|
|
9225697053 | ||
|
|
097b949763 | ||
|
|
60701c2a5c | ||
|
|
3ef1281450 | ||
|
|
af4e74a130 | ||
|
|
422fb2670d | ||
|
|
94a469205a | ||
|
|
95623f9b47 | ||
|
|
a65c246a2e | ||
|
|
045d496a98 | ||
|
|
5ed98b3d92 | ||
|
|
5799e3548b | ||
|
|
b01ed1e9f3 | ||
|
|
49839b8b8e | ||
|
|
500468ed1c | ||
|
|
de6f50ab12 | ||
|
|
2c6339f7a2 | ||
|
|
96c3d63557 |
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
.DS_Store
|
||||||
|
*.pyc
|
||||||
|
*.so
|
||||||
|
*.mo
|
||||||
|
*.pyd
|
||||||
|
*.waf*
|
||||||
|
.lock-waf*
|
||||||
|
.idea
|
||||||
|
.tox
|
||||||
|
|
||||||
|
build
|
||||||
|
dist
|
||||||
|
install
|
||||||
|
installer_tmp-cache
|
||||||
|
env
|
||||||
|
/deps
|
||||||
|
cocoa/autogen
|
||||||
|
|
||||||
|
/run.py
|
||||||
|
/conf.json
|
||||||
|
/cocoa/*/Info.plist
|
||||||
|
/cocoa/*/build
|
||||||
|
/qt/base/*_rc.py
|
||||||
|
/help/*/conf.py
|
||||||
|
/help/*/changelog.rst
|
||||||
22
.hgignore
22
.hgignore
@@ -1,22 +0,0 @@
|
|||||||
syntax: glob
|
|
||||||
|
|
||||||
.DS_Store
|
|
||||||
run.py
|
|
||||||
*.pyc
|
|
||||||
*.so
|
|
||||||
*.mo
|
|
||||||
*.pyd
|
|
||||||
*.waf*
|
|
||||||
.lock-waf*
|
|
||||||
conf.json
|
|
||||||
build
|
|
||||||
dist
|
|
||||||
install
|
|
||||||
installer_tmp-cache
|
|
||||||
env
|
|
||||||
cocoa/autogen
|
|
||||||
cocoa/*/Info.plist
|
|
||||||
cocoa/*/build
|
|
||||||
qt/base/*_rc.py
|
|
||||||
help/*/conf.py
|
|
||||||
help/*/changelog.rst
|
|
||||||
86
.hgtags
86
.hgtags
@@ -1,86 +0,0 @@
|
|||||||
0ef0ca83b49ad009c896f55824189acc932bcf22 se2.8.2
|
|
||||||
0ef0ca83b49ad009c896f55824189acc932bcf22 me5.6.6
|
|
||||||
0ef0ca83b49ad009c896f55824189acc932bcf22 pe1.7.8
|
|
||||||
a8f232f880b6f9ada565d472996a627ebf69b6e9 before-tiger-drop
|
|
||||||
321d15e818cf9a3f1fc037543090bb2fca2cccd7 me5.7.0
|
|
||||||
adc73ccd14b1386cb04dee773c53a2d126800e31 se2.9.0
|
|
||||||
cbcf9c80fee4c908ef2efbf1c143c9e47676c9b2 pe1.8.0
|
|
||||||
61c4101851bdea3cb37dfb76f0d404c78c7c594c se2.9.1
|
|
||||||
0e923897a3389331d4ab3debbc40b8dd616199d9 pe1.8.1
|
|
||||||
2c454eca9ebe93b6cf34916068f828a6a39e3eaf me5.7.1
|
|
||||||
19e40bab20521d4256acf325dba9b32e95e135c5 pe1.8.2
|
|
||||||
7b7c5a66ebee4e4b8125330d24fe9ce1a070ff25 se2.9.2
|
|
||||||
1cef6d39855f85d4be728646bc78b860e6d4e398 pe1.8.3
|
|
||||||
90ed56ee602666db2f267f73eac6f824347039b5 me5.7.2
|
|
||||||
4c3cb1e671a333eabde1151c7c6ffb3609cab025 pe1.8.4
|
|
||||||
0a71306434bca51bea9a5d5ae54fe1bf0e4900d8 pe1.8.5
|
|
||||||
556baf4a410779e9bbf43129de133e4c4b26d679 pe1.8.6
|
|
||||||
9149024283959a50fe9a47a5f175b905d1672c19 se2.10.0
|
|
||||||
388a7e5aef6385e515189f4a15b4c4fed3ae2fcf me5.8.0
|
|
||||||
27501167e3b9262ecb60c967941294f36d77eb25 pe1.9.0
|
|
||||||
cb0a860430bacd712820bce426bcf47a4135efe1 se2.10.1
|
|
||||||
cb0a860430bacd712820bce426bcf47a4135efe1 se2.10.1
|
|
||||||
f71d405e62badcfdc1b037facaac043cece40ee5 se2.10.1
|
|
||||||
3742e83edd9eadf44e1a501859f5e2462b1ef6fd me5.8.1
|
|
||||||
724ff565dd785fb739774588c6ee652cfc0612d5 pe1.9.1
|
|
||||||
634b66415c6529f46ae4f837318027cc9d70c3b5 before-py3k
|
|
||||||
2b67955db2b0580a8b0854dc918b6ab0d1fa3b88 se2.11.0
|
|
||||||
b56fe4dd8c95bca270b078a09e86848df77e2b2d me5.9.0
|
|
||||||
618a7365457d56fdc6920c70843a244762e2ea00 pe1.10.0
|
|
||||||
95b3a4b564c6222b414f2b40182dde2bd6d0e8a4 me5.9.1
|
|
||||||
9735a5218d2b5b3b1e1dfe17f2f874177cf8f61c se2.11.1
|
|
||||||
dbfee3ee2fa5cbb9e7ab36570659c17cd5b8561f se2.12.0
|
|
||||||
d3fe0d0dcda1e0bf1100d02f117503d3bf6baacf me5.10.0
|
|
||||||
b07ac1398703dd358912c1f3d20bd995633db9fe pe1.11.0
|
|
||||||
96b6aee668398d663b04eafc8d5dae05e18500ee before-fairware
|
|
||||||
22239f94589baf2a9fad2123045b8a718dbd68f5 se2.12.2
|
|
||||||
f9cae82a0752191276b24ffb2cc4e4a8afb5d754 me5.10.2
|
|
||||||
154c8cb6f018d446d88fa099490c900906e86386 pe1.11.2
|
|
||||||
ca93352ce35184853ad9fcb881935a43a8b1e249 me5.10.3
|
|
||||||
44f6ff67066c083f79daa18a9d2f1ab909e0a62e me5.10.4
|
|
||||||
3f71a8f5bf8f6d0729748a27af9163e013723294 pe1.11.3
|
|
||||||
0056293b0dade8b8230f68c1fe6f0c2d1e0b74d8 se2.12.3
|
|
||||||
8d12cab3b12b723e3a86d02cf8002731a0f73f95 se3.0.0
|
|
||||||
778876a8a9787658aa6adf6944b53aebcb7faeea se3.0.1
|
|
||||||
f1d40b556c01f32c58f9ef9f9acac5b78e01ba7a pe2.0.0
|
|
||||||
2fd901a516f8cb6b4438491f63f2ebfd52a57c13 me6.0.0
|
|
||||||
ff43c6d9feb388f103b7857eaa6f7809185f78ec before-pluginbuilder
|
|
||||||
d274bcb98f2d02b86470a04cd62e718eff33b74f pe2.1.0
|
|
||||||
77e169f757195c11e9c1c5febeb2db8eb3589510 se3.0.2
|
|
||||||
97893f37d7d0767b5aedf1b4b40de57ee36d426b se3.1.0
|
|
||||||
e44d5127ed605daa7a17a01eee65d0a157de20c0 pe2.2.0
|
|
||||||
ecf9aaa568340e3d03e8854b7556edd5a3285107 pe2.2.1
|
|
||||||
db1f325c907ffa9808a49cb7bc2886b9fca7aee2 se3.1.1
|
|
||||||
e62183e907d6177cf0bac354e31afa9546c199e6 se3.1.2
|
|
||||||
28ba95706dc54ba32b1c0cf4e1e6350515d19ba3 me6.0.2
|
|
||||||
925847384dcef62a5c3518fc9e5ce42feab2b093 pe2.2.2
|
|
||||||
383b14d6e8555ed2c8d5552259bc7ce600dfb1d0 before-leopard-drop
|
|
||||||
a2f7b7302e178f08725a6404ddc28464409510b1 se3.2.0
|
|
||||||
5a5134a4fa9bb7ca80ae3e32010030f5bd7ba434 me6.1.0
|
|
||||||
0fd77be57ff716d5c93232e829dc02acec036d7c se3.2.1
|
|
||||||
3dd08060135b0b9cef70b6f5a81f191ea339c8d5 me6.1.1
|
|
||||||
4e6cbef6bcdfcc0e56ff9690fbfe1cac1f4b1b09 pe2.3.0
|
|
||||||
9ea9af1b886cd1adc4f42fd2276cc2b38376eab0 se3.3.0
|
|
||||||
6e3379be6821bb36d7f0877a17dd6c07aa037b0a se3.3.1
|
|
||||||
015ba7e2c10d09afb944f387c2a9c97f7eff7571 me6.2.0
|
|
||||||
8178bda48324461a17118c98634241952c074f29 pe2.4.0
|
|
||||||
2a96f2fb3ddb6f1e0ae87951586733fc3e4a28a0 se3.3.2
|
|
||||||
6a08c1205dfe5e537e5c2dc99d05e05d1d3928f6 me6.2.1
|
|
||||||
a619f313712e2923160b8f90d8250ee0e184c7b9 pe2.4.1
|
|
||||||
fad463ae749b7189dce92f1e42a57ac4ee03987d se3.3.3
|
|
||||||
236cf9b690a144392e7e86e7c9749fc834a8b271 me6.3.0
|
|
||||||
90318f1303858d9d01065d92d78d98b888b38ea0 se3.4.0
|
|
||||||
93ed33410df2d2f21229a77ae49c83ece2c50a55 pe2.5.0
|
|
||||||
c153aef25e5c9911f2197d13899591c50cf38ffc se3.4.1
|
|
||||||
71b7e18613f3790cea18cb0dd8c9c986ce237267 me6.3.1
|
|
||||||
c3d9f91dc9c9d60f370c72bc211f09be3e4fc18d se3.5.0
|
|
||||||
254bce83ad6e56c102d69fd603f6845e2324b470 me6.4.0
|
|
||||||
e772f1de86744999ffbbe5845554417965b1dfba me6.4.1
|
|
||||||
c8a9a4d355927e509f514308c82306192bc71f92 pe2.6.0
|
|
||||||
a618e954f01e4bbdbe9a03e5667a67d62be995a7 me6.4.2
|
|
||||||
0f18c4498a6c7529bf77207db70aed8a5ec96ee4 se3.6.0
|
|
||||||
8f478379ec62fd1329d527aafb1ab0f2410f3a79 me6.5.0
|
|
||||||
d773721e6c3260f8130f40b4ab10442edc9965ec pe2.7.0
|
|
||||||
6b42e0d5628b937aee8039ee34d4b329149718a5 se3.6.0-arch
|
|
||||||
df6e045b9e7679f2a1949a57060e5c1863904444 me6.5.0-arch
|
|
||||||
286ba6959cd0af059f245371a3afb52c1da91dee pe2.7.0-arch
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[main]
|
[main]
|
||||||
host = https://www.transifex.net
|
host = https://www.transifex.com
|
||||||
|
|
||||||
[dupeguru.core]
|
[dupeguru.core]
|
||||||
file_filter = locale/<lang>/LC_MESSAGES/core.po
|
file_filter = locale/<lang>/LC_MESSAGES/core.po
|
||||||
|
|||||||
626
LICENSE
626
LICENSE
@@ -1,10 +1,622 @@
|
|||||||
Copyright 2013 Hardcoded Software Inc. (http://www.hardcoded.net)
|
GNU GENERAL PUBLIC LICENSE
|
||||||
All rights reserved.
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
Preamble
|
||||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
||||||
* Neither the name of Hardcoded Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
119
README.md
Normal file
119
README.md
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
# About the "rust" branch
|
||||||
|
|
||||||
|
I'm really excited about Rust and I'm trying out a Rust implementation of dupeGuru's bottlenecks
|
||||||
|
(PE's image comparison).
|
||||||
|
|
||||||
|
For fun.
|
||||||
|
|
||||||
|
# dupeGuru
|
||||||
|
|
||||||
|
[dupeGuru][dupeguru] is a cross-platform (Linux, OS X, Windows) GUI tool to find duplicate files in
|
||||||
|
a system. It's written mostly in Python 3 and has the peculiarity of using
|
||||||
|
[multiple GUI toolkits][cross-toolkit], all using the same core Python code. On OS X, the UI layer
|
||||||
|
is written in Objective-C and uses Cocoa. On Linux and Windows, it's written in Python and uses Qt5.
|
||||||
|
|
||||||
|
dupeGuru comes in 3 editions (standard, music and picture) which are all buildable from this same
|
||||||
|
source tree. You choose the edition you want to build in a `configure.py` flag.
|
||||||
|
|
||||||
|
# Current status: People wanted
|
||||||
|
|
||||||
|
dupeGuru has currently only one maintainer, me. This is a dangerous situation that needs to be
|
||||||
|
corrected.
|
||||||
|
|
||||||
|
The goal is to eventually have another active maintainer, but before we can get there, the project
|
||||||
|
needs more contributors. It is very much lacking on that side right now.
|
||||||
|
|
||||||
|
Whatever your skills, if you are remotely interestested in being a contributor, I'm interested in
|
||||||
|
mentoring you. If that's the case, please refer to [the open ticket on the subject][contrib-issue]
|
||||||
|
and let's get started.
|
||||||
|
|
||||||
|
# Contents of this folder
|
||||||
|
|
||||||
|
This folder contains the source for dupeGuru. Its documentation is in `help`, but is also
|
||||||
|
[available online][documentation] in its built form. Here's how this source tree is organised:
|
||||||
|
|
||||||
|
* core: Contains the core logic code for dupeGuru. It's Python code.
|
||||||
|
* core_*: Edition-specific-cross-toolkit code written in Python.
|
||||||
|
* cocoa: UI code for the Cocoa toolkit. It's Objective-C code.
|
||||||
|
* qt: UI code for the Qt toolkit. It's written in Python and uses PyQt.
|
||||||
|
* images: Images used by the different UI codebases.
|
||||||
|
* pkg: Skeleton files required to create different packages
|
||||||
|
* help: Help document, written for Sphinx.
|
||||||
|
* locale: .po files for localisation.
|
||||||
|
|
||||||
|
There are also other sub-folder that comes from external repositories and are part of this repo as
|
||||||
|
git subtrees:
|
||||||
|
|
||||||
|
* hscommon: A collection of helpers used across HS applications.
|
||||||
|
* cocoalib: A collection of helpers used across Cocoa UI codebases of HS applications.
|
||||||
|
* qtlib: A collection of helpers used across Qt UI codebases of HS applications.
|
||||||
|
|
||||||
|
# How to build dupeGuru from source
|
||||||
|
|
||||||
|
## The very, very, very easy way
|
||||||
|
|
||||||
|
If you're on Linux or Mac, there's a bootstrap script that will make building very, very easy. There
|
||||||
|
might be some things that you need to install manually on your system, but the bootstrap script will
|
||||||
|
tell you when what you need to install. You can run the bootstrap with:
|
||||||
|
|
||||||
|
./bootstrap.sh
|
||||||
|
|
||||||
|
and follow instructions from the script. You can then ignore the rest of the build documentation.
|
||||||
|
|
||||||
|
## Prerequisites installation
|
||||||
|
|
||||||
|
Prerequisites are installed through `pip`. However, some of them are not "pip installable" and have
|
||||||
|
to be installed manually.
|
||||||
|
|
||||||
|
* All systems: [Python 3.3+][python] and [setuptools][setuptools]
|
||||||
|
* Mac OS X: The last XCode to have the 10.7 SDK included. Python 3.4+.
|
||||||
|
* Windows: Visual Studio 2010, [PyQt 5.0+][pyqt], [cx_Freeze][cxfreeze] and
|
||||||
|
[Advanced Installer][advinst] (you only need the last two if you want to create an installer)
|
||||||
|
|
||||||
|
On Ubuntu (14.04+), the apt-get command to install all pre-requisites is:
|
||||||
|
|
||||||
|
$ apt-get install python3-dev python3-pyqt5 pyqt5-dev-tools
|
||||||
|
|
||||||
|
On Arch, it's:
|
||||||
|
|
||||||
|
$ pacman -S python-pyqt5
|
||||||
|
|
||||||
|
## Setting up the virtual environment
|
||||||
|
|
||||||
|
Use Python's built-in `pyvenv` to create a virtual environment in which we're going to install our.
|
||||||
|
Python-related dependencies. `pyvenv` is built-in Python but, unlike its `virtualenv` predecessor,
|
||||||
|
it doesn't install setuptools and pip (unless you use Python 3.4+), so it has to be installed
|
||||||
|
manually:
|
||||||
|
|
||||||
|
$ pyvenv --system-site-packages env
|
||||||
|
$ source env/bin/activate
|
||||||
|
$ python get-pip.py
|
||||||
|
|
||||||
|
Then, you can install pip requirements in your virtualenv:
|
||||||
|
|
||||||
|
$ pip install -r requirements-[osx|win].txt
|
||||||
|
|
||||||
|
([osx|win] depends, of course, on your platform. On other platforms, just use requirements.txt).
|
||||||
|
|
||||||
|
## Actual building and running
|
||||||
|
|
||||||
|
With your virtualenv activated, you can build and run dupeGuru with these commands:
|
||||||
|
|
||||||
|
$ python configure.py
|
||||||
|
$ python build.py
|
||||||
|
$ python run.py
|
||||||
|
|
||||||
|
You can also package dupeGuru into an installable package with:
|
||||||
|
|
||||||
|
$ python package.py
|
||||||
|
|
||||||
|
[dupeguru]: http://www.hardcoded.net/dupeguru/
|
||||||
|
[cross-toolkit]: http://www.hardcoded.net/articles/cross-toolkit-software
|
||||||
|
[contrib-issue]: https://github.com/hsoft/dupeguru/issues/300
|
||||||
|
[documentation]: http://www.hardcoded.net/dupeguru/help/en/
|
||||||
|
[python]: http://www.python.org/
|
||||||
|
[setuptools]: https://pypi.python.org/pypi/setuptools
|
||||||
|
[pyqt]: http://www.riverbankcomputing.com
|
||||||
|
[cxfreeze]: http://cx-freeze.sourceforge.net/
|
||||||
|
[advinst]: http://www.advancedinstaller.com
|
||||||
|
|
||||||
117
README.rst
117
README.rst
@@ -1,117 +0,0 @@
|
|||||||
Contents
|
|
||||||
========
|
|
||||||
|
|
||||||
This package contains the source for dupeGuru. To learn how to build it, refer to the
|
|
||||||
"Build dupeGuru" section. Below is the description of the various subfolders:
|
|
||||||
|
|
||||||
- core: Contains the core logic code for dupeGuru. It's Python code.
|
|
||||||
- core_*: Edition-specific-cross-toolkit code written in Python.
|
|
||||||
- cocoa: UI code for the Cocoa toolkit. It's Objective-C code.
|
|
||||||
- qt: UI code for the Qt toolkit. It's written in Python and uses PyQt.
|
|
||||||
- images: Images used by the different UI codebases.
|
|
||||||
- debian: Skeleton files required to create a .deb package
|
|
||||||
- help: Help document, written for Sphinx.
|
|
||||||
|
|
||||||
There are also other sub-folder that comes from external repositories (automatically checked out
|
|
||||||
as mercurial subrepos):
|
|
||||||
|
|
||||||
- hscommon: A collection of helpers used across HS applications.
|
|
||||||
- cocoalib: A collection of helpers used across Cocoa UI codebases of HS applications.
|
|
||||||
- qtlib: A collection of helpers used across Qt UI codebases of HS applications.
|
|
||||||
|
|
||||||
dupeGuru Dependencies
|
|
||||||
=====================
|
|
||||||
|
|
||||||
Before being able to build dupeGuru, a few dependencies have to be installed. If you use pip, you
|
|
||||||
will not have to install them all manually (see "The easy way!" below):
|
|
||||||
|
|
||||||
General dependencies
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
- Python 3.2 (http://www.python.org)
|
|
||||||
- Send2Trash3k (http://hg.hardcoded.net/send2trash)
|
|
||||||
- hsaudiotag3k 1.1.0 (for ME) (http://hg.hardcoded.net/hsaudiotag)
|
|
||||||
- jobprogress 1.0.3 (http://hg.hardcoded.net/jobprogress)
|
|
||||||
- Sphinx 1.1 (http://sphinx.pocoo.org/)
|
|
||||||
- polib 0.7.0 (http://bitbucket.org/izi/polib)
|
|
||||||
- pytest 2.0.0, to run unit tests. (http://pytest.org/)
|
|
||||||
|
|
||||||
OS X prerequisites
|
|
||||||
------------------
|
|
||||||
|
|
||||||
- XCode's command line tools
|
|
||||||
- objp 1.1.0 (http://bitbucket.org/hsoft/objp)
|
|
||||||
- appscript 1.0.0 for ME and PE (http://appscript.sourceforge.net/)
|
|
||||||
- xibless 0.4.0 (https://bitbucket.org/hsoft/xibless)
|
|
||||||
|
|
||||||
Windows prerequisites
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
- Visual Studio 2008 (Express is enough) is needed to build C extensions. (http://www.microsoft.com/Express/)
|
|
||||||
- PyQt 4.7+ (http://www.riverbankcomputing.co.uk/news)
|
|
||||||
- cx_Freeze, if you want to build a exe. You don't need it if you just want to run dupeGuru. (http://cx-freeze.sourceforge.net/)
|
|
||||||
- Advanced Installer, if you want to build the installer file. (http://www.advancedinstaller.com/)
|
|
||||||
|
|
||||||
Linux prerequisites
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
- PyQt 4.7+ (http://www.riverbankcomputing.co.uk/news)
|
|
||||||
|
|
||||||
The easy way!
|
|
||||||
-------------
|
|
||||||
|
|
||||||
There's an easy way to install the majority of the prerequisites above, and it's `pip <http://www.pip-installer.org/>`_ which has recently started to support Python 3. So install it and then run::
|
|
||||||
|
|
||||||
pip install -r requirements-[osx|win].txt
|
|
||||||
|
|
||||||
([osx|win] depends, of course, on your platform. On other platforms, just use requirements.txt).
|
|
||||||
|
|
||||||
Advanced Installer, having nothing to do with Python, needs to be installed manually.
|
|
||||||
|
|
||||||
PyQt isn't in the requirements file either (there's no package uploaded on PyPI) and you also have
|
|
||||||
to install it manually.
|
|
||||||
|
|
||||||
If you use a virtualenv (which you should), you have to enable the "site-packages" option because
|
|
||||||
dupeGuru will need the PyQt library which you'll have installed on your system.
|
|
||||||
|
|
||||||
Prerequisite gotchas
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Correctly installing the prerequisites is tricky. Make sure you have at least the version number
|
|
||||||
required for each prerequisite.
|
|
||||||
|
|
||||||
If you didn't use mercurial to download this source, you probably have an incomplete source folder!
|
|
||||||
External projects (hscommon, qtlib, cocoalib) need to be at the root of the dupeGuru project folder.
|
|
||||||
You'll have to download those separately. Or use mercurial, it's much easier.
|
|
||||||
|
|
||||||
Another one on OS X: I wouldn't use macports/fink/whatever. Whenever I tried using those, I always
|
|
||||||
ended up with problems.
|
|
||||||
|
|
||||||
Whenever you have a problem, always double-check that you're running the correct python version.
|
|
||||||
You'll probably have to tweak your $PATH.
|
|
||||||
|
|
||||||
To setup a build machine under Ubuntu 12.04 and up, install those packages: python3-dev, python3-pyqt4,
|
|
||||||
pyqt4-dev-tools, mercurial and then python3-setuptools. Once you've done that, install pip with
|
|
||||||
`easy_install`. Once you've done that, you can then perform "The easy way!" installation.
|
|
||||||
|
|
||||||
Building dupeGuru
|
|
||||||
=================
|
|
||||||
|
|
||||||
First, make sure you meet the dependencies listed in the section above. Then you need to configure
|
|
||||||
your build with::
|
|
||||||
|
|
||||||
python configure.py
|
|
||||||
|
|
||||||
If you want, you can specify a UI to use with the ``--ui`` option. So, if you want to build dupeGuru
|
|
||||||
with Qt on OS X, then you have to type ``python configure.py --ui=qt``. You can also use the
|
|
||||||
``--dev`` flag to indicate a dev build (mostly useful in OS X, where the python code in symlinked
|
|
||||||
so you don't have to repackage whenever you make a change in the python code).
|
|
||||||
|
|
||||||
Then, just build the thing and then run it with::
|
|
||||||
|
|
||||||
python build.py
|
|
||||||
python run.py
|
|
||||||
|
|
||||||
If you want to create ready-to-upload package, run::
|
|
||||||
|
|
||||||
python package.py
|
|
||||||
53
bootstrap.sh
Executable file
53
bootstrap.sh
Executable file
@@ -0,0 +1,53 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PYTHON=python3
|
||||||
|
command -v $PYTHON -m venv >/dev/null 2>&1 || { echo >&2 "Python 3.3 required. Install it and try again. Aborting"; exit 1; }
|
||||||
|
|
||||||
|
if [ -d "deps" ]; then
|
||||||
|
# We have a collection of dependencies in our source package. We might as well use it instead
|
||||||
|
# of downloading it from PyPI.
|
||||||
|
PIPARGS="--no-index --find-links=deps"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "env" ]; then
|
||||||
|
echo "No virtualenv. Creating one"
|
||||||
|
# We need a "system-site-packages" env to have PyQt, but we also need to ensure a local pip
|
||||||
|
# install. To achieve our latter goal, we start with a normal venv, which we later upgrade to
|
||||||
|
# a system-site-packages once pip is installed.
|
||||||
|
if ! $PYTHON -m venv env ; then
|
||||||
|
# We're probably under braindead Ubuntu 14.04 which completely messed up ensurepip.
|
||||||
|
# Work around it :(
|
||||||
|
echo "Ubuntu 14.04's version of Python 3.4 is braindead stupid, but we work around it anyway..."
|
||||||
|
$PYTHON -m venv --without-pip env
|
||||||
|
fi
|
||||||
|
source env/bin/activate
|
||||||
|
if python -m ensurepip; then
|
||||||
|
echo "We're under Python 3.4+, no need to try to install pip!"
|
||||||
|
else
|
||||||
|
python get-pip.py $PIPARGS --force-reinstall
|
||||||
|
fi
|
||||||
|
deactivate
|
||||||
|
if [ "$(uname)" != "Darwin" ]; then
|
||||||
|
# We only need system site packages for PyQt, so under OS X, we don't enable it
|
||||||
|
if ! $PYTHON -m venv env --upgrade --system-site-packages ; then
|
||||||
|
# We're probably under v3.4.1 and experiencing http://bugs.python.org/issue21643
|
||||||
|
# Work around it.
|
||||||
|
echo "Oops, can't upgrade our venv. Trying to work around it."
|
||||||
|
rm env/lib64
|
||||||
|
$PYTHON -m venv env --upgrade --system-site-packages
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
source env/bin/activate
|
||||||
|
|
||||||
|
echo "Installing pip requirements"
|
||||||
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
|
pip install $PIPARGS -r requirements-osx.txt
|
||||||
|
else
|
||||||
|
python -c "import PyQt5" >/dev/null 2>&1 || { echo >&2 "PyQt 5.1+ required. Install it and try again. Aborting"; exit 1; }
|
||||||
|
pip install $PIPARGS -r requirements.txt
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Bootstrapping complete! You can now configure, build and run dupeGuru with:"
|
||||||
|
echo ". env/bin/activate && python configure.py && python build.py && python run.py"
|
||||||
176
build.py
176
build.py
@@ -1,10 +1,10 @@
|
|||||||
# Created By: Virgil Dupras
|
# Created By: Virgil Dupras
|
||||||
# Created On: 2009-12-30
|
# Created On: 2009-12-30
|
||||||
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
#
|
#
|
||||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@@ -18,10 +18,12 @@ import compileall
|
|||||||
from setuptools import setup, Extension
|
from setuptools import setup, Extension
|
||||||
|
|
||||||
from hscommon import sphinxgen
|
from hscommon import sphinxgen
|
||||||
from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, filereplace,
|
from hscommon.build import (
|
||||||
get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, OSXAppStructure,
|
add_to_pythonpath, print_and_do, copy_packages, filereplace,
|
||||||
|
get_module_version, move_all, copy_all, OSXAppStructure,
|
||||||
build_cocoalib_xibless, fix_qt_resource_file, build_cocoa_ext, copy_embeddable_python_dylib,
|
build_cocoalib_xibless, fix_qt_resource_file, build_cocoa_ext, copy_embeddable_python_dylib,
|
||||||
collect_stdlib_dependencies, copy)
|
collect_stdlib_dependencies, copy
|
||||||
|
)
|
||||||
from hscommon import loc
|
from hscommon import loc
|
||||||
from hscommon.plat import ISOSX, ISLINUX
|
from hscommon.plat import ISOSX, ISLINUX
|
||||||
from hscommon.util import ensure_folder, delete_files_with_pattern
|
from hscommon.util import ensure_folder, delete_files_with_pattern
|
||||||
@@ -29,22 +31,42 @@ from hscommon.util import ensure_folder, delete_files_with_pattern
|
|||||||
def parse_args():
|
def parse_args():
|
||||||
usage = "usage: %prog [options]"
|
usage = "usage: %prog [options]"
|
||||||
parser = OptionParser(usage=usage)
|
parser = OptionParser(usage=usage)
|
||||||
parser.add_option('--clean', action='store_true', dest='clean',
|
parser.add_option(
|
||||||
help="Clean build folder before building")
|
'--clean', action='store_true', dest='clean',
|
||||||
parser.add_option('--doc', action='store_true', dest='doc',
|
help="Clean build folder before building"
|
||||||
help="Build only the help file")
|
)
|
||||||
parser.add_option('--loc', action='store_true', dest='loc',
|
parser.add_option(
|
||||||
help="Build only localization")
|
'--doc', action='store_true', dest='doc',
|
||||||
parser.add_option('--cocoa-ext', action='store_true', dest='cocoa_ext',
|
help="Build only the help file"
|
||||||
help="Build only Cocoa extensions")
|
)
|
||||||
parser.add_option('--cocoa-compile', action='store_true', dest='cocoa_compile',
|
parser.add_option(
|
||||||
help="Build only Cocoa executable")
|
'--loc', action='store_true', dest='loc',
|
||||||
parser.add_option('--xibless', action='store_true', dest='xibless',
|
help="Build only localization"
|
||||||
help="Build only xibless UIs")
|
)
|
||||||
parser.add_option('--updatepot', action='store_true', dest='updatepot',
|
parser.add_option(
|
||||||
help="Generate .pot files from source code.")
|
'--cocoa-ext', action='store_true', dest='cocoa_ext',
|
||||||
parser.add_option('--mergepot', action='store_true', dest='mergepot',
|
help="Build only Cocoa extensions"
|
||||||
help="Update all .po files based on .pot files.")
|
)
|
||||||
|
parser.add_option(
|
||||||
|
'--cocoa-compile', action='store_true', dest='cocoa_compile',
|
||||||
|
help="Build only Cocoa executable"
|
||||||
|
)
|
||||||
|
parser.add_option(
|
||||||
|
'--xibless', action='store_true', dest='xibless',
|
||||||
|
help="Build only xibless UIs"
|
||||||
|
)
|
||||||
|
parser.add_option(
|
||||||
|
'--updatepot', action='store_true', dest='updatepot',
|
||||||
|
help="Generate .pot files from source code."
|
||||||
|
)
|
||||||
|
parser.add_option(
|
||||||
|
'--mergepot', action='store_true', dest='mergepot',
|
||||||
|
help="Update all .po files based on .pot files."
|
||||||
|
)
|
||||||
|
parser.add_option(
|
||||||
|
'--normpo', action='store_true', dest='normpo',
|
||||||
|
help="Normalize all PO files (do this before commit)."
|
||||||
|
)
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
return options
|
return options
|
||||||
|
|
||||||
@@ -73,12 +95,20 @@ def build_xibless(edition, dest='cocoa/autogen'):
|
|||||||
('preferences_panel.py', 'PreferencesPanel_UI'),
|
('preferences_panel.py', 'PreferencesPanel_UI'),
|
||||||
]
|
]
|
||||||
for srcname, dstname in FNPAIRS:
|
for srcname, dstname in FNPAIRS:
|
||||||
xibless.generate(op.join('cocoa', 'base', 'ui', srcname), op.join(dest, dstname),
|
xibless.generate(
|
||||||
localizationTable='Localizable', args={'edition': edition})
|
op.join('cocoa', 'base', 'ui', srcname), op.join(dest, dstname),
|
||||||
|
localizationTable='Localizable', args={'edition': edition}
|
||||||
|
)
|
||||||
if edition == 'pe':
|
if edition == 'pe':
|
||||||
xibless.generate('cocoa/pe/ui/details_panel.py', op.join(dest, 'DetailsPanel_UI'), localizationTable='Localizable')
|
xibless.generate(
|
||||||
|
'cocoa/pe/ui/details_panel.py', op.join(dest, 'DetailsPanel_UI'),
|
||||||
|
localizationTable='Localizable'
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
xibless.generate('cocoa/base/ui/details_panel.py', op.join(dest, 'DetailsPanel_UI'), localizationTable='Localizable')
|
xibless.generate(
|
||||||
|
'cocoa/base/ui/details_panel.py', op.join(dest, 'DetailsPanel_UI'),
|
||||||
|
localizationTable='Localizable'
|
||||||
|
)
|
||||||
|
|
||||||
def build_cocoa(edition, dev):
|
def build_cocoa(edition, dev):
|
||||||
print("Creating OS X app structure")
|
print("Creating OS X app structure")
|
||||||
@@ -102,20 +132,26 @@ def build_cocoa(edition, dev):
|
|||||||
if not op.exists(pydep_folder):
|
if not op.exists(pydep_folder):
|
||||||
os.mkdir(pydep_folder)
|
os.mkdir(pydep_folder)
|
||||||
shutil.copy(op.join(cocoa_project_path, 'dg_cocoa.py'), 'build')
|
shutil.copy(op.join(cocoa_project_path, 'dg_cocoa.py'), 'build')
|
||||||
|
appscript_pkgs = ['appscript', 'aem', 'mactypes', 'osax']
|
||||||
specific_packages = {
|
specific_packages = {
|
||||||
'se': ['core_se'],
|
'se': ['core_se'],
|
||||||
'me': ['core_me'],
|
'me': ['core_me'] + appscript_pkgs + ['hsaudiotag'],
|
||||||
'pe': ['core_pe'],
|
'pe': ['core_pe'] + appscript_pkgs,
|
||||||
}[edition]
|
}[edition]
|
||||||
tocopy = ['core', 'hscommon', 'cocoa/inter', 'cocoalib/cocoa', 'jobprogress', 'objp',
|
tocopy = [
|
||||||
'send2trash'] + specific_packages
|
'core', 'hscommon', 'cocoa/inter', 'cocoalib/cocoa', 'objp', 'send2trash'
|
||||||
|
] + specific_packages
|
||||||
copy_packages(tocopy, pydep_folder, create_links=dev)
|
copy_packages(tocopy, pydep_folder, create_links=dev)
|
||||||
sys.path.insert(0, 'build')
|
sys.path.insert(0, 'build')
|
||||||
collect_stdlib_dependencies('build/dg_cocoa.py', pydep_folder)
|
extra_deps = None
|
||||||
|
if edition == 'pe':
|
||||||
|
# ModuleFinder can't seem to correctly detect the multiprocessing dependency, so we have
|
||||||
|
# to manually specify it.
|
||||||
|
extra_deps = ['multiprocessing']
|
||||||
|
collect_stdlib_dependencies('build/dg_cocoa.py', pydep_folder, extra_deps=extra_deps)
|
||||||
del sys.path[0]
|
del sys.path[0]
|
||||||
# Views are not referenced by python code, so they're not found by the collector.
|
# Views are not referenced by python code, so they're not found by the collector.
|
||||||
copy_all('build/inter/*.so', op.join(pydep_folder, 'inter'))
|
copy_all('build/inter/*.so', op.join(pydep_folder, 'inter'))
|
||||||
copy_sysconfig_files_for_embed(pydep_folder)
|
|
||||||
if not dev:
|
if not dev:
|
||||||
# Important: Don't ever run delete_files_with_pattern('*.py') on dev builds because you'll
|
# Important: Don't ever run delete_files_with_pattern('*.py') on dev builds because you'll
|
||||||
# be deleting all py files in symlinked folders.
|
# be deleting all py files in symlinked folders.
|
||||||
@@ -127,6 +163,7 @@ def build_cocoa(edition, dev):
|
|||||||
print_and_do(cocoa_compile_command(edition))
|
print_and_do(cocoa_compile_command(edition))
|
||||||
os.chdir('..')
|
os.chdir('..')
|
||||||
app.copy_executable('cocoa/build/dupeGuru')
|
app.copy_executable('cocoa/build/dupeGuru')
|
||||||
|
build_help(edition)
|
||||||
print("Copying resources and frameworks")
|
print("Copying resources and frameworks")
|
||||||
image_path = ed('cocoa/{}/dupeguru.icns')
|
image_path = ed('cocoa/{}/dupeguru.icns')
|
||||||
resources = [image_path, 'cocoa/base/dsa_pub.pem', 'build/dg_cocoa.py', 'build/help']
|
resources = [image_path, 'cocoa/base/dsa_pub.pem', 'build/dg_cocoa.py', 'build/help']
|
||||||
@@ -141,8 +178,9 @@ def build_qt(edition, dev, conf):
|
|||||||
print("Building localizations")
|
print("Building localizations")
|
||||||
build_localizations('qt', edition)
|
build_localizations('qt', edition)
|
||||||
print("Building Qt stuff")
|
print("Building Qt stuff")
|
||||||
print_and_do("pyrcc4 -py3 {0} > {1}".format(op.join('qt', 'base', 'dg.qrc'), op.join('qt', 'base', 'dg_rc.py')))
|
print_and_do("pyrcc5 {0} > {1}".format(op.join('qt', 'base', 'dg.qrc'), op.join('qt', 'base', 'dg_rc.py')))
|
||||||
fix_qt_resource_file(op.join('qt', 'base', 'dg_rc.py'))
|
fix_qt_resource_file(op.join('qt', 'base', 'dg_rc.py'))
|
||||||
|
build_help(edition)
|
||||||
print("Creating the run.py file")
|
print("Creating the run.py file")
|
||||||
filereplace(op.join('qt', 'run_template.py'), 'run.py', edition=edition)
|
filereplace(op.join('qt', 'run_template.py'), 'run.py', edition=edition)
|
||||||
|
|
||||||
@@ -152,7 +190,7 @@ def build_help(edition):
|
|||||||
help_basepath = op.join(current_path, 'help', 'en')
|
help_basepath = op.join(current_path, 'help', 'en')
|
||||||
help_destpath = op.join(current_path, 'build', 'help'.format(edition))
|
help_destpath = op.join(current_path, 'build', 'help'.format(edition))
|
||||||
changelog_path = op.join(current_path, 'help', 'changelog_{}'.format(edition))
|
changelog_path = op.join(current_path, 'help', 'changelog_{}'.format(edition))
|
||||||
tixurl = "https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}"
|
tixurl = "https://github.com/hsoft/dupeguru/issues/{}"
|
||||||
appname = {'se': 'dupeGuru', 'me': 'dupeGuru Music Edition', 'pe': 'dupeGuru Picture Edition'}[edition]
|
appname = {'se': 'dupeGuru', 'me': 'dupeGuru Music Edition', 'pe': 'dupeGuru Picture Edition'}[edition]
|
||||||
homepage = 'http://www.hardcoded.net/dupeguru{}/'.format('_' + edition if edition != 'se' else '')
|
homepage = 'http://www.hardcoded.net/dupeguru{}/'.format('_' + edition if edition != 'se' else '')
|
||||||
confrepl = {'edition': edition, 'appname': appname, 'homepage': homepage, 'language': 'en'}
|
confrepl = {'edition': edition, 'appname': appname, 'homepage': homepage, 'language': 'en'}
|
||||||
@@ -160,17 +198,12 @@ def build_help(edition):
|
|||||||
conftmpl = op.join(current_path, 'help', 'conf.tmpl')
|
conftmpl = op.join(current_path, 'help', 'conf.tmpl')
|
||||||
sphinxgen.gen(help_basepath, help_destpath, changelog_path, tixurl, confrepl, conftmpl, changelogtmpl)
|
sphinxgen.gen(help_basepath, help_destpath, changelog_path, tixurl, confrepl, conftmpl, changelogtmpl)
|
||||||
|
|
||||||
def build_base_localizations():
|
|
||||||
loc.compile_all_po('locale')
|
|
||||||
loc.compile_all_po(op.join('hscommon', 'locale'))
|
|
||||||
loc.merge_locale_dir(op.join('hscommon', 'locale'), 'locale')
|
|
||||||
|
|
||||||
def build_qt_localizations():
|
def build_qt_localizations():
|
||||||
loc.compile_all_po(op.join('qtlib', 'locale'))
|
loc.compile_all_po(op.join('qtlib', 'locale'))
|
||||||
loc.merge_locale_dir(op.join('qtlib', 'locale'), 'locale')
|
loc.merge_locale_dir(op.join('qtlib', 'locale'), 'locale')
|
||||||
|
|
||||||
def build_localizations(ui, edition):
|
def build_localizations(ui, edition):
|
||||||
build_base_localizations()
|
loc.compile_all_po('locale')
|
||||||
if ui == 'cocoa':
|
if ui == 'cocoa':
|
||||||
app = cocoa_app(edition)
|
app = cocoa_app(edition)
|
||||||
loc.build_cocoa_localizations(app, en_stringsfile=op.join('cocoa', 'base', 'en.lproj', 'Localizable.strings'))
|
loc.build_cocoa_localizations(app, en_stringsfile=op.join('cocoa', 'base', 'en.lproj', 'Localizable.strings'))
|
||||||
@@ -183,7 +216,7 @@ def build_localizations(ui, edition):
|
|||||||
shutil.copytree('locale', locale_dest, ignore=shutil.ignore_patterns('*.po', '*.pot'))
|
shutil.copytree('locale', locale_dest, ignore=shutil.ignore_patterns('*.po', '*.pot'))
|
||||||
if ui == 'qt' and not ISLINUX:
|
if ui == 'qt' and not ISLINUX:
|
||||||
print("Copying qt_*.qm files into the 'locale' folder")
|
print("Copying qt_*.qm files into the 'locale' folder")
|
||||||
from PyQt4.QtCore import QLibraryInfo
|
from PyQt5.QtCore import QLibraryInfo
|
||||||
trfolder = QLibraryInfo.location(QLibraryInfo.TranslationsPath)
|
trfolder = QLibraryInfo.location(QLibraryInfo.TranslationsPath)
|
||||||
for lang in loc.get_langs('locale'):
|
for lang in loc.get_langs('locale'):
|
||||||
qmname = 'qt_%s.qm' % lang
|
qmname = 'qt_%s.qm' % lang
|
||||||
@@ -212,8 +245,6 @@ def build_updatepot():
|
|||||||
# We want to merge the generated pot with the old pot in the most preserving way possible.
|
# We want to merge the generated pot with the old pot in the most preserving way possible.
|
||||||
ui_packages = ['qt', op.join('cocoa', 'inter')]
|
ui_packages = ['qt', op.join('cocoa', 'inter')]
|
||||||
loc.generate_pot(ui_packages, op.join('locale', 'ui.pot'), ['tr'], merge=(not ISOSX))
|
loc.generate_pot(ui_packages, op.join('locale', 'ui.pot'), ['tr'], merge=(not ISOSX))
|
||||||
print("Building hscommon.pot")
|
|
||||||
loc.generate_pot(['hscommon'], op.join('hscommon', 'locale', 'hscommon.pot'), ['tr'])
|
|
||||||
print("Building qtlib.pot")
|
print("Building qtlib.pot")
|
||||||
loc.generate_pot(['qtlib'], op.join('qtlib', 'locale', 'qtlib.pot'), ['tr'])
|
loc.generate_pot(['qtlib'], op.join('qtlib', 'locale', 'qtlib.pot'), ['tr'])
|
||||||
if ISOSX:
|
if ISOSX:
|
||||||
@@ -222,25 +253,35 @@ def build_updatepot():
|
|||||||
os.remove(cocoalib_pot)
|
os.remove(cocoalib_pot)
|
||||||
loc.strings2pot(op.join('cocoalib', 'en.lproj', 'cocoalib.strings'), cocoalib_pot)
|
loc.strings2pot(op.join('cocoalib', 'en.lproj', 'cocoalib.strings'), cocoalib_pot)
|
||||||
print("Enhancing ui.pot with Cocoa's strings files")
|
print("Enhancing ui.pot with Cocoa's strings files")
|
||||||
loc.strings2pot(op.join('cocoa', 'base', 'en.lproj', 'Localizable.strings'),
|
loc.strings2pot(
|
||||||
op.join('locale', 'ui.pot'))
|
op.join('cocoa', 'base', 'en.lproj', 'Localizable.strings'),
|
||||||
|
op.join('locale', 'ui.pot')
|
||||||
|
)
|
||||||
|
|
||||||
def build_mergepot():
|
def build_mergepot():
|
||||||
print("Updating .po files using .pot files")
|
print("Updating .po files using .pot files")
|
||||||
loc.merge_pots_into_pos('locale')
|
loc.merge_pots_into_pos('locale')
|
||||||
loc.merge_pots_into_pos(op.join('hscommon', 'locale'))
|
|
||||||
loc.merge_pots_into_pos(op.join('qtlib', 'locale'))
|
loc.merge_pots_into_pos(op.join('qtlib', 'locale'))
|
||||||
loc.merge_pots_into_pos(op.join('cocoalib', 'locale'))
|
loc.merge_pots_into_pos(op.join('cocoalib', 'locale'))
|
||||||
|
|
||||||
|
def build_normpo():
|
||||||
|
loc.normalize_all_pos('locale')
|
||||||
|
loc.normalize_all_pos(op.join('qtlib', 'locale'))
|
||||||
|
loc.normalize_all_pos(op.join('cocoalib', 'locale'))
|
||||||
|
|
||||||
def build_cocoa_proxy_module():
|
def build_cocoa_proxy_module():
|
||||||
print("Building Cocoa Proxy")
|
print("Building Cocoa Proxy")
|
||||||
import objp.p2o
|
import objp.p2o
|
||||||
objp.p2o.generate_python_proxy_code('cocoalib/cocoa/CocoaProxy.h', 'build/CocoaProxy.m')
|
objp.p2o.generate_python_proxy_code('cocoalib/cocoa/CocoaProxy.h', 'build/CocoaProxy.m')
|
||||||
build_cocoa_ext("CocoaProxy", 'cocoalib/cocoa',
|
build_cocoa_ext(
|
||||||
['cocoalib/cocoa/CocoaProxy.m', 'build/CocoaProxy.m', 'build/ObjP.m',
|
"CocoaProxy", 'cocoalib/cocoa',
|
||||||
'cocoalib/HSErrorReportWindow.m', 'cocoa/autogen/HSErrorReportWindow_UI.m'],
|
[
|
||||||
|
'cocoalib/cocoa/CocoaProxy.m', 'build/CocoaProxy.m', 'build/ObjP.m',
|
||||||
|
'cocoalib/HSErrorReportWindow.m', 'cocoa/autogen/HSErrorReportWindow_UI.m'
|
||||||
|
],
|
||||||
['AppKit', 'CoreServices'],
|
['AppKit', 'CoreServices'],
|
||||||
['cocoalib', 'cocoa/autogen'])
|
['cocoalib', 'cocoa/autogen']
|
||||||
|
)
|
||||||
|
|
||||||
def build_cocoa_bridging_interfaces(edition):
|
def build_cocoa_bridging_interfaces(edition):
|
||||||
print("Building Cocoa Bridging Interfaces")
|
print("Building Cocoa Bridging Interfaces")
|
||||||
@@ -248,8 +289,11 @@ def build_cocoa_bridging_interfaces(edition):
|
|||||||
import objp.p2o
|
import objp.p2o
|
||||||
add_to_pythonpath('cocoa')
|
add_to_pythonpath('cocoa')
|
||||||
add_to_pythonpath('cocoalib')
|
add_to_pythonpath('cocoalib')
|
||||||
from cocoa.inter import (PyGUIObject, GUIObjectView, PyColumns, ColumnsView, PyOutline,
|
from cocoa.inter import (
|
||||||
OutlineView, PySelectableList, SelectableListView, PyTable, TableView, PyBaseApp, PyFairware)
|
PyGUIObject, GUIObjectView, PyColumns, ColumnsView, PyOutline,
|
||||||
|
OutlineView, PySelectableList, SelectableListView, PyTable, TableView, PyBaseApp,
|
||||||
|
PyTextField, ProgressWindowView, PyProgressWindow
|
||||||
|
)
|
||||||
from inter.deletion_options import PyDeletionOptions, DeletionOptionsView
|
from inter.deletion_options import PyDeletionOptions, DeletionOptionsView
|
||||||
from inter.details_panel import PyDetailsPanel, DetailsPanelView
|
from inter.details_panel import PyDetailsPanel, DetailsPanelView
|
||||||
from inter.directory_outline import PyDirectoryOutline, DirectoryOutlineView
|
from inter.directory_outline import PyDirectoryOutline, DirectoryOutlineView
|
||||||
@@ -261,15 +305,20 @@ def build_cocoa_bridging_interfaces(edition):
|
|||||||
from inter.stats_label import PyStatsLabel, StatsLabelView
|
from inter.stats_label import PyStatsLabel, StatsLabelView
|
||||||
from inter.app import PyDupeGuruBase, DupeGuruView
|
from inter.app import PyDupeGuruBase, DupeGuruView
|
||||||
appmod = importlib.import_module('inter.app_{}'.format(edition))
|
appmod = importlib.import_module('inter.app_{}'.format(edition))
|
||||||
allclasses = [PyGUIObject, PyColumns, PyOutline, PySelectableList, PyTable, PyBaseApp, PyFairware,
|
allclasses = [
|
||||||
|
PyGUIObject, PyColumns, PyOutline, PySelectableList, PyTable, PyBaseApp,
|
||||||
PyDetailsPanel, PyDirectoryOutline, PyPrioritizeDialog, PyPrioritizeList, PyProblemDialog,
|
PyDetailsPanel, PyDirectoryOutline, PyPrioritizeDialog, PyPrioritizeList, PyProblemDialog,
|
||||||
PyIgnoreListDialog, PyDeletionOptions, PyResultTable, PyStatsLabel, PyDupeGuruBase,
|
PyIgnoreListDialog, PyDeletionOptions, PyResultTable, PyStatsLabel, PyDupeGuruBase,
|
||||||
appmod.PyDupeGuru]
|
PyTextField, PyProgressWindow, appmod.PyDupeGuru
|
||||||
|
]
|
||||||
for class_ in allclasses:
|
for class_ in allclasses:
|
||||||
objp.o2p.generate_objc_code(class_, 'cocoa/autogen', inherit=True)
|
objp.o2p.generate_objc_code(class_, 'cocoa/autogen', inherit=True)
|
||||||
allclasses = [GUIObjectView, ColumnsView, OutlineView, SelectableListView, TableView,
|
allclasses = [
|
||||||
|
GUIObjectView, ColumnsView, OutlineView, SelectableListView, TableView,
|
||||||
DetailsPanelView, DirectoryOutlineView, PrioritizeDialogView, PrioritizeListView,
|
DetailsPanelView, DirectoryOutlineView, PrioritizeDialogView, PrioritizeListView,
|
||||||
IgnoreListDialogView, DeletionOptionsView, ResultTableView, StatsLabelView, DupeGuruView]
|
IgnoreListDialogView, DeletionOptionsView, ResultTableView, StatsLabelView,
|
||||||
|
ProgressWindowView, DupeGuruView
|
||||||
|
]
|
||||||
clsspecs = [objp.o2p.spec_from_python_class(class_) for class_ in allclasses]
|
clsspecs = [objp.o2p.spec_from_python_class(class_) for class_ in allclasses]
|
||||||
objp.p2o.generate_python_proxy_code_from_clsspec(clsspecs, 'build/CocoaViews.m')
|
objp.p2o.generate_python_proxy_code_from_clsspec(clsspecs, 'build/CocoaViews.m')
|
||||||
build_cocoa_ext('CocoaViews', 'cocoa/inter', ['build/CocoaViews.m', 'build/ObjP.m'])
|
build_cocoa_ext('CocoaViews', 'cocoa/inter', ['build/CocoaViews.m', 'build/ObjP.m'])
|
||||||
@@ -288,11 +337,12 @@ def build_pe_modules(ui):
|
|||||||
extra_link_args=[
|
extra_link_args=[
|
||||||
"-framework", "CoreFoundation",
|
"-framework", "CoreFoundation",
|
||||||
"-framework", "Foundation",
|
"-framework", "Foundation",
|
||||||
"-framework", "ApplicationServices",]
|
"-framework", "ApplicationServices",
|
||||||
|
]
|
||||||
))
|
))
|
||||||
setup(
|
setup(
|
||||||
script_args = ['build_ext', '--inplace'],
|
script_args=['build_ext', '--inplace'],
|
||||||
ext_modules = exts,
|
ext_modules=exts,
|
||||||
)
|
)
|
||||||
move_all('_block_qt*', op.join('qt', 'pe'))
|
move_all('_block_qt*', op.join('qt', 'pe'))
|
||||||
move_all('_block*', 'core_pe')
|
move_all('_block*', 'core_pe')
|
||||||
@@ -301,7 +351,6 @@ def build_pe_modules(ui):
|
|||||||
def build_normal(edition, ui, dev, conf):
|
def build_normal(edition, ui, dev, conf):
|
||||||
print("Building dupeGuru {0} with UI {1}".format(edition.upper(), ui))
|
print("Building dupeGuru {0} with UI {1}".format(edition.upper(), ui))
|
||||||
add_to_pythonpath('.')
|
add_to_pythonpath('.')
|
||||||
build_help(edition)
|
|
||||||
print("Building dupeGuru")
|
print("Building dupeGuru")
|
||||||
if edition == 'pe':
|
if edition == 'pe':
|
||||||
build_pe_modules(ui)
|
build_pe_modules(ui)
|
||||||
@@ -319,8 +368,9 @@ def main():
|
|||||||
if dev:
|
if dev:
|
||||||
print("Building in Dev mode")
|
print("Building in Dev mode")
|
||||||
if options.clean:
|
if options.clean:
|
||||||
if op.exists('build'):
|
for path in ['build', op.join('cocoa', 'build'), op.join('cocoa', 'autogen')]:
|
||||||
shutil.rmtree('build')
|
if op.exists(path):
|
||||||
|
shutil.rmtree(path)
|
||||||
if not op.exists('build'):
|
if not op.exists('build'):
|
||||||
os.mkdir('build')
|
os.mkdir('build')
|
||||||
if options.doc:
|
if options.doc:
|
||||||
@@ -331,6 +381,8 @@ def main():
|
|||||||
build_updatepot()
|
build_updatepot()
|
||||||
elif options.mergepot:
|
elif options.mergepot:
|
||||||
build_mergepot()
|
build_mergepot()
|
||||||
|
elif options.normpo:
|
||||||
|
build_normpo()
|
||||||
elif options.cocoa_ext:
|
elif options.cocoa_ext:
|
||||||
build_cocoa_proxy_module()
|
build_cocoa_proxy_module()
|
||||||
build_cocoa_bridging_interfaces(edition)
|
build_cocoa_bridging_interfaces(edition)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
@@ -13,8 +13,9 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
#import "DetailsPanel.h"
|
#import "DetailsPanel.h"
|
||||||
#import "DirectoryPanel.h"
|
#import "DirectoryPanel.h"
|
||||||
#import "IgnoreListDialog.h"
|
#import "IgnoreListDialog.h"
|
||||||
#import "HSFairwareAboutBox.h"
|
#import "HSAboutBox.h"
|
||||||
#import "HSRecentFiles.h"
|
#import "HSRecentFiles.h"
|
||||||
|
#import "HSProgressWindow.h"
|
||||||
|
|
||||||
@interface AppDelegateBase : NSObject
|
@interface AppDelegateBase : NSObject
|
||||||
{
|
{
|
||||||
@@ -27,8 +28,9 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
DirectoryPanel *_directoryPanel;
|
DirectoryPanel *_directoryPanel;
|
||||||
DetailsPanel *_detailsPanel;
|
DetailsPanel *_detailsPanel;
|
||||||
IgnoreListDialog *_ignoreListDialog;
|
IgnoreListDialog *_ignoreListDialog;
|
||||||
|
HSProgressWindow *_progressWindow;
|
||||||
NSWindowController *_preferencesPanel;
|
NSWindowController *_preferencesPanel;
|
||||||
HSFairwareAboutBox *_aboutBox;
|
HSAboutBox *_aboutBox;
|
||||||
HSRecentFiles *_recentResults;
|
HSRecentFiles *_recentResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +73,4 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
|
|
||||||
/* model --> view */
|
/* model --> view */
|
||||||
- (void)showMessage:(NSString *)msg;
|
- (void)showMessage:(NSString *)msg;
|
||||||
- (void)setupAsRegistered;
|
|
||||||
- (void)showDemoNagWithPrompt:(NSString *)prompt;
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "AppDelegateBase.h"
|
#import "AppDelegateBase.h"
|
||||||
#import "ProgressController.h"
|
#import "ProgressController.h"
|
||||||
#import "HSFairwareReminder.h"
|
|
||||||
#import "HSPyUtil.h"
|
#import "HSPyUtil.h"
|
||||||
#import "Consts.h"
|
#import "Consts.h"
|
||||||
#import "Dialogs.h"
|
#import "Dialogs.h"
|
||||||
@@ -74,6 +73,8 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
_directoryPanel = [self createDirectoryPanel];
|
_directoryPanel = [self createDirectoryPanel];
|
||||||
_detailsPanel = [self createDetailsPanel];
|
_detailsPanel = [self createDetailsPanel];
|
||||||
_ignoreListDialog = [[IgnoreListDialog alloc] initWithPyRef:[model ignoreListDialog]];
|
_ignoreListDialog = [[IgnoreListDialog alloc] initWithPyRef:[model ignoreListDialog]];
|
||||||
|
_progressWindow = [[HSProgressWindow alloc] initWithPyRef:[[self model] progressWindow] view:nil];
|
||||||
|
[_progressWindow setParentWindow:[_resultWindow window]];
|
||||||
_aboutBox = nil; // Lazily loaded
|
_aboutBox = nil; // Lazily loaded
|
||||||
_preferencesPanel = nil; // Lazily loaded
|
_preferencesPanel = nil; // Lazily loaded
|
||||||
[[[self directoryPanel] window] makeKeyAndOrderFront:self];
|
[[[self directoryPanel] window] makeKeyAndOrderFront:self];
|
||||||
@@ -138,7 +139,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[op setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
|
[op setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
|
||||||
[op setTitle:NSLocalizedString(@"Select a results file to load", @"")];
|
[op setTitle:NSLocalizedString(@"Select a results file to load", @"")];
|
||||||
if ([op runModal] == NSOKButton) {
|
if ([op runModal] == NSOKButton) {
|
||||||
NSString *filename = [[op filenames] objectAtIndex:0];
|
NSString *filename = [[[op URLs] objectAtIndex:0] path];
|
||||||
[model loadResultsFrom:filename];
|
[model loadResultsFrom:filename];
|
||||||
[[self recentResults] addFile:filename];
|
[[self recentResults] addFile:filename];
|
||||||
}
|
}
|
||||||
@@ -160,7 +161,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
- (void)showAboutBox
|
- (void)showAboutBox
|
||||||
{
|
{
|
||||||
if (_aboutBox == nil) {
|
if (_aboutBox == nil) {
|
||||||
_aboutBox = [[HSFairwareAboutBox alloc] initWithApp:model];
|
_aboutBox = [[HSAboutBox alloc] initWithApp:model];
|
||||||
}
|
}
|
||||||
[[_aboutBox window] makeKeyAndOrderFront:nil];
|
[[_aboutBox window] makeKeyAndOrderFront:nil];
|
||||||
}
|
}
|
||||||
@@ -197,8 +198,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
/* Delegate */
|
/* Delegate */
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
[[ProgressController mainProgressController] setWorker:model];
|
|
||||||
[model initialRegistrationSetup];
|
|
||||||
[model loadSession];
|
[model loadSession];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,16 +259,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[[self resultWindow] showProblemDialog];
|
[[self resultWindow] showProblemDialog];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setupAsRegistered
|
|
||||||
{
|
|
||||||
// Nothing to do.
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)showDemoNagWithPrompt:(NSString *)prompt
|
|
||||||
{
|
|
||||||
[HSFairwareReminder showDemoNagWithApp:[self model] prompt:prompt];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)selectDestFolderWithPrompt:(NSString *)prompt
|
- (NSString *)selectDestFolderWithPrompt:(NSString *)prompt
|
||||||
{
|
{
|
||||||
NSOpenPanel *op = [NSOpenPanel openPanel];
|
NSOpenPanel *op = [NSOpenPanel openPanel];
|
||||||
@@ -279,7 +268,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[op setAllowsMultipleSelection:NO];
|
[op setAllowsMultipleSelection:NO];
|
||||||
[op setTitle:prompt];
|
[op setTitle:prompt];
|
||||||
if ([op runModal] == NSOKButton) {
|
if ([op runModal] == NSOKButton) {
|
||||||
return [[op filenames] objectAtIndex:0];
|
return [[[op URLs] objectAtIndex:0] path];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return nil;
|
return nil;
|
||||||
@@ -293,7 +282,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[sp setAllowedFileTypes:[NSArray arrayWithObject:extension]];
|
[sp setAllowedFileTypes:[NSArray arrayWithObject:extension]];
|
||||||
[sp setTitle:prompt];
|
[sp setTitle:prompt];
|
||||||
if ([sp runModal] == NSOKButton) {
|
if ([sp runModal] == NSOKButton) {
|
||||||
return [sp filename];
|
return [[sp URL] path];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return nil;
|
return nil;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JobStarted @"JobStarted"
|
#define JobStarted @"JobStarted"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "DeletionOptions.h"
|
#import "DeletionOptions.h"
|
||||||
@@ -64,4 +64,9 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[[self window] close];
|
[[self window] close];
|
||||||
return r == NSOKButton;
|
return r == NSOKButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setHardlinkOptionEnabled:(BOOL)enabled
|
||||||
|
{
|
||||||
|
[linkTypeRadio setEnabled:enabled];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "DetailsPanelBase.h"
|
#import "DetailsPanelBase.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
@@ -16,4 +16,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
@interface DirectoryOutline : HSOutline {}
|
@interface DirectoryOutline : HSOutline {}
|
||||||
- (id)initWithPyRef:(PyObject *)aPyRef outlineView:(HSOutlineView *)aOutlineView;
|
- (id)initWithPyRef:(PyObject *)aPyRef outlineView:(HSOutlineView *)aOutlineView;
|
||||||
- (PyDirectoryOutline *)model;
|
- (PyDirectoryOutline *)model;
|
||||||
|
|
||||||
|
- (void)selectAll;
|
||||||
@end;
|
@end;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "DirectoryOutline.h"
|
#import "DirectoryOutline.h"
|
||||||
@@ -22,6 +22,12 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
return (PyDirectoryOutline *)model;
|
return (PyDirectoryOutline *)model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Public */
|
||||||
|
- (void)selectAll
|
||||||
|
{
|
||||||
|
[[self model] selectAll];
|
||||||
|
}
|
||||||
|
|
||||||
/* Delegate */
|
/* Delegate */
|
||||||
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id < NSDraggingInfo >)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
|
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id < NSDraggingInfo >)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
@@ -46,4 +46,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
|
|
||||||
- (void)addDirectory:(NSString *)directory;
|
- (void)addDirectory:(NSString *)directory;
|
||||||
- (void)refreshRemoveButtonText;
|
- (void)refreshRemoveButtonText;
|
||||||
|
- (void)markAll;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "DirectoryPanel.h"
|
#import "DirectoryPanel.h"
|
||||||
@@ -91,8 +91,8 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[op setTitle:NSLocalizedString(@"Select a folder to add to the scanning list", @"")];
|
[op setTitle:NSLocalizedString(@"Select a folder to add to the scanning list", @"")];
|
||||||
[op setDelegate:self];
|
[op setDelegate:self];
|
||||||
if ([op runModal] == NSOKButton) {
|
if ([op runModal] == NSOKButton) {
|
||||||
for (NSString *directory in [op filenames]) {
|
for (NSURL *directoryURL in [op URLs]) {
|
||||||
[self addDirectory:directory];
|
[self addDirectory:[directoryURL path]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,6 +158,14 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)markAll
|
||||||
|
{
|
||||||
|
/* markAll isn't very descriptive of what we do, but since we re-use the Mark All button from
|
||||||
|
the result window, we don't have much choice.
|
||||||
|
*/
|
||||||
|
[outline selectAll];
|
||||||
|
}
|
||||||
|
|
||||||
/* Delegate */
|
/* Delegate */
|
||||||
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)path
|
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)path
|
||||||
{
|
{
|
||||||
@@ -171,6 +179,14 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[self addDirectory:path];
|
[self addDirectory:path];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
||||||
|
{
|
||||||
|
if ([item action] == @selector(markAll)) {
|
||||||
|
[item setTitle:NSLocalizedString(@"Select All", @"")];
|
||||||
|
}
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
/* Notifications */
|
/* Notifications */
|
||||||
|
|
||||||
- (void)directorySelectionChanged:(NSNotification *)aNotification
|
- (void)directorySelectionChanged:(NSNotification *)aNotification
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "IgnoreListDialog.h"
|
#import "IgnoreListDialog.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "PrioritizeDialog.h"
|
#import "PrioritizeDialog.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "PrioritizeList.h"
|
#import "PrioritizeList.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ProblemDialog.h"
|
#import "ProblemDialog.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
@@ -13,7 +13,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
|
|
||||||
@interface ResultTable : HSTable <QLPreviewPanelDataSource, QLPreviewPanelDelegate>
|
@interface ResultTable : HSTable <QLPreviewPanelDataSource, QLPreviewPanelDelegate>
|
||||||
{
|
{
|
||||||
NSSet *_deltaColumns;
|
|
||||||
}
|
}
|
||||||
- (id)initWithPyRef:(PyObject *)aPyRef view:(NSTableView *)aTableView;
|
- (id)initWithPyRef:(PyObject *)aPyRef view:(NSTableView *)aTableView;
|
||||||
- (PyResultTable *)model;
|
- (PyResultTable *)model;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ResultTable.h"
|
#import "ResultTable.h"
|
||||||
@@ -20,16 +20,9 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
- (id)initWithPyRef:(PyObject *)aPyRef view:(NSTableView *)aTableView
|
- (id)initWithPyRef:(PyObject *)aPyRef view:(NSTableView *)aTableView
|
||||||
{
|
{
|
||||||
self = [super initWithPyRef:aPyRef wrapperClass:[PyResultTable class] callbackClassName:@"ResultTableView" view:aTableView];
|
self = [super initWithPyRef:aPyRef wrapperClass:[PyResultTable class] callbackClassName:@"ResultTableView" view:aTableView];
|
||||||
_deltaColumns = [[NSSet setWithArray:[[self model] deltaColumns]] retain];
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
|
||||||
{
|
|
||||||
[_deltaColumns release];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (PyResultTable *)model
|
- (PyResultTable *)model
|
||||||
{
|
{
|
||||||
return (PyResultTable *)model;
|
return (PyResultTable *)model;
|
||||||
@@ -132,10 +125,8 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
color = [NSColor selectedTextColor];
|
color = [NSColor selectedTextColor];
|
||||||
}
|
}
|
||||||
else if (isMarkable) {
|
else if (isMarkable) {
|
||||||
if ([self deltaValuesMode]) {
|
if ([[self model] isDeltaAtRow:row column:[column identifier]]) {
|
||||||
if ([_deltaColumns containsObject:[column identifier]]) {
|
color = [NSColor orangeColor];
|
||||||
color = [NSColor orangeColor];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ResultWindowBase.h"
|
#import "ResultWindowBase.h"
|
||||||
@@ -42,9 +42,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[matches setTarget:self];
|
[matches setTarget:self];
|
||||||
[matches setDoubleAction:@selector(openClicked)];
|
[matches setDoubleAction:@selector(openClicked)];
|
||||||
[self adjustUIToLocalization];
|
[self adjustUIToLocalization];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobStarted:) name:JobStarted object:nil];
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobInProgress:) name:JobInProgress object:nil];
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,8 +258,8 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
[sp setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
|
[sp setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
|
||||||
[sp setTitle:NSLocalizedString(@"Select a file to save your results to", @"")];
|
[sp setTitle:NSLocalizedString(@"Select a file to save your results to", @"")];
|
||||||
if ([sp runModal] == NSOKButton) {
|
if ([sp runModal] == NSOKButton) {
|
||||||
[model saveResultsAs:[sp filename]];
|
[model saveResultsAs:[[sp URL] path]];
|
||||||
[[app recentResults] addFile:[sp filename]];
|
[[app recentResults] addFile:[[sp URL] path]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,22 +337,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
previewPanel = nil;
|
previewPanel = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)jobInProgress:(NSNotification *)aNotification
|
|
||||||
{
|
|
||||||
[Dialogs showMessage:NSLocalizedString(@"A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again.", @"")];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)jobStarted:(NSNotification *)aNotification
|
|
||||||
{
|
|
||||||
[[self window] makeKeyAndOrderFront:nil];
|
|
||||||
NSDictionary *ui = [aNotification userInfo];
|
|
||||||
NSString *desc = [ui valueForKey:@"desc"];
|
|
||||||
[[ProgressController mainProgressController] setJobDesc:desc];
|
|
||||||
NSString *jobid = [ui valueForKey:@"jobid"];
|
|
||||||
[[ProgressController mainProgressController] setJobId:jobid];
|
|
||||||
[[ProgressController mainProgressController] showSheetForParent:[self window]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem
|
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem
|
||||||
{
|
{
|
||||||
return ![[ProgressController mainProgressController] isShown];
|
return ![[ProgressController mainProgressController] isShown];
|
||||||
@@ -363,6 +344,9 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
|
|
||||||
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
||||||
{
|
{
|
||||||
|
if ([item action] == @selector(markAll)) {
|
||||||
|
[item setTitle:NSLocalizedString(@"Mark All", @"")];
|
||||||
|
}
|
||||||
return ![[ProgressController mainProgressController] isShown];
|
return ![[ProgressController mainProgressController] isShown];
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "StatsLabel.h"
|
#import "StatsLabel.h"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
"%@ Results" = "%@ Results";
|
"%@ Results" = "%@ Results";
|
||||||
"A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again." = "A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again.";
|
|
||||||
"About dupeGuru" = "About dupeGuru";
|
"About dupeGuru" = "About dupeGuru";
|
||||||
"Action" = "Action";
|
"Action" = "Action";
|
||||||
"Actions" = "Actions";
|
"Actions" = "Actions";
|
||||||
@@ -127,6 +126,7 @@
|
|||||||
"Select a file to save your results to" = "Select a file to save your results to";
|
"Select a file to save your results to" = "Select a file to save your results to";
|
||||||
"Select a folder to add to the scanning list" = "Select a folder to add to the scanning list";
|
"Select a folder to add to the scanning list" = "Select a folder to add to the scanning list";
|
||||||
"Select a results file to load" = "Select a results file to load";
|
"Select a results file to load" = "Select a results file to load";
|
||||||
|
"Select All" = "Select All";
|
||||||
"Select folders to scan and press \"Scan\"." = "Select folders to scan and press \"Scan\".";
|
"Select folders to scan and press \"Scan\"." = "Select folders to scan and press \"Scan\".";
|
||||||
"Selected" = "Selected";
|
"Selected" = "Selected";
|
||||||
"Send Marked to Trash..." = "Send Marked to Trash...";
|
"Send Marked to Trash..." = "Send Marked to Trash...";
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ result = Window(610, 400, "Re-Prioritize duplicates")
|
|||||||
promptLabel = Label(result, "Add criteria to the right box and click OK to send the dupes that "
|
promptLabel = Label(result, "Add criteria to the right box and click OK to send the dupes that "
|
||||||
"correspond the best to these criteria to their respective group's reference position. Read "
|
"correspond the best to these criteria to their respective group's reference position. Read "
|
||||||
"the help file for more information.")
|
"the help file for more information.")
|
||||||
categoryPopup = Popup(result)
|
split = SplitView(result, 2, vertical=True)
|
||||||
criteriaTable = ListView(result)
|
categoryPopup = Popup(split.subviews[0])
|
||||||
prioritizationTable = ListView(result)
|
criteriaTable = ListView(split.subviews[0])
|
||||||
addButton = Button(result, NLSTR("-->"))
|
prioritizationTable = ListView(split.subviews[1])
|
||||||
removeButton = Button(result, NLSTR("<--"))
|
addButton = Button(split.subviews[1], NLSTR("-->"))
|
||||||
|
removeButton = Button(split.subviews[1], NLSTR("<--"))
|
||||||
okButton = Button(result, "Ok")
|
okButton = Button(result, "Ok")
|
||||||
cancelButton = Button(result, "Cancel")
|
cancelButton = Button(result, "Cancel")
|
||||||
|
|
||||||
@@ -27,24 +28,38 @@ cancelButton.action = Action(owner, 'cancel')
|
|||||||
okButton.keyEquivalent = '\\r'
|
okButton.keyEquivalent = '\\r'
|
||||||
cancelButton.keyEquivalent = '\\e'
|
cancelButton.keyEquivalent = '\\e'
|
||||||
|
|
||||||
|
# For layouts to correctly work, subviews need to have the dimensions they'll approximately have
|
||||||
|
# at runtime.
|
||||||
|
split.subviews[0].width = 260
|
||||||
|
split.subviews[0].height = 260
|
||||||
|
split.subviews[1].width = 340
|
||||||
|
split.subviews[1].height = 260
|
||||||
promptLabel.height *= 3 # 3 lines
|
promptLabel.height *= 3 # 3 lines
|
||||||
|
|
||||||
leftLayout = VLayout([categoryPopup, criteriaTable], width=262, filler=criteriaTable)
|
leftLayout = VLayout([categoryPopup, criteriaTable], filler=criteriaTable)
|
||||||
middleLayout = VLayout([addButton, removeButton], width=41)
|
middleLayout = VLayout([addButton, removeButton], width=41)
|
||||||
buttonLayout = HLayout([None, cancelButton, okButton])
|
buttonLayout = HLayout([None, cancelButton, okButton])
|
||||||
|
|
||||||
|
#pack split subview 0
|
||||||
|
leftLayout.fillAll()
|
||||||
|
|
||||||
|
#pack split subview 1
|
||||||
|
prioritizationTable.fillAll()
|
||||||
|
prioritizationTable.width -= 48
|
||||||
|
prioritizationTable.moveTo(Pack.Right)
|
||||||
|
middleLayout.moveNextTo(prioritizationTable, Pack.Left, align=Pack.Middle)
|
||||||
|
|
||||||
|
# Main layout
|
||||||
promptLabel.packToCorner(Pack.UpperLeft)
|
promptLabel.packToCorner(Pack.UpperLeft)
|
||||||
promptLabel.fill(Pack.Right)
|
promptLabel.fill(Pack.Right)
|
||||||
leftLayout.packRelativeTo(promptLabel, Pack.Below)
|
split.moveNextTo(promptLabel, Pack.Below)
|
||||||
middleLayout.packRelativeTo(leftLayout, Pack.Right, align=Pack.Above)
|
buttonLayout.moveNextTo(split, Pack.Below)
|
||||||
prioritizationTable.packRelativeTo(middleLayout, Pack.Right, align=Pack.Above)
|
|
||||||
buttonLayout.packRelativeTo(leftLayout, Pack.Below)
|
|
||||||
buttonLayout.fill(Pack.Right)
|
buttonLayout.fill(Pack.Right)
|
||||||
leftLayout.fill(Pack.Below)
|
split.fill(Pack.LowerRight)
|
||||||
middleLayout.packRelativeTo(leftLayout, Pack.Right, align=Pack.Middle)
|
|
||||||
prioritizationTable.fill(Pack.Below, goal=leftLayout.y)
|
|
||||||
prioritizationTable.fill(Pack.Right)
|
|
||||||
|
|
||||||
promptLabel.setAnchor(Pack.UpperLeft, growX=True)
|
promptLabel.setAnchor(Pack.UpperLeft, growX=True)
|
||||||
prioritizationTable.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
prioritizationTable.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
||||||
|
categoryPopup.setAnchor(Pack.UpperLeft, growX=True)
|
||||||
|
criteriaTable.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
||||||
|
split.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
||||||
buttonLayout.setAnchor(Pack.Below)
|
buttonLayout.setAnchor(Pack.Below)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from cocoa.inter import PyTextField, PyProgressWindow
|
||||||
from .deletion_options import PyDeletionOptions
|
from .deletion_options import PyDeletionOptions
|
||||||
from .details_panel import PyDetailsPanel
|
from .details_panel import PyDetailsPanel
|
||||||
from .directory_outline import PyDirectoryOutline
|
from .directory_outline import PyDirectoryOutline
|
||||||
|
|||||||
@@ -1,41 +1,23 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from objp.util import pyref, dontwrap
|
from objp.util import pyref, dontwrap
|
||||||
from jobprogress import job
|
from cocoa import install_exception_hook, install_cocoa_logger, patch_threaded_job_performer
|
||||||
import cocoa
|
from cocoa.inter import PyBaseApp, BaseAppView
|
||||||
from cocoa import install_exception_hook, install_cocoa_logger, proxy
|
|
||||||
from cocoa.inter import PyFairware, FairwareView
|
|
||||||
from hscommon.trans import trget
|
|
||||||
|
|
||||||
from core.app import JobType
|
class DupeGuruView(BaseAppView):
|
||||||
|
|
||||||
tr = trget('ui')
|
|
||||||
|
|
||||||
JOBID2TITLE = {
|
|
||||||
JobType.Scan: tr("Scanning for duplicates"),
|
|
||||||
JobType.Load: tr("Loading"),
|
|
||||||
JobType.Move: tr("Moving"),
|
|
||||||
JobType.Copy: tr("Copying"),
|
|
||||||
JobType.Delete: tr("Sending to Trash"),
|
|
||||||
}
|
|
||||||
|
|
||||||
class DupeGuruView(FairwareView):
|
|
||||||
def askYesNoWithPrompt_(self, prompt: str) -> bool: pass
|
def askYesNoWithPrompt_(self, prompt: str) -> bool: pass
|
||||||
def showProblemDialog(self): pass
|
def showProblemDialog(self): pass
|
||||||
def selectDestFolderWithPrompt_(self, prompt: str) -> str: pass
|
def selectDestFolderWithPrompt_(self, prompt: str) -> str: pass
|
||||||
def selectDestFileWithPrompt_extension_(self, prompt: str, extension: str) -> str: pass
|
def selectDestFileWithPrompt_extension_(self, prompt: str, extension: str) -> str: pass
|
||||||
|
|
||||||
class PyDupeGuruBase(PyFairware):
|
class PyDupeGuruBase(PyBaseApp):
|
||||||
FOLLOW_PROTOCOLS = ['Worker']
|
|
||||||
|
|
||||||
@dontwrap
|
@dontwrap
|
||||||
def _init(self, modelclass):
|
def _init(self, modelclass):
|
||||||
logging.basicConfig(level=logging.WARNING, format='%(levelname)s %(message)s')
|
logging.basicConfig(level=logging.WARNING, format='%(levelname)s %(message)s')
|
||||||
install_exception_hook()
|
install_exception_hook('https://github.com/hsoft/dupeguru/issues')
|
||||||
install_cocoa_logger()
|
install_cocoa_logger()
|
||||||
appdata = proxy.getAppdataPath()
|
patch_threaded_job_performer()
|
||||||
self.model = modelclass(self, appdata)
|
self.model = modelclass(self)
|
||||||
self.progress = cocoa.ThreadedJobPerformer()
|
|
||||||
|
|
||||||
#---Sub-proxies
|
#---Sub-proxies
|
||||||
def detailsPanel(self) -> pyref:
|
def detailsPanel(self) -> pyref:
|
||||||
@@ -56,6 +38,9 @@ class PyDupeGuruBase(PyFairware):
|
|||||||
def ignoreListDialog(self) -> pyref:
|
def ignoreListDialog(self) -> pyref:
|
||||||
return self.model.ignore_list_dialog
|
return self.model.ignore_list_dialog
|
||||||
|
|
||||||
|
def progressWindow(self) -> pyref:
|
||||||
|
return self.model.progress_window
|
||||||
|
|
||||||
def deletionOptions(self) -> pyref:
|
def deletionOptions(self) -> pyref:
|
||||||
return self.model.deletion_options
|
return self.model.deletion_options
|
||||||
|
|
||||||
@@ -157,52 +142,7 @@ class PyDupeGuruBase(PyFairware):
|
|||||||
def setCopyMoveDestType_(self, copymove_dest_type: int):
|
def setCopyMoveDestType_(self, copymove_dest_type: int):
|
||||||
self.model.options['copymove_dest_type'] = copymove_dest_type
|
self.model.options['copymove_dest_type'] = copymove_dest_type
|
||||||
|
|
||||||
#---Worker
|
|
||||||
def getJobProgress(self) -> object: # NSNumber
|
|
||||||
try:
|
|
||||||
return self.progress.last_progress
|
|
||||||
except AttributeError:
|
|
||||||
# I have *no idea* why this can possible happen (last_progress is always set by
|
|
||||||
# create_job() *before* any threaded job notification, which shows the progress panel,
|
|
||||||
# is sent), but it happens anyway, so there we go. ref: #106
|
|
||||||
return -1
|
|
||||||
|
|
||||||
def getJobDesc(self) -> str:
|
|
||||||
try:
|
|
||||||
return self.progress.last_desc
|
|
||||||
except AttributeError:
|
|
||||||
# see getJobProgress
|
|
||||||
return ''
|
|
||||||
|
|
||||||
def cancelJob(self):
|
|
||||||
self.progress.job_cancelled = True
|
|
||||||
|
|
||||||
def jobCompleted_(self, jobid: str):
|
|
||||||
result = self.model._job_completed(jobid, self.progress.last_error)
|
|
||||||
if not result:
|
|
||||||
self.progress.reraise_if_error()
|
|
||||||
|
|
||||||
#--- model --> view
|
#--- model --> view
|
||||||
@dontwrap
|
|
||||||
def open_path(self, path):
|
|
||||||
proxy.openPath_(str(path))
|
|
||||||
|
|
||||||
@dontwrap
|
|
||||||
def reveal_path(self, path):
|
|
||||||
proxy.revealPath_(str(path))
|
|
||||||
|
|
||||||
@dontwrap
|
|
||||||
def start_job(self, jobid, func, args=()):
|
|
||||||
try:
|
|
||||||
j = self.progress.create_job()
|
|
||||||
args = tuple([j] + list(args))
|
|
||||||
self.progress.run_threaded(func, args=args)
|
|
||||||
except job.JobInProgressError:
|
|
||||||
proxy.postNotification_userInfo_('JobInProgress', None)
|
|
||||||
else:
|
|
||||||
ud = {'desc': JOBID2TITLE[jobid], 'jobid':jobid}
|
|
||||||
proxy.postNotification_userInfo_('JobStarted', ud)
|
|
||||||
|
|
||||||
@dontwrap
|
@dontwrap
|
||||||
def ask_yes_no(self, prompt):
|
def ask_yes_no(self, prompt):
|
||||||
return self.callback.askYesNoWithPrompt_(prompt)
|
return self.callback.askYesNoWithPrompt_(prompt)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# Created By: Virgil Dupras
|
# Created By: Virgil Dupras
|
||||||
# Created On: 2006/11/16
|
# Created On: 2006/11/16
|
||||||
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
#
|
#
|
||||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import plistlib
|
import plistlib
|
||||||
@@ -19,11 +19,11 @@ from hscommon.path import Path
|
|||||||
from hscommon.util import remove_invalid_xml
|
from hscommon.util import remove_invalid_xml
|
||||||
|
|
||||||
from core import directories
|
from core import directories
|
||||||
from core.app import JobType
|
from core.app import JobType, JOBID2TITLE
|
||||||
from core.scanner import ScanType
|
from core.scanner import ScanType
|
||||||
from core_me.app import DupeGuru as DupeGuruBase
|
from core_me.app import DupeGuru as DupeGuruBase
|
||||||
from core_me import fs
|
from core_me import fs
|
||||||
from .app import JOBID2TITLE, PyDupeGuruBase
|
from .app import PyDupeGuruBase
|
||||||
|
|
||||||
tr = trget('ui')
|
tr = trget('ui')
|
||||||
|
|
||||||
@@ -143,16 +143,13 @@ class Directories(directories.Directories):
|
|||||||
|
|
||||||
|
|
||||||
class DupeGuruME(DupeGuruBase):
|
class DupeGuruME(DupeGuruBase):
|
||||||
def __init__(self, view, appdata):
|
def __init__(self, view):
|
||||||
appdata = op.join(appdata, 'dupeGuru Music Edition')
|
DupeGuruBase.__init__(self, view)
|
||||||
DupeGuruBase.__init__(self, view, appdata)
|
|
||||||
# Use fileclasses set in DupeGuruBase.__init__()
|
# Use fileclasses set in DupeGuruBase.__init__()
|
||||||
self.directories = Directories(fileclasses=self.directories.fileclasses)
|
self.directories = Directories(fileclasses=self.directories.fileclasses)
|
||||||
self.dead_tracks = []
|
self.dead_tracks = []
|
||||||
|
|
||||||
def _do_delete(self, j, *args):
|
def _do_delete(self, j, *args):
|
||||||
# XXX If I read correctly, Python 3.3 will allow us to go fetch inner function easily, so
|
|
||||||
# we'll be able to replace "op" below with DupeGuruBase._do_delete.op.
|
|
||||||
def op(dupe):
|
def op(dupe):
|
||||||
j.add_progress()
|
j.add_progress()
|
||||||
return self._do_delete_dupe(dupe, *args)
|
return self._do_delete_dupe(dupe, *args)
|
||||||
@@ -174,7 +171,7 @@ class DupeGuruME(DupeGuruBase):
|
|||||||
DupeGuruBase._do_delete_dupe(self, dupe, *args)
|
DupeGuruBase._do_delete_dupe(self, dupe, *args)
|
||||||
|
|
||||||
def _create_file(self, path):
|
def _create_file(self, path):
|
||||||
if (self.directories.itunes_libpath is not None) and (path in self.directories.itunes_libpath[:-1]):
|
if (self.directories.itunes_libpath is not None) and (path in self.directories.itunes_libpath.parent()):
|
||||||
if not hasattr(self, 'itunes_songs'):
|
if not hasattr(self, 'itunes_songs'):
|
||||||
songs = get_itunes_songs(self.directories.itunes_libpath)
|
songs = get_itunes_songs(self.directories.itunes_libpath)
|
||||||
self.itunes_songs = {song.path: song for song in songs}
|
self.itunes_songs = {song.path: song for song in songs}
|
||||||
@@ -184,11 +181,14 @@ class DupeGuruME(DupeGuruBase):
|
|||||||
pass # We'll return the default file type, as per the last line of this method
|
pass # We'll return the default file type, as per the last line of this method
|
||||||
return DupeGuruBase._create_file(self, path)
|
return DupeGuruBase._create_file(self, path)
|
||||||
|
|
||||||
def _job_completed(self, jobid, exc):
|
def _job_completed(self, jobid):
|
||||||
if (jobid in {JobType.RemoveDeadTracks, JobType.ScanDeadTracks}) and (exc is not None):
|
# XXX Just before release, I'm realizing that this piece of code below is why I was passing
|
||||||
msg = tr("There were communication problems with iTunes. The operation couldn't be completed.")
|
# job exception as an argument to _job_completed(). I have to comment it for now. It's not
|
||||||
self.view.show_message(msg)
|
# the end of the world, but I should find an elegant solution to this at some point.
|
||||||
return True
|
# if (jobid in {JobType.RemoveDeadTracks, JobType.ScanDeadTracks}) and (exc is not None):
|
||||||
|
# msg = tr("There were communication problems with iTunes. The operation couldn't be completed.")
|
||||||
|
# self.view.show_message(msg)
|
||||||
|
# return True
|
||||||
if jobid == JobType.ScanDeadTracks:
|
if jobid == JobType.ScanDeadTracks:
|
||||||
dead_tracks_count = len(self.dead_tracks)
|
dead_tracks_count = len(self.dead_tracks)
|
||||||
if dead_tracks_count > 0:
|
if dead_tracks_count > 0:
|
||||||
@@ -202,7 +202,7 @@ class DupeGuruME(DupeGuruBase):
|
|||||||
if hasattr(self, 'itunes_songs'):
|
if hasattr(self, 'itunes_songs'):
|
||||||
# If we load another file, we want a refresh song list
|
# If we load another file, we want a refresh song list
|
||||||
del self.itunes_songs
|
del self.itunes_songs
|
||||||
DupeGuruBase._job_completed(self, jobid, exc)
|
DupeGuruBase._job_completed(self, jobid)
|
||||||
|
|
||||||
def copy_or_move(self, dupe, copy, destination, dest_type):
|
def copy_or_move(self, dupe, copy, destination, dest_type):
|
||||||
if isinstance(dupe, ITunesSong):
|
if isinstance(dupe, ITunesSong):
|
||||||
@@ -230,7 +230,7 @@ class DupeGuruME(DupeGuruBase):
|
|||||||
except CommandError as e:
|
except CommandError as e:
|
||||||
logging.warning('Error while trying to remove a track from iTunes: %s' % str(e))
|
logging.warning('Error while trying to remove a track from iTunes: %s' % str(e))
|
||||||
|
|
||||||
self.view.start_job(JobType.RemoveDeadTracks, do)
|
self._start_job(JobType.RemoveDeadTracks, do)
|
||||||
|
|
||||||
def scan_dead_tracks(self):
|
def scan_dead_tracks(self):
|
||||||
def do(j):
|
def do(j):
|
||||||
@@ -248,7 +248,7 @@ class DupeGuruME(DupeGuruBase):
|
|||||||
self.dead_tracks.append(track)
|
self.dead_tracks.append(track)
|
||||||
logging.info('Found %d dead tracks' % len(self.dead_tracks))
|
logging.info('Found %d dead tracks' % len(self.dead_tracks))
|
||||||
|
|
||||||
self.view.start_job(JobType.ScanDeadTracks, do)
|
self._start_job(JobType.ScanDeadTracks, do)
|
||||||
|
|
||||||
class PyDupeGuru(PyDupeGuruBase):
|
class PyDupeGuru(PyDupeGuruBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
@@ -1,21 +1,19 @@
|
|||||||
# Created By: Virgil Dupras
|
# Created By: Virgil Dupras
|
||||||
# Created On: 2006/11/13
|
# Created On: 2006/11/13
|
||||||
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
#
|
#
|
||||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
import os.path as op
|
|
||||||
import plistlib
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
import io
|
||||||
|
|
||||||
from appscript import app, its, k, CommandError, ApplicationNotFoundError
|
from appscript import app, its, k, CommandError, ApplicationNotFoundError
|
||||||
|
|
||||||
from hscommon import io
|
|
||||||
from hscommon.util import remove_invalid_xml, first
|
from hscommon.util import remove_invalid_xml, first
|
||||||
from hscommon.path import Path
|
from hscommon.path import Path, pathify
|
||||||
from hscommon.trans import trget
|
from hscommon.trans import trget
|
||||||
from cocoa import proxy
|
from cocoa import proxy
|
||||||
|
|
||||||
@@ -25,6 +23,7 @@ from core.app import JobType
|
|||||||
from core_pe import _block_osx
|
from core_pe import _block_osx
|
||||||
from core_pe.photo import Photo as PhotoBase
|
from core_pe.photo import Photo as PhotoBase
|
||||||
from core_pe.app import DupeGuru as DupeGuruBase
|
from core_pe.app import DupeGuru as DupeGuruBase
|
||||||
|
from core_pe.iphoto_plist import IPhotoPlistParser
|
||||||
from .app import PyDupeGuruBase
|
from .app import PyDupeGuruBase
|
||||||
|
|
||||||
tr = trget('ui')
|
tr = trget('ui')
|
||||||
@@ -48,6 +47,16 @@ class Photo(PhotoBase):
|
|||||||
raise IOError('The picture %s could not be read' % str(self.path))
|
raise IOError('The picture %s could not be read' % str(self.path))
|
||||||
return blocks
|
return blocks
|
||||||
|
|
||||||
|
def _get_exif_timestamp(self):
|
||||||
|
exifdata = proxy.readExifData_(str(self.path))
|
||||||
|
if exifdata:
|
||||||
|
try:
|
||||||
|
return exifdata['{Exif}']['DateTimeOriginal']
|
||||||
|
except KeyError:
|
||||||
|
return ''
|
||||||
|
else:
|
||||||
|
return ''
|
||||||
|
|
||||||
|
|
||||||
class IPhoto(Photo):
|
class IPhoto(Photo):
|
||||||
def __init__(self, path, db_id):
|
def __init__(self, path, db_id):
|
||||||
@@ -67,11 +76,12 @@ class AperturePhoto(Photo):
|
|||||||
def display_folder_path(self):
|
def display_folder_path(self):
|
||||||
return APERTURE_PATH
|
return APERTURE_PATH
|
||||||
|
|
||||||
def get_iphoto_or_aperture_pictures(plistpath, photo_class):
|
@pathify
|
||||||
|
def get_iphoto_or_aperture_pictures(plistpath: Path, photo_class):
|
||||||
# The structure of iPhoto and Aperture libraries for the base photo list are excactly the same.
|
# The structure of iPhoto and Aperture libraries for the base photo list are excactly the same.
|
||||||
if not io.exists(plistpath):
|
if not plistpath.exists():
|
||||||
return []
|
return []
|
||||||
s = io.open(plistpath, 'rt', encoding='utf-8').read()
|
s = plistpath.open('rt', encoding='utf-8').read()
|
||||||
# There was a case where a guy had 0x10 chars in his plist, causing expat errors on loading
|
# There was a case where a guy had 0x10 chars in his plist, causing expat errors on loading
|
||||||
s = remove_invalid_xml(s, replace_with='')
|
s = remove_invalid_xml(s, replace_with='')
|
||||||
# It seems that iPhoto sometimes doesn't properly escape & chars. The regexp below is to find
|
# It seems that iPhoto sometimes doesn't properly escape & chars. The regexp below is to find
|
||||||
@@ -80,7 +90,12 @@ def get_iphoto_or_aperture_pictures(plistpath, photo_class):
|
|||||||
s, count = re.subn(r'&(?![a-zA-Z0-9_-]+|#[0-9]+|#x[0-9a-fA-F]+;)', '', s)
|
s, count = re.subn(r'&(?![a-zA-Z0-9_-]+|#[0-9]+|#x[0-9a-fA-F]+;)', '', s)
|
||||||
if count:
|
if count:
|
||||||
logging.warning("%d invalid XML entities replacement made", count)
|
logging.warning("%d invalid XML entities replacement made", count)
|
||||||
plist = plistlib.readPlistFromBytes(s.encode('utf-8'))
|
parser = IPhotoPlistParser()
|
||||||
|
try:
|
||||||
|
plist = parser.parse(io.BytesIO(s.encode('utf-8')))
|
||||||
|
except Exception:
|
||||||
|
logging.warning("iPhoto plist parsing choked on data: %r", parser.lastdata)
|
||||||
|
raise
|
||||||
result = []
|
result = []
|
||||||
for key, photo_data in plist['Master Image List'].items():
|
for key, photo_data in plist['Master Image List'].items():
|
||||||
if photo_data['MediaType'] != 'Image':
|
if photo_data['MediaType'] != 'Image':
|
||||||
@@ -114,12 +129,12 @@ class Directories(directories.Directories):
|
|||||||
directories.Directories.__init__(self, fileclasses=[Photo])
|
directories.Directories.__init__(self, fileclasses=[Photo])
|
||||||
try:
|
try:
|
||||||
self.iphoto_libpath = get_iphoto_database_path()
|
self.iphoto_libpath = get_iphoto_database_path()
|
||||||
self.set_state(self.iphoto_libpath[:-1], directories.DirectoryState.Excluded)
|
self.set_state(self.iphoto_libpath.parent(), directories.DirectoryState.Excluded)
|
||||||
except directories.InvalidPathError:
|
except directories.InvalidPathError:
|
||||||
self.iphoto_libpath = None
|
self.iphoto_libpath = None
|
||||||
try:
|
try:
|
||||||
self.aperture_libpath = get_aperture_database_path()
|
self.aperture_libpath = get_aperture_database_path()
|
||||||
self.set_state(self.aperture_libpath[:-1], directories.DirectoryState.Excluded)
|
self.set_state(self.aperture_libpath.parent(), directories.DirectoryState.Excluded)
|
||||||
except directories.InvalidPathError:
|
except directories.InvalidPathError:
|
||||||
self.aperture_libpath = None
|
self.aperture_libpath = None
|
||||||
|
|
||||||
@@ -171,9 +186,8 @@ class Directories(directories.Directories):
|
|||||||
|
|
||||||
|
|
||||||
class DupeGuruPE(DupeGuruBase):
|
class DupeGuruPE(DupeGuruBase):
|
||||||
def __init__(self, view, appdata):
|
def __init__(self, view):
|
||||||
appdata = op.join(appdata, 'dupeGuru Picture Edition')
|
DupeGuruBase.__init__(self, view)
|
||||||
DupeGuruBase.__init__(self, view, appdata)
|
|
||||||
self.directories = Directories()
|
self.directories = Directories()
|
||||||
|
|
||||||
def _do_delete(self, j, *args):
|
def _do_delete(self, j, *args):
|
||||||
@@ -247,20 +261,20 @@ class DupeGuruPE(DupeGuruBase):
|
|||||||
DupeGuruBase._do_delete_dupe(self, dupe, *args)
|
DupeGuruBase._do_delete_dupe(self, dupe, *args)
|
||||||
|
|
||||||
def _create_file(self, path):
|
def _create_file(self, path):
|
||||||
if (self.directories.iphoto_libpath is not None) and (path in self.directories.iphoto_libpath[:-1]):
|
if (self.directories.iphoto_libpath is not None) and (path in self.directories.iphoto_libpath.parent()):
|
||||||
if not hasattr(self, 'path2iphoto'):
|
if not hasattr(self, 'path2iphoto'):
|
||||||
photos = get_iphoto_pictures(self.directories.iphoto_libpath)
|
photos = get_iphoto_pictures(self.directories.iphoto_libpath)
|
||||||
self.path2iphoto = {p.path: p for p in photos}
|
self.path2iphoto = {p.path: p for p in photos}
|
||||||
return self.path2iphoto.get(path)
|
return self.path2iphoto.get(path)
|
||||||
if (self.directories.aperture_libpath is not None) and (path in self.directories.aperture_libpath[:-1]):
|
if (self.directories.aperture_libpath is not None) and (path in self.directories.aperture_libpath.parent()):
|
||||||
if not hasattr(self, 'path2aperture'):
|
if not hasattr(self, 'path2aperture'):
|
||||||
photos = get_aperture_pictures(self.directories.aperture_libpath)
|
photos = get_aperture_pictures(self.directories.aperture_libpath)
|
||||||
self.path2aperture = {p.path: p for p in photos}
|
self.path2aperture = {p.path: p for p in photos}
|
||||||
return self.path2aperture.get(path)
|
return self.path2aperture.get(path)
|
||||||
return DupeGuruBase._create_file(self, path)
|
return DupeGuruBase._create_file(self, path)
|
||||||
|
|
||||||
def _job_completed(self, jobid, exc):
|
def _job_completed(self, jobid):
|
||||||
DupeGuruBase._job_completed(self, jobid, exc)
|
DupeGuruBase._job_completed(self, jobid)
|
||||||
if jobid == JobType.Load:
|
if jobid == JobType.Load:
|
||||||
if hasattr(self, 'path2iphoto'):
|
if hasattr(self, 'path2iphoto'):
|
||||||
del self.path2iphoto
|
del self.path2iphoto
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
# Created By: Virgil Dupras
|
# Created By: Virgil Dupras
|
||||||
# Created On: 2009-05-24
|
# Created On: 2009-05-24
|
||||||
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
#
|
#
|
||||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os.path as op
|
import os.path as op
|
||||||
|
|
||||||
from hscommon import io
|
from hscommon.path import Path, pathify
|
||||||
from hscommon.path import Path
|
|
||||||
from cocoa import proxy
|
from cocoa import proxy
|
||||||
|
|
||||||
from core.scanner import ScanType
|
from core.scanner import ScanType
|
||||||
from core import fs
|
|
||||||
from core.directories import Directories as DirectoriesBase, DirectoryState
|
from core.directories import Directories as DirectoriesBase, DirectoryState
|
||||||
from core_se.app import DupeGuru as DupeGuruBase
|
from core_se.app import DupeGuru as DupeGuruBase
|
||||||
|
from core_se import fs
|
||||||
from .app import PyDupeGuruBase
|
from .app import PyDupeGuruBase
|
||||||
|
|
||||||
def is_bundle(str_path):
|
def is_bundle(str_path):
|
||||||
@@ -27,8 +26,9 @@ def is_bundle(str_path):
|
|||||||
|
|
||||||
class Bundle(fs.Folder):
|
class Bundle(fs.Folder):
|
||||||
@classmethod
|
@classmethod
|
||||||
def can_handle(cls, path):
|
@pathify
|
||||||
return not io.islink(path) and io.isdir(path) and is_bundle(str(path))
|
def can_handle(cls, path: Path):
|
||||||
|
return not path.islink() and path.isdir() and is_bundle(str(path))
|
||||||
|
|
||||||
|
|
||||||
class Directories(DirectoriesBase):
|
class Directories(DirectoriesBase):
|
||||||
@@ -36,6 +36,7 @@ class Directories(DirectoriesBase):
|
|||||||
HOME_PATH_TO_EXCLUDE = [Path('Library')]
|
HOME_PATH_TO_EXCLUDE = [Path('Library')]
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
DirectoriesBase.__init__(self, fileclasses=[Bundle, fs.File])
|
DirectoriesBase.__init__(self, fileclasses=[Bundle, fs.File])
|
||||||
|
self.folderclass = fs.Folder
|
||||||
|
|
||||||
def _default_state_for_path(self, path):
|
def _default_state_for_path(self, path):
|
||||||
result = DirectoriesBase._default_state_for_path(self, path)
|
result = DirectoriesBase._default_state_for_path(self, path)
|
||||||
@@ -67,9 +68,10 @@ class Directories(DirectoriesBase):
|
|||||||
|
|
||||||
|
|
||||||
class DupeGuru(DupeGuruBase):
|
class DupeGuru(DupeGuruBase):
|
||||||
def __init__(self, view, appdata):
|
def __init__(self, view):
|
||||||
appdata = op.join(appdata, 'dupeGuru')
|
# appdata = op.join(appdata, 'dupeGuru')
|
||||||
DupeGuruBase.__init__(self, view, appdata)
|
# print(repr(appdata))
|
||||||
|
DupeGuruBase.__init__(self, view)
|
||||||
self.directories = Directories()
|
self.directories = Directories()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# Created On: 2012-05-30
|
# Created On: 2012-05-30
|
||||||
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
#
|
#
|
||||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
from objp.util import dontwrap
|
from objp.util import dontwrap
|
||||||
from cocoa.inter import PyGUIObject, GUIObjectView
|
from cocoa.inter import PyGUIObject, GUIObjectView
|
||||||
@@ -11,6 +11,7 @@ from cocoa.inter import PyGUIObject, GUIObjectView
|
|||||||
class DeletionOptionsView(GUIObjectView):
|
class DeletionOptionsView(GUIObjectView):
|
||||||
def updateMsg_(self, msg: str): pass
|
def updateMsg_(self, msg: str): pass
|
||||||
def show(self) -> bool: pass
|
def show(self) -> bool: pass
|
||||||
|
def setHardlinkOptionEnabled_(self, enabled: bool): pass
|
||||||
|
|
||||||
class PyDeletionOptions(PyGUIObject):
|
class PyDeletionOptions(PyGUIObject):
|
||||||
def setLinkDeleted_(self, link_deleted: bool):
|
def setLinkDeleted_(self, link_deleted: bool):
|
||||||
@@ -31,3 +32,6 @@ class PyDeletionOptions(PyGUIObject):
|
|||||||
def show(self):
|
def show(self):
|
||||||
return self.callback.show()
|
return self.callback.show()
|
||||||
|
|
||||||
|
@dontwrap
|
||||||
|
def set_hardlink_option_enabled(self, enabled):
|
||||||
|
self.callback.setHardlinkOptionEnabled_(enabled)
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ class PyDirectoryOutline(PyOutline):
|
|||||||
def removeSelectedDirectory(self):
|
def removeSelectedDirectory(self):
|
||||||
self.model.remove_selected()
|
self.model.remove_selected()
|
||||||
|
|
||||||
|
def selectAll(self):
|
||||||
|
self.model.select_all()
|
||||||
|
|
||||||
# python --> cocoa
|
# python --> cocoa
|
||||||
@dontwrap
|
@dontwrap
|
||||||
def refresh_states(self):
|
def refresh_states(self):
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ class PyResultTable(PyTable):
|
|||||||
def setDeltaValuesMode_(self, value: bool):
|
def setDeltaValuesMode_(self, value: bool):
|
||||||
self.model.delta_values = value
|
self.model.delta_values = value
|
||||||
|
|
||||||
def deltaColumns(self) -> list:
|
|
||||||
return list(self.model.DELTA_COLUMNS)
|
|
||||||
|
|
||||||
def valueForRow_column_(self, row_index: int, column: str) -> object:
|
def valueForRow_column_(self, row_index: int, column: str) -> object:
|
||||||
return self.model.get_row_value(row_index, column)
|
return self.model.get_row_value(row_index, column)
|
||||||
|
|
||||||
|
def isDeltaAtRow_column_(self, row_index: int, column: str) -> bool:
|
||||||
|
row = self.model[row_index]
|
||||||
|
return row.is_cell_delta(column)
|
||||||
|
|
||||||
def renameSelected_(self, newname: str) -> bool:
|
def renameSelected_(self, newname: str) -> bool:
|
||||||
return self.model.rename_selected(newname)
|
return self.model.rename_selected(newname)
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "../base/Consts.h"
|
#import "../base/Consts.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "DetailsPanel.h"
|
#import "DetailsPanel.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "DirectoryPanel.h"
|
#import "DirectoryPanel.h"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>© Hardcoded Software, 2013</string>
|
<string>© Hardcoded Software, 2014</string>
|
||||||
<key>SUFeedURL</key>
|
<key>SUFeedURL</key>
|
||||||
<string>http://www.hardcoded.net/updates/dupeguru_me.appcast</string>
|
<string>http://www.hardcoded.net/updates/dupeguru_me.appcast</string>
|
||||||
<key>SUPublicDSAKeyFile</key>
|
<key>SUPublicDSAKeyFile</key>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ResultWindow.h"
|
#import "ResultWindow.h"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
#
|
#
|
||||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
from hscommon.trans import install_gettext_trans_under_cocoa
|
from hscommon.trans import install_gettext_trans_under_cocoa
|
||||||
install_gettext_trans_under_cocoa()
|
install_gettext_trans_under_cocoa()
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "../base/Consts.h"
|
#import "../base/Consts.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "Utils.h"
|
#import "Utils.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "DirectoryPanel.h"
|
#import "DirectoryPanel.h"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>© Hardcoded Software, 2013</string>
|
<string>© Hardcoded Software, 2014</string>
|
||||||
<key>SUFeedURL</key>
|
<key>SUFeedURL</key>
|
||||||
<string>http://www.hardcoded.net/updates/dupeguru_pe.appcast</string>
|
<string>http://www.hardcoded.net/updates/dupeguru_pe.appcast</string>
|
||||||
<key>SUPublicDSAKeyFile</key>
|
<key>SUPublicDSAKeyFile</key>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ResultWindow.h"
|
#import "ResultWindow.h"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
#
|
#
|
||||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
from hscommon.trans import install_gettext_trans_under_cocoa
|
from hscommon.trans import install_gettext_trans_under_cocoa
|
||||||
install_gettext_trans_under_cocoa()
|
install_gettext_trans_under_cocoa()
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "DetailsPanel.h"
|
#import "DetailsPanel.h"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>© Hardcoded Software, 2013</string>
|
<string>© Hardcoded Software, 2014</string>
|
||||||
<key>SUFeedURL</key>
|
<key>SUFeedURL</key>
|
||||||
<string>http://www.hardcoded.net/updates/dupeguru.appcast</string>
|
<string>http://www.hardcoded.net/updates/dupeguru.appcast</string>
|
||||||
<key>SUPublicDSAKeyFile</key>
|
<key>SUPublicDSAKeyFile</key>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
which should be included with this package. The terms are also available at
|
which should be included with this package. The terms are also available at
|
||||||
http://www.hardcoded.net/licenses/bsd_license
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ResultWindow.h"
|
#import "ResultWindow.h"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
#
|
#
|
||||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
from hscommon.trans import install_gettext_trans_under_cocoa
|
from hscommon.trans import install_gettext_trans_under_cocoa
|
||||||
install_gettext_trans_under_cocoa()
|
install_gettext_trans_under_cocoa()
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ def configure(conf):
|
|||||||
os.symlink('../build/Python', versioned_dylib_path)
|
os.symlink('../build/Python', versioned_dylib_path)
|
||||||
# The rest is standard WAF code that you can find the the python and macapp demos.
|
# The rest is standard WAF code that you can find the the python and macapp demos.
|
||||||
conf.load('compiler_c python')
|
conf.load('compiler_c python')
|
||||||
conf.check_python_version((3,2,0))
|
conf.check_python_version((3,3,0))
|
||||||
conf.check_python_headers()
|
conf.check_python_headers()
|
||||||
conf.env.FRAMEWORK_COCOA = 'Cocoa'
|
conf.env.FRAMEWORK_COCOA = 'Cocoa'
|
||||||
conf.env.ARCH_COCOA = ['i386', 'x86_64']
|
conf.env.ARCH_COCOA = ['x86_64']
|
||||||
# Add cocoalib dir to the framework search path so we can find Sparkle.
|
# Add cocoalib dir to the framework search path so we can find Sparkle.
|
||||||
conf.env.CFLAGS = ['-F'+op.abspath('../cocoalib')]
|
conf.env.CFLAGS = ['-F'+op.abspath('../cocoalib')]
|
||||||
conf.env.LINKFLAGS = ['-F'+op.abspath('../cocoalib')]
|
conf.env.LINKFLAGS = ['-F'+op.abspath('../cocoalib')]
|
||||||
@@ -44,13 +44,14 @@ def build(ctx):
|
|||||||
cocoalib_node = ctx.srcnode.find_dir('..').find_dir('cocoalib')
|
cocoalib_node = ctx.srcnode.find_dir('..').find_dir('cocoalib')
|
||||||
cocoalib_folders = ['controllers', 'views']
|
cocoalib_folders = ['controllers', 'views']
|
||||||
cocoalib_includes = [cocoalib_node] + [cocoalib_node.find_dir(folder) for folder in cocoalib_folders]
|
cocoalib_includes = [cocoalib_node] + [cocoalib_node.find_dir(folder) for folder in cocoalib_folders]
|
||||||
cocoalib_uses = ['NSEventAdditions', 'Dialogs', 'HSFairwareAboutBox', 'HSFairwareReminder', 'Utils',
|
cocoalib_uses = ['NSEventAdditions', 'Dialogs', 'HSAboutBox', 'Utils',
|
||||||
'HSPyUtil', 'ProgressController', 'HSRecentFiles', 'HSQuicklook', 'ValueTransformers',
|
'HSPyUtil', 'ProgressController', 'HSRecentFiles', 'HSQuicklook', 'ValueTransformers',
|
||||||
'NSImageAdditions', 'NSNotificationAdditions',
|
'NSImageAdditions', 'NSNotificationAdditions',
|
||||||
'views/HSTableView', 'views/HSOutlineView', 'views/NSIndexPathAdditions',
|
'views/HSTableView', 'views/HSOutlineView', 'views/NSIndexPathAdditions',
|
||||||
'views/NSTableViewAdditions',
|
'views/NSTableViewAdditions',
|
||||||
'controllers/HSColumns', 'controllers/HSGUIController', 'controllers/HSTable',
|
'controllers/HSColumns', 'controllers/HSGUIController', 'controllers/HSTable',
|
||||||
'controllers/HSOutline', 'controllers/HSPopUpList', 'controllers/HSSelectableList']
|
'controllers/HSOutline', 'controllers/HSPopUpList', 'controllers/HSSelectableList',
|
||||||
|
'controllers/HSTextField', 'controllers/HSProgressWindow']
|
||||||
cocoalib_src = [cocoalib_node.find_node(usename + '.m') for usename in cocoalib_uses] + cocoalib_node.ant_glob('autogen/*.m')
|
cocoalib_src = [cocoalib_node.find_node(usename + '.m') for usename in cocoalib_uses] + cocoalib_node.ant_glob('autogen/*.m')
|
||||||
project_folders = ['autogen', 'base', ctx.env.DGEDITION]
|
project_folders = ['autogen', 'base', ctx.env.DGEDITION]
|
||||||
project_src = sum([ctx.srcnode.ant_glob('%s/*.m' % folder) for folder in project_folders], [])
|
project_src = sum([ctx.srcnode.ant_glob('%s/*.m' % folder) for folder in project_folders], [])
|
||||||
|
|||||||
15
cocoalib/.gitignore
vendored
Normal file
15
cocoalib/.gitignore
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
.DS_Store
|
||||||
|
__pycache__
|
||||||
|
autogen
|
||||||
|
*.pyc
|
||||||
|
*.so
|
||||||
|
nl.lproj
|
||||||
|
cs.lproj
|
||||||
|
de.lproj
|
||||||
|
fr.lproj
|
||||||
|
it.lproj
|
||||||
|
hy.lproj
|
||||||
|
ru.lproj
|
||||||
|
uk.lproj
|
||||||
|
zh_CN.lproj
|
||||||
|
pt_BR.lproj
|
||||||
8
cocoalib/.tx/config
Normal file
8
cocoalib/.tx/config
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[main]
|
||||||
|
host = https://www.transifex.com
|
||||||
|
|
||||||
|
[hscommon.cocoalib]
|
||||||
|
file_filter = locale/<lang>/LC_MESSAGES/cocoalib.po
|
||||||
|
source_file = locale/cocoalib.pot
|
||||||
|
source_lang = en
|
||||||
|
type = PO
|
||||||
14
cocoalib/Dialogs.h
Normal file
14
cocoalib/Dialogs.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@interface Dialogs : NSObject
|
||||||
|
+ (void)showMessage:(NSString *)message;
|
||||||
|
+ (NSInteger)askYesNo:(NSString *)message;
|
||||||
|
@end
|
||||||
31
cocoalib/Dialogs.m
Normal file
31
cocoalib/Dialogs.m
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "Dialogs.h"
|
||||||
|
|
||||||
|
@implementation Dialogs
|
||||||
|
+ (void)showMessage:(NSString *)message
|
||||||
|
{
|
||||||
|
NSAlert *a = [[NSAlert alloc] init];
|
||||||
|
[a addButtonWithTitle:NSLocalizedStringFromTable(@"OK", @"cocoalib", @"")];
|
||||||
|
[a setMessageText:message];
|
||||||
|
[a runModal];
|
||||||
|
[a release];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSInteger)askYesNo:(NSString *)message
|
||||||
|
{
|
||||||
|
NSAlert *a = [[NSAlert alloc] init];
|
||||||
|
[a addButtonWithTitle:NSLocalizedStringFromTable(@"Yes", @"cocoalib", @"")];
|
||||||
|
[[a addButtonWithTitle:NSLocalizedStringFromTable(@"No", @"cocoalib", @"")] setKeyEquivalent:@"\E"];
|
||||||
|
[a setMessageText:message];
|
||||||
|
NSInteger r = [a runModal];
|
||||||
|
[a release];
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
@end
|
||||||
27
cocoalib/HSAboutBox.h
Normal file
27
cocoalib/HSAboutBox.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "PyBaseApp.h"
|
||||||
|
|
||||||
|
@interface HSAboutBox : NSWindowController
|
||||||
|
{
|
||||||
|
NSTextField *titleTextField;
|
||||||
|
NSTextField *versionTextField;
|
||||||
|
NSTextField *copyrightTextField;
|
||||||
|
|
||||||
|
PyBaseApp *app;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property (readwrite, retain) NSTextField *titleTextField;
|
||||||
|
@property (readwrite, retain) NSTextField *versionTextField;
|
||||||
|
@property (readwrite, retain) NSTextField *copyrightTextField;
|
||||||
|
|
||||||
|
- (id)initWithApp:(PyBaseApp *)app;
|
||||||
|
- (void)updateFields;
|
||||||
|
@end
|
||||||
42
cocoalib/HSAboutBox.m
Normal file
42
cocoalib/HSAboutBox.m
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSAboutBox.h"
|
||||||
|
#import "HSAboutBox_UI.h"
|
||||||
|
|
||||||
|
@implementation HSAboutBox
|
||||||
|
|
||||||
|
@synthesize titleTextField;
|
||||||
|
@synthesize versionTextField;
|
||||||
|
@synthesize copyrightTextField;
|
||||||
|
|
||||||
|
- (id)initWithApp:(PyBaseApp *)aApp
|
||||||
|
{
|
||||||
|
self = [super initWithWindow:nil];
|
||||||
|
[self setWindow:createHSAboutBox_UI(self)];
|
||||||
|
app = [aApp retain];
|
||||||
|
[self updateFields];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
[app release];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)updateFields
|
||||||
|
{
|
||||||
|
[titleTextField setStringValue:[app appLongName]];
|
||||||
|
NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
|
||||||
|
[versionTextField setStringValue:[NSString stringWithFormat:@"Version: %@",version]];
|
||||||
|
NSString *copyright = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSHumanReadableCopyright"];
|
||||||
|
[copyrightTextField setStringValue:copyright];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
26
cocoalib/HSErrorReportWindow.h
Normal file
26
cocoalib/HSErrorReportWindow.h
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@interface HSErrorReportWindow : NSWindowController
|
||||||
|
{
|
||||||
|
NSTextView *contentTextView;
|
||||||
|
NSString *githubUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property (readwrite, retain) NSTextView *contentTextView;
|
||||||
|
@property (readwrite, retain) NSString *githubUrl;
|
||||||
|
|
||||||
|
// True if the user wants to send the report
|
||||||
|
+ (void)showErrorReportWithContent:(NSString *)content githubUrl:(NSString *)githubUrl;
|
||||||
|
- (id)initWithContent:(NSString *)content githubUrl:(NSString *)githubUrl;
|
||||||
|
|
||||||
|
- (void)goToGithub;
|
||||||
|
- (void)close;
|
||||||
|
@end
|
||||||
44
cocoalib/HSErrorReportWindow.m
Normal file
44
cocoalib/HSErrorReportWindow.m
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSErrorReportWindow.h"
|
||||||
|
#import "HSErrorReportWindow_UI.h"
|
||||||
|
|
||||||
|
@implementation HSErrorReportWindow
|
||||||
|
|
||||||
|
@synthesize contentTextView;
|
||||||
|
@synthesize githubUrl;
|
||||||
|
|
||||||
|
+ (void)showErrorReportWithContent:(NSString *)content githubUrl:(NSString *)githubUrl
|
||||||
|
{
|
||||||
|
HSErrorReportWindow *report = [[HSErrorReportWindow alloc] initWithContent:content githubUrl:githubUrl];
|
||||||
|
[NSApp runModalForWindow:[report window]];
|
||||||
|
[report release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithContent:(NSString *)content githubUrl:(NSString *)aGithubUrl
|
||||||
|
{
|
||||||
|
self = [super initWithWindow:nil];
|
||||||
|
[self setWindow:createHSErrorReportWindow_UI(self)];
|
||||||
|
[contentTextView alignLeft:nil];
|
||||||
|
[[[contentTextView textStorage] mutableString] setString:content];
|
||||||
|
self.githubUrl = aGithubUrl;
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)goToGithub
|
||||||
|
{
|
||||||
|
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:self.githubUrl]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)close
|
||||||
|
{
|
||||||
|
[[self window] orderOut:self];
|
||||||
|
[NSApp stopModalWithCode:NSOKButton];
|
||||||
|
}
|
||||||
|
@end
|
||||||
15
cocoalib/HSGeometry.h
Normal file
15
cocoalib/HSGeometry.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import <math.h>
|
||||||
|
|
||||||
|
CGFloat deg2rad(CGFloat deg);
|
||||||
|
CGFloat distance(NSPoint p1, NSPoint p2);
|
||||||
|
NSPoint pointInCircle(NSPoint center, CGFloat radius, CGFloat angle);
|
||||||
|
CGFloat angleFromPoints(NSPoint pt1, NSPoint pt2);
|
||||||
71
cocoalib/HSGeometry.m
Normal file
71
cocoalib/HSGeometry.m
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSGeometry.h"
|
||||||
|
|
||||||
|
CGFloat deg2rad(CGFloat deg)
|
||||||
|
{
|
||||||
|
return deg * M_PI / 180;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGFloat distance(NSPoint p1, NSPoint p2)
|
||||||
|
{
|
||||||
|
CGFloat dX = p1.x - p2.x;
|
||||||
|
CGFloat dY = p1.y - p2.y;
|
||||||
|
return sqrt(dX * dX + dY * dY);
|
||||||
|
}
|
||||||
|
|
||||||
|
NSPoint pointInCircle(NSPoint center, CGFloat radius, CGFloat angle)
|
||||||
|
{
|
||||||
|
// a/sin(A) = b/sin(B) = c/sin(C) = 2R
|
||||||
|
// the start point it (center.x + radius, center.y) and goes counterclockwise
|
||||||
|
angle = fmod(angle, M_PI*2);
|
||||||
|
CGFloat C = M_PI/2;
|
||||||
|
CGFloat A = fmod(angle, M_PI/2);
|
||||||
|
CGFloat B = C - A;
|
||||||
|
CGFloat c = radius;
|
||||||
|
CGFloat ratio = c / sin(C);
|
||||||
|
CGFloat b = ratio * sin(B);
|
||||||
|
CGFloat a = ratio * sin(A);
|
||||||
|
if (angle >= M_PI * 1.5)
|
||||||
|
return NSMakePoint(center.x + a, center.y - b);
|
||||||
|
else if (angle >= M_PI)
|
||||||
|
return NSMakePoint(center.x - b, center.y - a);
|
||||||
|
else if (angle >= M_PI/2)
|
||||||
|
return NSMakePoint(center.x - a, center.y + b);
|
||||||
|
else
|
||||||
|
return NSMakePoint(center.x + b, center.y + a);
|
||||||
|
}
|
||||||
|
|
||||||
|
CGFloat angleFromPoints(NSPoint pt1, NSPoint pt2)
|
||||||
|
{
|
||||||
|
// Returns the angle (radian) formed by the line pt1-pt2. The angle follows the same logic
|
||||||
|
// as in pointInCircle.
|
||||||
|
// What we do here is that we take the line and reduce it to fit a "unit circle" (circle with
|
||||||
|
// a radius of 1). Then, either asin(adjusted_dy) or acos(adjusted_dx) will give us our angle.
|
||||||
|
// We'll use asin(adjusted_dy).
|
||||||
|
CGFloat length = distance(pt1, pt2);
|
||||||
|
CGFloat dx = pt2.x - pt1.x;
|
||||||
|
CGFloat dy = pt2.y - pt1.y;
|
||||||
|
CGFloat ajdusted_dy = ABS(dy) / length;
|
||||||
|
CGFloat angle = asin(ajdusted_dy);
|
||||||
|
|
||||||
|
if ((dx < 0) && (dy >= 0)) {
|
||||||
|
// top-left quadrant
|
||||||
|
angle = M_PI - angle;
|
||||||
|
}
|
||||||
|
else if ((dx < 0) && (dy < 0)) {
|
||||||
|
// bottom-left quadrant
|
||||||
|
angle = M_PI + angle;
|
||||||
|
}
|
||||||
|
else if ((dx >= 0) && (dy < 0)) {
|
||||||
|
// bottom-right quadrant
|
||||||
|
angle = (2 * M_PI) - angle;
|
||||||
|
}
|
||||||
|
return angle;
|
||||||
|
}
|
||||||
13
cocoalib/HSPyUtil.h
Normal file
13
cocoalib/HSPyUtil.h
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import <Python.h>
|
||||||
|
|
||||||
|
void setCocoaViewsModuleName(NSString *moduleName);
|
||||||
|
PyObject* createCallback(NSString *aViewClassName, id aViewRef);
|
||||||
34
cocoalib/HSPyUtil.m
Normal file
34
cocoalib/HSPyUtil.m
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSPyUtil.h"
|
||||||
|
#import "ObjP.h"
|
||||||
|
|
||||||
|
static NSString *gCocoaViewsModuleName;
|
||||||
|
void setCocoaViewsModuleName(NSString *moduleName)
|
||||||
|
{
|
||||||
|
if (gCocoaViewsModuleName != nil) {
|
||||||
|
[gCocoaViewsModuleName release];
|
||||||
|
}
|
||||||
|
gCocoaViewsModuleName = [moduleName retain];
|
||||||
|
}
|
||||||
|
|
||||||
|
PyObject* createCallback(NSString *aViewClassName, id aViewRef)
|
||||||
|
{
|
||||||
|
NSString *moduleName;
|
||||||
|
if (gCocoaViewsModuleName != nil) {
|
||||||
|
moduleName = gCocoaViewsModuleName;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
moduleName = @"inter.CocoaViews";
|
||||||
|
}
|
||||||
|
PyGILState_STATE gilState = PyGILState_Ensure();
|
||||||
|
PyObject *pCallback = ObjP_classInstanceWithRef(aViewClassName, moduleName, aViewRef);
|
||||||
|
PyGILState_Release(gilState);
|
||||||
|
return pCallback;
|
||||||
|
}
|
||||||
18
cocoalib/HSQuicklook.h
Normal file
18
cocoalib/HSQuicklook.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import <Quartz/Quartz.h>
|
||||||
|
|
||||||
|
@interface HSQLPreviewItem : NSObject <QLPreviewItem>
|
||||||
|
{
|
||||||
|
NSURL *url;
|
||||||
|
NSString *title;
|
||||||
|
}
|
||||||
|
- (id)initWithUrl:(NSURL *)aUrl title:(NSString *)aTitle;
|
||||||
|
@end
|
||||||
36
cocoalib/HSQuicklook.m
Normal file
36
cocoalib/HSQuicklook.m
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSQuicklook.h"
|
||||||
|
|
||||||
|
@implementation HSQLPreviewItem
|
||||||
|
- (id)initWithUrl:(NSURL *)aUrl title:(NSString *)aTitle
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
url = [aUrl retain];
|
||||||
|
title = [aTitle retain];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
[url release];
|
||||||
|
[title release];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSURL *)previewItemURL
|
||||||
|
{
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)previewItemTitle
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
@end
|
||||||
35
cocoalib/HSRecentFiles.h
Normal file
35
cocoalib/HSRecentFiles.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@interface HSRecentFiles : NSObject
|
||||||
|
{
|
||||||
|
id delegate;
|
||||||
|
NSMenu *menu;
|
||||||
|
NSString *name;
|
||||||
|
NSMutableArray *filepaths;
|
||||||
|
NSInteger numberOfMenuItemsToPreserve;
|
||||||
|
}
|
||||||
|
- (id)initWithName:(NSString *)aName menu:(NSMenu *)aMenu;
|
||||||
|
|
||||||
|
- (void)addFile:(NSString *)path;
|
||||||
|
- (void)rebuildMenu;
|
||||||
|
- (void)fillMenu:(NSMenu *)menu;
|
||||||
|
- (void)clearMenu:(id)sender;
|
||||||
|
- (void)menuClick:(id)sender;
|
||||||
|
|
||||||
|
- (NSMenu *)menu;
|
||||||
|
- (id)delegate;
|
||||||
|
- (void)setDelegate:(id)aDelegate;
|
||||||
|
- (NSArray *)filepaths;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@protocol HSRecentFilesDelegate
|
||||||
|
- (void)recentFileClicked:(NSString *)path;
|
||||||
|
@end
|
||||||
89
cocoalib/HSRecentFiles.m
Normal file
89
cocoalib/HSRecentFiles.m
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSRecentFiles.h"
|
||||||
|
|
||||||
|
@implementation HSRecentFiles
|
||||||
|
- (id)initWithName:(NSString *)aName menu:(NSMenu *)aMenu
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
name = aName;
|
||||||
|
menu = [aMenu retain];
|
||||||
|
numberOfMenuItemsToPreserve = [menu numberOfItems];
|
||||||
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||||
|
filepaths = [[NSMutableArray alloc] initWithArray:[ud arrayForKey:name]];
|
||||||
|
NSFileManager *fm = [NSFileManager defaultManager];
|
||||||
|
for (NSInteger i=[filepaths count]-1;i>=0;i--) {
|
||||||
|
NSString *path = [filepaths objectAtIndex:i];
|
||||||
|
// We check for path class because we might be fed with garbage from the prefs.
|
||||||
|
if ((![path isKindOfClass:[NSString class]]) || (![fm fileExistsAtPath:path])) {
|
||||||
|
[filepaths removeObjectAtIndex:i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[self rebuildMenu];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||||
|
[ud setObject:filepaths forKey:name];
|
||||||
|
[ud synchronize];
|
||||||
|
[filepaths release];
|
||||||
|
[menu release];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)addFile:(NSString *)path
|
||||||
|
{
|
||||||
|
[filepaths removeObject:path];
|
||||||
|
[filepaths insertObject:path atIndex:0];
|
||||||
|
[self rebuildMenu];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)rebuildMenu
|
||||||
|
{
|
||||||
|
while ([menu numberOfItems] > numberOfMenuItemsToPreserve)
|
||||||
|
[menu removeItemAtIndex:[menu numberOfItems]-1];
|
||||||
|
[self fillMenu:menu];
|
||||||
|
if ([filepaths count] > 0) {
|
||||||
|
[menu addItem:[NSMenuItem separatorItem]];
|
||||||
|
NSMenuItem *mi = [menu addItemWithTitle:NSLocalizedStringFromTable(@"Clear List", @"cocoalib", @"") action:@selector(clearMenu:) keyEquivalent:@""];
|
||||||
|
[mi setTarget:self];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)fillMenu:(NSMenu *)menuToFill
|
||||||
|
{
|
||||||
|
for (int i=0;i<[filepaths count];i++) {
|
||||||
|
NSMenuItem *mi = [menuToFill addItemWithTitle:[filepaths objectAtIndex:i] action:@selector(menuClick:) keyEquivalent:@""];
|
||||||
|
[mi setTag:i];
|
||||||
|
[mi setTarget:self];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)clearMenu:(id)sender
|
||||||
|
{
|
||||||
|
[filepaths removeAllObjects];
|
||||||
|
[self rebuildMenu];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)menuClick:(id)sender
|
||||||
|
{
|
||||||
|
if (delegate == nil)
|
||||||
|
return;
|
||||||
|
if ([delegate respondsToSelector:@selector(recentFileClicked:)])
|
||||||
|
[delegate recentFileClicked:[filepaths objectAtIndex:[sender tag]]];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Properties */
|
||||||
|
- (NSMenu *)menu {return menu;}
|
||||||
|
- (id)delegate { return delegate; }
|
||||||
|
- (void)setDelegate:(id)aDelegate { delegate = aDelegate; }
|
||||||
|
- (NSArray *)filepaths {return filepaths;}
|
||||||
|
@end
|
||||||
10
cocoalib/LICENSE
Normal file
10
cocoalib/LICENSE
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Copyright 2014, Hardcoded Software Inc., http://www.hardcoded.net
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of Hardcoded Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
24
cocoalib/NSEventAdditions.h
Normal file
24
cocoalib/NSEventAdditions.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@interface NSEvent(NSEventAdditions)
|
||||||
|
- (unichar)firstCharacter;
|
||||||
|
- (NSUInteger)flags;
|
||||||
|
- (NSUInteger)modifierKeysFlags;
|
||||||
|
- (BOOL)isDeleteOrBackspace;
|
||||||
|
- (BOOL)isReturnOrEnter;
|
||||||
|
- (BOOL)isTab;
|
||||||
|
- (BOOL)isBackTab;
|
||||||
|
- (BOOL)isSpace;
|
||||||
|
- (BOOL)isUp;
|
||||||
|
- (BOOL)isDown;
|
||||||
|
- (BOOL)isLeft;
|
||||||
|
- (BOOL)isRight;
|
||||||
|
@end
|
||||||
85
cocoalib/NSEventAdditions.m
Normal file
85
cocoalib/NSEventAdditions.m
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "NSEventAdditions.h"
|
||||||
|
|
||||||
|
@implementation NSEvent(NSEventAdditions)
|
||||||
|
|
||||||
|
- (unichar)firstCharacter
|
||||||
|
{
|
||||||
|
NSString *characters = [self characters];
|
||||||
|
if ([characters length] == 0)
|
||||||
|
{
|
||||||
|
return '\0';
|
||||||
|
}
|
||||||
|
return [characters characterAtIndex:0];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSUInteger)flags
|
||||||
|
{
|
||||||
|
// get flags and strip the lower 16 (device dependant) bits
|
||||||
|
// See modifierFlags's doc for details
|
||||||
|
return [self modifierFlags] & NSDeviceIndependentModifierFlagsMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSUInteger)modifierKeysFlags
|
||||||
|
{
|
||||||
|
// This is modifierFlags with only Command, Opt, Ctrl and Shift, without the rest of the flags
|
||||||
|
// to pollute.
|
||||||
|
return [self flags] & (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isDeleteOrBackspace
|
||||||
|
{
|
||||||
|
unichar firstChar = [self firstCharacter];
|
||||||
|
return firstChar == NSDeleteFunctionKey || firstChar == NSDeleteCharFunctionKey ||
|
||||||
|
firstChar == NSDeleteCharacter || firstChar == NSBackspaceCharacter;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isReturnOrEnter
|
||||||
|
{
|
||||||
|
unichar firstChar = [self firstCharacter];
|
||||||
|
return firstChar == NSCarriageReturnCharacter || firstChar == NSEnterCharacter;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isTab
|
||||||
|
{
|
||||||
|
return [self firstCharacter] == NSTabCharacter;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isBackTab
|
||||||
|
{
|
||||||
|
return [self firstCharacter] == NSBackTabCharacter;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isSpace
|
||||||
|
{
|
||||||
|
return ([self firstCharacter] == 0x20) && (![self flags]);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isUp
|
||||||
|
{
|
||||||
|
return [self firstCharacter] == NSUpArrowFunctionKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isDown
|
||||||
|
{
|
||||||
|
return [self firstCharacter] == NSDownArrowFunctionKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isLeft
|
||||||
|
{
|
||||||
|
return [self firstCharacter] == NSLeftArrowFunctionKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isRight
|
||||||
|
{
|
||||||
|
return [self firstCharacter] == NSRightArrowFunctionKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
21
cocoalib/NSImageAdditions.h
Normal file
21
cocoalib/NSImageAdditions.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
// Created by Scott Stevenson on 9/28/07.
|
||||||
|
//
|
||||||
|
// Personal site: http://theocacao.com/
|
||||||
|
// Post for this sample: http://theocacao.com/document.page/497
|
||||||
|
//
|
||||||
|
// The code in this project is intended to be used as a learning
|
||||||
|
// tool for Cocoa programmers. You may freely use the code in
|
||||||
|
// your own programs, but please do not use the code as-is in
|
||||||
|
// other tutorials.
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
|
||||||
|
@interface NSImage (Extras)
|
||||||
|
|
||||||
|
// creates a copy of the current image while maintaining
|
||||||
|
// proportions. also centers image, if necessary
|
||||||
|
|
||||||
|
- (NSImage*)imageByScalingProportionallyToSize:(NSSize)aSize;
|
||||||
|
|
||||||
|
@end
|
||||||
114
cocoalib/NSImageAdditions.m
Normal file
114
cocoalib/NSImageAdditions.m
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
// Created by Scott Stevenson on 9/28/07.
|
||||||
|
//
|
||||||
|
// Personal site: http://theocacao.com/
|
||||||
|
// Post for this sample: http://theocacao.com/document.page/497
|
||||||
|
//
|
||||||
|
// The code in this project is intended to be used as a learning
|
||||||
|
// tool for Cocoa programmers. You may freely use the code in
|
||||||
|
// your own programs, but please do not use the code as-is in
|
||||||
|
// other tutorials.
|
||||||
|
|
||||||
|
#import "NSImageAdditions.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation NSImage (Extras)
|
||||||
|
|
||||||
|
- (NSImage*)imageByScalingProportionallyToSize:(NSSize)targetSize
|
||||||
|
{
|
||||||
|
NSImage* sourceImage = self;
|
||||||
|
NSImage* newImage = nil;
|
||||||
|
|
||||||
|
if ([sourceImage isValid])
|
||||||
|
{
|
||||||
|
NSSize imageSize = [sourceImage size];
|
||||||
|
CGFloat width = imageSize.width;
|
||||||
|
CGFloat height = imageSize.height;
|
||||||
|
|
||||||
|
CGFloat targetWidth = targetSize.width;
|
||||||
|
CGFloat targetHeight = targetSize.height;
|
||||||
|
|
||||||
|
// scaleFactor will be the fraction that we'll
|
||||||
|
// use to adjust the size. For example, if we shrink
|
||||||
|
// an image by half, scaleFactor will be 0.5. the
|
||||||
|
// scaledWidth and scaledHeight will be the original,
|
||||||
|
// multiplied by the scaleFactor.
|
||||||
|
//
|
||||||
|
// IMPORTANT: the "targetHeight" is the size of the space
|
||||||
|
// we're drawing into. The "scaledHeight" is the height that
|
||||||
|
// the image actually is drawn at, once we take into
|
||||||
|
// account the ideal of maintaining proportions
|
||||||
|
|
||||||
|
CGFloat scaleFactor = 0.0;
|
||||||
|
CGFloat scaledWidth = targetWidth;
|
||||||
|
CGFloat scaledHeight = targetHeight;
|
||||||
|
|
||||||
|
NSPoint thumbnailPoint = NSMakePoint(0,0);
|
||||||
|
|
||||||
|
// since not all images are square, we want to scale
|
||||||
|
// proportionately. To do this, we find the longest
|
||||||
|
// edge and use that as a guide.
|
||||||
|
|
||||||
|
if ( NSEqualSizes( imageSize, targetSize ) == NO )
|
||||||
|
{
|
||||||
|
// use the longeset edge as a guide. if the
|
||||||
|
// image is wider than tall, we'll figure out
|
||||||
|
// the scale factor by dividing it by the
|
||||||
|
// intended width. Otherwise, we'll use the
|
||||||
|
// height.
|
||||||
|
|
||||||
|
CGFloat widthFactor = targetWidth / width;
|
||||||
|
CGFloat heightFactor = targetHeight / height;
|
||||||
|
|
||||||
|
if ( widthFactor < heightFactor )
|
||||||
|
scaleFactor = widthFactor;
|
||||||
|
else
|
||||||
|
scaleFactor = heightFactor;
|
||||||
|
|
||||||
|
// ex: 500 * 0.5 = 250 (newWidth)
|
||||||
|
|
||||||
|
scaledWidth = width * scaleFactor;
|
||||||
|
scaledHeight = height * scaleFactor;
|
||||||
|
|
||||||
|
// center the thumbnail in the frame. if
|
||||||
|
// wider than tall, we need to adjust the
|
||||||
|
// vertical drawing point (y axis)
|
||||||
|
|
||||||
|
if ( widthFactor < heightFactor )
|
||||||
|
thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5;
|
||||||
|
|
||||||
|
else if ( widthFactor > heightFactor )
|
||||||
|
thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// create a new image to draw into
|
||||||
|
newImage = [[NSImage alloc] initWithSize:targetSize];
|
||||||
|
|
||||||
|
// once focus is locked, all drawing goes into this NSImage instance
|
||||||
|
// directly, not to the screen. It also receives its own graphics
|
||||||
|
// context.
|
||||||
|
//
|
||||||
|
// Also, keep in mind that we're doing this in a background thread.
|
||||||
|
// You only want to draw to the screen in the main thread, but
|
||||||
|
// drawing to an offscreen image is (apparently) okay.
|
||||||
|
|
||||||
|
[newImage lockFocus];
|
||||||
|
|
||||||
|
NSRect thumbnailRect;
|
||||||
|
thumbnailRect.origin = thumbnailPoint;
|
||||||
|
thumbnailRect.size.width = scaledWidth;
|
||||||
|
thumbnailRect.size.height = scaledHeight;
|
||||||
|
|
||||||
|
[sourceImage drawInRect: thumbnailRect
|
||||||
|
fromRect: NSZeroRect
|
||||||
|
operation: NSCompositeSourceOver
|
||||||
|
fraction: 1.0];
|
||||||
|
|
||||||
|
[newImage unlockFocus];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return [newImage autorelease];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
10
cocoalib/NSNotificationAdditions.h
Normal file
10
cocoalib/NSNotificationAdditions.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
// from http://www.cocoadev.com/index.pl?NotificationsAcrossThreads
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
@interface NSNotificationCenter (NSNotificationCenterAdditions)
|
||||||
|
- (void) postNotificationOnMainThread:(NSNotification *) notification;
|
||||||
|
- (void) postNotificationOnMainThread:(NSNotification *) notification waitUntilDone:(BOOL) wait;
|
||||||
|
|
||||||
|
- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object;
|
||||||
|
- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object userInfo:(NSDictionary *) userInfo;
|
||||||
|
- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object userInfo:(NSDictionary *) userInfo waitUntilDone:(BOOL) wait;
|
||||||
|
@end
|
||||||
48
cocoalib/NSNotificationAdditions.m
Normal file
48
cocoalib/NSNotificationAdditions.m
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
#import "NSNotificationAdditions.h"
|
||||||
|
#import <pthread.h>
|
||||||
|
|
||||||
|
@implementation NSNotificationCenter (NSNotificationCenterAdditions)
|
||||||
|
- (void) postNotificationOnMainThread:(NSNotification *) notification {
|
||||||
|
if( pthread_main_np() ) return [self postNotification:notification];
|
||||||
|
[self postNotificationOnMainThread:notification waitUntilDone:NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) postNotificationOnMainThread:(NSNotification *) notification waitUntilDone:(BOOL) wait {
|
||||||
|
if( pthread_main_np() ) return [self postNotification:notification];
|
||||||
|
[[self class] performSelectorOnMainThread:@selector( _postNotification: ) withObject:notification waitUntilDone:wait];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void) _postNotification:(NSNotification *) notification {
|
||||||
|
[[self defaultCenter] postNotification:notification];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object {
|
||||||
|
if( pthread_main_np() ) return [self postNotificationName:name object:object userInfo:nil];
|
||||||
|
[self postNotificationOnMainThreadWithName:name object:object userInfo:nil waitUntilDone:NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object userInfo:(NSDictionary *) userInfo {
|
||||||
|
if( pthread_main_np() ) return [self postNotificationName:name object:object userInfo:userInfo];
|
||||||
|
[self postNotificationOnMainThreadWithName:name object:object userInfo:nil waitUntilDone:NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object userInfo:(NSDictionary *) userInfo waitUntilDone:(BOOL) wait {
|
||||||
|
if( pthread_main_np() ) return [self postNotificationName:name object:object userInfo:userInfo];
|
||||||
|
|
||||||
|
NSMutableDictionary *info = [[NSMutableDictionary allocWithZone:nil] init];
|
||||||
|
[info setObject:name forKey:@"name"];
|
||||||
|
if( object ) [info setObject:object forKey:@"object"];
|
||||||
|
if( userInfo ) [info setObject:userInfo forKey:@"userInfo"];
|
||||||
|
|
||||||
|
[[self class] performSelectorOnMainThread:@selector( _postNotificationName: ) withObject:info waitUntilDone:wait];
|
||||||
|
[info release];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void) _postNotificationName:(NSDictionary *) info {
|
||||||
|
NSString *name = [info objectForKey:@"name"];
|
||||||
|
id object = [info objectForKey:@"object"];
|
||||||
|
NSDictionary *userInfo = [info objectForKey:@"userInfo"];
|
||||||
|
|
||||||
|
[[self defaultCenter] postNotificationName:name object:object userInfo:userInfo];
|
||||||
|
}
|
||||||
|
@end
|
||||||
50
cocoalib/ProgressController.h
Normal file
50
cocoalib/ProgressController.h
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "Worker.h"
|
||||||
|
|
||||||
|
extern NSString *JobCompletedNotification;
|
||||||
|
extern NSString *JobCancelledNotification;
|
||||||
|
|
||||||
|
@interface ProgressController : NSWindowController <NSWindowDelegate>
|
||||||
|
{
|
||||||
|
NSButton *cancelButton;
|
||||||
|
NSProgressIndicator *progressBar;
|
||||||
|
NSTextField *statusText;
|
||||||
|
NSTextField *descText;
|
||||||
|
|
||||||
|
id _jobId;
|
||||||
|
BOOL _running;
|
||||||
|
NSObject<Worker> *_worker;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property (readwrite, retain) NSButton *cancelButton;
|
||||||
|
@property (readwrite, retain) NSProgressIndicator *progressBar;
|
||||||
|
@property (readwrite, retain) NSTextField *statusText;
|
||||||
|
@property (readwrite, retain) NSTextField *descText;
|
||||||
|
|
||||||
|
+ (ProgressController *)mainProgressController;
|
||||||
|
|
||||||
|
- (id)init;
|
||||||
|
|
||||||
|
- (void)cancel;
|
||||||
|
|
||||||
|
- (void)hide;
|
||||||
|
- (void)show;
|
||||||
|
- (void)showWithCancelButton:(BOOL)cancelEnabled;
|
||||||
|
- (void)showSheetForParent:(NSWindow *) parentWindow;
|
||||||
|
- (void)showSheetForParent:(NSWindow *) parentWindow withCancelButton:(BOOL)cancelEnabled;
|
||||||
|
|
||||||
|
/* Properties */
|
||||||
|
- (BOOL)isShown;
|
||||||
|
- (id)jobId;
|
||||||
|
- (void)setJobId:(id)jobId;
|
||||||
|
- (void)setJobDesc:(NSString *)desc;
|
||||||
|
- (void)setWorker:(NSObject<Worker> *)worker;
|
||||||
|
@end
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user