mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-25 16:11:39 +00:00
Compare commits
114 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
e86b23259c | ||
|
|
89955aa96a | ||
|
|
39a601e393 | ||
|
|
3b9e11d14f | ||
|
|
81a7c4d6a6 | ||
|
|
35a162faf4 | ||
|
|
70e505ad92 | ||
|
|
aa3cf9700d | ||
|
|
e4b949abf6 | ||
|
|
2e23303d7e | ||
|
|
2fcaacd285 | ||
|
|
6627f0dbea | ||
|
|
a64b42de65 | ||
|
|
6dddcb1a47 | ||
|
|
4a8ce9b6c4 | ||
|
|
d4e6632e7e | ||
|
|
0ced3e39c8 | ||
|
|
26d923e175 | ||
|
|
592eba9eaa | ||
|
|
11450ae56a | ||
|
|
008bd1414e | ||
|
|
62f6cc3705 | ||
|
|
e16041c703 | ||
|
|
1103b58ec5 | ||
|
|
dc8b1b3b02 | ||
|
|
36b214443a | ||
|
|
d11e20f6ba | ||
|
|
477f73ffa4 | ||
|
|
0b5cd61540 | ||
|
|
17b5703885 | ||
|
|
7cac0b5d6e | ||
|
|
a4003b6072 | ||
|
|
fb26d7d077 | ||
|
|
f2cbb513d3 | ||
|
|
8c36218150 | ||
|
|
7637e493a6 | ||
|
|
62be8da6f9 | ||
|
|
b1c2941616 | ||
|
|
8efd3033a3 | ||
|
|
d417dbd2e3 | ||
|
|
3a717a86d8 | ||
|
|
e1f7260774 | ||
|
|
bfc1ee90ec | ||
|
|
93a5fd01b5 | ||
|
|
b028670250 | ||
|
|
dff141e800 | ||
|
|
f49c7dee96 | ||
|
|
5da793b029 | ||
|
|
a56258f8b3 | ||
|
|
ab6e0945a7 | ||
|
|
8ac035c8a9 | ||
|
|
1c15b0114b | ||
|
|
e78b14f9a2 |
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
.DS_Store
|
||||||
|
*.pyc
|
||||||
|
*.so
|
||||||
|
*.mo
|
||||||
|
*.pyd
|
||||||
|
*.waf*
|
||||||
|
.lock-waf*
|
||||||
|
|
||||||
|
build
|
||||||
|
dist
|
||||||
|
install
|
||||||
|
installer_tmp-cache
|
||||||
|
env
|
||||||
|
cocoa/autogen
|
||||||
|
|
||||||
|
/run.py
|
||||||
|
/conf.json
|
||||||
|
/cocoa/*/Info.plist
|
||||||
|
/cocoa/*/build
|
||||||
|
/qt/base/*_rc.py
|
||||||
|
/help/*/conf.py
|
||||||
|
/help/*/changelog.rst
|
||||||
21
.hgignore
21
.hgignore
@@ -1,21 +0,0 @@
|
|||||||
syntax: glob
|
|
||||||
|
|
||||||
.DS_Store
|
|
||||||
run.py
|
|
||||||
*.pyc
|
|
||||||
*.so
|
|
||||||
*.mo
|
|
||||||
*.pyd
|
|
||||||
*.waf*
|
|
||||||
.lock-waf*
|
|
||||||
conf.json
|
|
||||||
build
|
|
||||||
dist
|
|
||||||
install
|
|
||||||
installer_tmp-cache
|
|
||||||
cocoa/autogen
|
|
||||||
cocoa/*/Info.plist
|
|
||||||
cocoa/*/build
|
|
||||||
qt/base/*_rc.py
|
|
||||||
help/*/conf.py
|
|
||||||
help/*/changelog.rst
|
|
||||||
82
.hgtags
82
.hgtags
@@ -1,82 +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
|
|
||||||
21
.tx/config
Normal file
21
.tx/config
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
[main]
|
||||||
|
host = https://www.transifex.com
|
||||||
|
|
||||||
|
[dupeguru.core]
|
||||||
|
file_filter = locale/<lang>/LC_MESSAGES/core.po
|
||||||
|
source_file = locale/core.pot
|
||||||
|
source_lang = en
|
||||||
|
type = PO
|
||||||
|
|
||||||
|
[dupeguru.columns]
|
||||||
|
file_filter = locale/<lang>/LC_MESSAGES/columns.po
|
||||||
|
source_file = locale/columns.pot
|
||||||
|
source_lang = en
|
||||||
|
type = PO
|
||||||
|
|
||||||
|
[dupeguru.ui]
|
||||||
|
file_filter = locale/<lang>/LC_MESSAGES/ui.po
|
||||||
|
source_file = locale/ui.pot
|
||||||
|
source_lang = en
|
||||||
|
type = PO
|
||||||
|
|
||||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
Copyright 2012 Hardcoded Software Inc. (http://www.hardcoded.net)
|
Copyright 2013 Hardcoded Software Inc. (http://www.hardcoded.net)
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|||||||
109
README
109
README
@@ -1,109 +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 written in TDD style.
|
|
||||||
- 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
|
|
||||||
with 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:
|
|
||||||
|
|
||||||
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)
|
|
||||||
- pluginbuilder 1.1.0 (http://bitbucket.org/hsoft/pluginbuilder)
|
|
||||||
- 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.5 (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.5 (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).
|
|
||||||
You might have to compile PyObjC manually (see gotchas below). Sparkle and
|
|
||||||
Advanced Installer, having nothing to do with Python, are also manual installs.
|
|
||||||
|
|
||||||
PyQt isn't in the requirements file either (there's no package uploaded on PyPI) and you also have
|
|
||||||
to install it manually.
|
|
||||||
|
|
||||||
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 (it will build `dg_cocoa.plugin` in alias mode and use the "dev" config in XCode).
|
|
||||||
|
|
||||||
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
|
|
||||||
94
README.md
Normal file
94
README.md
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
# dupeGuru
|
||||||
|
|
||||||
|
This package contains the source for dupeGuru. Its documentation is
|
||||||
|
[available online][documentation]. 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.
|
||||||
|
* debian: Skeleton files required to create a .deb package
|
||||||
|
* 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.2+][python] and [setuptools][setuptools]
|
||||||
|
* Mac OS X: The last XCode to have the 10.6 SDK included.
|
||||||
|
* Windows: Visual Studio 2008, [PyQt 4.7+][pyqt], [cx_Freeze][cxfreeze] and
|
||||||
|
[Advanced Installer][advinst] (you only need the last two if you want to create an installer)
|
||||||
|
|
||||||
|
On Ubuntu, the apt-get command to install all pre-requisites is:
|
||||||
|
|
||||||
|
$ apt-get install python3-dev python3-pyqt4 pyqt4-dev-tools python3-setuptools
|
||||||
|
|
||||||
|
## Virtualenv setup
|
||||||
|
|
||||||
|
First, you need `pip` and `virtualenv` in your system Python install:
|
||||||
|
|
||||||
|
$ sudo easy_install pip
|
||||||
|
$ sudo pip install virtualenv
|
||||||
|
|
||||||
|
Then, in dupeGuru's source folder, create a virtual environment and activate it:
|
||||||
|
|
||||||
|
$ virtualenv --system-site-packages env
|
||||||
|
$ source env/bin/activate
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
## Alternative: pyvenv
|
||||||
|
|
||||||
|
If you're on Python 3.3+, you can use the built-in `pyvenv` instead of `virtualenv`. `pyvenv` is
|
||||||
|
pretty much the same thing as `virtualenv`, except that it doesn't install setuptools and pip, so it
|
||||||
|
has to be installed manually:
|
||||||
|
|
||||||
|
$ pyvenv --system-site-packages env
|
||||||
|
$ source env/bin/activate
|
||||||
|
$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
|
||||||
|
$ easy_install pip
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
[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
|
||||||
26
bootstrap.sh
Executable file
26
bootstrap.sh
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
command -v python3 -m venv >/dev/null 2>&1 || { echo >&2 "Python 3.3 required. Install it and try again. Aborting"; exit 1; }
|
||||||
|
|
||||||
|
if [ ! -d "env" ]; then
|
||||||
|
echo "No virtualenv. Creating one"
|
||||||
|
command -v curl >/dev/null 2>&1 || { echo >&2 "curl required. Install it and try again. Aborting"; exit 1; }
|
||||||
|
python3 -m venv --system-site-packages env
|
||||||
|
source env/bin/activate
|
||||||
|
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python
|
||||||
|
easy_install pip
|
||||||
|
else
|
||||||
|
echo "There's already an env. Activating it"
|
||||||
|
source env/bin/activate
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Installing pip requirements"
|
||||||
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
|
pip install -r requirements-osx.txt
|
||||||
|
else
|
||||||
|
python3 -c "import PyQt4" >/dev/null 2>&1 || { echo >&2 "PyQt 4.8+ required. Install it and try again. Aborting"; exit 1; }
|
||||||
|
pip install -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"
|
||||||
118
build.py
118
build.py
@@ -1,6 +1,6 @@
|
|||||||
# Created By: Virgil Dupras
|
# Created By: Virgil Dupras
|
||||||
# Created On: 2009-12-30
|
# Created On: 2009-12-30
|
||||||
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2013 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 "BSD" 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
|
||||||
@@ -13,16 +13,18 @@ from optparse import OptionParser
|
|||||||
import shutil
|
import shutil
|
||||||
import json
|
import json
|
||||||
import importlib
|
import importlib
|
||||||
|
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 (add_to_pythonpath, print_and_do, copy_packages, filereplace,
|
||||||
get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, move, copy,
|
get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, OSXAppStructure,
|
||||||
OSXAppStructure, build_cocoalib_xibless, fix_qt_resource_file)
|
build_cocoalib_xibless, fix_qt_resource_file, build_cocoa_ext, copy_embeddable_python_dylib,
|
||||||
|
collect_stdlib_dependencies, copy)
|
||||||
from hscommon import loc
|
from hscommon import loc
|
||||||
from hscommon.plat import ISOSX
|
from hscommon.plat import ISOSX, ISLINUX
|
||||||
from hscommon.util import ensure_folder
|
from hscommon.util import ensure_folder, delete_files_with_pattern
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
usage = "usage: %prog [options]"
|
usage = "usage: %prog [options]"
|
||||||
@@ -43,6 +45,8 @@ def parse_args():
|
|||||||
help="Generate .pot files from source code.")
|
help="Generate .pot files from source code.")
|
||||||
parser.add_option('--mergepot', action='store_true', dest='mergepot',
|
parser.add_option('--mergepot', action='store_true', dest='mergepot',
|
||||||
help="Update all .po files based on .pot files.")
|
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
|
||||||
|
|
||||||
@@ -95,27 +99,37 @@ def build_cocoa(edition, dev):
|
|||||||
build_cocoa_proxy_module()
|
build_cocoa_proxy_module()
|
||||||
build_cocoa_bridging_interfaces(edition)
|
build_cocoa_bridging_interfaces(edition)
|
||||||
print("Building the cocoa layer")
|
print("Building the cocoa layer")
|
||||||
from pluginbuilder import copy_embeddable_python_dylib, collect_dependencies
|
|
||||||
copy_embeddable_python_dylib('build')
|
copy_embeddable_python_dylib('build')
|
||||||
pydep_folder = op.join(app.resources, 'py')
|
pydep_folder = op.join(app.resources, 'py')
|
||||||
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'] + specific_packages
|
tocopy = ['core', 'hscommon', 'cocoa/inter', 'cocoalib/cocoa', 'jobprogress', 'objp',
|
||||||
copy_packages(tocopy, 'build')
|
'send2trash'] + specific_packages
|
||||||
|
copy_packages(tocopy, pydep_folder, create_links=dev)
|
||||||
sys.path.insert(0, 'build')
|
sys.path.insert(0, 'build')
|
||||||
collect_dependencies('build/dg_cocoa.py', pydep_folder, excludes=['PyQt4'])
|
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]
|
||||||
if dev:
|
|
||||||
copy_packages(tocopy, pydep_folder, create_links=True)
|
|
||||||
# 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)
|
copy_sysconfig_files_for_embed(pydep_folder)
|
||||||
|
if not dev:
|
||||||
|
# Important: Don't ever run delete_files_with_pattern('*.py') on dev builds because you'll
|
||||||
|
# be deleting all py files in symlinked folders.
|
||||||
|
compileall.compile_dir(pydep_folder, force=True, legacy=True)
|
||||||
|
delete_files_with_pattern(pydep_folder, '*.py')
|
||||||
|
delete_files_with_pattern(pydep_folder, '__pycache__')
|
||||||
print("Compiling with WAF")
|
print("Compiling with WAF")
|
||||||
os.chdir('cocoa')
|
os.chdir('cocoa')
|
||||||
print_and_do(cocoa_compile_command(edition))
|
print_and_do(cocoa_compile_command(edition))
|
||||||
@@ -127,20 +141,18 @@ def build_cocoa(edition, dev):
|
|||||||
app.copy_resources(*resources, use_symlinks=dev)
|
app.copy_resources(*resources, use_symlinks=dev)
|
||||||
app.copy_frameworks('build/Python', 'cocoalib/Sparkle.framework')
|
app.copy_frameworks('build/Python', 'cocoalib/Sparkle.framework')
|
||||||
print("Creating the run.py file")
|
print("Creating the run.py file")
|
||||||
tmpl = open('run_template_cocoa.py', 'rt').read()
|
tmpl = open('cocoa/run_template.py', 'rt').read()
|
||||||
run_contents = tmpl.replace('{{app_path}}', app.dest)
|
run_contents = tmpl.replace('{{app_path}}', app.dest)
|
||||||
open('run.py', 'wt').write(run_contents)
|
open('run.py', 'wt').write(run_contents)
|
||||||
|
|
||||||
def build_qt(edition, dev):
|
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("pyrcc4 -py3 {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'))
|
||||||
print("Creating the run.py file")
|
print("Creating the run.py file")
|
||||||
tmpl = open('run_template_qt.py', 'rt').read()
|
filereplace(op.join('qt', 'run_template.py'), 'run.py', edition=edition)
|
||||||
run_contents = tmpl.replace('{{edition}}', edition)
|
|
||||||
open('run.py', 'wt').write(run_contents)
|
|
||||||
|
|
||||||
def build_help(edition):
|
def build_help(edition):
|
||||||
print("Generating Help")
|
print("Generating Help")
|
||||||
@@ -148,7 +160,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'}
|
||||||
@@ -161,24 +173,6 @@ def build_base_localizations():
|
|||||||
loc.compile_all_po(op.join('hscommon', 'locale'))
|
loc.compile_all_po(op.join('hscommon', 'locale'))
|
||||||
loc.merge_locale_dir(op.join('hscommon', 'locale'), 'locale')
|
loc.merge_locale_dir(op.join('hscommon', 'locale'), 'locale')
|
||||||
|
|
||||||
def build_cocoa_localizations(edition):
|
|
||||||
print("Creating lproj folders based on .po files")
|
|
||||||
app = cocoa_app(edition)
|
|
||||||
en_stringsfile = op.join('cocoa', 'base', 'en.lproj', 'Localizable.strings')
|
|
||||||
en_cocoastringsfile = op.join('cocoalib', 'en.lproj', 'cocoalib.strings')
|
|
||||||
for lang in loc.get_langs('locale'):
|
|
||||||
pofile = op.join('locale', lang, 'LC_MESSAGES', 'ui.po')
|
|
||||||
dest_lproj = op.join(app.resources, lang + '.lproj')
|
|
||||||
ensure_folder(dest_lproj)
|
|
||||||
loc.po2strings(pofile, en_stringsfile, op.join(dest_lproj, 'Localizable.strings'))
|
|
||||||
pofile = op.join('cocoalib', 'locale', lang, 'LC_MESSAGES', 'cocoalib.po')
|
|
||||||
loc.po2strings(pofile, en_cocoastringsfile, op.join(dest_lproj, 'cocoalib.strings'))
|
|
||||||
# We also have to copy the "en.lproj" strings
|
|
||||||
en_lproj = op.join(app.resources, 'en.lproj')
|
|
||||||
ensure_folder(en_lproj)
|
|
||||||
copy(en_stringsfile, en_lproj)
|
|
||||||
copy(en_cocoastringsfile, en_lproj)
|
|
||||||
|
|
||||||
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')
|
||||||
@@ -186,14 +180,24 @@ def build_qt_localizations():
|
|||||||
def build_localizations(ui, edition):
|
def build_localizations(ui, edition):
|
||||||
build_base_localizations()
|
build_base_localizations()
|
||||||
if ui == 'cocoa':
|
if ui == 'cocoa':
|
||||||
build_cocoa_localizations(edition)
|
app = cocoa_app(edition)
|
||||||
locale_dest = op.join(cocoa_app(edition).resources, 'locale')
|
loc.build_cocoa_localizations(app, en_stringsfile=op.join('cocoa', 'base', 'en.lproj', 'Localizable.strings'))
|
||||||
|
locale_dest = op.join(app.resources, 'locale')
|
||||||
elif ui == 'qt':
|
elif ui == 'qt':
|
||||||
build_qt_localizations()
|
build_qt_localizations()
|
||||||
locale_dest = op.join('build', 'locale')
|
locale_dest = op.join('build', 'locale')
|
||||||
if op.exists(locale_dest):
|
if op.exists(locale_dest):
|
||||||
shutil.rmtree(locale_dest)
|
shutil.rmtree(locale_dest)
|
||||||
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:
|
||||||
|
print("Copying qt_*.qm files into the 'locale' folder")
|
||||||
|
from PyQt4.QtCore import QLibraryInfo
|
||||||
|
trfolder = QLibraryInfo.location(QLibraryInfo.TranslationsPath)
|
||||||
|
for lang in loc.get_langs('locale'):
|
||||||
|
qmname = 'qt_%s.qm' % lang
|
||||||
|
src = op.join(trfolder, qmname)
|
||||||
|
if op.exists(src):
|
||||||
|
copy(src, op.join('build', 'locale', qmname))
|
||||||
|
|
||||||
def build_updatepot():
|
def build_updatepot():
|
||||||
if ISOSX:
|
if ISOSX:
|
||||||
@@ -212,8 +216,10 @@ def build_updatepot():
|
|||||||
print("Building columns.pot")
|
print("Building columns.pot")
|
||||||
loc.generate_pot(all_cores, op.join('locale', 'columns.pot'), ['coltr'])
|
loc.generate_pot(all_cores, op.join('locale', 'columns.pot'), ['coltr'])
|
||||||
print("Building ui.pot")
|
print("Building ui.pot")
|
||||||
|
# When we're not under OS X, we don't want to overwrite ui.pot because it contains Cocoa locs
|
||||||
|
# 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'])
|
loc.generate_pot(ui_packages, op.join('locale', 'ui.pot'), ['tr'], merge=(not ISOSX))
|
||||||
print("Building hscommon.pot")
|
print("Building hscommon.pot")
|
||||||
loc.generate_pot(['hscommon'], op.join('hscommon', 'locale', 'hscommon.pot'), ['tr'])
|
loc.generate_pot(['hscommon'], op.join('hscommon', 'locale', 'hscommon.pot'), ['tr'])
|
||||||
print("Building qtlib.pot")
|
print("Building qtlib.pot")
|
||||||
@@ -234,15 +240,11 @@ def build_mergepot():
|
|||||||
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_cocoa_ext(extname, dest, source_files, extra_frameworks=(), extra_includes=()):
|
def build_normpo():
|
||||||
extra_link_args = ["-framework", "CoreFoundation", "-framework", "Foundation"]
|
loc.normalize_all_pos('locale')
|
||||||
for extra in extra_frameworks:
|
loc.normalize_all_pos(op.join('hscommon', 'locale'))
|
||||||
extra_link_args += ['-framework', extra]
|
loc.normalize_all_pos(op.join('qtlib', 'locale'))
|
||||||
ext = Extension(extname, source_files, extra_link_args=extra_link_args, include_dirs=extra_includes)
|
loc.normalize_all_pos(op.join('cocoalib', 'locale'))
|
||||||
setup(script_args=['build_ext', '--inplace'], ext_modules=[ext])
|
|
||||||
fn = extname + '.so'
|
|
||||||
assert op.exists(fn)
|
|
||||||
move(fn, op.join(dest, fn))
|
|
||||||
|
|
||||||
def build_cocoa_proxy_module():
|
def build_cocoa_proxy_module():
|
||||||
print("Building Cocoa Proxy")
|
print("Building Cocoa Proxy")
|
||||||
@@ -261,7 +263,8 @@ def build_cocoa_bridging_interfaces(edition):
|
|||||||
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 (PyGUIObject, GUIObjectView, PyColumns, ColumnsView, PyOutline,
|
||||||
OutlineView, PySelectableList, SelectableListView, PyTable, TableView, PyFairware)
|
OutlineView, PySelectableList, SelectableListView, PyTable, TableView, PyBaseApp,
|
||||||
|
PyFairware, 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
|
||||||
@@ -273,15 +276,16 @@ 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, PyFairware,
|
allclasses = [PyGUIObject, PyColumns, PyOutline, PySelectableList, PyTable, PyBaseApp, PyFairware,
|
||||||
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'])
|
||||||
@@ -310,7 +314,7 @@ def build_pe_modules(ui):
|
|||||||
move_all('_block*', 'core_pe')
|
move_all('_block*', 'core_pe')
|
||||||
move_all('_cache*', 'core_pe')
|
move_all('_cache*', 'core_pe')
|
||||||
|
|
||||||
def build_normal(edition, ui, dev):
|
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)
|
build_help(edition)
|
||||||
@@ -320,7 +324,7 @@ def build_normal(edition, ui, dev):
|
|||||||
if ui == 'cocoa':
|
if ui == 'cocoa':
|
||||||
build_cocoa(edition, dev)
|
build_cocoa(edition, dev)
|
||||||
elif ui == 'qt':
|
elif ui == 'qt':
|
||||||
build_qt(edition, dev)
|
build_qt(edition, dev, conf)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
options = parse_args()
|
options = parse_args()
|
||||||
@@ -343,6 +347,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)
|
||||||
@@ -355,7 +361,7 @@ def main():
|
|||||||
build_cocoalib_xibless()
|
build_cocoalib_xibless()
|
||||||
build_xibless(edition)
|
build_xibless(edition)
|
||||||
else:
|
else:
|
||||||
build_normal(edition, ui, dev)
|
build_normal(edition, ui, dev, conf)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
@@ -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 "HSAboutBox.h"
|
#import "HSFairwareAboutBox.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;
|
||||||
HSAboutBox *_aboutBox;
|
HSFairwareAboutBox *_aboutBox;
|
||||||
HSRecentFiles *_recentResults;
|
HSRecentFiles *_recentResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +74,5 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
/* model --> view */
|
/* model --> view */
|
||||||
- (void)showMessage:(NSString *)msg;
|
- (void)showMessage:(NSString *)msg;
|
||||||
- (void)setupAsRegistered;
|
- (void)setupAsRegistered;
|
||||||
- (void)showFairwareNagWithPrompt:(NSString *)prompt;
|
|
||||||
- (void)showDemoNagWithPrompt:(NSString *)prompt;
|
- (void)showDemoNagWithPrompt:(NSString *)prompt;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
@@ -74,6 +74,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];
|
||||||
@@ -160,7 +162,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
- (void)showAboutBox
|
- (void)showAboutBox
|
||||||
{
|
{
|
||||||
if (_aboutBox == nil) {
|
if (_aboutBox == nil) {
|
||||||
_aboutBox = [[HSAboutBox alloc] initWithApp:model];
|
_aboutBox = [[HSFairwareAboutBox alloc] initWithApp:model];
|
||||||
}
|
}
|
||||||
[[_aboutBox window] makeKeyAndOrderFront:nil];
|
[[_aboutBox window] makeKeyAndOrderFront:nil];
|
||||||
}
|
}
|
||||||
@@ -197,7 +199,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 initialRegistrationSetup];
|
||||||
[model loadSession];
|
[model loadSession];
|
||||||
}
|
}
|
||||||
@@ -265,11 +266,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showFairwareNagWithPrompt:(NSString *)prompt
|
|
||||||
{
|
|
||||||
[HSFairwareReminder showFairwareNagWithApp:[self model] prompt:prompt];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)showDemoNagWithPrompt:(NSString *)prompt
|
- (void)showDemoNagWithPrompt:(NSString *)prompt
|
||||||
{
|
{
|
||||||
[HSFairwareReminder showDemoNagWithApp:[self model] prompt:prompt];
|
[HSFairwareReminder showDemoNagWithApp:[self model] prompt:prompt];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
@@ -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,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
@@ -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,12 +125,10 @@ 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 {
|
||||||
color = [NSColor blueColor];
|
color = [NSColor blueColor];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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.hardcoded.net/licenses/bsd_license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ResultWindow.h"
|
#import "ResultWindowBase.h"
|
||||||
#import "ResultWindow_UI.h"
|
#import "ResultWindow_UI.h"
|
||||||
#import "Dialogs.h"
|
#import "Dialogs.h"
|
||||||
#import "ProgressController.h"
|
#import "ProgressController.h"
|
||||||
@@ -29,7 +29,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
app = aApp;
|
app = aApp;
|
||||||
model = [app model];
|
model = [app model];
|
||||||
[self setWindow:createResultWindow_UI(self)];
|
[self setWindow:createResultWindow_UI(self)];
|
||||||
[[self window] setTitle:fmt(@"%@ Results", [model appName])];
|
[[self window] setTitle:fmt(NSLocalizedString(@"%@ Results", @""), [model appName])];
|
||||||
/* Put a cute iTunes-like bottom bar */
|
/* Put a cute iTunes-like bottom bar */
|
||||||
[[self window] setContentBorderThickness:28 forEdge:NSMinYEdge];
|
[[self window] setContentBorderThickness:28 forEdge:NSMinYEdge];
|
||||||
table = [[ResultTable alloc] initWithPyRef:[model resultTable] view:matches];
|
table = [[ResultTable alloc] initWithPyRef:[model resultTable] view:matches];
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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];
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
"%@ 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.";
|
"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";
|
||||||
@@ -82,7 +83,7 @@
|
|||||||
"Load Recent Results" = "Load Recent Results";
|
"Load Recent Results" = "Load Recent Results";
|
||||||
"Load Results" = "Load Results";
|
"Load Results" = "Load Results";
|
||||||
"Load Results..." = "Load Results...";
|
"Load Results..." = "Load Results...";
|
||||||
"Make Selected Reference" = "Make Selected Reference";
|
"Make Selected into Reference" = "Make Selected into Reference";
|
||||||
"Mark All" = "Mark All";
|
"Mark All" = "Mark All";
|
||||||
"Mark None" = "Mark None";
|
"Mark None" = "Mark None";
|
||||||
"Mark Selected" = "Mark Selected";
|
"Mark Selected" = "Mark Selected";
|
||||||
@@ -104,7 +105,7 @@
|
|||||||
"Quick Look" = "Quick Look";
|
"Quick Look" = "Quick Look";
|
||||||
"Quit dupeGuru" = "Quit dupeGuru";
|
"Quit dupeGuru" = "Quit dupeGuru";
|
||||||
"Re-Prioritize duplicates" = "Re-Prioritize duplicates";
|
"Re-Prioritize duplicates" = "Re-Prioritize duplicates";
|
||||||
"Re-Prioritize Results" = "Re-Prioritize Results";
|
"Re-Prioritize Results..." = "Re-Prioritize Results...";
|
||||||
"Recreate absolute path" = "Recreate absolute path";
|
"Recreate absolute path" = "Recreate absolute path";
|
||||||
"Recreate relative path" = "Recreate relative path";
|
"Recreate relative path" = "Recreate relative path";
|
||||||
"Reference" = "Reference";
|
"Reference" = "Reference";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ actionMenu.addItem("Send Marked to Trash...", Action(None, 'trashMarked'), 'cmd+
|
|||||||
actionMenu.addItem("Move Marked to...", Action(None, 'moveMarked'), 'cmd+m')
|
actionMenu.addItem("Move Marked to...", Action(None, 'moveMarked'), 'cmd+m')
|
||||||
actionMenu.addItem("Copy Marked to...", Action(None, 'copyMarked'), 'cmd+alt+m')
|
actionMenu.addItem("Copy Marked to...", Action(None, 'copyMarked'), 'cmd+alt+m')
|
||||||
actionMenu.addItem("Remove Marked from Results", Action(None, 'removeMarked'), 'cmd+r')
|
actionMenu.addItem("Remove Marked from Results", Action(None, 'removeMarked'), 'cmd+r')
|
||||||
actionMenu.addItem("Re-Prioritize Results", Action(None, 'reprioritizeResults'))
|
actionMenu.addItem("Re-Prioritize Results...", Action(None, 'reprioritizeResults'))
|
||||||
actionMenu.addSeparator()
|
actionMenu.addSeparator()
|
||||||
actionMenu.addItem("Remove Selected from Results", Action(None, 'removeSelected'), 'cmd+backspace')
|
actionMenu.addItem("Remove Selected from Results", Action(None, 'removeSelected'), 'cmd+backspace')
|
||||||
actionMenu.addItem("Add Selected to Ignore List", Action(None, 'ignoreSelected'), 'cmd+g')
|
actionMenu.addItem("Add Selected to Ignore List", Action(None, 'ignoreSelected'), 'cmd+g')
|
||||||
actionMenu.addItem("Make Selected Reference", Action(None, 'switchSelected'), 'cmd+arrowup')
|
actionMenu.addItem("Make Selected into Reference", Action(None, 'switchSelected'), 'cmd+arrowup')
|
||||||
actionMenu.addSeparator()
|
actionMenu.addSeparator()
|
||||||
actionMenu.addItem("Open Selected with Default Application", Action(None, 'openSelected'), 'cmd+return')
|
actionMenu.addItem("Open Selected with Default Application", Action(None, 'openSelected'), 'cmd+return')
|
||||||
actionMenu.addItem("Reveal Selected in Finder", Action(None, 'revealSelected'), 'cmd+alt+return')
|
actionMenu.addItem("Reveal Selected in Finder", Action(None, 'revealSelected'), 'cmd+alt+return')
|
||||||
|
|||||||
@@ -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,5 +1,5 @@
|
|||||||
wnerclass = 'ResultWindow'
|
ownerclass = 'ResultWindowBase'
|
||||||
ownerimport = 'ResultWindow.h'
|
ownerimport = 'ResultWindowBase.h'
|
||||||
|
|
||||||
result = Window(557, 400, "dupeGuru Results")
|
result = Window(557, 400, "dupeGuru Results")
|
||||||
toolbar = result.createToolbar('ResultsToolbar')
|
toolbar = result.createToolbar('ResultsToolbar')
|
||||||
@@ -57,7 +57,7 @@ actionPopup.menu.addSeparator()
|
|||||||
for menu in (actionPopup.menu, contextMenu):
|
for menu in (actionPopup.menu, contextMenu):
|
||||||
menu.addItem("Remove Selected from Results", action=Action(owner, 'removeSelected'))
|
menu.addItem("Remove Selected from Results", action=Action(owner, 'removeSelected'))
|
||||||
menu.addItem("Add Selected to Ignore List", action=Action(owner, 'ignoreSelected'))
|
menu.addItem("Add Selected to Ignore List", action=Action(owner, 'ignoreSelected'))
|
||||||
menu.addItem("Make Selected Reference", action=Action(owner, 'switchSelected'))
|
menu.addItem("Make Selected into Reference", action=Action(owner, 'switchSelected'))
|
||||||
menu.addSeparator()
|
menu.addSeparator()
|
||||||
menu.addItem("Open Selected with Default Application", action=Action(owner, 'openSelected'))
|
menu.addItem("Open Selected with Default Application", action=Action(owner, 'openSelected'))
|
||||||
menu.addItem("Reveal Selected in Finder", action=Action(owner, 'revealSelected'))
|
menu.addItem("Reveal Selected in Finder", action=Action(owner, 'revealSelected'))
|
||||||
|
|||||||
@@ -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,23 +1,8 @@
|
|||||||
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, proxy
|
||||||
import cocoa
|
|
||||||
from cocoa import install_exception_hook, install_cocoa_logger, proxy
|
|
||||||
from cocoa.inter import PyFairware, FairwareView
|
from cocoa.inter import PyFairware, FairwareView
|
||||||
from hscommon.trans import trget
|
|
||||||
|
|
||||||
from core.app import JobType
|
|
||||||
|
|
||||||
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):
|
class DupeGuruView(FairwareView):
|
||||||
def askYesNoWithPrompt_(self, prompt: str) -> bool: pass
|
def askYesNoWithPrompt_(self, prompt: str) -> bool: pass
|
||||||
@@ -26,16 +11,14 @@ class DupeGuruView(FairwareView):
|
|||||||
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(PyFairware):
|
||||||
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()
|
||||||
install_cocoa_logger()
|
install_cocoa_logger()
|
||||||
|
patch_threaded_job_performer()
|
||||||
appdata = proxy.getAppdataPath()
|
appdata = proxy.getAppdataPath()
|
||||||
self.model = modelclass(self, appdata)
|
self.model = modelclass(self, appdata)
|
||||||
self.progress = cocoa.ThreadedJobPerformer()
|
|
||||||
|
|
||||||
#---Sub-proxies
|
#---Sub-proxies
|
||||||
def detailsPanel(self) -> pyref:
|
def detailsPanel(self) -> pyref:
|
||||||
@@ -56,6 +39,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,31 +143,6 @@ 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
|
@dontwrap
|
||||||
def open_path(self, path):
|
def open_path(self, path):
|
||||||
@@ -191,18 +152,6 @@ class PyDupeGuruBase(PyFairware):
|
|||||||
def reveal_path(self, path):
|
def reveal_path(self, path):
|
||||||
proxy.revealPath_(str(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,6 +1,6 @@
|
|||||||
# Created By: Virgil Dupras
|
# Created By: Virgil Dupras
|
||||||
# Created On: 2006/11/16
|
# Created On: 2006/11/16
|
||||||
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2013 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 "BSD" 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
|
||||||
@@ -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')
|
||||||
|
|
||||||
@@ -184,11 +184,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 +205,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 +233,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 +251,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,6 +1,6 @@
|
|||||||
# Created By: Virgil Dupras
|
# Created By: Virgil Dupras
|
||||||
# Created On: 2006/11/13
|
# Created On: 2006/11/13
|
||||||
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Created By: Virgil Dupras
|
# Created By: Virgil Dupras
|
||||||
# Created On: 2009-05-24
|
# Created On: 2009-05-24
|
||||||
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2013 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 "BSD" 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
|
||||||
@@ -14,9 +14,9 @@ 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):
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Created On: 2012-05-30
|
# Created On: 2012-05-30
|
||||||
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -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,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -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, 2012</string>
|
<string>© Hardcoded Software, 2013</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,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
@@ -7,7 +7,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "../base/ResultWindow.h"
|
#import "ResultWindowBase.h"
|
||||||
|
|
||||||
@interface ResultWindow : ResultWindowBase {}
|
@interface ResultWindow : ResultWindowBase {}
|
||||||
- (void)removeDeadTracks;
|
- (void)removeDeadTracks;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -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, 2012</string>
|
<string>© Hardcoded Software, 2013</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,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
@@ -7,7 +7,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "../base/ResultWindow.h"
|
#import "ResultWindowBase.h"
|
||||||
|
|
||||||
@interface ResultWindow : ResultWindowBase {}
|
@interface ResultWindow : ResultWindowBase {}
|
||||||
- (void)clearPictureCache;
|
- (void)clearPictureCache;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -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, 2012</string>
|
<string>© Hardcoded Software, 2013</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,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
@@ -7,7 +7,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "../base/ResultWindow.h"
|
#import "ResultWindowBase.h"
|
||||||
|
|
||||||
@interface ResultWindow : ResultWindowBase {}
|
@interface ResultWindow : ResultWindowBase {}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
# Copyright 2013 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 "BSD" 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
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys
|
||||||
import os
|
import os
|
||||||
import os.path as op
|
import os.path as op
|
||||||
|
|
||||||
@@ -25,14 +26,15 @@ def configure(conf):
|
|||||||
# I did a lot of fiddling-around, but I didn't find how to tell WAF the Python library name
|
# I did a lot of fiddling-around, but I didn't find how to tell WAF the Python library name
|
||||||
# to look for without making the whole compilation process fail, so I just create a symlink
|
# to look for without making the whole compilation process fail, so I just create a symlink
|
||||||
# with the name WAF is looking for.
|
# with the name WAF is looking for.
|
||||||
if not op.exists('../build/libpython3.2.dylib'):
|
versioned_dylib_path = '../build/libpython{}.dylib'.format(sys.version[:3])
|
||||||
os.symlink('../build/Python', '../build/libpython3.2.dylib')
|
if not op.exists(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,2,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')]
|
||||||
@@ -42,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', 'HSAboutBox', 'HSFairwareReminder', 'Utils',
|
cocoalib_uses = ['NSEventAdditions', 'Dialogs', 'HSFairwareAboutBox', 'HSFairwareReminder', '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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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
|
||||||
29
cocoalib/HSAboutBox.h
Normal file
29
cocoalib/HSAboutBox.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "PyBaseApp.h"
|
||||||
|
|
||||||
|
@interface HSAboutBox : NSWindowController
|
||||||
|
{
|
||||||
|
NSTextField *titleTextField;
|
||||||
|
NSTextField *versionTextField;
|
||||||
|
NSTextField *copyrightTextField;
|
||||||
|
NSTextField *registeredTextField;
|
||||||
|
NSButton *registerButton;
|
||||||
|
|
||||||
|
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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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
|
||||||
23
cocoalib/HSErrorReportWindow.h
Normal file
23
cocoalib/HSErrorReportWindow.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@interface HSErrorReportWindow : NSWindowController
|
||||||
|
{
|
||||||
|
NSTextView *contentTextView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property (readwrite, retain) NSTextView *contentTextView;
|
||||||
|
|
||||||
|
+ (void)showErrorReportWithContent:(NSString *)content;
|
||||||
|
- (id)initWithContent:(NSString *)content;
|
||||||
|
|
||||||
|
- (void)send;
|
||||||
|
- (void)dontSend;
|
||||||
|
@end
|
||||||
48
cocoalib/HSErrorReportWindow.m
Normal file
48
cocoalib/HSErrorReportWindow.m
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSErrorReportWindow.h"
|
||||||
|
#import "HSErrorReportWindow_UI.h"
|
||||||
|
|
||||||
|
@implementation HSErrorReportWindow
|
||||||
|
|
||||||
|
@synthesize contentTextView;
|
||||||
|
|
||||||
|
+ (void)showErrorReportWithContent:(NSString *)content
|
||||||
|
{
|
||||||
|
HSErrorReportWindow *report = [[HSErrorReportWindow alloc] initWithContent:content];
|
||||||
|
[NSApp runModalForWindow:[report window]];
|
||||||
|
[report release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithContent:(NSString *)content
|
||||||
|
{
|
||||||
|
self = [super initWithWindow:nil];
|
||||||
|
[self setWindow:createHSErrorReportWindow_UI(self)];
|
||||||
|
[contentTextView alignLeft:nil];
|
||||||
|
[[[contentTextView textStorage] mutableString] setString:content];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)send
|
||||||
|
{
|
||||||
|
NSString *text = [[contentTextView textStorage] string];
|
||||||
|
NSString *URL = [NSString stringWithFormat:@"mailto:support@hardcoded.net?SUBJECT=Error Report&BODY=%@",text];
|
||||||
|
NSString *encodedURL = [URL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||||
|
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:encodedURL]];
|
||||||
|
|
||||||
|
[[self window] orderOut:self];
|
||||||
|
[NSApp stopModalWithCode:NSOKButton];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dontSend
|
||||||
|
{
|
||||||
|
[[self window] orderOut:self];
|
||||||
|
[NSApp stopModalWithCode:NSCancelButton];
|
||||||
|
}
|
||||||
|
@end
|
||||||
19
cocoalib/HSFairware.h
Normal file
19
cocoalib/HSFairware.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "HSFairwareProtocol.h"
|
||||||
|
|
||||||
|
@interface HSFairware : NSObject <HSFairwareProtocol>
|
||||||
|
{
|
||||||
|
NSInteger appId;
|
||||||
|
NSString *name;
|
||||||
|
BOOL registered;
|
||||||
|
}
|
||||||
|
- (id)initWithAppId:(NSInteger)aAppId name:(NSString *)aName;
|
||||||
|
@end
|
||||||
150
cocoalib/HSFairware.m
Normal file
150
cocoalib/HSFairware.m
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSFairware.h"
|
||||||
|
#import <CommonCrypto/CommonDigest.h>
|
||||||
|
#import "HSFairwareReminder.h"
|
||||||
|
#import "Dialogs.h"
|
||||||
|
#import "Utils.h"
|
||||||
|
|
||||||
|
NSString* md5str(NSString *source)
|
||||||
|
{
|
||||||
|
const char *cSource = [source UTF8String];
|
||||||
|
unsigned char result[16];
|
||||||
|
CC_MD5(cSource, strlen(cSource), result);
|
||||||
|
return fmt(@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||||
|
result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7],
|
||||||
|
result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL validateCode(NSString *code, NSString *email, NSInteger appId)
|
||||||
|
{
|
||||||
|
if ([code length] != 32) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
NSInteger i;
|
||||||
|
for (i=0; i<=100; i++) {
|
||||||
|
NSString *blob = fmt(@"%i%@%iaybabtu", appId, email, i);
|
||||||
|
if ([md5str(blob) isEqualTo:code]) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString* normalizeString(NSString *str)
|
||||||
|
{
|
||||||
|
return [[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] lowercaseString];
|
||||||
|
}
|
||||||
|
|
||||||
|
@implementation HSFairware
|
||||||
|
- (id)initWithAppId:(NSInteger)aAppId name:(NSString *)aName;
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
appId = aAppId;
|
||||||
|
name = [aName retain];
|
||||||
|
registered = NO;
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
[name release];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Private */
|
||||||
|
- (void)setRegistrationCode:(NSString *)aCode email:(NSString *)aEmail
|
||||||
|
{
|
||||||
|
registered = validateCode(aCode, aEmail, appId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Public */
|
||||||
|
- (void)initialRegistrationSetup
|
||||||
|
{
|
||||||
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||||
|
NSString *code = [ud stringForKey:@"RegistrationCode"];
|
||||||
|
NSString *email = [ud stringForKey:@"RegistrationEmail"];
|
||||||
|
if (code && email) {
|
||||||
|
[self setRegistrationCode:code email:email];
|
||||||
|
}
|
||||||
|
if (!registered) {
|
||||||
|
BOOL fairwareMode = [ud boolForKey:@"FairwareMode"];
|
||||||
|
if (!fairwareMode) {
|
||||||
|
NSString *prompt = @"%@ is fairware, which means \"open source software developed "
|
||||||
|
"with expectation of fair contributions from users\". It's a very interesting "
|
||||||
|
"concept, but one year of fairware has shown that most people just want to know "
|
||||||
|
"how much it costs and not be bothered with theories about intellectual property."
|
||||||
|
"\n\n"
|
||||||
|
"So I won't bother you and will be very straightforward: You can try %@ for "
|
||||||
|
"free but you have to buy it in order to use it without limitations. In demo mode, "
|
||||||
|
"%@ will show this dialog on startup."
|
||||||
|
"\n\n"
|
||||||
|
"So it's as simple as this. If you're curious about fairware, however, I encourage "
|
||||||
|
"you to read more about it by clicking on the \"Fairware?\" button.";
|
||||||
|
[HSFairwareReminder showDemoNagWithApp:self prompt:fmt(prompt, name, name, name)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)appName
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)appLongName
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isRegistered
|
||||||
|
{
|
||||||
|
return registered;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)setRegisteredCode:(NSString *)code andEmail:(NSString *)email
|
||||||
|
{
|
||||||
|
code = normalizeString(code);
|
||||||
|
email = normalizeString(email);
|
||||||
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||||
|
if (([code isEqualTo:@"fairware"]) || ([email isEqualTo:@"fairware"])) {
|
||||||
|
[ud setBool:YES forKey:@"FairwareMode"];
|
||||||
|
[Dialogs showMessage:@"Fairware mode enabled."];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
[self setRegistrationCode:code email:email];
|
||||||
|
if (registered) {
|
||||||
|
[ud setObject:code forKey:@"RegistrationCode"];
|
||||||
|
[ud setObject:email forKey:@"RegistrationEmail"];
|
||||||
|
[Dialogs showMessage:@"Your code is valid, thanks!"];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[Dialogs showMessage:@"Your code is invalid. Make sure that you wrote the good code. Also "
|
||||||
|
"make sure that the e-mail you gave is the same as the e-mail you used for your purchase."];
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)contribute
|
||||||
|
{
|
||||||
|
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://open.hardcoded.net/contribute/"]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)buy
|
||||||
|
{
|
||||||
|
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.hardcoded.net/purchase.htm"]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)aboutFairware
|
||||||
|
{
|
||||||
|
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://open.hardcoded.net/about/"]];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
33
cocoalib/HSFairwareAboutBox.h
Normal file
33
cocoalib/HSFairwareAboutBox.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "PyFairware.h"
|
||||||
|
|
||||||
|
@interface HSFairwareAboutBox : NSWindowController
|
||||||
|
{
|
||||||
|
NSTextField *titleTextField;
|
||||||
|
NSTextField *versionTextField;
|
||||||
|
NSTextField *copyrightTextField;
|
||||||
|
NSTextField *registeredTextField;
|
||||||
|
NSButton *registerButton;
|
||||||
|
|
||||||
|
PyFairware *app;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property (readwrite, retain) NSTextField *titleTextField;
|
||||||
|
@property (readwrite, retain) NSTextField *versionTextField;
|
||||||
|
@property (readwrite, retain) NSTextField *copyrightTextField;
|
||||||
|
@property (readwrite, retain) NSTextField *registeredTextField;
|
||||||
|
@property (readwrite, retain) NSButton *registerButton;
|
||||||
|
|
||||||
|
- (id)initWithApp:(PyFairware *)app;
|
||||||
|
- (void)updateFields;
|
||||||
|
|
||||||
|
- (void)showRegisterDialog;
|
||||||
|
@end
|
||||||
60
cocoalib/HSFairwareAboutBox.m
Normal file
60
cocoalib/HSFairwareAboutBox.m
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSFairwareAboutBox.h"
|
||||||
|
#import "HSFairwareAboutBox_UI.h"
|
||||||
|
#import "HSFairwareReminder.h"
|
||||||
|
|
||||||
|
@implementation HSFairwareAboutBox
|
||||||
|
|
||||||
|
@synthesize titleTextField;
|
||||||
|
@synthesize versionTextField;
|
||||||
|
@synthesize copyrightTextField;
|
||||||
|
@synthesize registeredTextField;
|
||||||
|
@synthesize registerButton;
|
||||||
|
|
||||||
|
- (id)initWithApp:(PyFairware *)aApp
|
||||||
|
{
|
||||||
|
self = [super initWithWindow:nil];
|
||||||
|
[self setWindow:createHSFairwareAboutBox_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];
|
||||||
|
if ([app isRegistered]) {
|
||||||
|
[registeredTextField setHidden:NO];
|
||||||
|
[registerButton setHidden:YES];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[registeredTextField setHidden:YES];
|
||||||
|
[registerButton setHidden:NO];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)showRegisterDialog
|
||||||
|
{
|
||||||
|
HSFairwareReminder *fr = [[HSFairwareReminder alloc] initWithApp:app];
|
||||||
|
[fr enterCode];
|
||||||
|
[fr release];
|
||||||
|
[self updateFields];
|
||||||
|
}
|
||||||
|
@end
|
||||||
20
cocoalib/HSFairwareProtocol.h
Normal file
20
cocoalib/HSFairwareProtocol.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@protocol HSFairwareProtocol
|
||||||
|
- (void)initialRegistrationSetup;
|
||||||
|
- (NSString *)appName;
|
||||||
|
- (NSString *)appLongName;
|
||||||
|
- (BOOL)isRegistered;
|
||||||
|
- (BOOL)setRegisteredCode:(NSString *)code andEmail:(NSString *)email;
|
||||||
|
- (void)contribute;
|
||||||
|
- (void)buy;
|
||||||
|
- (void)aboutFairware;
|
||||||
|
@end
|
||||||
46
cocoalib/HSFairwareReminder.h
Normal file
46
cocoalib/HSFairwareReminder.h
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "HSFairwareProtocol.h"
|
||||||
|
|
||||||
|
@interface HSFairwareReminder : NSObject
|
||||||
|
{
|
||||||
|
NSWindow *codePanel;
|
||||||
|
NSTextField *codePromptTextField;
|
||||||
|
NSTextField *codeTextField;
|
||||||
|
NSTextField *emailTextField;
|
||||||
|
NSWindow *demoNagPanel;
|
||||||
|
NSTextField *demoPromptTextField;
|
||||||
|
|
||||||
|
id <HSFairwareProtocol> app;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property (readwrite, retain) NSWindow *codePanel;
|
||||||
|
@property (readwrite, retain) NSTextField *codePromptTextField;
|
||||||
|
@property (readwrite, retain) NSTextField *codeTextField;
|
||||||
|
@property (readwrite, retain) NSTextField *emailTextField;
|
||||||
|
@property (readwrite, retain) NSWindow *demoNagPanel;
|
||||||
|
@property (readwrite, retain) NSTextField *demoPromptTextField;
|
||||||
|
|
||||||
|
//Show nag only if needed
|
||||||
|
+ (BOOL)showDemoNagWithApp:(id <HSFairwareProtocol>)app prompt:(NSString *)prompt;
|
||||||
|
- (id)initWithApp:(id <HSFairwareProtocol>)app;
|
||||||
|
|
||||||
|
- (void)contribute;
|
||||||
|
- (void)buy;
|
||||||
|
- (void)moreInfo;
|
||||||
|
- (void)cancelCode;
|
||||||
|
- (void)showEnterCode;
|
||||||
|
- (void)submitCode;
|
||||||
|
- (void)closeDialog;
|
||||||
|
|
||||||
|
- (BOOL)showNagPanel:(NSWindow *)panel; //YES: The code has been sucessfully submitted NO: The use wan't to try the demo.
|
||||||
|
- (BOOL)showDemoNagPanelWithPrompt:(NSString *)prompt;
|
||||||
|
- (NSInteger)enterCode; //returns the modal code.
|
||||||
|
@end
|
||||||
115
cocoalib/HSFairwareReminder.m
Normal file
115
cocoalib/HSFairwareReminder.m
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "HSFairwareReminder.h"
|
||||||
|
#import "HSDemoReminder_UI.h"
|
||||||
|
#import "HSEnterCode_UI.h"
|
||||||
|
#import "Dialogs.h"
|
||||||
|
#import "Utils.h"
|
||||||
|
|
||||||
|
@implementation HSFairwareReminder
|
||||||
|
|
||||||
|
@synthesize codePanel;
|
||||||
|
@synthesize codePromptTextField;
|
||||||
|
@synthesize codeTextField;
|
||||||
|
@synthesize emailTextField;
|
||||||
|
@synthesize demoNagPanel;
|
||||||
|
@synthesize demoPromptTextField;
|
||||||
|
|
||||||
|
+ (BOOL)showDemoNagWithApp:(id <HSFairwareProtocol>)app prompt:(NSString *)prompt
|
||||||
|
{
|
||||||
|
HSFairwareReminder *fr = [[HSFairwareReminder alloc] initWithApp:app];
|
||||||
|
BOOL r = [fr showDemoNagPanelWithPrompt:prompt];
|
||||||
|
[fr release];
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithApp:(id <HSFairwareProtocol>)aApp
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
app = aApp;
|
||||||
|
[self setDemoNagPanel:createHSDemoReminder_UI(self)];
|
||||||
|
[self setCodePanel:createHSEnterCode_UI(self)];
|
||||||
|
[codePanel update];
|
||||||
|
[codePromptTextField setStringValue:fmt([codePromptTextField stringValue],[app appName])];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)contribute
|
||||||
|
{
|
||||||
|
[app contribute];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)buy
|
||||||
|
{
|
||||||
|
[app buy];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)moreInfo
|
||||||
|
{
|
||||||
|
[app aboutFairware];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)cancelCode
|
||||||
|
{
|
||||||
|
[codePanel close];
|
||||||
|
[NSApp stopModalWithCode:NSCancelButton];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)showEnterCode
|
||||||
|
{
|
||||||
|
[demoNagPanel close];
|
||||||
|
[NSApp stopModalWithCode:NSOKButton];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)submitCode
|
||||||
|
{
|
||||||
|
NSString *code = [codeTextField stringValue];
|
||||||
|
NSString *email = [emailTextField stringValue];
|
||||||
|
if ([app setRegisteredCode:code andEmail:email]) {
|
||||||
|
[codePanel close];
|
||||||
|
[NSApp stopModalWithCode:NSOKButton];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)closeDialog
|
||||||
|
{
|
||||||
|
[demoNagPanel close];
|
||||||
|
[NSApp stopModalWithCode:NSCancelButton];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)showNagPanel:(NSWindow *)panel;
|
||||||
|
{
|
||||||
|
NSInteger r;
|
||||||
|
while (YES) {
|
||||||
|
r = [NSApp runModalForWindow:panel];
|
||||||
|
if (r == NSOKButton) {
|
||||||
|
r = [self enterCode];
|
||||||
|
if (r == NSOKButton) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)showDemoNagPanelWithPrompt:(NSString *)prompt
|
||||||
|
{
|
||||||
|
[demoNagPanel setTitle:fmt([demoNagPanel title],[app appName])];
|
||||||
|
[demoPromptTextField setStringValue:prompt];
|
||||||
|
return [self showNagPanel:demoNagPanel];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSInteger)enterCode
|
||||||
|
{
|
||||||
|
return [NSApp runModalForWindow:codePanel];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
15
cocoalib/HSGeometry.h
Normal file
15
cocoalib/HSGeometry.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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 2013 Hardcoded Software (http://www.hardcoded.net)
|
||||||
|
|
||||||
|
This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||||
|
which should be included with this package. The terms are also available at
|
||||||
|
http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user