New upstream version 2.93
Sandro Tosi
6 years ago
0 | 0 | The Transmission Project |
1 | http://www.transmissionbt.com/ | |
1 | https://transmissionbt.com/ | |
2 | 2 | |
3 | 3 | Lead Developers <dev@transmissionbt.com> |
4 | 4 | Jordan Lee, Mnemosyne LLC <jordan@transmissionbt.com> (Daemon, Backend, GTK+ client) |
40 | 40 | # "Z" for unsupported trunk builds, |
41 | 41 | # "0" for stable, supported releases |
42 | 42 | # these should be the only two lines you need to change |
43 | set(TR_USER_AGENT_PREFIX "2.92") | |
44 | set(TR_PEER_ID_PREFIX "-TR2920-") | |
43 | set(TR_USER_AGENT_PREFIX "2.93") | |
44 | set(TR_PEER_ID_PREFIX "-TR2930-") | |
45 | 45 | |
46 | 46 | string(REGEX MATCH "^([0-9]+)\\.([0-9]+).*" TR_VERSION "${TR_USER_AGENT_PREFIX}") |
47 | 47 | set(TR_VERSION_MAJOR "${CMAKE_MATCH_1}") |
55 | 55 | set(TR_STABLE_RELEASE 1) |
56 | 56 | endif() |
57 | 57 | |
58 | set(TR_SCM_REVISION_FILE "${CMAKE_SOURCE_DIR}/REVISION") | |
59 | set(TR_SCM_REVISION_RELIABLE ON) | |
60 | ||
61 | if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.svn) | |
62 | find_package(Subversion) | |
63 | if(Subversion_FOUND) | |
64 | Subversion_WC_INFO(${CMAKE_SOURCE_DIR} TR_SVN) | |
65 | set(TR_SCM_REVISION "${TR_SVN_WC_REVISION}") | |
66 | endif() | |
58 | set(TR_VCS_REVISION_FILE "${CMAKE_SOURCE_DIR}/REVISION") | |
59 | ||
60 | if(NOT "$ENV{JENKINS_URL}" STREQUAL "" AND NOT "$ENV{GIT_COMMIT}" STREQUAL "") | |
61 | set(TR_VCS_REVISION "$ENV{GIT_COMMIT}") | |
62 | elseif(NOT "$ENV{TEAMCITY_PROJECT_NAME}" STREQUAL "" AND NOT "$ENV{BUILD_VCS_NUMBER}" STREQUAL "") | |
63 | set(TR_VCS_REVISION "$ENV{BUILD_VCS_NUMBER}") | |
67 | 64 | elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) |
68 | 65 | find_package(Git) |
69 | 66 | if(GIT_FOUND) |
70 | 67 | execute_process( |
71 | 68 | COMMAND |
72 | ${GIT_EXECUTABLE} rev-list --max-count=1 --abbrev-commit HEAD | |
69 | ${GIT_EXECUTABLE} rev-list --max-count=1 HEAD | |
73 | 70 | WORKING_DIRECTORY |
74 | 71 | ${CMAKE_SOURCE_DIR} |
75 | 72 | OUTPUT_VARIABLE |
76 | TR_SCM_REVISION | |
73 | TR_VCS_REVISION | |
77 | 74 | OUTPUT_STRIP_TRAILING_WHITESPACE |
78 | 75 | ) |
79 | 76 | endif() |
80 | 77 | endif() |
81 | 78 | |
82 | if("${TR_SCM_REVISION}" STREQUAL "" AND EXISTS "${TR_SCM_REVISION_FILE}") | |
83 | file(READ "${TR_SCM_REVISION_FILE}" TR_SCM_REVISION) | |
84 | string(STRIP "${TR_SCM_REVISION}" TR_SCM_REVISION) | |
85 | endif() | |
86 | ||
87 | if("${TR_SCM_REVISION}" STREQUAL "") | |
88 | # Give up and check the source files | |
89 | set(TR_SCM_REVISION 0) | |
90 | set(TR_SCM_REVISION_RELIABLE OFF) | |
91 | file(GLOB_RECURSE TR_ALL_SOURCES RELATIVE ${CMAKE_SOURCE_DIR} *.cc *.[chm] *.po) | |
92 | foreach(F ${TR_ALL_SOURCES}) | |
93 | file(STRINGS ${F} F_ID REGEX "\\$Id:") | |
94 | if(F_ID MATCHES "\\$Id: [^ ]+ ([0-9]+) " AND CMAKE_MATCH_1 GREATER TR_SCM_REVISION) | |
95 | set(TR_SCM_REVISION ${CMAKE_MATCH_1}) | |
96 | endif() | |
97 | endforeach() | |
98 | endif() | |
99 | ||
100 | if("${TR_SCM_REVISION}" STREQUAL "") | |
101 | set(TR_SCM_REVISION 0) | |
79 | if("${TR_VCS_REVISION}" STREQUAL "" AND EXISTS "${TR_VCS_REVISION_FILE}") | |
80 | file(READ "${TR_VCS_REVISION_FILE}" TR_VCS_REVISION) | |
81 | endif() | |
82 | ||
83 | string(STRIP "${TR_VCS_REVISION}" TR_VCS_REVISION) | |
84 | ||
85 | if(NOT "${TR_VCS_REVISION}" STREQUAL "") | |
86 | file(WRITE "${TR_VCS_REVISION_FILE}" "${TR_VCS_REVISION}\n") | |
102 | 87 | else() |
103 | if(TR_SCM_REVISION_RELIABLE) | |
104 | file(WRITE "${TR_SCM_REVISION_FILE}" "${TR_SCM_REVISION}") | |
105 | else() | |
106 | file(REMOVE "${TR_SCM_REVISION_FILE}") | |
107 | endif() | |
108 | endif() | |
88 | set(TR_VCS_REVISION 0) | |
89 | file(REMOVE "${TR_VCS_REVISION_FILE}") | |
90 | endif() | |
91 | ||
92 | string(SUBSTRING "${TR_VCS_REVISION}" 0 10 TR_VCS_REVISION) | |
109 | 93 | |
110 | 94 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) |
111 | 95 |
402 | 402 | prefix = @prefix@ |
403 | 403 | program_transform_name = @program_transform_name@ |
404 | 404 | psdir = @psdir@ |
405 | runstatedir = @runstatedir@ | |
405 | 406 | sbindir = @sbindir@ |
406 | 407 | sharedstatedir = @sharedstatedir@ |
407 | 408 | srcdir = @srcdir@ |
0 | === Transmission 2.93 (2018/01/xx) === | |
1 | [https://github.com/transmission/transmission/releases/tag/2.93 All tickets closed by this release] | |
2 | ==== All Platforms ==== | |
3 | * Fix CVE-2018-5702 (#468) | |
4 | * Fix crash on handshake if establishing DH shared secret fails (#27) | |
5 | * Fix crash when switching to next tracker during announcement (#297) | |
6 | * Fix potential issue during password salt extraction in OOM situation (#141) | |
7 | * Workaround `glib_DEFUN`- and `glib_REQUIRE`-related configuration issue (#215) | |
8 | * Fix building against OpenSSL 1.1.0+ (#24) | |
9 | ==== Mac Client ==== | |
10 | * Fix uncaught exception when dragging multiple items between groups (#51) | |
11 | * Don't hard-code libcrypto version to 0.9.8 in Xcode project (#71) | |
12 | ||
0 | 13 | === Transmission 2.92 (2016/03/06) === |
1 | 14 | [http://trac.transmissionbt.com/query?milestone=2.92&group=component&order=severity All tickets closed by this release] |
2 | 15 | ==== Mac Client ==== |
7 | 7 | * A headless daemon for servers and routers |
8 | 8 | * A web UI for remote controlling any of the above |
9 | 9 | |
10 | Visit http://www.transmissionbt.com/ for more information. | |
10 | Visit https://transmissionbt.com/ for more information. | |
11 | 11 | |
12 | 12 | BUILDING |
13 | 13 | |
15 | 15 | for building in Xcode. |
16 | 16 | |
17 | 17 | For a more detailed description, and dependancies, visit: |
18 | http://trac.transmissionbt.com/wiki/ | |
18 | https://github.com/transmission/transmission/wiki | |
19 | 19 | |
20 | 20 | Building a Transmission release from the command line: |
21 | 21 | |
27 | 27 | |
28 | 28 | Building Transmission from the nightly builds: |
29 | 29 | |
30 | Download a tarball from http://build.transmissionbt.com/job/trunk-linux-inc/ | |
30 | Download a tarball from https://build.transmissionbt.com/job/trunk-linux-inc/ | |
31 | 31 | and follow the steps from the previous section. |
32 | 32 | |
33 | 33 | If you're new to building programs from source code, this is typically |
128 | 128 | A225A4C0187E369C00CDE823 /* ShareToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A225A4BF187E369C00CDE823 /* ShareToolbarItem.m */; }; |
129 | 129 | A2265F420B5EF5F40093DDA5 /* FileNameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2265F400B5EF5F40093DDA5 /* FileNameCell.m */; }; |
130 | 130 | A226FDAC0D0CDF20005A7F71 /* libnatpmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C7A118D0D0B2EB800B5701F /* libnatpmp.a */; }; |
131 | A2290D1E14421CC100B95A09 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; | |
132 | A2290D2014421CD000B95A09 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; | |
133 | A2290D2214421CD800B95A09 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; | |
134 | A2290D2514421D1A00B95A09 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; | |
131 | A2290D1E14421CC100B95A09 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; | |
132 | A2290D2014421CD000B95A09 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; | |
133 | A2290D2214421CD800B95A09 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; | |
134 | A2290D2514421D1A00B95A09 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; | |
135 | 135 | A2290D2E1442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; }; |
136 | 136 | A2290D2F1442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; }; |
137 | 137 | A2290D301442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; }; |
392 | 392 | A2F35BCA15C5A0A100EBF632 /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = A2F35BC915C5A0A100EBF632 /* GenerateThumbnailForURL.m */; }; |
393 | 393 | A2F35BCC15C5A0A100EBF632 /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = A2F35BCB15C5A0A100EBF632 /* GeneratePreviewForURL.m */; }; |
394 | 394 | A2F35BD415C5A19A00EBF632 /* libtransmission.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D18389709DEC0030047D688 /* libtransmission.a */; }; |
395 | A2F35BD715C5A46D00EBF632 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; | |
395 | A2F35BD715C5A46D00EBF632 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; | |
396 | 396 | A2F35BDA15C5A49200EBF632 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2B6141B1395ADE9000E0975 /* libz.dylib */; }; |
397 | 397 | A2F35BDB15C5A4A000EBF632 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; }; |
398 | 398 | A2F35BE115C5A7ED00EBF632 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2F35BE015C5A7ED00EBF632 /* Cocoa.framework */; }; |
919 | 919 | A2725D5C0DE7507C003445E7 /* TrackerTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TrackerTableView.m; path = macosx/TrackerTableView.m; sourceTree = "<group>"; }; |
920 | 920 | A27476FF0CC38EE6003CC76D /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = macosx/es.lproj/InfoPlist.strings; sourceTree = "<group>"; }; |
921 | 921 | A27477010CC38EE6003CC76D /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = macosx/es.lproj/Localizable.strings; sourceTree = "<group>"; }; |
922 | A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.0.9.8.dylib; path = "third-party/openssl/lib/libcrypto.0.9.8.dylib"; sourceTree = "<group>"; }; | |
922 | A27653A714369C5C009D3CCF /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = "third-party/openssl/lib/libcrypto.dylib"; sourceTree = "<group>"; }; | |
923 | 923 | A277DA090C693D9C00DA2CD4 /* ActionOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionOn.png; path = macosx/Images/ActionOn.png; sourceTree = "<group>"; }; |
924 | 924 | A279E3D011C3BDC300D48B1F /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/AddMagnetWindow.xib; sourceTree = "<group>"; }; |
925 | 925 | A279E3D111C3BDC300D48B1F /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/InfoActivityView.xib; sourceTree = "<group>"; }; |
1255 | 1255 | files = ( |
1256 | 1256 | 4D9A2BF009E16D21002D0FF9 /* libtransmission.a in Frameworks */, |
1257 | 1257 | A296EF3C11E560BD004A2781 /* libiconv.dylib in Frameworks */, |
1258 | A2290D1E14421CC100B95A09 /* libcrypto.0.9.8.dylib in Frameworks */, | |
1258 | A2290D1E14421CC100B95A09 /* libcrypto.dylib in Frameworks */, | |
1259 | 1259 | A2290D2F1442B23200B95A09 /* libcurl.4.dylib in Frameworks */, |
1260 | 1260 | A2B6141E1395B0EC000E0975 /* libz.dylib in Frameworks */, |
1261 | 1261 | A2B3FB4C0E59023000FF78FB /* Cocoa.framework in Frameworks */, |
1272 | 1272 | A24F19080A3A790800C9C145 /* Sparkle.framework in Frameworks */, |
1273 | 1273 | A261F1DC0A69A1610002815A /* Growl.framework in Frameworks */, |
1274 | 1274 | A296EF3B11E560A7004A2781 /* libiconv.dylib in Frameworks */, |
1275 | A2290D2514421D1A00B95A09 /* libcrypto.0.9.8.dylib in Frameworks */, | |
1275 | A2290D2514421D1A00B95A09 /* libcrypto.dylib in Frameworks */, | |
1276 | 1276 | A2290D2E1442B23200B95A09 /* libcurl.4.dylib in Frameworks */, |
1277 | 1277 | A2B6141F1395B0F5000E0975 /* libz.dylib in Frameworks */, |
1278 | 1278 | A2E669790F5B8E5A00B4251A /* Security.framework in Frameworks */, |
1306 | 1306 | A2F35BD415C5A19A00EBF632 /* libtransmission.a in Frameworks */, |
1307 | 1307 | A2F35BDB15C5A4A000EBF632 /* libiconv.dylib in Frameworks */, |
1308 | 1308 | A2F35BDA15C5A49200EBF632 /* libz.dylib in Frameworks */, |
1309 | A2F35BD715C5A46D00EBF632 /* libcrypto.0.9.8.dylib in Frameworks */, | |
1309 | A2F35BD715C5A46D00EBF632 /* libcrypto.dylib in Frameworks */, | |
1310 | 1310 | A2AB76EA15D8130B009EFC95 /* libcurl.4.dylib in Frameworks */, |
1311 | 1311 | ); |
1312 | 1312 | runOnlyForDeploymentPostprocessing = 0; |
1344 | 1344 | files = ( |
1345 | 1345 | BEFC1C050C07753500B0BB3C /* libtransmission.a in Frameworks */, |
1346 | 1346 | A296EF3D11E560C3004A2781 /* libiconv.dylib in Frameworks */, |
1347 | A2290D2014421CD000B95A09 /* libcrypto.0.9.8.dylib in Frameworks */, | |
1347 | A2290D2014421CD000B95A09 /* libcrypto.dylib in Frameworks */, | |
1348 | 1348 | A2290D301442B23200B95A09 /* libcurl.4.dylib in Frameworks */, |
1349 | 1349 | A2B6141D1395B0E3000E0975 /* libz.dylib in Frameworks */, |
1350 | 1350 | A2B3FB530E59027100FF78FB /* Cocoa.framework in Frameworks */, |
1357 | 1357 | files = ( |
1358 | 1358 | BEFC1D2D0C0783D900B0BB3C /* libtransmission.a in Frameworks */, |
1359 | 1359 | A296EF3E11E560D1004A2781 /* libiconv.dylib in Frameworks */, |
1360 | A2290D2214421CD800B95A09 /* libcrypto.0.9.8.dylib in Frameworks */, | |
1360 | A2290D2214421CD800B95A09 /* libcrypto.dylib in Frameworks */, | |
1361 | 1361 | A2290D311442B23200B95A09 /* libcurl.4.dylib in Frameworks */, |
1362 | 1362 | A2B6141C1395ADE9000E0975 /* libz.dylib in Frameworks */, |
1363 | 1363 | A25E03D90E4015100086C225 /* Cocoa.framework in Frameworks */, |
1837 | 1837 | 4DDBB71509E16B3F00284745 /* Libraries */ = { |
1838 | 1838 | isa = PBXGroup; |
1839 | 1839 | children = ( |
1840 | A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */, | |
1840 | A27653A714369C5C009D3CCF /* libcrypto.dylib */, | |
1841 | 1841 | A2290D2D1442B23200B95A09 /* libcurl.4.dylib */, |
1842 | 1842 | A296EF3411E5605E004A2781 /* libiconv.dylib */, |
1843 | 1843 | A2B6141B1395ADE9000E0975 /* libz.dylib */, |
18 | 18 | You have another version of autoconf. It may work, but is not guaranteed to. |
19 | 19 | If you have problems, you may need to regenerate the build system entirely. |
20 | 20 | To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
21 | ||
22 | # Copyright (C) 1995-2002 Free Software Foundation, Inc. | |
23 | # Copyright (C) 2001-2003,2004 Red Hat, Inc. | |
24 | # | |
25 | # This file is free software, distributed under the terms of the GNU | |
26 | # General Public License. As a special exception to the GNU General | |
27 | # Public License, this file may be distributed as part of a program | |
28 | # that contains a configuration script generated by Autoconf, under | |
29 | # the same distribution terms as the rest of that program. | |
30 | # | |
31 | # This file can be copied and used freely without restrictions. It can | |
32 | # be used in projects which are not available under the GNU Public License | |
33 | # but which still want to provide support for the GNU gettext functionality. | |
34 | # | |
35 | # Macro to add for using GNU gettext. | |
36 | # Ulrich Drepper <drepper@cygnus.com>, 1995, 1996 | |
37 | # | |
38 | # Modified to never use included libintl. | |
39 | # Owen Taylor <otaylor@redhat.com>, 12/15/1998 | |
40 | # | |
41 | # Major rework to remove unused code | |
42 | # Owen Taylor <otaylor@redhat.com>, 12/11/2002 | |
43 | # | |
44 | # Added better handling of ALL_LINGUAS from GNU gettext version | |
45 | # written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002 | |
46 | # | |
47 | # Modified to require ngettext | |
48 | # Matthias Clasen <mclasen@redhat.com> 08/06/2004 | |
49 | # | |
50 | # We need this here as well, since someone might use autoconf-2.5x | |
51 | # to configure GLib then an older version to configure a package | |
52 | # using AM_GLIB_GNU_GETTEXT | |
53 | AC_PREREQ(2.53) | |
54 | ||
55 | dnl | |
56 | dnl We go to great lengths to make sure that aclocal won't | |
57 | dnl try to pull in the installed version of these macros | |
58 | dnl when running aclocal in the glib directory. | |
59 | dnl | |
60 | m4_copy([AC_DEFUN],[glib_DEFUN]) | |
61 | m4_copy([AC_REQUIRE],[glib_REQUIRE]) | |
62 | dnl | |
63 | dnl At the end, if we're not within glib, we'll define the public | |
64 | dnl definitions in terms of our private definitions. | |
65 | dnl | |
66 | ||
67 | # GLIB_LC_MESSAGES | |
68 | #-------------------- | |
69 | glib_DEFUN([GLIB_LC_MESSAGES], | |
70 | [AC_CHECK_HEADERS([locale.h]) | |
71 | if test $ac_cv_header_locale_h = yes; then | |
72 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | |
73 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | |
74 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | |
75 | if test $am_cv_val_LC_MESSAGES = yes; then | |
76 | AC_DEFINE(HAVE_LC_MESSAGES, 1, | |
77 | [Define if your <locale.h> file defines LC_MESSAGES.]) | |
78 | fi | |
79 | fi]) | |
80 | ||
81 | # GLIB_PATH_PROG_WITH_TEST | |
82 | #---------------------------- | |
83 | dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, | |
84 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) | |
85 | glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], | |
86 | [# Extract the first word of "$2", so it can be a program name with args. | |
87 | set dummy $2; ac_word=[$]2 | |
88 | AC_MSG_CHECKING([for $ac_word]) | |
89 | AC_CACHE_VAL(ac_cv_path_$1, | |
90 | [case "[$]$1" in | |
91 | /*) | |
92 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. | |
93 | ;; | |
94 | *) | |
95 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
96 | for ac_dir in ifelse([$5], , $PATH, [$5]); do | |
97 | test -z "$ac_dir" && ac_dir=. | |
98 | if test -f $ac_dir/$ac_word; then | |
99 | if [$3]; then | |
100 | ac_cv_path_$1="$ac_dir/$ac_word" | |
101 | break | |
102 | fi | |
103 | fi | |
104 | done | |
105 | IFS="$ac_save_ifs" | |
106 | dnl If no 4th arg is given, leave the cache variable unset, | |
107 | dnl so AC_PATH_PROGS will keep looking. | |
108 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" | |
109 | ])dnl | |
110 | ;; | |
111 | esac])dnl | |
112 | $1="$ac_cv_path_$1" | |
113 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then | |
114 | AC_MSG_RESULT([$]$1) | |
115 | else | |
116 | AC_MSG_RESULT(no) | |
117 | fi | |
118 | AC_SUBST($1)dnl | |
119 | ]) | |
120 | ||
121 | # GLIB_WITH_NLS | |
122 | #----------------- | |
123 | glib_DEFUN([GLIB_WITH_NLS], | |
124 | dnl NLS is obligatory | |
125 | [USE_NLS=yes | |
126 | AC_SUBST(USE_NLS) | |
127 | ||
128 | gt_cv_have_gettext=no | |
129 | ||
130 | CATOBJEXT=NONE | |
131 | XGETTEXT=: | |
132 | INTLLIBS= | |
133 | ||
134 | AC_CHECK_HEADER(libintl.h, | |
135 | [gt_cv_func_dgettext_libintl="no" | |
136 | libintl_extra_libs="" | |
137 | ||
138 | # | |
139 | # First check in libc | |
140 | # | |
141 | AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, | |
142 | [AC_TRY_LINK([ | |
143 | #include <libintl.h> | |
144 | ], | |
145 | [return !ngettext ("","", 1)], | |
146 | gt_cv_func_ngettext_libc=yes, | |
147 | gt_cv_func_ngettext_libc=no) | |
148 | ]) | |
149 | ||
150 | if test "$gt_cv_func_ngettext_libc" = "yes" ; then | |
151 | AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, | |
152 | [AC_TRY_LINK([ | |
153 | #include <libintl.h> | |
154 | ], | |
155 | [return !dgettext ("","")], | |
156 | gt_cv_func_dgettext_libc=yes, | |
157 | gt_cv_func_dgettext_libc=no) | |
158 | ]) | |
159 | fi | |
160 | ||
161 | if test "$gt_cv_func_ngettext_libc" = "yes" ; then | |
162 | AC_CHECK_FUNCS(bind_textdomain_codeset) | |
163 | fi | |
164 | ||
165 | # | |
166 | # If we don't have everything we want, check in libintl | |
167 | # | |
168 | if test "$gt_cv_func_dgettext_libc" != "yes" \ | |
169 | || test "$gt_cv_func_ngettext_libc" != "yes" \ | |
170 | || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then | |
171 | ||
172 | AC_CHECK_LIB(intl, bindtextdomain, | |
173 | [AC_CHECK_LIB(intl, ngettext, | |
174 | [AC_CHECK_LIB(intl, dgettext, | |
175 | gt_cv_func_dgettext_libintl=yes)])]) | |
176 | ||
177 | if test "$gt_cv_func_dgettext_libintl" != "yes" ; then | |
178 | AC_MSG_CHECKING([if -liconv is needed to use gettext]) | |
179 | AC_MSG_RESULT([]) | |
180 | AC_CHECK_LIB(intl, ngettext, | |
181 | [AC_CHECK_LIB(intl, dcgettext, | |
182 | [gt_cv_func_dgettext_libintl=yes | |
183 | libintl_extra_libs=-liconv], | |
184 | :,-liconv)], | |
185 | :,-liconv) | |
186 | fi | |
187 | ||
188 | # | |
189 | # If we found libintl, then check in it for bind_textdomain_codeset(); | |
190 | # we'll prefer libc if neither have bind_textdomain_codeset(), | |
191 | # and both have dgettext and ngettext | |
192 | # | |
193 | if test "$gt_cv_func_dgettext_libintl" = "yes" ; then | |
194 | glib_save_LIBS="$LIBS" | |
195 | LIBS="$LIBS -lintl $libintl_extra_libs" | |
196 | unset ac_cv_func_bind_textdomain_codeset | |
197 | AC_CHECK_FUNCS(bind_textdomain_codeset) | |
198 | LIBS="$glib_save_LIBS" | |
199 | ||
200 | if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then | |
201 | gt_cv_func_dgettext_libc=no | |
202 | else | |
203 | if test "$gt_cv_func_dgettext_libc" = "yes" \ | |
204 | && test "$gt_cv_func_ngettext_libc" = "yes"; then | |
205 | gt_cv_func_dgettext_libintl=no | |
206 | fi | |
207 | fi | |
208 | fi | |
209 | fi | |
210 | ||
211 | if test "$gt_cv_func_dgettext_libc" = "yes" \ | |
212 | || test "$gt_cv_func_dgettext_libintl" = "yes"; then | |
213 | gt_cv_have_gettext=yes | |
214 | fi | |
215 | ||
216 | if test "$gt_cv_func_dgettext_libintl" = "yes"; then | |
217 | INTLLIBS="-lintl $libintl_extra_libs" | |
218 | fi | |
219 | ||
220 | if test "$gt_cv_have_gettext" = "yes"; then | |
221 | AC_DEFINE(HAVE_GETTEXT,1, | |
222 | [Define if the GNU gettext() function is already present or preinstalled.]) | |
223 | GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
224 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl | |
225 | if test "$MSGFMT" != "no"; then | |
226 | glib_save_LIBS="$LIBS" | |
227 | LIBS="$LIBS $INTLLIBS" | |
228 | AC_CHECK_FUNCS(dcgettext) | |
229 | MSGFMT_OPTS= | |
230 | AC_MSG_CHECKING([if msgfmt accepts -c]) | |
231 | GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ | |
232 | msgid "" | |
233 | msgstr "" | |
234 | "Content-Type: text/plain; charset=UTF-8\n" | |
235 | "Project-Id-Version: test 1.0\n" | |
236 | "PO-Revision-Date: 2007-02-15 12:01+0100\n" | |
237 | "Last-Translator: test <foo@bar.xx>\n" | |
238 | "Language-Team: C <LL@li.org>\n" | |
239 | "MIME-Version: 1.0\n" | |
240 | "Content-Transfer-Encoding: 8bit\n" | |
241 | ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) | |
242 | AC_SUBST(MSGFMT_OPTS) | |
243 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
244 | GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
245 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
246 | AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; | |
247 | return _nl_msg_cat_cntr], | |
248 | [CATOBJEXT=.gmo | |
249 | DATADIRNAME=share], | |
250 | [case $host in | |
251 | *-*-solaris*) | |
252 | dnl On Solaris, if bind_textdomain_codeset is in libc, | |
253 | dnl GNU format message catalog is always supported, | |
254 | dnl since both are added to the libc all together. | |
255 | dnl Hence, we'd like to go with DATADIRNAME=share and | |
256 | dnl and CATOBJEXT=.gmo in this case. | |
257 | AC_CHECK_FUNC(bind_textdomain_codeset, | |
258 | [CATOBJEXT=.gmo | |
259 | DATADIRNAME=share], | |
260 | [CATOBJEXT=.mo | |
261 | DATADIRNAME=lib]) | |
262 | ;; | |
263 | *-*-openbsd*) | |
264 | CATOBJEXT=.mo | |
265 | DATADIRNAME=share | |
266 | ;; | |
267 | *) | |
268 | CATOBJEXT=.mo | |
269 | DATADIRNAME=lib | |
270 | ;; | |
271 | esac]) | |
272 | LIBS="$glib_save_LIBS" | |
273 | INSTOBJEXT=.mo | |
274 | else | |
275 | gt_cv_have_gettext=no | |
276 | fi | |
277 | fi | |
278 | ]) | |
279 | ||
280 | if test "$gt_cv_have_gettext" = "yes" ; then | |
281 | AC_DEFINE(ENABLE_NLS, 1, | |
282 | [always defined to indicate that i18n is enabled]) | |
283 | fi | |
284 | ||
285 | dnl Test whether we really found GNU xgettext. | |
286 | if test "$XGETTEXT" != ":"; then | |
287 | dnl If it is not GNU xgettext we define it as : so that the | |
288 | dnl Makefiles still can work. | |
289 | if $XGETTEXT --omit-header /dev/null 2> /dev/null; then | |
290 | : ; | |
291 | else | |
292 | AC_MSG_RESULT( | |
293 | [found xgettext program is not GNU xgettext; ignore it]) | |
294 | XGETTEXT=":" | |
295 | fi | |
296 | fi | |
297 | ||
298 | # We need to process the po/ directory. | |
299 | POSUB=po | |
300 | ||
301 | AC_OUTPUT_COMMANDS( | |
302 | [case "$CONFIG_FILES" in *po/Makefile.in*) | |
303 | sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile | |
304 | esac]) | |
305 | ||
306 | dnl These rules are solely for the distribution goal. While doing this | |
307 | dnl we only have to keep exactly one list of the available catalogs | |
308 | dnl in configure.ac. | |
309 | for lang in $ALL_LINGUAS; do | |
310 | GMOFILES="$GMOFILES $lang.gmo" | |
311 | POFILES="$POFILES $lang.po" | |
312 | done | |
313 | ||
314 | dnl Make all variables we use known to autoconf. | |
315 | AC_SUBST(CATALOGS) | |
316 | AC_SUBST(CATOBJEXT) | |
317 | AC_SUBST(DATADIRNAME) | |
318 | AC_SUBST(GMOFILES) | |
319 | AC_SUBST(INSTOBJEXT) | |
320 | AC_SUBST(INTLLIBS) | |
321 | AC_SUBST(PO_IN_DATADIR_TRUE) | |
322 | AC_SUBST(PO_IN_DATADIR_FALSE) | |
323 | AC_SUBST(POFILES) | |
324 | AC_SUBST(POSUB) | |
325 | ]) | |
326 | ||
327 | # AM_GLIB_GNU_GETTEXT | |
328 | # ------------------- | |
329 | # Do checks necessary for use of gettext. If a suitable implementation | |
330 | # of gettext is found in either in libintl or in the C library, | |
331 | # it will set INTLLIBS to the libraries needed for use of gettext | |
332 | # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable | |
333 | # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() | |
334 | # on various variables needed by the Makefile.in.in installed by | |
335 | # glib-gettextize. | |
336 | dnl | |
337 | AU_DEFUN([GLIB_GNU_GETTEXT], | |
338 | [AC_REQUIRE([AC_PROG_CC])dnl | |
339 | ||
340 | GLIB_LC_MESSAGES | |
341 | GLIB_WITH_NLS | |
342 | ||
343 | if test "$gt_cv_have_gettext" = "yes"; then | |
344 | if test "x$ALL_LINGUAS" = "x"; then | |
345 | LINGUAS= | |
346 | else | |
347 | AC_MSG_CHECKING(for catalogs to be installed) | |
348 | NEW_LINGUAS= | |
349 | for presentlang in $ALL_LINGUAS; do | |
350 | useit=no | |
351 | if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then | |
352 | desiredlanguages="$LINGUAS" | |
353 | else | |
354 | desiredlanguages="$ALL_LINGUAS" | |
355 | fi | |
356 | for desiredlang in $desiredlanguages; do | |
357 | # Use the presentlang catalog if desiredlang is | |
358 | # a. equal to presentlang, or | |
359 | # b. a variant of presentlang (because in this case, | |
360 | # presentlang can be used as a fallback for messages | |
361 | # which are not translated in the desiredlang catalog). | |
362 | case "$desiredlang" in | |
363 | "$presentlang"*) useit=yes;; | |
364 | esac | |
365 | done | |
366 | if test $useit = yes; then | |
367 | NEW_LINGUAS="$NEW_LINGUAS $presentlang" | |
368 | fi | |
369 | done | |
370 | LINGUAS=$NEW_LINGUAS | |
371 | AC_MSG_RESULT($LINGUAS) | |
372 | fi | |
373 | ||
374 | dnl Construct list of names of catalog files to be constructed. | |
375 | if test -n "$LINGUAS"; then | |
376 | for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done | |
377 | fi | |
378 | fi | |
379 | ||
380 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly | |
381 | dnl find the mkinstalldirs script in another subdir but ($top_srcdir). | |
382 | dnl Try to locate is. | |
383 | MKINSTALLDIRS= | |
384 | if test -n "$ac_aux_dir"; then | |
385 | MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" | |
386 | fi | |
387 | if test -z "$MKINSTALLDIRS"; then | |
388 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" | |
389 | fi | |
390 | AC_SUBST(MKINSTALLDIRS) | |
391 | ||
392 | dnl Generate list of files to be processed by xgettext which will | |
393 | dnl be included in po/Makefile. | |
394 | test -d po || mkdir po | |
395 | if test "x$srcdir" != "x."; then | |
396 | if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then | |
397 | posrcprefix="$srcdir/" | |
398 | else | |
399 | posrcprefix="../$srcdir/" | |
400 | fi | |
401 | else | |
402 | posrcprefix="../" | |
403 | fi | |
404 | rm -f po/POTFILES | |
405 | sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ | |
406 | < $srcdir/po/POTFILES.in > po/POTFILES | |
407 | ], | |
408 | [[$0: This macro is deprecated. You should use upstream gettext instead.]]) | |
409 | ||
410 | # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) | |
411 | # ------------------------------- | |
412 | # Define VARIABLE to the location where catalog files will | |
413 | # be installed by po/Makefile. | |
414 | glib_DEFUN([GLIB_DEFINE_LOCALEDIR], | |
415 | [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl | |
416 | glib_save_prefix="$prefix" | |
417 | glib_save_exec_prefix="$exec_prefix" | |
418 | glib_save_datarootdir="$datarootdir" | |
419 | test "x$prefix" = xNONE && prefix=$ac_default_prefix | |
420 | test "x$exec_prefix" = xNONE && exec_prefix=$prefix | |
421 | datarootdir=`eval echo "${datarootdir}"` | |
422 | if test "x$CATOBJEXT" = "x.mo" ; then | |
423 | localedir=`eval echo "${libdir}/locale"` | |
424 | else | |
425 | localedir=`eval echo "${datadir}/locale"` | |
426 | fi | |
427 | prefix="$glib_save_prefix" | |
428 | exec_prefix="$glib_save_exec_prefix" | |
429 | datarootdir="$glib_save_datarootdir" | |
430 | AC_DEFINE_UNQUOTED($1, "$localedir", | |
431 | [Define the location where the catalogs will be installed]) | |
432 | ]) | |
433 | ||
434 | dnl | |
435 | dnl Now the definitions that aclocal will find | |
436 | dnl | |
437 | ifdef(glib_configure_ac,[],[ | |
438 | AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) | |
439 | AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) | |
440 | ])dnl | |
441 | ||
442 | # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) | |
443 | # | |
444 | # Create a temporary file with TEST-FILE as its contents and pass the | |
445 | # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with | |
446 | # 0 and perform ACTION-IF-FAIL for any other exit status. | |
447 | AC_DEFUN([GLIB_RUN_PROG], | |
448 | [cat >conftest.foo <<_ACEOF | |
449 | $2 | |
450 | _ACEOF | |
451 | if AC_RUN_LOG([$1 conftest.foo]); then | |
452 | m4_ifval([$3], [$3], [:]) | |
453 | m4_ifvaln([$4], [else $4])dnl | |
454 | echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD | |
455 | sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD | |
456 | fi]) | |
457 | ||
21 | 458 | |
22 | 459 | |
23 | 460 | dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) |
210 | 647 | |
211 | 648 | |
212 | 649 | # nls.m4 serial 5 (gettext-0.18) |
213 | dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation, | |
214 | dnl Inc. | |
650 | dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software | |
651 | dnl Foundation, Inc. | |
215 | 652 | dnl This file is free software; the Free Software Foundation |
216 | 653 | dnl gives unlimited permission to copy and/or distribute it, |
217 | 654 | dnl with or without modifications, as long as this notice is preserved. |
401 | 401 | prefix = @prefix@ |
402 | 402 | program_transform_name = @program_transform_name@ |
403 | 403 | psdir = @psdir@ |
404 | runstatedir = @runstatedir@ | |
404 | 405 | sbindir = @sbindir@ |
405 | 406 | sharedstatedir = @sharedstatedir@ |
406 | 407 | srcdir = @srcdir@ |
0 | 0 | /****************************************************************************** |
1 | * $Id: cli.c 14581 2015-10-18 18:39:14Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
64 | 64 | Set a script to run when the torrent finishes |
65 | 65 | .It Fl g, Fl -config-dir Ar directory |
66 | 66 | Where to look for configuration files. This can be used to swap between using the cli, daemon, gtk, and qt clients. |
67 | See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. | |
67 | See https://github.com/transmission/transmission/wiki/Configuration-Files for more information. | |
68 | 68 | .It Fl h, Fl -help |
69 | 69 | Prints a short usage summary. |
70 | 70 | .It Fl m, Fl -portmap |
132 | 132 | .Xr transmission-remote 1 , |
133 | 133 | .Xr transmission-show 1 |
134 | 134 | .Pp |
135 | http://www.transmissionbt.com/ | |
135 | https://transmissionbt.com/ |
0 | 0 | #! /bin/sh |
1 | 1 | # Attempt to guess a canonical system name. |
2 | # Copyright 1992-2015 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2015-12-14' | |
2 | # Copyright 1992-2016 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2016-10-02' | |
5 | 5 | |
6 | 6 | # This file is free software; you can redistribute it and/or modify it |
7 | 7 | # under the terms of the GNU General Public License as published by |
26 | 26 | # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. |
27 | 27 | # |
28 | 28 | # You can get the latest version of this script from: |
29 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD | |
29 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | |
30 | 30 | # |
31 | 31 | # Please send patches to <config-patches@gnu.org>. |
32 | 32 | |
49 | 49 | GNU config.guess ($timestamp) |
50 | 50 | |
51 | 51 | Originally written by Per Bothner. |
52 | Copyright 1992-2015 Free Software Foundation, Inc. | |
52 | Copyright 1992-2016 Free Software Foundation, Inc. | |
53 | 53 | |
54 | 54 | This is free software; see the source for copying conditions. There is NO |
55 | 55 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
185 | 185 | *) machine=${UNAME_MACHINE_ARCH}-unknown ;; |
186 | 186 | esac |
187 | 187 | # The Operating System including object format, if it has switched |
188 | # to ELF recently, or will in the future. | |
188 | # to ELF recently (or will in the future) and ABI. | |
189 | 189 | case "${UNAME_MACHINE_ARCH}" in |
190 | arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) | |
190 | earm*) | |
191 | os=netbsdelf | |
192 | ;; | |
193 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) | |
191 | 194 | eval $set_cc_for_build |
192 | 195 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
193 | 196 | | grep -q __ELF__ |
236 | 239 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
237 | 240 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
238 | 241 | exit ;; |
242 | *:LibertyBSD:*:*) | |
243 | UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` | |
244 | echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} | |
245 | exit ;; | |
239 | 246 | *:ekkoBSD:*:*) |
240 | 247 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} |
241 | 248 | exit ;; |
267 | 274 | ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` |
268 | 275 | case "$ALPHA_CPU_TYPE" in |
269 | 276 | "EV4 (21064)") |
270 | UNAME_MACHINE="alpha" ;; | |
277 | UNAME_MACHINE=alpha ;; | |
271 | 278 | "EV4.5 (21064)") |
272 | UNAME_MACHINE="alpha" ;; | |
279 | UNAME_MACHINE=alpha ;; | |
273 | 280 | "LCA4 (21066/21068)") |
274 | UNAME_MACHINE="alpha" ;; | |
281 | UNAME_MACHINE=alpha ;; | |
275 | 282 | "EV5 (21164)") |
276 | UNAME_MACHINE="alphaev5" ;; | |
283 | UNAME_MACHINE=alphaev5 ;; | |
277 | 284 | "EV5.6 (21164A)") |
278 | UNAME_MACHINE="alphaev56" ;; | |
285 | UNAME_MACHINE=alphaev56 ;; | |
279 | 286 | "EV5.6 (21164PC)") |
280 | UNAME_MACHINE="alphapca56" ;; | |
287 | UNAME_MACHINE=alphapca56 ;; | |
281 | 288 | "EV5.7 (21164PC)") |
282 | UNAME_MACHINE="alphapca57" ;; | |
289 | UNAME_MACHINE=alphapca57 ;; | |
283 | 290 | "EV6 (21264)") |
284 | UNAME_MACHINE="alphaev6" ;; | |
291 | UNAME_MACHINE=alphaev6 ;; | |
285 | 292 | "EV6.7 (21264A)") |
286 | UNAME_MACHINE="alphaev67" ;; | |
293 | UNAME_MACHINE=alphaev67 ;; | |
287 | 294 | "EV6.8CB (21264C)") |
288 | UNAME_MACHINE="alphaev68" ;; | |
295 | UNAME_MACHINE=alphaev68 ;; | |
289 | 296 | "EV6.8AL (21264B)") |
290 | UNAME_MACHINE="alphaev68" ;; | |
297 | UNAME_MACHINE=alphaev68 ;; | |
291 | 298 | "EV6.8CX (21264D)") |
292 | UNAME_MACHINE="alphaev68" ;; | |
299 | UNAME_MACHINE=alphaev68 ;; | |
293 | 300 | "EV6.9A (21264/EV69A)") |
294 | UNAME_MACHINE="alphaev69" ;; | |
301 | UNAME_MACHINE=alphaev69 ;; | |
295 | 302 | "EV7 (21364)") |
296 | UNAME_MACHINE="alphaev7" ;; | |
303 | UNAME_MACHINE=alphaev7 ;; | |
297 | 304 | "EV7.9 (21364A)") |
298 | UNAME_MACHINE="alphaev79" ;; | |
305 | UNAME_MACHINE=alphaev79 ;; | |
299 | 306 | esac |
300 | 307 | # A Pn.n version is a patched version. |
301 | 308 | # A Vn.n version is a released version. |
302 | 309 | # A Tn.n version is a released field test version. |
303 | 310 | # A Xn.n version is an unreleased experimental baselevel. |
304 | 311 | # 1.2 uses "1.2" for uname -r. |
305 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | |
312 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` | |
306 | 313 | # Reset EXIT trap before exiting to avoid spurious non-zero exit code. |
307 | 314 | exitcode=$? |
308 | 315 | trap '' 0 |
375 | 382 | exit ;; |
376 | 383 | i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) |
377 | 384 | eval $set_cc_for_build |
378 | SUN_ARCH="i386" | |
385 | SUN_ARCH=i386 | |
379 | 386 | # If there is a compiler, see if it is configured for 64-bit objects. |
380 | 387 | # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. |
381 | 388 | # This test works for both compilers. |
382 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
389 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | |
383 | 390 | if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ |
384 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
391 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
385 | 392 | grep IS_64BIT_ARCH >/dev/null |
386 | 393 | then |
387 | SUN_ARCH="x86_64" | |
394 | SUN_ARCH=x86_64 | |
388 | 395 | fi |
389 | 396 | fi |
390 | 397 | echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
409 | 416 | exit ;; |
410 | 417 | sun*:*:4.2BSD:*) |
411 | 418 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` |
412 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 | |
419 | test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 | |
413 | 420 | case "`/bin/arch`" in |
414 | 421 | sun3) |
415 | 422 | echo m68k-sun-sunos${UNAME_RELEASE} |
634 | 641 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` |
635 | 642 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` |
636 | 643 | case "${sc_cpu_version}" in |
637 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 | |
638 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 | |
644 | 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 | |
645 | 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 | |
639 | 646 | 532) # CPU_PA_RISC2_0 |
640 | 647 | case "${sc_kernel_bits}" in |
641 | 32) HP_ARCH="hppa2.0n" ;; | |
642 | 64) HP_ARCH="hppa2.0w" ;; | |
643 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 | |
648 | 32) HP_ARCH=hppa2.0n ;; | |
649 | 64) HP_ARCH=hppa2.0w ;; | |
650 | '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 | |
644 | 651 | esac ;; |
645 | 652 | esac |
646 | 653 | fi |
679 | 686 | exit (0); |
680 | 687 | } |
681 | 688 | EOF |
682 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | |
689 | (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | |
683 | 690 | test -z "$HP_ARCH" && HP_ARCH=hppa |
684 | 691 | fi ;; |
685 | 692 | esac |
686 | if [ ${HP_ARCH} = "hppa2.0w" ] | |
693 | if [ ${HP_ARCH} = hppa2.0w ] | |
687 | 694 | then |
688 | 695 | eval $set_cc_for_build |
689 | 696 | |
696 | 703 | # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess |
697 | 704 | # => hppa64-hp-hpux11.23 |
698 | 705 | |
699 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | | |
706 | if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | | |
700 | 707 | grep -q __LP64__ |
701 | 708 | then |
702 | HP_ARCH="hppa2.0w" | |
709 | HP_ARCH=hppa2.0w | |
703 | 710 | else |
704 | HP_ARCH="hppa64" | |
711 | HP_ARCH=hppa64 | |
705 | 712 | fi |
706 | 713 | fi |
707 | 714 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} |
806 | 813 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
807 | 814 | exit ;; |
808 | 815 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
809 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | |
810 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
816 | FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` | |
817 | FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` | |
811 | 818 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` |
812 | 819 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
813 | 820 | exit ;; |
814 | 821 | 5000:UNIX_System_V:4.*:*) |
815 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
816 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` | |
822 | FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` | |
823 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` | |
817 | 824 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" |
818 | 825 | exit ;; |
819 | 826 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) |
895 | 902 | exit ;; |
896 | 903 | *:GNU/*:*:*) |
897 | 904 | # other systems with GNU libc and userland |
898 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} | |
905 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} | |
899 | 906 | exit ;; |
900 | 907 | i*86:Minix:*:*) |
901 | 908 | echo ${UNAME_MACHINE}-pc-minix |
918 | 925 | EV68*) UNAME_MACHINE=alphaev68 ;; |
919 | 926 | esac |
920 | 927 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
921 | if test "$?" = 0 ; then LIBC="gnulibc1" ; fi | |
928 | if test "$?" = 0 ; then LIBC=gnulibc1 ; fi | |
922 | 929 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
923 | 930 | exit ;; |
924 | 931 | arc:Linux:*:* | arceb:Linux:*:*) |
992 | 999 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
993 | 1000 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } |
994 | 1001 | ;; |
1002 | mips64el:Linux:*:*) | |
1003 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1004 | exit ;; | |
995 | 1005 | openrisc*:Linux:*:*) |
996 | 1006 | echo or1k-unknown-linux-${LIBC} |
997 | 1007 | exit ;; |
1024 | 1034 | ppcle:Linux:*:*) |
1025 | 1035 | echo powerpcle-unknown-linux-${LIBC} |
1026 | 1036 | exit ;; |
1037 | riscv32:Linux:*:* | riscv64:Linux:*:*) | |
1038 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
1039 | exit ;; | |
1027 | 1040 | s390:Linux:*:* | s390x:Linux:*:*) |
1028 | 1041 | echo ${UNAME_MACHINE}-ibm-linux-${LIBC} |
1029 | 1042 | exit ;; |
1043 | 1056 | echo ${UNAME_MACHINE}-dec-linux-${LIBC} |
1044 | 1057 | exit ;; |
1045 | 1058 | x86_64:Linux:*:*) |
1046 | eval $set_cc_for_build | |
1047 | X86_64_ABI= | |
1048 | # If there is a compiler, see if it is configured for 32-bit objects. | |
1049 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
1050 | if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ | |
1051 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1052 | grep IS_X32 >/dev/null | |
1053 | then | |
1054 | X86_64_ABI=x32 | |
1055 | fi | |
1056 | fi | |
1057 | echo ${UNAME_MACHINE}-pc-linux-${LIBC}${X86_64_ABI} | |
1059 | echo ${UNAME_MACHINE}-pc-linux-${LIBC} | |
1058 | 1060 | exit ;; |
1059 | 1061 | xtensa*:Linux:*:*) |
1060 | 1062 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
1282 | 1284 | SX-8R:SUPER-UX:*:*) |
1283 | 1285 | echo sx8r-nec-superux${UNAME_RELEASE} |
1284 | 1286 | exit ;; |
1287 | SX-ACE:SUPER-UX:*:*) | |
1288 | echo sxace-nec-superux${UNAME_RELEASE} | |
1289 | exit ;; | |
1285 | 1290 | Power*:Rhapsody:*:*) |
1286 | 1291 | echo powerpc-apple-rhapsody${UNAME_RELEASE} |
1287 | 1292 | exit ;; |
1295 | 1300 | UNAME_PROCESSOR=powerpc |
1296 | 1301 | fi |
1297 | 1302 | if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then |
1298 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
1303 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | |
1299 | 1304 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
1300 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1305 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1301 | 1306 | grep IS_64BIT_ARCH >/dev/null |
1302 | 1307 | then |
1303 | 1308 | case $UNAME_PROCESSOR in |
1319 | 1324 | exit ;; |
1320 | 1325 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
1321 | 1326 | UNAME_PROCESSOR=`uname -p` |
1322 | if test "$UNAME_PROCESSOR" = "x86"; then | |
1327 | if test "$UNAME_PROCESSOR" = x86; then | |
1323 | 1328 | UNAME_PROCESSOR=i386 |
1324 | 1329 | UNAME_MACHINE=pc |
1325 | 1330 | fi |
1350 | 1355 | # "uname -m" is not consistent, so use $cputype instead. 386 |
1351 | 1356 | # is converted to i386 for consistency with other x86 |
1352 | 1357 | # operating systems. |
1353 | if test "$cputype" = "386"; then | |
1358 | if test "$cputype" = 386; then | |
1354 | 1359 | UNAME_MACHINE=i386 |
1355 | 1360 | else |
1356 | 1361 | UNAME_MACHINE="$cputype" |
1392 | 1397 | echo i386-pc-xenix |
1393 | 1398 | exit ;; |
1394 | 1399 | i*86:skyos:*:*) |
1395 | echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' | |
1400 | echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` | |
1396 | 1401 | exit ;; |
1397 | 1402 | i*86:rdos:*:*) |
1398 | 1403 | echo ${UNAME_MACHINE}-pc-rdos |
1411 | 1416 | cat >&2 <<EOF |
1412 | 1417 | $0: unable to guess system type |
1413 | 1418 | |
1414 | This script, last modified $timestamp, has failed to recognize | |
1415 | the operating system you are using. It is advised that you | |
1416 | download the most up to date version of the config scripts from | |
1417 | ||
1418 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD | |
1419 | This script (version $timestamp), has failed to recognize the | |
1420 | operating system you are using. If your script is old, overwrite | |
1421 | config.guess and config.sub with the latest versions from: | |
1422 | ||
1423 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | |
1419 | 1424 | and |
1420 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD | |
1421 | ||
1422 | If the version you run ($0) is already up to date, please | |
1423 | send the following data and any information you think might be | |
1424 | pertinent to <config-patches@gnu.org> in order to provide the needed | |
1425 | information to handle your system. | |
1425 | http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | |
1426 | ||
1427 | If $0 has already been updated, send the following data and any | |
1428 | information you think might be pertinent to config-patches@gnu.org to | |
1429 | provide the necessary information to handle your system. | |
1426 | 1430 | |
1427 | 1431 | config.guess timestamp = $timestamp |
1428 | 1432 |
0 | 0 | #! /bin/sh |
1 | 1 | # Configuration validation subroutine script. |
2 | # Copyright 1992-2015 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2015-12-14' | |
2 | # Copyright 1992-2016 Free Software Foundation, Inc. | |
3 | ||
4 | timestamp='2016-11-04' | |
5 | 5 | |
6 | 6 | # This file is free software; you can redistribute it and/or modify it |
7 | 7 | # under the terms of the GNU General Public License as published by |
32 | 32 | # Otherwise, we print the canonical config type on stdout and succeed. |
33 | 33 | |
34 | 34 | # You can get the latest version of this script from: |
35 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD | |
35 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | |
36 | 36 | |
37 | 37 | # This file is supposed to be the same for all GNU packages |
38 | 38 | # and recognize all the CPU types, system types and aliases |
66 | 66 | version="\ |
67 | 67 | GNU config.sub ($timestamp) |
68 | 68 | |
69 | Copyright 1992-2015 Free Software Foundation, Inc. | |
69 | Copyright 1992-2016 Free Software Foundation, Inc. | |
70 | 70 | |
71 | 71 | This is free software; see the source for copying conditions. There is NO |
72 | 72 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
116 | 116 | nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ |
117 | 117 | linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ |
118 | 118 | knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ |
119 | kopensolaris*-gnu* | \ | |
119 | kopensolaris*-gnu* | cloudabi*-eabi* | \ | |
120 | 120 | storm-chaos* | os2-emx* | rtmk-nova*) |
121 | 121 | os=-$maybe_os |
122 | 122 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` |
257 | 257 | | be32 | be64 \ |
258 | 258 | | bfin \ |
259 | 259 | | c4x | c8051 | clipper \ |
260 | | d10v | d30v | dlx | dsp16xx | dvp \ | |
260 | | d10v | d30v | dlx | dsp16xx \ | |
261 | 261 | | e2k | epiphany \ |
262 | 262 | | fido | fr30 | frv | ft32 \ |
263 | 263 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ |
300 | 300 | | open8 | or1k | or1knd | or32 \ |
301 | 301 | | pdp10 | pdp11 | pj | pjl \ |
302 | 302 | | powerpc | powerpc64 | powerpc64le | powerpcle \ |
303 | | pru \ | |
303 | 304 | | pyramid \ |
304 | 305 | | riscv32 | riscv64 \ |
305 | 306 | | rl78 | rx \ |
427 | 428 | | orion-* \ |
428 | 429 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ |
429 | 430 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ |
431 | | pru-* \ | |
430 | 432 | | pyramid-* \ |
431 | 433 | | riscv32-* | riscv64-* \ |
432 | 434 | | rl78-* | romp-* | rs6000-* | rx-* \ |
642 | 644 | basic_machine=m68k-bull |
643 | 645 | os=-sysv3 |
644 | 646 | ;; |
647 | e500v[12]) | |
648 | basic_machine=powerpc-unknown | |
649 | os=$os"spe" | |
650 | ;; | |
651 | e500v[12]-*) | |
652 | basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
653 | os=$os"spe" | |
654 | ;; | |
645 | 655 | ebmon29k) |
646 | 656 | basic_machine=a29k-amd |
647 | 657 | os=-ebmon |
826 | 836 | *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) |
827 | 837 | basic_machine=m68k-atari |
828 | 838 | os=-mint |
829 | ;; | |
830 | mipsEE* | ee | ps2) | |
831 | basic_machine=mips64r5900el-scei | |
832 | case $os in | |
833 | -linux*) | |
834 | ;; | |
835 | *) | |
836 | os=-elf | |
837 | ;; | |
838 | esac | |
839 | ;; | |
840 | iop) | |
841 | basic_machine=mipsel-scei | |
842 | os=-irx | |
843 | ;; | |
844 | dvp) | |
845 | basic_machine=dvp-scei | |
846 | os=-elf | |
847 | 839 | ;; |
848 | 840 | mips3*-*) |
849 | 841 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` |
1039 | 1031 | ppc-* | ppcbe-*) |
1040 | 1032 | basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` |
1041 | 1033 | ;; |
1042 | ppcle | powerpclittle | ppc-le | powerpc-little) | |
1034 | ppcle | powerpclittle) | |
1043 | 1035 | basic_machine=powerpcle-unknown |
1044 | 1036 | ;; |
1045 | 1037 | ppcle-* | powerpclittle-*) |
1049 | 1041 | ;; |
1050 | 1042 | ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` |
1051 | 1043 | ;; |
1052 | ppc64le | powerpc64little | ppc64-le | powerpc64-little) | |
1044 | ppc64le | powerpc64little) | |
1053 | 1045 | basic_machine=powerpc64le-unknown |
1054 | 1046 | ;; |
1055 | 1047 | ppc64le-* | powerpc64little-*) |
1399 | 1391 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ |
1400 | 1392 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ |
1401 | 1393 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ |
1402 | | -bitrig* | -openbsd* | -solidbsd* \ | |
1394 | | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | |
1403 | 1395 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ |
1404 | 1396 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ |
1405 | 1397 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ |
1406 | 1398 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ |
1407 | 1399 | | -chorusos* | -chorusrdb* | -cegcc* \ |
1408 | 1400 | | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ |
1409 | | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | |
1401 | | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | |
1410 | 1402 | | -linux-newlib* | -linux-musl* | -linux-uclibc* \ |
1411 | 1403 | | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ |
1412 | 1404 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ |
1413 | 1405 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ |
1414 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \ | |
1406 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | |
1415 | 1407 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
1416 | 1408 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
1417 | 1409 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
1418 | 1410 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ |
1419 | | -onefs* | -tirtos*) | |
1411 | | -onefs* | -tirtos* | -phoenix* | -fuchsia*) | |
1420 | 1412 | # Remember, each alternative MUST END IN *, to match a version number. |
1421 | 1413 | ;; |
1422 | 1414 | -qnx*) |
1548 | 1540 | ;; |
1549 | 1541 | -nacl*) |
1550 | 1542 | ;; |
1543 | -ios) | |
1544 | ;; | |
1551 | 1545 | -none) |
1552 | 1546 | ;; |
1553 | 1547 | *) |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for transmission 2.92. | |
2 | # Generated by GNU Autoconf 2.69 for transmission 2.93. | |
3 | 3 | # |
4 | # Report bugs to <http://trac.transmissionbt.com/newticket>. | |
4 | # Report bugs to <https://github.com/transmission/transmission>. | |
5 | 5 | # |
6 | 6 | # |
7 | 7 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. |
274 | 274 | $as_echo "$0: be upgraded to zsh 4.3.4 or later." |
275 | 275 | else |
276 | 276 | $as_echo "$0: Please tell bug-autoconf@gnu.org and |
277 | $0: http://trac.transmissionbt.com/newticket about your | |
277 | $0: https://github.com/transmission/transmission about your | |
278 | 278 | $0: system, including any error possibly output before this |
279 | 279 | $0: message. Then install a modern shell, or manually run |
280 | 280 | $0: the script under such a shell if you do have one." |
589 | 589 | # Identity of this package. |
590 | 590 | PACKAGE_NAME='transmission' |
591 | 591 | PACKAGE_TARNAME='transmission' |
592 | PACKAGE_VERSION='2.92' | |
593 | PACKAGE_STRING='transmission 2.92' | |
594 | PACKAGE_BUGREPORT='http://trac.transmissionbt.com/newticket' | |
592 | PACKAGE_VERSION='2.93' | |
593 | PACKAGE_STRING='transmission 2.93' | |
594 | PACKAGE_BUGREPORT='https://github.com/transmission/transmission' | |
595 | 595 | PACKAGE_URL='' |
596 | 596 | |
597 | 597 | ac_unique_file="libtransmission/transmission.h" |
873 | 873 | docdir |
874 | 874 | oldincludedir |
875 | 875 | includedir |
876 | runstatedir | |
876 | 877 | localstatedir |
877 | 878 | sharedstatedir |
878 | 879 | sysconfdir |
992 | 993 | sysconfdir='${prefix}/etc' |
993 | 994 | sharedstatedir='${prefix}/com' |
994 | 995 | localstatedir='${prefix}/var' |
996 | runstatedir='${localstatedir}/run' | |
995 | 997 | includedir='${prefix}/include' |
996 | 998 | oldincludedir='/usr/include' |
997 | 999 | docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' |
1244 | 1246 | | -silent | --silent | --silen | --sile | --sil) |
1245 | 1247 | silent=yes ;; |
1246 | 1248 | |
1249 | -runstatedir | --runstatedir | --runstatedi | --runstated \ | |
1250 | | --runstate | --runstat | --runsta | --runst | --runs \ | |
1251 | | --run | --ru | --r) | |
1252 | ac_prev=runstatedir ;; | |
1253 | -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | |
1254 | | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | |
1255 | | --run=* | --ru=* | --r=*) | |
1256 | runstatedir=$ac_optarg ;; | |
1257 | ||
1247 | 1258 | -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) |
1248 | 1259 | ac_prev=sbindir ;; |
1249 | 1260 | -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ |
1381 | 1392 | for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ |
1382 | 1393 | datadir sysconfdir sharedstatedir localstatedir includedir \ |
1383 | 1394 | oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ |
1384 | libdir localedir mandir | |
1395 | libdir localedir mandir runstatedir | |
1385 | 1396 | do |
1386 | 1397 | eval ac_val=\$$ac_var |
1387 | 1398 | # Remove trailing slashes. |
1494 | 1505 | # Omit some internal or obsolete options to make the list less imposing. |
1495 | 1506 | # This message is too long to be a string in the A/UX 3.1 sh. |
1496 | 1507 | cat <<_ACEOF |
1497 | \`configure' configures transmission 2.92 to adapt to many kinds of systems. | |
1508 | \`configure' configures transmission 2.93 to adapt to many kinds of systems. | |
1498 | 1509 | |
1499 | 1510 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1500 | 1511 | |
1534 | 1545 | --sysconfdir=DIR read-only single-machine data [PREFIX/etc] |
1535 | 1546 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
1536 | 1547 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
1548 | --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] | |
1537 | 1549 | --libdir=DIR object code libraries [EPREFIX/lib] |
1538 | 1550 | --includedir=DIR C header files [PREFIX/include] |
1539 | 1551 | --oldincludedir=DIR C header files for non-gcc [/usr/include] |
1564 | 1576 | |
1565 | 1577 | if test -n "$ac_init_help"; then |
1566 | 1578 | case $ac_init_help in |
1567 | short | recursive ) echo "Configuration of transmission 2.92:";; | |
1579 | short | recursive ) echo "Configuration of transmission 2.93:";; | |
1568 | 1580 | esac |
1569 | 1581 | cat <<\_ACEOF |
1570 | 1582 | |
1667 | 1679 | Use these variables to override the choices made by `configure' or to help |
1668 | 1680 | it to find libraries and programs with nonstandard names/locations. |
1669 | 1681 | |
1670 | Report bugs to <http://trac.transmissionbt.com/newticket>. | |
1682 | Report bugs to <https://github.com/transmission/transmission>. | |
1671 | 1683 | _ACEOF |
1672 | 1684 | ac_status=$? |
1673 | 1685 | fi |
1730 | 1742 | test -n "$ac_init_help" && exit $ac_status |
1731 | 1743 | if $ac_init_version; then |
1732 | 1744 | cat <<\_ACEOF |
1733 | transmission configure 2.92 | |
1745 | transmission configure 2.93 | |
1734 | 1746 | generated by GNU Autoconf 2.69 |
1735 | 1747 | |
1736 | 1748 | Copyright (C) 2012 Free Software Foundation, Inc. |
2196 | 2208 | $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} |
2197 | 2209 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 |
2198 | 2210 | $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} |
2199 | ( $as_echo "## ------------------------------------------------------- ## | |
2200 | ## Report this to http://trac.transmissionbt.com/newticket ## | |
2201 | ## ------------------------------------------------------- ##" | |
2211 | ( $as_echo "## ----------------------------------------------------------- ## | |
2212 | ## Report this to https://github.com/transmission/transmission ## | |
2213 | ## ----------------------------------------------------------- ##" | |
2202 | 2214 | ) | sed "s/^/$as_me: WARNING: /" >&2 |
2203 | 2215 | ;; |
2204 | 2216 | esac |
2266 | 2278 | This file contains any messages produced by compilers while |
2267 | 2279 | running configure, to aid debugging if configure makes a mistake. |
2268 | 2280 | |
2269 | It was created by transmission $as_me 2.92, which was | |
2281 | It was created by transmission $as_me 2.93, which was | |
2270 | 2282 | generated by GNU Autoconf 2.69. Invocation command line was |
2271 | 2283 | |
2272 | 2284 | $ $0 $@ |
2614 | 2626 | ac_compiler_gnu=$ac_cv_c_compiler_gnu |
2615 | 2627 | |
2616 | 2628 | |
2617 | USERAGENT_PREFIX=2.92 | |
2618 | ||
2619 | PEERID_PREFIX=-TR2920- | |
2629 | USERAGENT_PREFIX=2.93 | |
2630 | ||
2631 | PEERID_PREFIX=-TR2930- | |
2620 | 2632 | |
2621 | 2633 | |
2622 | 2634 | # Check whether --enable-silent-rules was given. |
3138 | 3150 | |
3139 | 3151 | # Define the identity of the package. |
3140 | 3152 | PACKAGE='transmission' |
3141 | VERSION='2.92' | |
3153 | VERSION='2.93' | |
3142 | 3154 | |
3143 | 3155 | |
3144 | 3156 | cat >>confdefs.h <<_ACEOF |
5664 | 5676 | lt_cv_deplibs_check_method=pass_all |
5665 | 5677 | ;; |
5666 | 5678 | |
5667 | netbsd*) | |
5679 | netbsd* | netbsdelf*-gnu) | |
5668 | 5680 | if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then |
5669 | 5681 | lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' |
5670 | 5682 | else |
9357 | 9369 | openbsd* | bitrig*) |
9358 | 9370 | with_gnu_ld=no |
9359 | 9371 | ;; |
9372 | linux* | k*bsd*-gnu | gnu*) | |
9373 | link_all_deplibs=no | |
9374 | ;; | |
9360 | 9375 | esac |
9361 | 9376 | |
9362 | 9377 | ld_shlibs=yes |
9611 | 9626 | fi |
9612 | 9627 | ;; |
9613 | 9628 | |
9614 | netbsd*) | |
9629 | netbsd* | netbsdelf*-gnu) | |
9615 | 9630 | if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then |
9616 | 9631 | archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' |
9617 | 9632 | wlarc= |
10281 | 10296 | if test yes = "$lt_cv_irix_exported_symbol"; then |
10282 | 10297 | archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' |
10283 | 10298 | fi |
10299 | link_all_deplibs=no | |
10284 | 10300 | else |
10285 | 10301 | archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' |
10286 | 10302 | archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' |
10302 | 10318 | esac |
10303 | 10319 | ;; |
10304 | 10320 | |
10305 | netbsd*) | |
10321 | netbsd* | netbsdelf*-gnu) | |
10306 | 10322 | if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then |
10307 | 10323 | archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out |
10308 | 10324 | else |
11177 | 11193 | *) objformat=elf ;; |
11178 | 11194 | esac |
11179 | 11195 | fi |
11180 | # Handle Gentoo/FreeBSD as it was Linux | |
11181 | case $host_vendor in | |
11182 | gentoo) | |
11183 | version_type=linux ;; | |
11184 | *) | |
11185 | version_type=freebsd-$objformat ;; | |
11186 | esac | |
11187 | ||
11196 | version_type=freebsd-$objformat | |
11188 | 11197 | case $version_type in |
11189 | 11198 | freebsd-elf*) |
11190 | 11199 | library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' |
11195 | 11204 | freebsd-*) |
11196 | 11205 | library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' |
11197 | 11206 | need_version=yes |
11198 | ;; | |
11199 | linux) | |
11200 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | |
11201 | soname_spec='${libname}${release}${shared_ext}$major' | |
11202 | need_lib_prefix=no | |
11203 | need_version=no | |
11204 | 11207 | ;; |
11205 | 11208 | esac |
11206 | 11209 | shlibpath_var=LD_LIBRARY_PATH |
11428 | 11431 | # people can always --disable-shared, the test was removed, and we |
11429 | 11432 | # assume the GNU/Linux dynamic linker is in use. |
11430 | 11433 | dynamic_linker='GNU/Linux ld.so' |
11434 | ;; | |
11435 | ||
11436 | netbsdelf*-gnu) | |
11437 | version_type=linux | |
11438 | need_lib_prefix=no | |
11439 | need_version=no | |
11440 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | |
11441 | soname_spec='${libname}${release}${shared_ext}$major' | |
11442 | shlibpath_var=LD_LIBRARY_PATH | |
11443 | shlibpath_overrides_runpath=no | |
11444 | hardcode_into_libs=yes | |
11445 | dynamic_linker='NetBSD ld.elf_so' | |
11431 | 11446 | ;; |
11432 | 11447 | |
11433 | 11448 | netbsd*) |
15672 | 15687 | ;; |
15673 | 15688 | esac |
15674 | 15689 | ;; |
15675 | netbsd*) | |
15690 | netbsd* | netbsdelf*-gnu) | |
15676 | 15691 | ;; |
15677 | 15692 | *qnx* | *nto*) |
15678 | 15693 | # QNX uses GNU C++, but need to define -shared option too, otherwise |
16047 | 16062 | ;; |
16048 | 16063 | esac |
16049 | 16064 | ;; |
16065 | linux* | k*bsd*-gnu | gnu*) | |
16066 | link_all_deplibs_CXX=no | |
16067 | ;; | |
16050 | 16068 | *) |
16051 | 16069 | export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' |
16052 | 16070 | ;; |
16500 | 16518 | *) objformat=elf ;; |
16501 | 16519 | esac |
16502 | 16520 | fi |
16503 | # Handle Gentoo/FreeBSD as it was Linux | |
16504 | case $host_vendor in | |
16505 | gentoo) | |
16506 | version_type=linux ;; | |
16507 | *) | |
16508 | version_type=freebsd-$objformat ;; | |
16509 | esac | |
16510 | ||
16521 | version_type=freebsd-$objformat | |
16511 | 16522 | case $version_type in |
16512 | 16523 | freebsd-elf*) |
16513 | 16524 | library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' |
16518 | 16529 | freebsd-*) |
16519 | 16530 | library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' |
16520 | 16531 | need_version=yes |
16521 | ;; | |
16522 | linux) | |
16523 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | |
16524 | soname_spec='${libname}${release}${shared_ext}$major' | |
16525 | need_lib_prefix=no | |
16526 | need_version=no | |
16527 | 16532 | ;; |
16528 | 16533 | esac |
16529 | 16534 | shlibpath_var=LD_LIBRARY_PATH |
16753 | 16758 | dynamic_linker='GNU/Linux ld.so' |
16754 | 16759 | ;; |
16755 | 16760 | |
16761 | netbsdelf*-gnu) | |
16762 | version_type=linux | |
16763 | need_lib_prefix=no | |
16764 | need_version=no | |
16765 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | |
16766 | soname_spec='${libname}${release}${shared_ext}$major' | |
16767 | shlibpath_var=LD_LIBRARY_PATH | |
16768 | shlibpath_overrides_runpath=no | |
16769 | hardcode_into_libs=yes | |
16770 | dynamic_linker='NetBSD ld.elf_so' | |
16771 | ;; | |
16772 | ||
16756 | 16773 | netbsd*) |
16757 | 16774 | version_type=sunos |
16758 | 16775 | need_lib_prefix=no |
18781 | 18798 | We can't simply define LARGE_OFF_T to be 9223372036854775807, |
18782 | 18799 | since some C++ compilers masquerading as C compilers |
18783 | 18800 | incorrectly reject 9223372036854775807. */ |
18784 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
18801 | #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) | |
18785 | 18802 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
18786 | 18803 | && LARGE_OFF_T % 2147483647 == 1) |
18787 | 18804 | ? 1 : -1]; |
18827 | 18844 | We can't simply define LARGE_OFF_T to be 9223372036854775807, |
18828 | 18845 | since some C++ compilers masquerading as C compilers |
18829 | 18846 | incorrectly reject 9223372036854775807. */ |
18830 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
18847 | #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) | |
18831 | 18848 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
18832 | 18849 | && LARGE_OFF_T % 2147483647 == 1) |
18833 | 18850 | ? 1 : -1]; |
18851 | 18868 | We can't simply define LARGE_OFF_T to be 9223372036854775807, |
18852 | 18869 | since some C++ compilers masquerading as C compilers |
18853 | 18870 | incorrectly reject 9223372036854775807. */ |
18854 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
18871 | #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) | |
18855 | 18872 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
18856 | 18873 | && LARGE_OFF_T % 2147483647 == 1) |
18857 | 18874 | ? 1 : -1]; |
18896 | 18913 | We can't simply define LARGE_OFF_T to be 9223372036854775807, |
18897 | 18914 | since some C++ compilers masquerading as C compilers |
18898 | 18915 | incorrectly reject 9223372036854775807. */ |
18899 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
18916 | #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) | |
18900 | 18917 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
18901 | 18918 | && LARGE_OFF_T % 2147483647 == 1) |
18902 | 18919 | ? 1 : -1]; |
18920 | 18937 | We can't simply define LARGE_OFF_T to be 9223372036854775807, |
18921 | 18938 | since some C++ compilers masquerading as C compilers |
18922 | 18939 | incorrectly reject 9223372036854775807. */ |
18923 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
18940 | #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) | |
18924 | 18941 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
18925 | 18942 | && LARGE_OFF_T % 2147483647 == 1) |
18926 | 18943 | ? 1 : -1]; |
21977 | 21994 | # report actual input values of CONFIG_FILES etc. instead of their |
21978 | 21995 | # values after options handling. |
21979 | 21996 | ac_log=" |
21980 | This file was extended by transmission $as_me 2.92, which was | |
21997 | This file was extended by transmission $as_me 2.93, which was | |
21981 | 21998 | generated by GNU Autoconf 2.69. Invocation command line was |
21982 | 21999 | |
21983 | 22000 | CONFIG_FILES = $CONFIG_FILES |
22028 | 22045 | Configuration commands: |
22029 | 22046 | $config_commands |
22030 | 22047 | |
22031 | Report bugs to <http://trac.transmissionbt.com/newticket>." | |
22048 | Report bugs to <https://github.com/transmission/transmission>." | |
22032 | 22049 | |
22033 | 22050 | _ACEOF |
22034 | 22051 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
22035 | 22052 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
22036 | 22053 | ac_cs_version="\\ |
22037 | transmission config.status 2.92 | |
22054 | transmission config.status 2.93 | |
22038 | 22055 | configured by $0, generated by GNU Autoconf 2.69, |
22039 | 22056 | with options \\"\$ac_cs_config\\" |
22040 | 22057 | |
23103 | 23120 | cat <<_LT_EOF >> "$cfgfile" |
23104 | 23121 | #! $SHELL |
23105 | 23122 | # Generated automatically by $as_me ($PACKAGE) $VERSION |
23106 | # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | |
23107 | 23123 | # NOTE: Changes made to this file will be lost: look at ltmain.sh. |
23108 | 23124 | |
23109 | 23125 | # Provide generalized library-building support services. |
2 | 2 | dnl "Z" for unsupported trunk builds, |
3 | 3 | dnl "0" for stable, supported releases |
4 | 4 | dnl these should be the only two lines you need to change |
5 | m4_define([user_agent_prefix],[2.92]) | |
6 | m4_define([peer_id_prefix],[-TR2920-]) | |
7 | ||
8 | AC_INIT([transmission],[user_agent_prefix],[http://trac.transmissionbt.com/newticket]) | |
5 | m4_define([user_agent_prefix],[2.93]) | |
6 | m4_define([peer_id_prefix],[-TR2930-]) | |
7 | ||
8 | AC_INIT([transmission],[user_agent_prefix],[https://github.com/transmission/transmission]) | |
9 | 9 | AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix]) |
10 | 10 | AC_SUBST(PEERID_PREFIX,[peer_id_prefix]) |
11 | 11 |
421 | 421 | prefix = @prefix@ |
422 | 422 | program_transform_name = @program_transform_name@ |
423 | 423 | psdir = @psdir@ |
424 | runstatedir = @runstatedir@ | |
424 | 425 | sbindir = @sbindir@ |
425 | 426 | sharedstatedir = @sharedstatedir@ |
426 | 427 | srcdir = @srcdir@ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: daemon-posix.c 14641 2015-12-29 00:42:40Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: daemon-win32.c 14700 2016-03-02 16:15:06Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <process.h> /* _beginthreadex () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: daemon.c 14675 2016-01-25 22:09:49Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <errno.h> |
79 | 79 | getUsage (void) |
80 | 80 | { |
81 | 81 | return "Transmission " LONG_VERSION_STRING |
82 | " http://www.transmissionbt.com/\n" | |
82 | " https://transmissionbt.com/\n" | |
83 | 83 | "A fast and easy BitTorrent client\n" |
84 | 84 | "\n" |
85 | 85 | MY_NAME " is a headless Transmission session\n" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: daemon.h 14485 2015-04-04 17:43:56Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef DTR_DAEMON_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: remote.c 14707 2016-03-05 17:27:40Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
197 | 197 | return |
198 | 198 | MY_NAME" "LONG_VERSION_STRING"\n" |
199 | 199 | "A fast and easy BitTorrent client\n" |
200 | "http://www.transmissionbt.com/\n" | |
200 | "https://transmissionbt.com/\n" | |
201 | 201 | "\n" |
202 | 202 | "Usage: " MY_NAME |
203 | 203 | " [host] [options]\n" |
58 | 58 | Run in the foreground and print errors to stderr. |
59 | 59 | .It Fl g Fl -config-dir Ar directory |
60 | 60 | Where to look for configuration files. This can be used to swap between using the cli, daemon, gtk, and qt clients. |
61 | See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. | |
61 | See https://github.com/transmission/transmission/wiki/Configuration-Files for more information. | |
62 | 62 | .It Fl er Fl -encryption-required |
63 | 63 | Encrypt all peer connections. |
64 | 64 | .It Fl ep Fl -encryption-preferred |
147 | 147 | nor |
148 | 148 | .Op Fl g |
149 | 149 | is specified. |
150 | See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. | |
150 | See https://github.com/transmission/transmission/wiki/Configuration-Files for more information. | |
151 | 151 | .El |
152 | 152 | .Sh AUTHORS |
153 | 153 | .An -nosplit |
165 | 165 | .Xr transmission-remote 1 , |
166 | 166 | .Xr transmission-show 1 |
167 | 167 | .Pp |
168 | http://www.transmissionbt.com/ | |
168 | https://transmissionbt.com/ |
407 | 407 | .Xr transmission-remote 1 , |
408 | 408 | .Xr transmission-show 1 |
409 | 409 | .Pp |
410 | http://www.transmissionbt.com/ | |
410 | https://transmissionbt.com/ |
316 | 316 | prefix = @prefix@ |
317 | 317 | program_transform_name = @program_transform_name@ |
318 | 318 | psdir = @psdir@ |
319 | runstatedir = @runstatedir@ | |
319 | 320 | sbindir = @sbindir@ |
320 | 321 | sharedstatedir = @sharedstatedir@ |
321 | 322 | srcdir = @srcdir@ |
64 | 64 | |
65 | 65 | So, the correct way to handle a 409 response is to update your |
66 | 66 | X-Transmission-Session-Id and to resend the previous request. |
67 | ||
68 | 2.3.2. DNS Rebinding Protection | |
69 | ||
70 | Additional check is being made on each RPC request to make sure that the | |
71 | client sending the request does so using one of the allowed hostnames by | |
72 | which RPC server is meant to be available. | |
73 | ||
74 | If host whitelisting is enabled (which is true by default), Transmission | |
75 | inspects the "Host:" HTTP header value (with port stripped, if any) and | |
76 | matches it to one of the whitelisted names. Regardless of host whitelist | |
77 | content, "localhost" and "localhost." domain names as well as all the IP | |
78 | addresses are always implicitly allowed. | |
79 | ||
80 | For more information on configuration, see settings.json documentation for | |
81 | "rpc-host-whitelist-enabled" and "rpc-host-whitelist" keys. | |
67 | 82 | |
68 | 83 | 3. Torrent Requests |
69 | 84 |
465 | 465 | prefix = @prefix@ |
466 | 466 | program_transform_name = @program_transform_name@ |
467 | 467 | psdir = @psdir@ |
468 | runstatedir = @runstatedir@ | |
468 | 469 | sbindir = @sbindir@ |
469 | 470 | sharedstatedir = @sharedstatedir@ |
470 | 471 | srcdir = @srcdir@ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: actions.c 14681 2016-02-23 04:34:57Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: actions.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_ACTIONS_H |
0 | 0 | /****************************************************************************** |
1 | * $Id: conf.c 14526 2015-05-09 11:56:35Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: conf.h 13683 2012-12-22 20:35:19Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: details.c 14552 2015-07-13 00:32:48Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <limits.h> /* INT_MAX */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: details.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_TORRENT_DETAILS_H |
0 | 0 | /****************************************************************************** |
1 | * $Id: dialogs.c 13625 2012-12-05 17:29:46Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: dialogs.h 13625 2012-12-05 17:29:46Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: favicon.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <glib/gstdio.h> /* g_remove () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: favicon.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_FAVICON_CACHE_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: file-list.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <limits.h> /* INT_MAX */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: file-list.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTK_TORRENT_FILE_LIST_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: filter.c 14613 2015-12-06 22:13:10Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <stdlib.h> /* qsort () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: filter.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_FILTER_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: hig.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <gtk/gtk.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: hig.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_HIG_H |
318 | 318 | prefix = @prefix@ |
319 | 319 | program_transform_name = @program_transform_name@ |
320 | 320 | psdir = @psdir@ |
321 | runstatedir = @runstatedir@ | |
321 | 322 | sbindir = @sbindir@ |
322 | 323 | sharedstatedir = @sharedstatedir@ |
323 | 324 | srcdir = @srcdir@ |
2 | 2 | * "There is no problem for me, you can license my code |
3 | 3 | * under whatever licence you wish :)" |
4 | 4 | * |
5 | * $Id: icons.c 14613 2015-12-06 22:13:10Z jordan $ | |
5 | * $Id$ | |
6 | 6 | */ |
7 | 7 | |
8 | 8 | #include <glib.h> |
2 | 2 | * "There is no problem for me, you can license |
3 | 3 | * my code under whatever licence you wish :)" |
4 | 4 | * |
5 | * $Id: icons.h 13625 2012-12-05 17:29:46Z jordan $ | |
5 | * $Id$ | |
6 | 6 | */ |
7 | 7 | |
8 | 8 | #ifndef GTR_ICONS_H |
0 | 0 | /****************************************************************************** |
1 | * $Id: main.c 14689 2016-02-27 23:18:02Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
1362 | 1362 | static void |
1363 | 1363 | show_about_dialog (GtkWindow * parent) |
1364 | 1364 | { |
1365 | const char * uri = "http://www.transmissionbt.com/"; | |
1365 | const char * uri = "https://transmissionbt.com/"; | |
1366 | 1366 | const char * authors[] = { "Jordan Lee (Backend; GTK+)", |
1367 | 1367 | "Mitchell Livingston (Backend; OS X)", |
1368 | 1368 | NULL }; |
1546 | 1546 | } |
1547 | 1547 | else if (!g_strcmp0 (action_name, "donate")) |
1548 | 1548 | { |
1549 | gtr_open_uri ("http://www.transmissionbt.com/donate.php"); | |
1549 | gtr_open_uri ("https://transmissionbt.com/donate/"); | |
1550 | 1550 | } |
1551 | 1551 | else if (!g_strcmp0 (action_name, "pause-all-torrents")) |
1552 | 1552 | { |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: makemeta-ui.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <glib/gi18n.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: makemeta-ui.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_TORRENT_CREATION_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: msgwin.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <errno.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: msgwin.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: notify.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <gio/gio.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: notify.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_NOTIFY_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: open-dialog.c 14666 2016-01-07 19:20:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <glib/gi18n.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: open-dialog.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_OPEN_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: relocate.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <libtransmission/transmission.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: relocate.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_RELOCATE_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: stats.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <glib/gi18n.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: stats.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_STATS_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: torrent-cell-renderer.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <limits.h> /* INT_MAX */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: torrent-cell-renderer.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_TORRENT_CELL_RENDERER_H |
0 | 0 | /****************************************************************************** |
1 | * $Id: tr-core.c 14587 2015-10-23 04:09:40Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: tr-core.h 14681 2016-02-23 04:34:57Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: tr-icon.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: tr-icon.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_ICON_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: tr-prefs.c 14639 2015-12-28 23:52:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <ctype.h> /* isspace */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: tr-prefs.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_PREFS_H |
0 | 0 | /****************************************************************************** |
1 | * $Id: tr-window.c 14519 2015-05-03 10:30:35Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: tr-window.h 13625 2012-12-05 17:29:46Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
0 | .\" $Id: transmission-gtk.1 11626 2011-01-03 05:58:58Z jordan $ | |
0 | .\" $Id$ | |
1 | 1 | .\" |
2 | 2 | .\" Copyright (c) 2007 Joshua Elsasser |
3 | 3 | .\" |
48 | 48 | Start minimized in notification area |
49 | 49 | .It Fl g, Fl -config-dir Ar directory |
50 | 50 | Where to look for configuration files. This can be used to swap between using the cli, daemon, gtk, and qt clients. |
51 | See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. | |
51 | See https://github.com/transmission/transmission/wiki/Configuration-Files for more information. | |
52 | 52 | .El |
53 | 53 | .Pp |
54 | 54 | Multiple .torrent files may be added at startup |
90 | 90 | .Xr transmission-remote 1 , |
91 | 91 | .Xr transmission-show 1 |
92 | 92 | .Pp |
93 | http://www.transmissionbt.com/ | |
93 | https://transmissionbt.com/ |
1595 | 1595 | |
1596 | 1596 | #define G_HAS_CONSTRUCTORS 1 |
1597 | 1597 | |
1598 | #define G_DEFINE_CONSTRUCTOR(_func) \ | |
1598 | /* We do some weird things to avoid the constructors being optimized | |
1599 | * away on VS2015 if WholeProgramOptimization is enabled. First we | |
1600 | * make a reference to the array from the wrapper to make sure its | |
1601 | * references. Then we use a pragma to make sure the wrapper function | |
1602 | * symbol is always included at the link stage. Also, the symbols | |
1603 | * need to be extern (but not dllexport), even though they are not | |
1604 | * really used from another object file. | |
1605 | */ | |
1606 | ||
1607 | /* We need to account for differences between the mangling of symbols | |
1608 | * for Win32 (x86) and x64 programs, as symbols on Win32 are prefixed | |
1609 | * with an underscore but symbols on x64 are not. | |
1610 | */ | |
1611 | #ifdef _WIN64 | |
1612 | #define G_MSVC_SYMBOL_PREFIX "" | |
1613 | #else | |
1614 | #define G_MSVC_SYMBOL_PREFIX "_" | |
1615 | #endif | |
1616 | ||
1617 | #define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX) | |
1618 | #define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX) | |
1619 | ||
1620 | #define G_MSVC_CTOR(_func,_sym_prefix) \ | |
1599 | 1621 | static void _func(void); \ |
1600 | static int _func ## _wrapper(void) { _func(); return 0; } \ | |
1622 | extern int (* _array ## _func)(void); \ | |
1623 | int _func ## _wrapper(void) { _func(); g_slist_find (NULL, _array ## _func); return 0; } \ | |
1624 | __pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \ | |
1601 | 1625 | __pragma(section(".CRT$XCU",read)) \ |
1602 | __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _wrapper; | |
1603 | ||
1604 | #define G_DEFINE_DESTRUCTOR(_func) \ | |
1626 | __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper; | |
1627 | ||
1628 | #define G_MSVC_DTOR(_func,_sym_prefix) \ | |
1605 | 1629 | static void _func(void); \ |
1606 | static int _func ## _constructor(void) { atexit (_func); return 0; } \ | |
1630 | extern int (* _array ## _func)(void); \ | |
1631 | int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL, _array ## _func); return 0; } \ | |
1632 | __pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \ | |
1607 | 1633 | __pragma(section(".CRT$XCU",read)) \ |
1608 | __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor; | |
1634 | __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor; | |
1609 | 1635 | |
1610 | 1636 | #elif defined (_MSC_VER) |
1611 | 1637 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: util.c 14587 2015-10-23 04:09:40Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <ctype.h> /* isxdigit () */ |
352 | 352 | |
353 | 353 | if (!uri) |
354 | 354 | { |
355 | const char * fmt = "http://www.transmissionbt.com/help/gtk/%d.%dx"; | |
355 | const char * fmt = "https://transmissionbt.com/help/gtk/%d.%dx"; | |
356 | 356 | uri = g_strdup_printf (fmt, MAJOR_VERSION, MINOR_VERSION / 10); |
357 | 357 | } |
358 | 358 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: util.h 14587 2015-10-23 04:09:40Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef GTR_UTIL_H |
0 | 0 | #!/bin/sh |
1 | 1 | # install - install a program, script, or datafile |
2 | 2 | |
3 | scriptversion=2013-12-25.23; # UTC | |
3 | scriptversion=2014-09-12.12; # UTC | |
4 | 4 | |
5 | 5 | # This originates from X11R5 (mit/util/scripts/install.sh), which was |
6 | 6 | # later released in X11R6 (xc/config/util/install.sh) with the |
323 | 323 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. |
324 | 324 | ;; |
325 | 325 | *) |
326 | # $RANDOM is not portable (e.g. dash); use it when possible to | |
327 | # lower collision chance | |
326 | 328 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ |
327 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 | |
328 | ||
329 | trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 | |
330 | ||
331 | # As "mkdir -p" follows symlinks and we work in /tmp possibly; so | |
332 | # create the $tmpdir first (and fail if unsuccessful) to make sure | |
333 | # that nobody tries to guess the $tmpdir name. | |
329 | 334 | if (umask $mkdir_umask && |
330 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 | |
335 | $mkdirprog $mkdir_mode "$tmpdir" && | |
336 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 | |
331 | 337 | then |
332 | 338 | if test -z "$dir_arg" || { |
333 | 339 | # Check for POSIX incompatibilities with -m. |
334 | 340 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or |
335 | 341 | # other-writable bit of parent directory when it shouldn't. |
336 | 342 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. |
337 | ls_ld_tmpdir=`ls -ld "$tmpdir"` | |
343 | test_tmpdir="$tmpdir/a" | |
344 | ls_ld_tmpdir=`ls -ld "$test_tmpdir"` | |
338 | 345 | case $ls_ld_tmpdir in |
339 | 346 | d????-?r-*) different_mode=700;; |
340 | 347 | d????-?--*) different_mode=755;; |
341 | 348 | *) false;; |
342 | 349 | esac && |
343 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { | |
344 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` | |
350 | $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { | |
351 | ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` | |
345 | 352 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" |
346 | 353 | } |
347 | 354 | } |
348 | 355 | then posix_mkdir=: |
349 | 356 | fi |
350 | rmdir "$tmpdir/d" "$tmpdir" | |
357 | rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" | |
351 | 358 | else |
352 | 359 | # Remove any dirs left behind by ancient mkdir implementations. |
353 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null | |
360 | rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null | |
354 | 361 | fi |
355 | 362 | trap '' 0;; |
356 | 363 | esac;; |
822 | 822 | prefix = @prefix@ |
823 | 823 | program_transform_name = @program_transform_name@ |
824 | 824 | psdir = @psdir@ |
825 | runstatedir = @runstatedir@ | |
825 | 826 | sbindir = @sbindir@ |
826 | 827 | sharedstatedir = @sharedstatedir@ |
827 | 828 | srcdir = @srcdir@ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: announcer-common.h 14521 2015-05-04 19:58:34Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __LIBTRANSMISSION_ANNOUNCER_MODULE__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: announcer-http.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <limits.h> /* USHRT_MAX */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: announcer-udp.c 14648 2015-12-31 14:17:37Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #define __LIBTRANSMISSION_ANNOUNCER_MODULE__ |
658 | 658 | } |
659 | 659 | |
660 | 660 | static void |
661 | tau_tracker_upkeep (struct tau_tracker * tracker) | |
661 | tau_tracker_upkeep_ex (struct tau_tracker * tracker, | |
662 | bool timeout_reqs) | |
662 | 663 | { |
663 | 664 | const time_t now = tr_time (); |
664 | 665 | const bool closing = tracker->close_at != 0; |
716 | 717 | return; |
717 | 718 | } |
718 | 719 | |
719 | tau_tracker_timeout_reqs (tracker); | |
720 | if (timeout_reqs) | |
721 | tau_tracker_timeout_reqs (tracker); | |
720 | 722 | |
721 | 723 | if ((tracker->addr != NULL) && (tracker->connection_expiration_time > now)) |
722 | 724 | tau_tracker_send_reqs (tracker); |
725 | } | |
726 | ||
727 | static void | |
728 | tau_tracker_upkeep (struct tau_tracker * tracker) | |
729 | { | |
730 | tau_tracker_upkeep_ex (tracker, true); | |
723 | 731 | } |
724 | 732 | |
725 | 733 | /**** |
956 | 964 | response_func, |
957 | 965 | user_data); |
958 | 966 | tr_ptrArrayAppend (&tracker->announces, r); |
959 | tau_tracker_upkeep (tracker); | |
967 | tau_tracker_upkeep_ex (tracker, false); | |
960 | 968 | } |
961 | 969 | |
962 | 970 | void |
971 | 979 | response_func, |
972 | 980 | user_data); |
973 | 981 | tr_ptrArrayAppend (&tracker->scrapes, r); |
974 | tau_tracker_upkeep (tracker); | |
975 | } | |
982 | tau_tracker_upkeep_ex (tracker, false); | |
983 | } |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: announcer.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
1424 | 1424 | char * url = tier->currentTracker->scrape; |
1425 | 1425 | const uint8_t * hash = tier->tor->info.hash; |
1426 | 1426 | |
1427 | assert (url != NULL); | |
1428 | ||
1427 | 1429 | /* if there's a request with this scrape URL and a free slot, use it */ |
1428 | 1430 | for (j=0; j<request_count; ++j) |
1429 | 1431 | { |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: announcer.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: bandwidth.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: bandwidth.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: bitfield-test.c 14669 2016-01-08 11:12:22Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> /* strlen () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: bitfield.c 14646 2015-12-31 05:22:42Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: bitfield.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: blocklist-test.c 14382 2014-12-13 15:22:39Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: blocklist.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: blocklist.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: cache.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <stdlib.h> /* qsort () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: cache.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: clients-test.c 14286 2014-06-07 15:07:51Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "transmission.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: clients.c 14546 2015-06-26 21:22:27Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | /* thanks amc1! */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: clients.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: completion.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: completion.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto-test.c 14429 2015-01-03 21:35:20Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto-utils-cyassl.c 14442 2015-01-07 13:20:56Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto-utils-fallback.c 14370 2014-12-11 05:11:02Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | /* This file is designed specifically to be included by other source files to |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto-utils-openssl.c 14640 2015-12-28 23:53:55Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifdef __APPLE__ |
229 | 229 | **** |
230 | 230 | ***/ |
231 | 231 | |
232 | #if OPENSSL_VERSION_NUMBER < 0x10100000 | |
233 | static inline int | |
234 | DH_set0_pqg (DH * dh, | |
235 | BIGNUM * p, | |
236 | BIGNUM * q, | |
237 | BIGNUM * g) | |
238 | { | |
239 | /* If the fields p and g in d are NULL, the corresponding input | |
240 | * parameters MUST be non-NULL. q may remain NULL. | |
241 | */ | |
242 | if ((dh->p == NULL && p == NULL) | |
243 | || (dh->g == NULL && g == NULL)) | |
244 | return 0; | |
245 | ||
246 | if (p != NULL) { | |
247 | BN_free (dh->p); | |
248 | dh->p = p; | |
249 | } | |
250 | if (q != NULL) { | |
251 | BN_free (dh->q); | |
252 | dh->q = q; | |
253 | } | |
254 | if (g != NULL) { | |
255 | BN_free (dh->g); | |
256 | dh->g = g; | |
257 | } | |
258 | ||
259 | if (q != NULL) { | |
260 | dh->length = BN_num_bits (q); | |
261 | } | |
262 | ||
263 | return 1; | |
264 | } | |
265 | ||
266 | static inline int | |
267 | DH_set_length (DH * dh, | |
268 | long length) | |
269 | { | |
270 | dh->length = length; | |
271 | return 1; | |
272 | } | |
273 | ||
274 | static inline void | |
275 | DH_get0_key(const DH * dh, | |
276 | const BIGNUM ** pub_key, | |
277 | const BIGNUM ** priv_key) | |
278 | { | |
279 | if (pub_key != NULL) | |
280 | *pub_key = dh->pub_key; | |
281 | if (priv_key != NULL) | |
282 | *priv_key = dh->priv_key; | |
283 | } | |
284 | ||
285 | #endif | |
286 | ||
232 | 287 | tr_dh_ctx_t |
233 | 288 | tr_dh_new (const uint8_t * prime_num, |
234 | 289 | size_t prime_num_length, |
236 | 291 | size_t generator_num_length) |
237 | 292 | { |
238 | 293 | DH * handle = DH_new (); |
294 | BIGNUM * p, * g; | |
239 | 295 | |
240 | 296 | assert (prime_num != NULL); |
241 | 297 | assert (generator_num != NULL); |
242 | ||
243 | if (!check_pointer (handle->p = BN_bin2bn (prime_num, prime_num_length, NULL)) || | |
244 | !check_pointer (handle->g = BN_bin2bn (generator_num, generator_num_length, NULL))) | |
298 | p = BN_bin2bn (prime_num, prime_num_length, NULL); | |
299 | g = BN_bin2bn (generator_num, generator_num_length, NULL); | |
300 | ||
301 | if (!check_pointer (p) || | |
302 | !check_pointer (g) || | |
303 | !DH_set0_pqg (handle, p, NULL, g)) | |
245 | 304 | { |
305 | BN_free (p); | |
306 | BN_free (g); | |
246 | 307 | DH_free (handle); |
247 | 308 | handle = NULL; |
248 | 309 | } |
267 | 328 | { |
268 | 329 | DH * handle = raw_handle; |
269 | 330 | int dh_size, my_public_key_length; |
331 | const BIGNUM * hand_pub_key; | |
270 | 332 | |
271 | 333 | assert (handle != NULL); |
272 | 334 | assert (public_key != NULL); |
273 | 335 | |
274 | handle->length = private_key_length * 8; | |
336 | ||
337 | DH_set_length(handle, private_key_length * 8); | |
275 | 338 | |
276 | 339 | if (!check_result (DH_generate_key (handle))) |
277 | 340 | return false; |
278 | 341 | |
279 | my_public_key_length = BN_bn2bin (handle->pub_key, public_key); | |
342 | DH_get0_key (handle, &hand_pub_key, NULL); | |
343 | ||
344 | my_public_key_length = BN_bn2bin (hand_pub_key, public_key); | |
280 | 345 | dh_size = DH_size (handle); |
281 | 346 | |
282 | 347 | tr_dh_align_key (public_key, my_public_key_length, dh_size); |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto-utils-polarssl.c 14444 2015-01-07 14:05:58Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto-utils.c 14618 2015-12-13 01:29:39Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
132 | 132 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
133 | 133 | "./"; |
134 | 134 | |
135 | assert (plain_text != NULL); | |
136 | ||
135 | 137 | size_t i; |
136 | 138 | unsigned char salt[saltval_len]; |
137 | 139 | uint8_t sha[SHA_DIGEST_LENGTH]; |
154 | 156 | tr_ssha1_matches (const char * ssha1, |
155 | 157 | const char * plain_text) |
156 | 158 | { |
157 | char * salt; | |
158 | size_t saltlen; | |
159 | char * my_ssha1; | |
160 | uint8_t buf[SHA_DIGEST_LENGTH]; | |
161 | bool result; | |
162 | const size_t sourcelen = strlen (ssha1); | |
159 | assert (ssha1 != NULL); | |
160 | assert (plain_text != NULL); | |
161 | ||
162 | const size_t brace_len = 1; | |
163 | const size_t brace_and_hash_len = brace_len + 2 * SHA_DIGEST_LENGTH; | |
164 | ||
165 | const size_t source_len = strlen (ssha1); | |
166 | if (source_len < brace_and_hash_len || ssha1[0] != '{') | |
167 | return false; | |
163 | 168 | |
164 | 169 | /* extract the salt */ |
165 | if (sourcelen < 2 * SHA_DIGEST_LENGTH - 1) | |
166 | return false; | |
167 | saltlen = sourcelen - 2 * SHA_DIGEST_LENGTH - 1; | |
168 | salt = tr_malloc (saltlen); | |
169 | memcpy (salt, ssha1 + 2 * SHA_DIGEST_LENGTH + 1, saltlen); | |
170 | const char * const salt = ssha1 + brace_and_hash_len; | |
171 | const size_t salt_len = source_len - brace_and_hash_len; | |
172 | ||
173 | uint8_t buf[SHA_DIGEST_LENGTH * 2 + 1]; | |
170 | 174 | |
171 | 175 | /* hash pass + salt */ |
172 | my_ssha1 = tr_malloc (2 * SHA_DIGEST_LENGTH + saltlen + 2); | |
173 | tr_sha1 (buf, plain_text, strlen (plain_text), salt, saltlen, NULL); | |
174 | tr_sha1_to_hex (&my_ssha1[1], buf); | |
175 | memcpy (my_ssha1 + 1 + 2 * SHA_DIGEST_LENGTH, salt, saltlen); | |
176 | my_ssha1[1 + 2 * SHA_DIGEST_LENGTH + saltlen] = '\0'; | |
177 | my_ssha1[0] = '{'; | |
178 | ||
179 | result = strcmp (ssha1, my_ssha1) == 0; | |
180 | ||
181 | tr_free (my_ssha1); | |
182 | tr_free (salt); | |
183 | ||
184 | return result; | |
176 | tr_sha1 (buf, plain_text, (int) strlen (plain_text), salt, (int) salt_len, NULL); | |
177 | tr_sha1_to_hex ((char *) buf, buf); | |
178 | ||
179 | return strncmp (ssha1 + brace_len, (const char *) buf, SHA_DIGEST_LENGTH * 2) == 0; | |
185 | 180 | } |
186 | 181 | |
187 | 182 | /*** |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto-utils.h 14422 2015-01-01 21:16:36Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_CRYPTO_UTILS_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto.c 14476 2015-03-15 11:43:32Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: crypto.h 14360 2014-12-04 20:45:18Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_ENCRYPTION_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: error-test.c 14657 2016-01-03 21:03:54Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "transmission.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: error-types.h 14492 2015-04-11 10:58:08Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_ERROR_TYPES_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: error.c 14369 2014-12-10 18:58:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: error.h 14369 2014-12-10 18:58:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_ERROR_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: fdlimit.c 14548 2015-07-01 00:54:41Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
222 | 222 | /* If the file already exists and it's too large, truncate it. |
223 | 223 | * This is a fringe case that happens if a torrent's been updated |
224 | 224 | * and one of the updated torrent's files is smaller. |
225 | * http://trac.transmissionbt.com/ticket/2228 | |
225 | * https://trac.transmissionbt.com/ticket/2228 | |
226 | 226 | * https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/318249 |
227 | 227 | */ |
228 | 228 | if (resize_needed && !tr_sys_file_truncate (fd, file_size, &error)) |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: fdlimit.h 14479 2015-03-18 07:34:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: file-posix.c 14640 2015-12-28 23:53:55Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #if defined (HAVE_MKDTEMP) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 700) |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: file-test.c 14658 2016-01-04 05:04:55Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: file-win32.c 14588 2015-10-23 05:29:47Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: file.c 14493 2015-04-11 14:54:01Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: file.h 14584 2015-10-20 21:22:19Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_FILE_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: handshake.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
425 | 425 | |
426 | 426 | /* compute the secret */ |
427 | 427 | evbuffer_remove (inbuf, yb, KEY_LEN); |
428 | tr_cryptoComputeSecret (handshake->crypto, yb); | |
428 | if (!tr_cryptoComputeSecret (handshake->crypto, yb)) | |
429 | return tr_handshakeDone (handshake, false); | |
429 | 430 | |
430 | 431 | /* now send these: HASH ('req1', S), HASH ('req2', SKEY) xor HASH ('req3', S), |
431 | 432 | * ENCRYPT (VC, crypto_provide, len (PadC), PadC, len (IA)), ENCRYPT (IA) */ |
741 | 742 | |
742 | 743 | /* read the incoming peer's public key */ |
743 | 744 | evbuffer_remove (inbuf, ya, KEY_LEN); |
744 | tr_cryptoComputeSecret (handshake->crypto, ya); | |
745 | if (!tr_cryptoComputeSecret (handshake->crypto, ya)) | |
746 | return tr_handshakeDone (handshake, false); | |
747 | ||
745 | 748 | computeRequestHash (handshake, "req1", handshake->myReq1); |
746 | 749 | |
747 | 750 | /* send our public key to the peer */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: handshake.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: history-test.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> /* memset () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: history.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: history.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: inout.c 14476 2015-03-15 11:43:32Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: inout.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: json-test.c 14640 2015-12-28 23:53:55Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> /* strlen () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: libtransmission-test.c 14581 2015-10-18 18:39:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: libtransmission-test.h 14382 2014-12-13 15:22:39Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | /* Note VERBOSE needs to be (un)defined before including this file */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: list.c 14319 2014-07-06 20:06:45Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "transmission.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: list.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: log.c 14620 2015-12-13 10:34:53Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: log.h 14476 2015-03-15 11:43:32Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_LOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: magnet-test.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "transmission.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: magnet.c 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: magnet.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: makemeta-test.c 14428 2015-01-02 11:15:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "libtransmission-test.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: makemeta.c 14355 2014-12-04 12:13:59Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: makemeta.h 14294 2014-06-10 00:43:21Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_MAKEMETA_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: metainfo-test.c 14428 2015-01-02 11:15:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "libtransmission-test.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: metainfo.c 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: metainfo.h 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: move-test.c 14587 2015-10-23 04:09:40Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: natpmp.c 14532 2015-05-31 22:13:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <errno.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: natpmp_local.h 14369 2014-12-10 18:58:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
0 | 0 | /****************************************************************************** |
1 | 1 | * |
2 | * $Id: net.c 14578 2015-10-16 19:49:07Z mikedld $ | |
2 | * $Id$ | |
3 | 3 | * |
4 | 4 | * Copyright (c) Transmission authors and contributors |
5 | 5 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: net.h 14574 2015-10-11 16:35:51Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) Transmission authors and contributors |
4 | 4 | * |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: peer-common.h 14382 2014-12-13 15:22:39Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: peer-io.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: peer-io.h 14479 2015-03-18 07:34:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: peer-mgr.c 14666 2016-01-07 19:20:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: peer-mgr.h 14479 2015-03-18 07:34:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: peer-msgs-test.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <stdio.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: peer-msgs.c 14666 2016-01-07 19:20:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: peer-msgs.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: platform-quota.c 14480 2015-03-19 06:08:06Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <errno.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: platform-quota.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: platform.c 14633 2015-12-25 10:19:50Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #define _XOPEN_SOURCE 600 /* needed for recursive locks. */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: platform.h 14532 2015-05-31 22:13:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: port-forwarding.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: port-forwarding.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: ptrarray.c 14592 2015-10-25 17:13:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: ptrarray.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: quark-test.c 14669 2016-01-08 11:12:22Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> /* strlen() */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: quark.c 14666 2016-01-07 19:20:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
288 | 288 | { "rpc-authentication-required", 27 }, |
289 | 289 | { "rpc-bind-address", 16 }, |
290 | 290 | { "rpc-enabled", 11 }, |
291 | { "rpc-host-whitelist", 18 }, | |
292 | { "rpc-host-whitelist-enabled", 26 }, | |
291 | 293 | { "rpc-password", 12 }, |
292 | 294 | { "rpc-port", 8 }, |
293 | 295 | { "rpc-url", 7 }, |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: quark.h 14369 2014-12-10 18:58:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_QUARK_H |
290 | 290 | TR_KEY_rpc_authentication_required, |
291 | 291 | TR_KEY_rpc_bind_address, |
292 | 292 | TR_KEY_rpc_enabled, |
293 | TR_KEY_rpc_host_whitelist, | |
294 | TR_KEY_rpc_host_whitelist_enabled, | |
293 | 295 | TR_KEY_rpc_password, |
294 | 296 | TR_KEY_rpc_port, |
295 | 297 | TR_KEY_rpc_url, |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: rename-test.c 14491 2015-04-11 10:51:59Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: resume.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: resume.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: rpc-server.c 14663 2016-01-07 15:28:58Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
51 | 51 | bool isEnabled; |
52 | 52 | bool isPasswordEnabled; |
53 | 53 | bool isWhitelistEnabled; |
54 | bool isHostWhitelistEnabled; | |
54 | 55 | tr_port port; |
55 | 56 | char * url; |
56 | 57 | struct in_addr bindAddress; |
62 | 63 | char * password; |
63 | 64 | char * whitelistStr; |
64 | 65 | tr_list * whitelist; |
66 | tr_list * hostWhitelist; | |
65 | 67 | |
66 | 68 | char * sessionId; |
67 | 69 | time_t sessionIdExpiresAt; |
584 | 586 | if (tr_wildmat (address, l->data)) |
585 | 587 | return true; |
586 | 588 | |
589 | return false; | |
590 | } | |
591 | ||
592 | static bool | |
593 | isIPAddressWithOptionalPort (const char * host) | |
594 | { | |
595 | struct sockaddr_storage address; | |
596 | int address_len = sizeof (address); | |
597 | ||
598 | /* TODO: move to net.{c,h} */ | |
599 | return evutil_parse_sockaddr_port (host, (struct sockaddr *) &address, &address_len) != -1; | |
600 | } | |
601 | ||
602 | static bool | |
603 | isHostnameAllowed (const tr_rpc_server * server, struct evhttp_request * req) | |
604 | { | |
605 | /* If password auth is enabled, any hostname is permitted. */ | |
606 | if (server->isPasswordEnabled) | |
607 | return true; | |
608 | ||
609 | /* If whitelist is disabled, no restrictions. */ | |
610 | if (!server->isHostWhitelistEnabled) | |
611 | return true; | |
612 | ||
613 | const char * const host = evhttp_find_header (req->input_headers, "Host"); | |
614 | ||
615 | /* No host header, invalid request. */ | |
616 | if (host == NULL) | |
617 | return false; | |
618 | ||
619 | /* IP address is always acceptable. */ | |
620 | if (isIPAddressWithOptionalPort (host)) | |
621 | return true; | |
622 | ||
623 | /* Host header might include the port. */ | |
624 | char * const hostname = tr_strndup (host, strcspn (host, ":")); | |
625 | ||
626 | /* localhost is always acceptable. */ | |
627 | if (strcmp (hostname, "localhost") == 0 || strcmp (hostname, "localhost.") == 0) | |
628 | { | |
629 | tr_free (hostname); | |
630 | return true; | |
631 | } | |
632 | ||
633 | /* Otherwise, hostname must be whitelisted. */ | |
634 | for (tr_list * l = server->hostWhitelist; l != NULL; l = l->next) | |
635 | { | |
636 | if (tr_wildmat (hostname, l->data)) | |
637 | { | |
638 | tr_free (hostname); | |
639 | return true; | |
640 | } | |
641 | } | |
642 | ||
643 | tr_free(hostname); | |
587 | 644 | return false; |
588 | 645 | } |
589 | 646 | |
661 | 718 | { |
662 | 719 | handle_upload (req, server); |
663 | 720 | } |
721 | else if (!isHostnameAllowed (server, req)) | |
722 | { | |
723 | char * const tmp = tr_strdup_printf ( | |
724 | "<p>Transmission received your request, but the hostname was unrecognized.</p>" | |
725 | "<p>To fix this, choose one of the following options:" | |
726 | "<ul>" | |
727 | "<li>Enable password authentication, then any hostname is allowed.</li>" | |
728 | "<li>Add the hostname you want to use to the whitelist in settings.</li>" | |
729 | "</ul></p>" | |
730 | "<p>If you're editing settings.json, see the 'rpc-host-whitelist' and 'rpc-host-whitelist-enabled' entries.</p>" | |
731 | "<p>This requirement has been added to help prevent " | |
732 | "<a href=\"https://en.wikipedia.org/wiki/DNS_rebinding\">DNS Rebinding</a> " | |
733 | "attacks.</p>"); | |
734 | send_simple_response (req, 421, tmp); | |
735 | tr_free (tmp); | |
736 | } | |
664 | 737 | #ifdef REQUIRE_SESSION_ID |
665 | 738 | else if (!test_session_id (server, req)) |
666 | 739 | { |
673 | 746 | "<li> When you get this 409 error message, resend your request with the updated header" |
674 | 747 | "</ol></p>" |
675 | 748 | "<p>This requirement has been added to help prevent " |
676 | "<a href=\"http://en.wikipedia.org/wiki/Cross-site_request_forgery\">CSRF</a> " | |
749 | "<a href=\"https://en.wikipedia.org/wiki/Cross-site_request_forgery\">CSRF</a> " | |
677 | 750 | "attacks.</p>" |
678 | 751 | "<p><code>%s: %s</code></p>", |
679 | 752 | TR_RPC_SESSION_ID_HEADER, sessionId); |
874 | 947 | return server->url ? server->url : ""; |
875 | 948 | } |
876 | 949 | |
877 | void | |
878 | tr_rpcSetWhitelist (tr_rpc_server * server, const char * whitelistStr) | |
950 | static void | |
951 | tr_rpcSetList (const char * whitelistStr, tr_list ** list) | |
879 | 952 | { |
880 | 953 | void * tmp; |
881 | 954 | const char * walk; |
882 | 955 | |
883 | /* keep the string */ | |
884 | tmp = server->whitelistStr; | |
885 | server->whitelistStr = tr_strdup (whitelistStr); | |
886 | tr_free (tmp); | |
887 | ||
888 | 956 | /* clear out the old whitelist entries */ |
889 | while ((tmp = tr_list_pop_front (&server->whitelist))) | |
957 | while ((tmp = tr_list_pop_front (list))) | |
890 | 958 | tr_free (tmp); |
891 | 959 | |
892 | 960 | /* build the new whitelist entries */ |
895 | 963 | const char * delimiters = " ,;"; |
896 | 964 | const size_t len = strcspn (walk, delimiters); |
897 | 965 | char * token = tr_strndup (walk, len); |
898 | tr_list_append (&server->whitelist, token); | |
966 | tr_list_append (list, token); | |
899 | 967 | if (strcspn (token, "+-") < len) |
900 | 968 | tr_logAddNamedInfo (MY_NAME, "Adding address to whitelist: %s (And it has a '+' or '-'! Are you using an old ACL by mistake?)", token); |
901 | 969 | else |
908 | 976 | } |
909 | 977 | } |
910 | 978 | |
979 | void | |
980 | tr_rpcSetHostWhitelist (tr_rpc_server* server, const char * whitelistStr) | |
981 | { | |
982 | tr_rpcSetList (whitelistStr, &server->hostWhitelist); | |
983 | } | |
984 | ||
985 | void | |
986 | tr_rpcSetWhitelist (tr_rpc_server * server, const char * whitelistStr) | |
987 | { | |
988 | /* keep the string */ | |
989 | char* const tmp = server->whitelistStr; | |
990 | server->whitelistStr = tr_strdup (whitelistStr); | |
991 | tr_free (tmp); | |
992 | ||
993 | tr_rpcSetList (whitelistStr, &server->whitelist); | |
994 | } | |
995 | ||
911 | 996 | const char* |
912 | 997 | tr_rpcGetWhitelist (const tr_rpc_server * server) |
913 | 998 | { |
927 | 1012 | tr_rpcGetWhitelistEnabled (const tr_rpc_server * server) |
928 | 1013 | { |
929 | 1014 | return server->isWhitelistEnabled; |
1015 | } | |
1016 | ||
1017 | void | |
1018 | tr_rpcSetHostWhitelistEnabled(tr_rpc_server * server, bool isEnabled) | |
1019 | { | |
1020 | server->isHostWhitelistEnabled = isEnabled; | |
930 | 1021 | } |
931 | 1022 | |
932 | 1023 | /**** |
1062 | 1153 | else |
1063 | 1154 | tr_rpcSetWhitelistEnabled (s, boolVal); |
1064 | 1155 | |
1156 | key = TR_KEY_rpc_host_whitelist_enabled; | |
1157 | if (!tr_variantDictFindBool (settings, key, &boolVal)) | |
1158 | missing_settings_key (key); | |
1159 | else | |
1160 | tr_rpcSetHostWhitelistEnabled (s, boolVal); | |
1161 | ||
1162 | key = TR_KEY_rpc_host_whitelist; | |
1163 | if (!tr_variantDictFindStr (settings, key, &str, NULL) && str) | |
1164 | missing_settings_key (key); | |
1165 | else | |
1166 | tr_rpcSetHostWhitelist (s, str); | |
1167 | ||
1065 | 1168 | key = TR_KEY_rpc_authentication_required; |
1066 | 1169 | if (!tr_variantDictFindBool (settings, key, &boolVal)) |
1067 | 1170 | missing_settings_key (key); |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: rpc-server.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
48 | 48 | |
49 | 49 | const char* tr_rpcGetWhitelist (const tr_rpc_server * server); |
50 | 50 | |
51 | void tr_rpcSetHostWhitelistEnabled (tr_rpc_server * server, | |
52 | bool isEnabled); | |
53 | ||
54 | void tr_rpcSetHostWhitelist (tr_rpc_server * server, | |
55 | const char * whitelist); | |
56 | ||
51 | 57 | void tr_rpcSetPassword (tr_rpc_server * server, |
52 | 58 | const char * password); |
53 | 59 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: rpc-test.c 14633 2015-12-25 10:19:50Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "transmission.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: rpcimpl.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: rpcimpl.h 14633 2015-12-25 10:19:50Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_RPC_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: session-test.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <stdio.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: session.c 14666 2016-01-07 19:20:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
358 | 358 | tr_variantDictAddStr (d, TR_KEY_rpc_username, ""); |
359 | 359 | tr_variantDictAddStr (d, TR_KEY_rpc_whitelist, TR_DEFAULT_RPC_WHITELIST); |
360 | 360 | tr_variantDictAddBool (d, TR_KEY_rpc_whitelist_enabled, true); |
361 | tr_variantDictAddStr (d, TR_KEY_rpc_host_whitelist, TR_DEFAULT_RPC_HOST_WHITELIST); | |
362 | tr_variantDictAddBool (d, TR_KEY_rpc_host_whitelist_enabled, true); | |
361 | 363 | tr_variantDictAddInt (d, TR_KEY_rpc_port, atoi (TR_DEFAULT_RPC_PORT_STR)); |
362 | 364 | tr_variantDictAddStr (d, TR_KEY_rpc_url, TR_DEFAULT_RPC_URL_STR); |
363 | 365 | tr_variantDictAddBool (d, TR_KEY_scrape_paused_torrents_enabled, true); |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: session.h 14581 2015-10-18 18:39:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: stats.c 14491 2015-04-11 10:51:59Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "transmission.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: torrent-ctor.c 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <errno.h> /* EINVAL */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: torrent-magnet.c 14664 2016-01-07 17:12:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: torrent-magnet.h 14664 2016-01-07 17:12:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: torrent.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <errno.h> /* EINVAL */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: torrent.h 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
18 | 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
19 | 19 | * THE SOFTWARE. |
20 | 20 | * |
21 | * $Id: tr-dht.c 14536 2015-06-08 19:54:51Z mikedld $ | |
21 | * $Id$ | |
22 | 22 | * |
23 | 23 | */ |
24 | 24 |
18 | 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
19 | 19 | * THE SOFTWARE. |
20 | 20 | * |
21 | * $Id: tr-dht.h 14532 2015-05-31 22:13:31Z mikedld $ | |
21 | * $Id$ | |
22 | 22 | * |
23 | 23 | */ |
24 | 24 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: tr-getopt-test.c 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "transmission.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: tr-getopt.c 14615 2015-12-06 22:39:14Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <ctype.h> /* isspace () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: tr-getopt.h 14615 2015-12-06 22:39:14Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_GETOPT_H |
62 | 62 | * This module implements the Local Peer Discovery (LPD) protocol as supported by the |
63 | 63 | * uTorrent client application. A typical LPD datagram is 119 bytes long. |
64 | 64 | * |
65 | * $Id: tr-lpd.c 14641 2015-12-29 00:42:40Z mikedld $ | |
65 | * $Id$ | |
66 | 66 | */ |
67 | 67 | |
68 | 68 | static void event_callback (evutil_socket_t, short, void*); |
26 | 26 | #ifndef _TR_LPD_H |
27 | 27 | #define _TR_LPD_H |
28 | 28 | |
29 | /* $Id: tr-lpd.h 14321 2014-07-08 00:15:12Z jordan $ */ | |
29 | /* $Id$ */ | |
30 | 30 | |
31 | 31 | int tr_lpdInit (tr_session*, tr_address*); |
32 | 32 | void tr_lpdUninit (tr_session*); |
3 | 3 | * It may be used under the 3-Clause BSD License, the GNU Public License v2, |
4 | 4 | * or v3, or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: transmission.h 14645 2015-12-29 19:44:50Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | /* |
122 | 122 | #define TR_DEFAULT_BIND_ADDRESS_IPV4 "0.0.0.0" |
123 | 123 | #define TR_DEFAULT_BIND_ADDRESS_IPV6 "::" |
124 | 124 | #define TR_DEFAULT_RPC_WHITELIST "127.0.0.1" |
125 | #define TR_DEFAULT_RPC_HOST_WHITELIST "" | |
125 | 126 | #define TR_DEFAULT_RPC_PORT_STR "9091" |
126 | 127 | #define TR_DEFAULT_RPC_URL_STR "/transmission/" |
127 | 128 | #define TR_DEFAULT_PEER_PORT_STR "51413" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: trevent.c 14648 2015-12-31 14:17:37Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: trevent.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: upnp.c 14565 2015-10-04 04:53:18Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: upnp.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: utils-test.c 14678 2016-02-07 11:54:01Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <limits.h> /* INT_MAX */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: utils.c 14682 2016-02-23 05:07:43Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifdef HAVE_MEMMEM |
635 | 635 | { |
636 | 636 | static const char hex[] = "0123456789abcdef"; |
637 | 637 | const uint8_t * input_octets = input; |
638 | size_t i; | |
639 | ||
640 | for (i = 0; i < byte_length; ++i) | |
641 | { | |
642 | const unsigned int val = *input_octets++; | |
643 | *output++ = hex[val >> 4]; | |
644 | *output++ = hex[val & 0xf]; | |
645 | } | |
638 | ||
639 | /* go from back to front to allow for in-place conversion */ | |
640 | input_octets += byte_length; | |
641 | output += byte_length * 2; | |
646 | 642 | |
647 | 643 | *output = '\0'; |
644 | ||
645 | while (byte_length-- > 0) | |
646 | { | |
647 | const unsigned int val = *(--input_octets); | |
648 | *(--output) = hex[val & 0xf]; | |
649 | *(--output) = hex[val >> 4]; | |
650 | } | |
648 | 651 | } |
649 | 652 | |
650 | 653 | void |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: utils.h 14641 2015-12-29 00:42:40Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_UTILS_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: variant-benc.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: variant-common.h 14521 2015-05-04 19:58:34Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __LIBTRANSMISSION_VARIANT_MODULE__ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: variant-json.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: variant-test.c 14666 2016-01-07 19:20:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <ctype.h> /* isspace () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: variant.c 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #if defined (HAVE_USELOCALE) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 700) |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: variant.h 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_VARIANT_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: verify.c 14543 2015-06-23 21:16:33Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #if defined (HAVE_POSIX_FADVISE) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 600) |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: verify.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
0 | #define PEERID_PREFIX "-TR2920-" | |
1 | #define USERAGENT_PREFIX "2.92" | |
2 | #define SVN_REVISION "14714" | |
3 | #define SVN_REVISION_NUM 14714 | |
4 | #define SHORT_VERSION_STRING "2.92" | |
5 | #define LONG_VERSION_STRING "2.92 (14714)" | |
6 | #define VERSION_STRING_INFOPLIST 2.92 | |
0 | #pragma once | |
1 | ||
2 | #define PEERID_PREFIX "-TR2930-" | |
3 | #define USERAGENT_PREFIX "2.93" | |
4 | #define VCS_REVISION "3c5870d4f5" | |
5 | #define VCS_REVISION_NUM 3c5870d4f5 | |
6 | #define SHORT_VERSION_STRING "2.93" | |
7 | #define LONG_VERSION_STRING "2.93 (3c5870d4f5)" | |
8 | #define VERSION_STRING_INFOPLIST 2.93 | |
7 | 9 | #define MAJOR_VERSION 2 |
8 | #define MINOR_VERSION 92 | |
10 | #define MINOR_VERSION 93 | |
9 | 11 | #define TR_STABLE_RELEASE 1 |
0 | #ifndef TR_VERSION_H | |
1 | #define TR_VERSION_H | |
0 | #pragma once | |
2 | 1 | |
3 | 2 | #define PEERID_PREFIX "${TR_PEER_ID_PREFIX}" |
4 | 3 | #define USERAGENT_PREFIX "${TR_USER_AGENT_PREFIX}" |
5 | #define SVN_REVISION "${TR_SCM_REVISION}" | |
6 | #define SVN_REVISION_NUM ${TR_SCM_REVISION} | |
4 | #define VCS_REVISION "${TR_VCS_REVISION}" | |
5 | #define VCS_REVISION_NUM ${TR_VCS_REVISION} | |
7 | 6 | #define SHORT_VERSION_STRING "${TR_USER_AGENT_PREFIX}" |
8 | #define LONG_VERSION_STRING "${TR_USER_AGENT_PREFIX} (${TR_SCM_REVISION})" | |
7 | #define LONG_VERSION_STRING "${TR_USER_AGENT_PREFIX} (${TR_VCS_REVISION})" | |
9 | 8 | #define VERSION_STRING_INFOPLIST ${TR_USER_AGENT_PREFIX} |
10 | 9 | #define MAJOR_VERSION ${TR_VERSION_MAJOR} |
11 | 10 | #define MINOR_VERSION ${TR_VERSION_MINOR} |
13 | 12 | #cmakedefine TR_BETA_RELEASE 1 |
14 | 13 | #cmakedefine TR_NIGHTLY_RELEASE 1 |
15 | 14 | #cmakedefine TR_STABLE_RELEASE 1 |
16 | ||
17 | #endif /* TR_VERSION_H */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: watchdir-common.h 14651 2016-01-02 14:28:59Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_WATCHDIR_COMMON_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: watchdir-generic.c 14651 2016-01-02 14:28:59Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: watchdir-inotify.c 14651 2016-01-02 14:28:59Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: watchdir-kqueue.c 14651 2016-01-02 14:28:59Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: watchdir-test.c 14675 2016-01-25 22:09:49Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <event2/event.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: watchdir-win32.c 14653 2016-01-02 15:26:23Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: watchdir.c 14674 2016-01-25 21:48:58Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: watchdir.h 14674 2016-01-25 21:48:58Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_WATCHDIR_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: web.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <assert.h> |
593 | 593 | case 415: return "Unsupported Media Type"; |
594 | 594 | case 416: return "Requested Range Not Satisfiable"; |
595 | 595 | case 417: return "Expectation Failed"; |
596 | case 421: return "Misdirected Request"; | |
596 | 597 | case 500: return "Internal Server Error"; |
597 | 598 | case 501: return "Not Implemented"; |
598 | 599 | case 502: return "Bad Gateway"; |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: web.h 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef TR_HTTP_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: webseed.c 14619 2015-12-13 10:23:22Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <string.h> /* strlen () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: webseed.h 14241 2014-01-21 03:10:30Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef __TRANSMISSION__ |
30 | 30 | |
31 | 31 | PROGRAM=libtool |
32 | 32 | PACKAGE=libtool |
33 | VERSION=2.4.6 | |
33 | VERSION="2.4.6 Debian-2.4.6-2" | |
34 | 34 | package_revision=2.4.6 |
35 | 35 | |
36 | 36 | |
2067 | 2067 | compiler: $LTCC |
2068 | 2068 | compiler flags: $LTCFLAGS |
2069 | 2069 | linker: $LD (gnu? $with_gnu_ld) |
2070 | version: $progname (GNU libtool) 2.4.6 | |
2070 | version: $progname $scriptversion Debian-2.4.6-2 | |
2071 | 2071 | automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` |
2072 | 2072 | autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` |
2073 | 2073 | |
2074 | 2074 | Report bugs to <bug-libtool@gnu.org>. |
2075 | GNU libtool home page: <http://www.gnu.org/software/libtool/>. | |
2075 | GNU libtool home page: <http://www.gnu.org/s/libtool/>. | |
2076 | 2076 | General help using GNU software: <http://www.gnu.org/gethelp/>." |
2077 | 2077 | exit 0 |
2078 | 2078 | } |
7271 | 7271 | # -tp=* Portland pgcc target processor selection |
7272 | 7272 | # --sysroot=* for sysroot support |
7273 | 7273 | # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization |
7274 | # -fuse-ld=* Linker select flags for GCC | |
7274 | # -specs=* GCC specs files | |
7275 | 7275 | # -stdlib=* select c++ std lib with clang |
7276 | # -fsanitize=* Clang/GCC memory and address sanitizer | |
7276 | 7277 | -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ |
7277 | 7278 | -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ |
7278 | 7279 | -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ |
7279 | -fuse-ld=*) | |
7280 | -specs=*|-fsanitize=*) | |
7280 | 7281 | func_quote_for_eval "$arg" |
7281 | 7282 | arg=$func_quote_for_eval_result |
7282 | 7283 | func_append compile_command " $arg" |
7569 | 7570 | case $pass in |
7570 | 7571 | dlopen) libs=$dlfiles ;; |
7571 | 7572 | dlpreopen) libs=$dlprefiles ;; |
7572 | link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; | |
7573 | link) | |
7574 | libs="$deplibs %DEPLIBS%" | |
7575 | test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" | |
7576 | ;; | |
7573 | 7577 | esac |
7574 | 7578 | fi |
7575 | 7579 | if test lib,dlpreopen = "$linkmode,$pass"; then |
7888 | 7892 | # It is a libtool convenience library, so add in its objects. |
7889 | 7893 | func_append convenience " $ladir/$objdir/$old_library" |
7890 | 7894 | func_append old_convenience " $ladir/$objdir/$old_library" |
7895 | tmp_libs= | |
7896 | for deplib in $dependency_libs; do | |
7897 | deplibs="$deplib $deplibs" | |
7898 | if $opt_preserve_dup_deps; then | |
7899 | case "$tmp_libs " in | |
7900 | *" $deplib "*) func_append specialdeplibs " $deplib" ;; | |
7901 | esac | |
7902 | fi | |
7903 | func_append tmp_libs " $deplib" | |
7904 | done | |
7891 | 7905 | elif test prog != "$linkmode" && test lib != "$linkmode"; then |
7892 | 7906 | func_fatal_error "'$lib' is not a convenience library" |
7893 | 7907 | fi |
7894 | tmp_libs= | |
7895 | for deplib in $dependency_libs; do | |
7896 | deplibs="$deplib $deplibs" | |
7897 | if $opt_preserve_dup_deps; then | |
7898 | case "$tmp_libs " in | |
7899 | *" $deplib "*) func_append specialdeplibs " $deplib" ;; | |
7900 | esac | |
7901 | fi | |
7902 | func_append tmp_libs " $deplib" | |
7903 | done | |
7904 | 7908 | continue |
7905 | 7909 | fi # $pass = conv |
7906 | 7910 | |
8823 | 8827 | age=$number_minor |
8824 | 8828 | revision=$number_minor |
8825 | 8829 | lt_irix_increment=no |
8830 | ;; | |
8831 | *) | |
8832 | func_fatal_configuration "$modename: unknown library version type '$version_type'" | |
8826 | 8833 | ;; |
8827 | 8834 | esac |
8828 | 8835 | ;; |
35 | 35 | dnl try to pull in the installed version of these macros |
36 | 36 | dnl when running aclocal in the glib directory. |
37 | 37 | dnl |
38 | m4_copy([AC_DEFUN],[glib_DEFUN]) | |
39 | m4_copy([AC_REQUIRE],[glib_REQUIRE]) | |
38 | m4_copy_force([AC_DEFUN],[glib_DEFUN]) | |
39 | m4_copy_force([AC_REQUIRE],[glib_REQUIRE]) | |
40 | 40 | dnl |
41 | 41 | dnl At the end, if we're not within glib, we'll define the public |
42 | 42 | dnl definitions in terms of our private definitions. |
727 | 727 | cat <<_LT_EOF >> "$cfgfile" |
728 | 728 | #! $SHELL |
729 | 729 | # Generated automatically by $as_me ($PACKAGE) $VERSION |
730 | # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | |
731 | 730 | # NOTE: Changes made to this file will be lost: look at ltmain.sh. |
732 | 731 | |
733 | 732 | # Provide generalized library-building support services. |
2665 | 2664 | *) objformat=elf ;; |
2666 | 2665 | esac |
2667 | 2666 | fi |
2668 | # Handle Gentoo/FreeBSD as it was Linux | |
2669 | case $host_vendor in | |
2670 | gentoo) | |
2671 | version_type=linux ;; | |
2672 | *) | |
2673 | version_type=freebsd-$objformat ;; | |
2674 | esac | |
2675 | ||
2667 | version_type=freebsd-$objformat | |
2676 | 2668 | case $version_type in |
2677 | 2669 | freebsd-elf*) |
2678 | 2670 | library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' |
2683 | 2675 | freebsd-*) |
2684 | 2676 | library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' |
2685 | 2677 | need_version=yes |
2686 | ;; | |
2687 | linux) | |
2688 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | |
2689 | soname_spec='${libname}${release}${shared_ext}$major' | |
2690 | need_lib_prefix=no | |
2691 | need_version=no | |
2692 | 2678 | ;; |
2693 | 2679 | esac |
2694 | 2680 | shlibpath_var=LD_LIBRARY_PATH |
2897 | 2883 | # people can always --disable-shared, the test was removed, and we |
2898 | 2884 | # assume the GNU/Linux dynamic linker is in use. |
2899 | 2885 | dynamic_linker='GNU/Linux ld.so' |
2886 | ;; | |
2887 | ||
2888 | netbsdelf*-gnu) | |
2889 | version_type=linux | |
2890 | need_lib_prefix=no | |
2891 | need_version=no | |
2892 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | |
2893 | soname_spec='${libname}${release}${shared_ext}$major' | |
2894 | shlibpath_var=LD_LIBRARY_PATH | |
2895 | shlibpath_overrides_runpath=no | |
2896 | hardcode_into_libs=yes | |
2897 | dynamic_linker='NetBSD ld.elf_so' | |
2900 | 2898 | ;; |
2901 | 2899 | |
2902 | 2900 | netbsd*) |
3558 | 3556 | lt_cv_deplibs_check_method=pass_all |
3559 | 3557 | ;; |
3560 | 3558 | |
3561 | netbsd*) | |
3559 | netbsd* | netbsdelf*-gnu) | |
3562 | 3560 | if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then |
3563 | 3561 | lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' |
3564 | 3562 | else |
4436 | 4434 | ;; |
4437 | 4435 | esac |
4438 | 4436 | ;; |
4439 | netbsd*) | |
4437 | netbsd* | netbsdelf*-gnu) | |
4440 | 4438 | ;; |
4441 | 4439 | *qnx* | *nto*) |
4442 | 4440 | # QNX uses GNU C++, but need to define -shared option too, otherwise |
4948 | 4946 | ;; |
4949 | 4947 | esac |
4950 | 4948 | ;; |
4949 | linux* | k*bsd*-gnu | gnu*) | |
4950 | _LT_TAGVAR(link_all_deplibs, $1)=no | |
4951 | ;; | |
4951 | 4952 | *) |
4952 | 4953 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' |
4953 | 4954 | ;; |
5009 | 5010 | ;; |
5010 | 5011 | openbsd* | bitrig*) |
5011 | 5012 | with_gnu_ld=no |
5013 | ;; | |
5014 | linux* | k*bsd*-gnu | gnu*) | |
5015 | _LT_TAGVAR(link_all_deplibs, $1)=no | |
5012 | 5016 | ;; |
5013 | 5017 | esac |
5014 | 5018 | |
5264 | 5268 | fi |
5265 | 5269 | ;; |
5266 | 5270 | |
5267 | netbsd*) | |
5271 | netbsd* | netbsdelf*-gnu) | |
5268 | 5272 | if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then |
5269 | 5273 | _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' |
5270 | 5274 | wlarc= |
5785 | 5789 | if test yes = "$lt_cv_irix_exported_symbol"; then |
5786 | 5790 | _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' |
5787 | 5791 | fi |
5792 | _LT_TAGVAR(link_all_deplibs, $1)=no | |
5788 | 5793 | else |
5789 | 5794 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' |
5790 | 5795 | _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' |
5806 | 5811 | esac |
5807 | 5812 | ;; |
5808 | 5813 | |
5809 | netbsd*) | |
5814 | netbsd* | netbsdelf*-gnu) | |
5810 | 5815 | if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then |
5811 | 5816 | _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out |
5812 | 5817 | else |
0 | 0 | /****************************************************************************** |
1 | * $Id: AboutWindowController.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: AboutWindowController.m 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: AddMagnetWindowController.h 13602 2012-10-30 00:22:10Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: AddMagnetWindowController.m 13602 2012-10-30 00:22:10Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: AddWindowController.h 13602 2012-10-30 00:22:10Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: AddWindowController.m 14587 2015-10-23 04:09:40Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BadgeView.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BadgeView.m 13340 2012-06-10 02:35:58Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: Badger.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: Badger.m 13571 2012-10-15 02:12:44Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BlocklistDownloader.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BlocklistDownloader.m 13326 2012-05-29 01:03:21Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BlocklistDownloaderViewController.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BlocklistDownloaderViewController.m 13253 2012-03-13 03:20:09Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BlocklistScheduler.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BlocklistScheduler.m 13492 2012-09-10 02:37:29Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BonjourController.h 13491 2012-09-10 02:01:07Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: BonjourController.m 13491 2012-09-10 02:01:07Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ButtonToolbarItem.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ButtonToolbarItem.m 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ColorTextField.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ColorTextField.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: Controller.h 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
258 | 258 | |
259 | 259 | - (void) linkHomepage: (id) sender; |
260 | 260 | - (void) linkForums: (id) sender; |
261 | - (void) linkTrac: (id) sender; | |
261 | - (void) linkGitHub: (id) sender; | |
262 | 262 | - (void) linkDonate: (id) sender; |
263 | 263 | |
264 | 264 | - (void) rpcCallback: (tr_rpc_callback_type) type forTorrentStruct: (struct tr_torrent *) torrentStruct; |
0 | 0 | /****************************************************************************** |
1 | * $Id: Controller.m 14712 2016-03-06 19:45:41Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
132 | 132 | |
133 | 133 | #define TRANSFER_PLIST @"Transfers.plist" |
134 | 134 | |
135 | #define WEBSITE_URL @"http://www.transmissionbt.com/" | |
136 | #define FORUM_URL @"http://forum.transmissionbt.com/" | |
137 | #define TRAC_URL @"http://trac.transmissionbt.com/" | |
138 | #define DONATE_URL @"http://www.transmissionbt.com/donate.php" | |
135 | #define WEBSITE_URL @"https://transmissionbt.com/" | |
136 | #define FORUM_URL @"https://forum.transmissionbt.com/" | |
137 | #define GITHUB_URL @"https://github.com/transmission/transmission" | |
138 | #define DONATE_URL @"https://transmissionbt.com/donate/" | |
139 | 139 | |
140 | 140 | #define DONATE_NAG_TIME (60 * 60 * 24 * 7) |
141 | 141 | |
227 | 227 | { |
228 | 228 | if ([krFilePath length] == 0 || ![fileManager fileExistsAtPath: krFilePath]) |
229 | 229 | continue; |
230 | ||
230 | ||
231 | 231 | if (![fileManager removeItemAtPath: krFilePath error: NULL]) |
232 | 232 | NSLog(@"Unable to remove ransomware file at %@, please do so manually", krFilePath); |
233 | 233 | } |
257 | 257 | [alert setInformativeText: NSLocalizedString(@"There is already a copy of Transmission running. " |
258 | 258 | "This copy cannot be opened until that instance is quit.", "Transmission already running alert -> message")]; |
259 | 259 | [alert setAlertStyle: NSCriticalAlertStyle]; |
260 | ||
260 | ||
261 | 261 | [alert runModal]; |
262 | 262 | [alert release]; |
263 | ||
263 | ||
264 | 264 | //kill ourselves right away |
265 | 265 | exit(0); |
266 | 266 | } |
267 | ||
267 | ||
268 | 268 | [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithContentsOfFile: |
269 | 269 | [[NSBundle mainBundle] pathForResource: @"Defaults" ofType: @"plist"]]]; |
270 | ||
270 | ||
271 | 271 | //set custom value transformers |
272 | 272 | ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease]; |
273 | 273 | [NSValueTransformer setValueTransformer: pathTransformer forName: @"ExpandedPathToPathTransformer"]; |
274 | ||
274 | ||
275 | 275 | ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease]; |
276 | 276 | [NSValueTransformer setValueTransformer: iconTransformer forName: @"ExpandedPathToIconTransformer"]; |
277 | ||
277 | ||
278 | 278 | //cover our asses |
279 | 279 | if ([[NSUserDefaults standardUserDefaults] boolForKey: @"WarningLegal"]) |
280 | 280 | { |
287 | 287 | " You and you alone are fully responsible for exercising proper judgement and abiding by your local laws.", |
288 | 288 | "Legal alert -> message")]; |
289 | 289 | [alert setAlertStyle: NSInformationalAlertStyle]; |
290 | ||
290 | ||
291 | 291 | if ([alert runModal] == NSAlertSecondButtonReturn) |
292 | 292 | exit(0); |
293 | 293 | [alert release]; |
294 | ||
294 | ||
295 | 295 | [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningLegal"]; |
296 | 296 | } |
297 | 297 | } |
301 | 301 | if ((self = [super init])) |
302 | 302 | { |
303 | 303 | fDefaults = [NSUserDefaults standardUserDefaults]; |
304 | ||
304 | ||
305 | 305 | //checks for old version speeds of -1 |
306 | 306 | if ([fDefaults integerForKey: @"UploadLimit"] < 0) |
307 | 307 | { |
313 | 313 | [fDefaults removeObjectForKey: @"DownloadLimit"]; |
314 | 314 | [fDefaults setBool: NO forKey: @"CheckDownload"]; |
315 | 315 | } |
316 | ||
316 | ||
317 | 317 | //upgrading from versions < 2.40: clear recent items |
318 | 318 | [[NSDocumentController sharedDocumentController] clearRecentDocuments: nil]; |
319 | ||
319 | ||
320 | 320 | tr_variant settings; |
321 | 321 | tr_variantInitDict(&settings, 41); |
322 | 322 | tr_sessionGetDefaultSettings(&settings); |
323 | ||
323 | ||
324 | 324 | const BOOL usesSpeedLimitSched = [fDefaults boolForKey: @"SpeedLimitAuto"]; |
325 | 325 | if (!usesSpeedLimitSched) |
326 | 326 | tr_variantDictAddBool(&settings, TR_KEY_alt_speed_enabled, [fDefaults boolForKey: @"SpeedLimit"]); |
327 | ||
327 | ||
328 | 328 | tr_variantDictAddInt(&settings, TR_KEY_alt_speed_up, [fDefaults integerForKey: @"SpeedLimitUploadLimit"]); |
329 | 329 | tr_variantDictAddInt(&settings, TR_KEY_alt_speed_down, [fDefaults integerForKey: @"SpeedLimitDownloadLimit"]); |
330 | ||
330 | ||
331 | 331 | tr_variantDictAddBool(&settings, TR_KEY_alt_speed_time_enabled, [fDefaults boolForKey: @"SpeedLimitAuto"]); |
332 | 332 | tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_begin, [PrefsController dateToTimeSum: |
333 | 333 | [fDefaults objectForKey: @"SpeedLimitAutoOnDate"]]); |
334 | 334 | tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_end, [PrefsController dateToTimeSum: |
335 | 335 | [fDefaults objectForKey: @"SpeedLimitAutoOffDate"]]); |
336 | 336 | tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_day, [fDefaults integerForKey: @"SpeedLimitAutoDay"]); |
337 | ||
337 | ||
338 | 338 | tr_variantDictAddInt(&settings, TR_KEY_speed_limit_down, [fDefaults integerForKey: @"DownloadLimit"]); |
339 | 339 | tr_variantDictAddBool(&settings, TR_KEY_speed_limit_down_enabled, [fDefaults boolForKey: @"CheckDownload"]); |
340 | 340 | tr_variantDictAddInt(&settings, TR_KEY_speed_limit_up, [fDefaults integerForKey: @"UploadLimit"]); |
341 | 341 | tr_variantDictAddBool(&settings, TR_KEY_speed_limit_up_enabled, [fDefaults boolForKey: @"CheckUpload"]); |
342 | ||
342 | ||
343 | 343 | //hidden prefs |
344 | 344 | if ([fDefaults objectForKey: @"BindAddressIPv4"]) |
345 | 345 | tr_variantDictAddStr(&settings, TR_KEY_bind_address_ipv4, [[fDefaults stringForKey: @"BindAddressIPv4"] UTF8String]); |
346 | 346 | if ([fDefaults objectForKey: @"BindAddressIPv6"]) |
347 | 347 | tr_variantDictAddStr(&settings, TR_KEY_bind_address_ipv6, [[fDefaults stringForKey: @"BindAddressIPv6"] UTF8String]); |
348 | ||
348 | ||
349 | 349 | tr_variantDictAddBool(&settings, TR_KEY_blocklist_enabled, [fDefaults boolForKey: @"BlocklistNew"]); |
350 | 350 | if ([fDefaults objectForKey: @"BlocklistURL"]) |
351 | 351 | tr_variantDictAddStr(&settings, TR_KEY_blocklist_url, [[fDefaults stringForKey: @"BlocklistURL"] UTF8String]); |
363 | 363 | tr_variantDictAddInt(&settings, TR_KEY_message_level, TR_LOG_DEBUG); |
364 | 364 | tr_variantDictAddInt(&settings, TR_KEY_peer_limit_global, [fDefaults integerForKey: @"PeersTotal"]); |
365 | 365 | tr_variantDictAddInt(&settings, TR_KEY_peer_limit_per_torrent, [fDefaults integerForKey: @"PeersTorrent"]); |
366 | ||
366 | ||
367 | 367 | const BOOL randomPort = [fDefaults boolForKey: @"RandomPort"]; |
368 | 368 | tr_variantDictAddBool(&settings, TR_KEY_peer_port_random_on_start, randomPort); |
369 | 369 | if (!randomPort) |
370 | 370 | tr_variantDictAddInt(&settings, TR_KEY_peer_port, [fDefaults integerForKey: @"BindPort"]); |
371 | ||
371 | ||
372 | 372 | //hidden pref |
373 | 373 | if ([fDefaults objectForKey: @"PeerSocketTOS"]) |
374 | 374 | tr_variantDictAddStr(&settings, TR_KEY_peer_socket_tos, [[fDefaults stringForKey: @"PeerSocketTOS"] UTF8String]); |
375 | ||
375 | ||
376 | 376 | tr_variantDictAddBool(&settings, TR_KEY_pex_enabled, [fDefaults boolForKey: @"PEXGlobal"]); |
377 | 377 | tr_variantDictAddBool(&settings, TR_KEY_port_forwarding_enabled, [fDefaults boolForKey: @"NatTraversal"]); |
378 | 378 | tr_variantDictAddBool(&settings, TR_KEY_queue_stalled_enabled, [fDefaults boolForKey: @"CheckStalled"]); |
385 | 385 | tr_variantDictAddInt(&settings, TR_KEY_rpc_port, [fDefaults integerForKey: @"RPCPort"]); |
386 | 386 | tr_variantDictAddStr(&settings, TR_KEY_rpc_username, [[fDefaults stringForKey: @"RPCUsername"] UTF8String]); |
387 | 387 | tr_variantDictAddBool(&settings, TR_KEY_rpc_whitelist_enabled, [fDefaults boolForKey: @"RPCUseWhitelist"]); |
388 | tr_variantDictAddBool(&settings, TR_KEY_rpc_host_whitelist_enabled, [fDefaults boolForKey: @"RPCUseHostWhitelist"]); | |
388 | 389 | tr_variantDictAddBool(&settings, TR_KEY_seed_queue_enabled, [fDefaults boolForKey: @"QueueSeed"]); |
389 | 390 | tr_variantDictAddInt(&settings, TR_KEY_seed_queue_size, [fDefaults integerForKey: @"QueueSeedNumber"]); |
390 | 391 | tr_variantDictAddBool(&settings, TR_KEY_start_added_torrents, [fDefaults boolForKey: @"AutoStartDownload"]); |
391 | 392 | tr_variantDictAddBool(&settings, TR_KEY_script_torrent_done_enabled, [fDefaults boolForKey: @"DoneScriptEnabled"]); |
392 | 393 | tr_variantDictAddStr(&settings, TR_KEY_script_torrent_done_filename, [[fDefaults stringForKey: @"DoneScriptPath"] UTF8String]); |
393 | 394 | tr_variantDictAddBool(&settings, TR_KEY_utp_enabled, [fDefaults boolForKey: @"UTPGlobal"]); |
394 | ||
395 | ||
395 | ||
396 | // TODO: Add to GUI | |
397 | if ([fDefaults objectForKey: @"RPCHostWhitelist"]) | |
398 | tr_variantDictAddStr(&settings, TR_KEY_rpc_host_whitelist, [[fDefaults stringForKey: @"RPCHostWhitelist"] UTF8String]); | |
399 | ||
396 | 400 | NSString * kbString, * mbString, * gbString, * tbString; |
397 | 401 | if ([NSApp isOnMountainLionOrBetter]) |
398 | 402 | { |
399 | 403 | NSByteCountFormatter * unitFormatter = [[NSByteCountFormatterMtLion alloc] init]; |
400 | 404 | [unitFormatter setIncludesCount: NO]; |
401 | 405 | [unitFormatter setAllowsNonnumericFormatting: NO]; |
402 | ||
406 | ||
403 | 407 | [unitFormatter setAllowedUnits: NSByteCountFormatterUseKB]; |
404 | 408 | kbString = [unitFormatter stringFromByteCount: 17]; //use a random value to avoid possible pluralization issues with 1 or 0 (an example is if we use 1 for bytes, we'd get "byte" when we'd want "bytes" for the generic libtransmission value at least) |
405 | ||
409 | ||
406 | 410 | [unitFormatter setAllowedUnits: NSByteCountFormatterUseMB]; |
407 | 411 | mbString = [unitFormatter stringFromByteCount: 17]; |
408 | ||
412 | ||
409 | 413 | [unitFormatter setAllowedUnits: NSByteCountFormatterUseGB]; |
410 | 414 | gbString = [unitFormatter stringFromByteCount: 17]; |
411 | ||
415 | ||
412 | 416 | [unitFormatter setAllowedUnits: NSByteCountFormatterUseTB]; |
413 | 417 | tbString = [unitFormatter stringFromByteCount: 17]; |
414 | ||
418 | ||
415 | 419 | [unitFormatter release]; |
416 | 420 | } |
417 | 421 | else |
421 | 425 | gbString = NSLocalizedString(@"GB", "file/memory size - gigabytes"); |
422 | 426 | tbString = NSLocalizedString(@"TB", "file/memory size - terabytes"); |
423 | 427 | } |
424 | ||
428 | ||
425 | 429 | tr_formatter_size_init(1000, [kbString UTF8String], |
426 | 430 | [mbString UTF8String], |
427 | 431 | [gbString UTF8String], |
436 | 440 | [mbString UTF8String], |
437 | 441 | [gbString UTF8String], |
438 | 442 | [tbString UTF8String]); |
439 | ||
443 | ||
440 | 444 | const char * configDir = tr_getDefaultConfigDir("Transmission"); |
441 | 445 | fLib = tr_sessionInit(configDir, YES, &settings); |
442 | 446 | tr_variantFree(&settings); |
443 | ||
447 | ||
444 | 448 | fConfigDirectory = [[NSString alloc] initWithUTF8String: configDir]; |
445 | ||
449 | ||
446 | 450 | [NSApp setDelegate: self]; |
447 | ||
451 | ||
448 | 452 | //register for magnet URLs (has to be in init) |
449 | 453 | [[NSAppleEventManager sharedAppleEventManager] setEventHandler: self andSelector: @selector(handleOpenContentsEvent:replyEvent:) |
450 | 454 | forEventClass: kInternetEventClass andEventID: kAEGetURL]; |
451 | ||
455 | ||
452 | 456 | fTorrents = [[NSMutableArray alloc] init]; |
453 | 457 | fDisplayedTorrents = [[NSMutableArray alloc] init]; |
454 | ||
458 | ||
455 | 459 | fInfoController = [[InfoWindowController alloc] init]; |
456 | ||
460 | ||
457 | 461 | //needs to be done before init-ing the prefs controller |
458 | 462 | fFileWatcherQueue = [[VDKQueue alloc] init]; |
459 | 463 | [fFileWatcherQueue setDelegate: self]; |
460 | ||
464 | ||
461 | 465 | fPrefsController = [[PrefsController alloc] initWithHandle: fLib]; |
462 | ||
466 | ||
463 | 467 | fQuitting = NO; |
464 | 468 | fGlobalPopoverShown = NO; |
465 | 469 | fSoundPlaying = NO; |
466 | ||
470 | ||
467 | 471 | tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self); |
468 | 472 | if (usesSpeedLimitSched) |
469 | 473 | [fDefaults setBool: tr_sessionUsesAltSpeed(fLib) forKey: @"SpeedLimit"]; |
470 | ||
474 | ||
471 | 475 | tr_sessionSetRPCCallback(fLib, rpcCallback, self); |
472 | ||
476 | ||
473 | 477 | [GrowlApplicationBridge setGrowlDelegate: self]; |
474 | ||
478 | ||
475 | 479 | [[SUUpdater sharedUpdater] setDelegate: self]; |
476 | 480 | fQuitRequested = NO; |
477 | ||
481 | ||
478 | 482 | fPauseOnLaunch = (GetCurrentKeyModifiers() & (optionKey | rightOptionKey)) != 0; |
479 | 483 | } |
480 | 484 | return self; |
489 | 493 | [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly]; |
490 | 494 | [fWindow setToolbar: toolbar]; |
491 | 495 | [toolbar release]; |
492 | ||
496 | ||
493 | 497 | [fWindow setDelegate: self]; //do manually to avoid placement issue |
494 | ||
498 | ||
495 | 499 | [fWindow makeFirstResponder: fTableView]; |
496 | 500 | [fWindow setExcludedFromWindowsMenu: YES]; |
497 | ||
501 | ||
498 | 502 | //set table size |
499 | 503 | const BOOL small = [fDefaults boolForKey: @"SmallView"]; |
500 | 504 | if (small) |
501 | 505 | [fTableView setRowHeight: ROW_HEIGHT_SMALL]; |
502 | 506 | [fTableView setUsesAlternatingRowBackgroundColors: !small]; |
503 | ||
507 | ||
504 | 508 | [fWindow setContentBorderThickness: NSMinY([[fTableView enclosingScrollView] frame]) forEdge: NSMinYEdge]; |
505 | 509 | [fWindow setMovableByWindowBackground: YES]; |
506 | ||
510 | ||
507 | 511 | [[fTotalTorrentsField cell] setBackgroundStyle: NSBackgroundStyleRaised]; |
508 | ||
512 | ||
509 | 513 | //set up filter bar |
510 | 514 | [self showFilterBar: [fDefaults boolForKey: @"FilterBar"] animate: NO]; |
511 | ||
515 | ||
512 | 516 | //set up status bar |
513 | 517 | [self showStatusBar: [fDefaults boolForKey: @"StatusBar"] animate: NO]; |
514 | ||
518 | ||
515 | 519 | [fActionButton setToolTip: NSLocalizedString(@"Shortcuts for changing global settings.", |
516 | 520 | "Main window -> 1st bottom left button (action) tooltip")]; |
517 | 521 | [fSpeedLimitButton setToolTip: NSLocalizedString(@"Speed Limit overrides the total bandwidth limits with its own limits.", |
518 | 522 | "Main window -> 2nd bottom left button (turtle) tooltip")]; |
519 | 523 | [fClearCompletedButton setToolTip: NSLocalizedString(@"Remove all transfers that have completed seeding.", |
520 | 524 | "Main window -> 3rd bottom left button (remove all) tooltip")]; |
521 | ||
525 | ||
522 | 526 | [fTableView registerForDraggedTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE]]; |
523 | 527 | [fWindow registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, NSURLPboardType, nil]]; |
524 | ||
528 | ||
525 | 529 | //sort the sort menu items (localization is from strings file) |
526 | 530 | NSMutableArray * sortMenuItems = [NSMutableArray arrayWithCapacity: 7]; |
527 | 531 | NSUInteger sortMenuIndex = 0; |
542 | 546 | ++sortMenuIndex; |
543 | 547 | } |
544 | 548 | } |
545 | ||
549 | ||
546 | 550 | [sortMenuItems sortUsingDescriptors: [NSArray arrayWithObject: [NSSortDescriptor sortDescriptorWithKey: @"title" ascending: YES selector: @selector(localizedCompare:)]]]; |
547 | ||
551 | ||
548 | 552 | for (NSMenuItem * item in sortMenuItems) |
549 | 553 | [fSortMenu insertItem: item atIndex: sortMenuIndex++]; |
550 | ||
554 | ||
551 | 555 | //you would think this would be called later in this method from updateUI, but it's not reached in awakeFromNib |
552 | 556 | //this must be called after showStatusBar: |
553 | 557 | [fStatusBar updateWithDownload: 0.0 upload: 0.0]; |
554 | 558 | |
555 | 559 | //this should also be after the rest of the setup |
556 | 560 | [self updateForAutoSize]; |
557 | ||
561 | ||
558 | 562 | //register for sleep notifications |
559 | 563 | IONotificationPortRef notify; |
560 | 564 | io_object_t iterator; |
562 | 566 | CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes); |
563 | 567 | else |
564 | 568 | NSLog(@"Could not IORegisterForSystemPower"); |
565 | ||
569 | ||
566 | 570 | //load previous transfers |
567 | 571 | NSString * historyFile = [fConfigDirectory stringByAppendingPathComponent: TRANSFER_PLIST]; |
568 | 572 | NSArray * history = [NSArray arrayWithContentsOfFile: historyFile]; |
572 | 576 | if ((history = [fDefaults arrayForKey: @"History"])) |
573 | 577 | [fDefaults removeObjectForKey: @"History"]; |
574 | 578 | } |
575 | ||
579 | ||
576 | 580 | if (history) |
577 | 581 | { |
578 | 582 | NSMutableArray * waitToStartTorrents = [NSMutableArray arrayWithCapacity: (([history count] > 0 && !fPauseOnLaunch) ? [history count]-1 : 0)]; //theoretical max without doing a lot of work |
579 | ||
583 | ||
580 | 584 | for (NSDictionary * historyItem in history) |
581 | 585 | { |
582 | 586 | Torrent * torrent; |
583 | 587 | if ((torrent = [[Torrent alloc] initWithHistory: historyItem lib: fLib forcePause: fPauseOnLaunch])) |
584 | 588 | { |
585 | 589 | [fTorrents addObject: torrent]; |
586 | ||
590 | ||
587 | 591 | NSNumber * waitToStart; |
588 | 592 | if (!fPauseOnLaunch && (waitToStart = [historyItem objectForKey: @"WaitToStart"]) && [waitToStart boolValue]) |
589 | 593 | [waitToStartTorrents addObject: torrent]; |
590 | ||
594 | ||
591 | 595 | [torrent release]; |
592 | 596 | } |
593 | 597 | } |
594 | ||
598 | ||
595 | 599 | //now that all are loaded, let's set those in the queue to waiting |
596 | 600 | for (Torrent * torrent in waitToStartTorrents) |
597 | 601 | [torrent startTransfer]; |
598 | 602 | } |
599 | ||
603 | ||
600 | 604 | fBadger = [[Badger alloc] initWithLib: fLib]; |
601 | ||
605 | ||
602 | 606 | if ([NSApp isOnMountainLionOrBetter]) |
603 | 607 | [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] setDelegate: self]; |
604 | ||
608 | ||
605 | 609 | // remove Share menu items |
606 | 610 | if (![NSApp isOnMountainLionOrBetter]) { |
607 | 611 | [[fShareMenuItem menu] removeItem:fShareMenuItem]; |
608 | 612 | [[fShareContextMenuItem menu] removeItem:fShareContextMenuItem]; |
609 | 613 | } |
610 | ||
614 | ||
611 | 615 | //observe notifications |
612 | 616 | NSNotificationCenter * nc = [NSNotificationCenter defaultCenter]; |
613 | ||
617 | ||
614 | 618 | [nc addObserver: self selector: @selector(updateUI) |
615 | 619 | name: @"UpdateUI" object: nil]; |
616 | ||
620 | ||
617 | 621 | [nc addObserver: self selector: @selector(torrentFinishedDownloading:) |
618 | 622 | name: @"TorrentFinishedDownloading" object: nil]; |
619 | ||
623 | ||
620 | 624 | [nc addObserver: self selector: @selector(torrentRestartedDownloading:) |
621 | 625 | name: @"TorrentRestartedDownloading" object: nil]; |
622 | ||
626 | ||
623 | 627 | [nc addObserver: self selector: @selector(torrentFinishedSeeding:) |
624 | 628 | name: @"TorrentFinishedSeeding" object: nil]; |
625 | ||
629 | ||
626 | 630 | [nc addObserver: self selector: @selector(applyFilter) |
627 | 631 | name: kTorrentDidChangeGroupNotification object: nil]; |
628 | ||
632 | ||
629 | 633 | //avoids need of setting delegate |
630 | 634 | [nc addObserver: self selector: @selector(torrentTableViewSelectionDidChange:) |
631 | 635 | name: NSOutlineViewSelectionDidChangeNotification object: fTableView]; |
632 | ||
636 | ||
633 | 637 | [nc addObserver: self selector: @selector(changeAutoImport) |
634 | 638 | name: @"AutoImportSettingChange" object: nil]; |
635 | ||
639 | ||
636 | 640 | [nc addObserver: self selector: @selector(updateForAutoSize) |
637 | 641 | name: @"AutoSizeSettingChange" object: nil]; |
638 | ||
642 | ||
639 | 643 | [nc addObserver: self selector: @selector(updateForExpandCollape) |
640 | 644 | name: @"OutlineExpandCollapse" object: nil]; |
641 | ||
645 | ||
642 | 646 | [nc addObserver: fWindow selector: @selector(makeKeyWindow) |
643 | 647 | name: @"MakeWindowKey" object: nil]; |
644 | ||
648 | ||
645 | 649 | #warning rename |
646 | 650 | [nc addObserver: self selector: @selector(fullUpdateUI) |
647 | 651 | name: @"UpdateQueue" object: nil]; |
648 | ||
652 | ||
649 | 653 | [nc addObserver: self selector: @selector(applyFilter) |
650 | 654 | name: @"ApplyFilter" object: nil]; |
651 | ||
655 | ||
652 | 656 | //open newly created torrent file |
653 | 657 | [nc addObserver: self selector: @selector(beginCreateFile:) |
654 | 658 | name: @"BeginCreateTorrentFile" object: nil]; |
655 | ||
659 | ||
656 | 660 | //open newly created torrent file |
657 | 661 | [nc addObserver: self selector: @selector(openCreatedFile:) |
658 | 662 | name: @"OpenCreatedTorrentFile" object: nil]; |
659 | ||
663 | ||
660 | 664 | [nc addObserver: self selector: @selector(applyFilter) |
661 | 665 | name: @"UpdateGroups" object: nil]; |
662 | 666 | |
666 | 670 | selector: @selector(updateUI) userInfo: nil repeats: YES] retain]; |
667 | 671 | [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode]; |
668 | 672 | [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode]; |
669 | ||
673 | ||
670 | 674 | [self applyFilter]; |
671 | ||
675 | ||
672 | 676 | [fWindow makeKeyAndOrderFront: nil]; |
673 | ||
677 | ||
674 | 678 | if ([fDefaults boolForKey: @"InfoVisible"]) |
675 | 679 | [self showInfo: nil]; |
676 | 680 | } |
678 | 682 | - (void) applicationDidFinishLaunching: (NSNotification *) notification |
679 | 683 | { |
680 | 684 | [NSApp setServicesProvider: self]; |
681 | ||
685 | ||
682 | 686 | //register for dock icon drags (has to be in applicationDidFinishLaunching: to work) |
683 | 687 | [[NSAppleEventManager sharedAppleEventManager] setEventHandler: self andSelector: @selector(handleOpenContentsEvent:replyEvent:) |
684 | 688 | forEventClass: kCoreEventClass andEventID: kAEOpenContents]; |
685 | ||
689 | ||
686 | 690 | //if we were opened from a user notification, do the corresponding action |
687 | 691 | if ([NSApp isOnMountainLionOrBetter]) |
688 | 692 | { |
690 | 694 | if (launchNotification) |
691 | 695 | [self userNotificationCenter: nil didActivateNotification: launchNotification]; |
692 | 696 | } |
693 | ||
697 | ||
694 | 698 | //auto importing |
695 | 699 | [self checkAutoImportDirectory]; |
696 | ||
700 | ||
697 | 701 | //registering the Web UI to Bonjour |
698 | 702 | if ([fDefaults boolForKey: @"RPC"] && [fDefaults boolForKey: @"RPCWebDiscovery"]) |
699 | 703 | [[BonjourController defaultController] startWithPort: [fDefaults integerForKey: @"RPCPort"]]; |
700 | ||
704 | ||
701 | 705 | //shamelessly ask for donations |
702 | 706 | if ([fDefaults boolForKey: @"WarningDonate"]) |
703 | 707 | { |
704 | 708 | tr_session_stats stats; |
705 | 709 | tr_sessionGetCumulativeStats(fLib, &stats); |
706 | 710 | const BOOL firstLaunch = stats.sessionCount <= 1; |
707 | ||
711 | ||
708 | 712 | NSDate * lastDonateDate = [fDefaults objectForKey: @"DonateAskDate"]; |
709 | 713 | const BOOL timePassed = !lastDonateDate || (-1 * [lastDonateDate timeIntervalSinceNow]) >= DONATE_NAG_TIME; |
710 | ||
714 | ||
711 | 715 | if (!firstLaunch && timePassed) |
712 | 716 | { |
713 | 717 | [fDefaults setObject: [NSDate date] forKey: @"DonateAskDate"]; |
714 | ||
718 | ||
715 | 719 | NSAlert * alert = [[NSAlert alloc] init]; |
716 | 720 | [alert setMessageText: NSLocalizedString(@"Support open-source indie software", "Donation beg -> title")]; |
717 | ||
721 | ||
718 | 722 | NSString * donateMessage = [NSString stringWithFormat: @"%@\n\n%@", |
719 | 723 | NSLocalizedString(@"Transmission is a full-featured torrent application." |
720 | 724 | " A lot of time and effort have gone into development, coding, and refinement." |
721 | 725 | " If you enjoy using it, please consider showing your love with a donation.", "Donation beg -> message"), |
722 | 726 | NSLocalizedString(@"Donate or not, there will be no difference to your torrenting experience.", "Donation beg -> message")]; |
723 | ||
727 | ||
724 | 728 | [alert setInformativeText: donateMessage]; |
725 | 729 | [alert setAlertStyle: NSInformationalAlertStyle]; |
726 | ||
730 | ||
727 | 731 | [alert addButtonWithTitle: [NSLocalizedString(@"Donate", "Donation beg -> button") stringByAppendingEllipsis]]; |
728 | 732 | NSButton * noDonateButton = [alert addButtonWithTitle: NSLocalizedString(@"Nope", "Donation beg -> button")]; |
729 | 733 | [noDonateButton setKeyEquivalent: @"\e"]; //escape key |
730 | ||
734 | ||
731 | 735 | const BOOL allowNeverAgain = lastDonateDate != nil; //hide the "don't show again" check the first time - give them time to try the app |
732 | 736 | [alert setShowsSuppressionButton: allowNeverAgain]; |
733 | 737 | if (allowNeverAgain) |
734 | 738 | [[alert suppressionButton] setTitle: NSLocalizedString(@"Don't bug me about this ever again.", "Donation beg -> button")]; |
735 | ||
739 | ||
736 | 740 | const NSInteger donateResult = [alert runModal]; |
737 | 741 | if (donateResult == NSAlertFirstButtonReturn) |
738 | 742 | [self linkDonate: self]; |
739 | ||
743 | ||
740 | 744 | if (allowNeverAgain) |
741 | 745 | [fDefaults setBool: ([[alert suppressionButton] state] != NSOnState) forKey: @"WarningDonate"]; |
742 | ||
746 | ||
743 | 747 | [alert release]; |
744 | 748 | } |
745 | 749 | } |
750 | 754 | NSWindow * mainWindow = [NSApp mainWindow]; |
751 | 755 | if (!mainWindow || ![mainWindow isVisible]) |
752 | 756 | [fWindow makeKeyAndOrderFront: nil]; |
753 | ||
757 | ||
754 | 758 | return NO; |
755 | 759 | } |
756 | 760 | |
766 | 770 | if (![torrent allDownloaded]) |
767 | 771 | downloading++; |
768 | 772 | } |
769 | ||
773 | ||
770 | 774 | if ([fDefaults boolForKey: @"CheckQuitDownloading"] ? downloading > 0 : active > 0) |
771 | 775 | { |
772 | 776 | NSString * message = active == 1 |
782 | 786 | return NSTerminateLater; |
783 | 787 | } |
784 | 788 | } |
785 | ||
789 | ||
786 | 790 | return NSTerminateNow; |
787 | 791 | } |
788 | 792 | |
794 | 798 | - (void) applicationWillTerminate: (NSNotification *) notification |
795 | 799 | { |
796 | 800 | fQuitting = YES; |
797 | ||
801 | ||
798 | 802 | //stop the Bonjour service |
799 | 803 | if ([BonjourController defaultControllerExists]) |
800 | 804 | [[BonjourController defaultController] stop]; |
802 | 806 | //stop blocklist download |
803 | 807 | if ([BlocklistDownloader isRunning]) |
804 | 808 | [[BlocklistDownloader downloader] cancelDownload]; |
805 | ||
809 | ||
806 | 810 | //stop timers and notification checking |
807 | 811 | [[NSNotificationCenter defaultCenter] removeObserver: self]; |
808 | ||
812 | ||
809 | 813 | [fTimer invalidate]; |
810 | 814 | [fTimer release]; |
811 | ||
815 | ||
812 | 816 | if (fAutoImportTimer) |
813 | { | |
817 | { | |
814 | 818 | if ([fAutoImportTimer isValid]) |
815 | 819 | [fAutoImportTimer invalidate]; |
816 | 820 | [fAutoImportTimer release]; |
817 | 821 | } |
818 | ||
822 | ||
819 | 823 | [fBadger setQuitting]; |
820 | ||
824 | ||
821 | 825 | //remove all torrent downloads |
822 | 826 | if (fPendingTorrentDownloads) |
823 | 827 | { |
829 | 833 | } |
830 | 834 | [fPendingTorrentDownloads release]; |
831 | 835 | } |
832 | ||
836 | ||
833 | 837 | //remember window states and close all windows |
834 | 838 | [fDefaults setBool: [[fInfoController window] isVisible] forKey: @"InfoVisible"]; |
835 | ||
839 | ||
836 | 840 | if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]) |
837 | 841 | [[QLPreviewPanel sharedPreviewPanel] updateController]; |
838 | ||
842 | ||
839 | 843 | for (NSWindow * window in [NSApp windows]) |
840 | 844 | [window close]; |
841 | ||
845 | ||
842 | 846 | [self showStatusBar: NO animate: NO]; |
843 | 847 | [self showFilterBar: NO animate: NO]; |
844 | ||
848 | ||
845 | 849 | //save history |
846 | 850 | [self updateTorrentHistory]; |
847 | 851 | [fTableView saveCollapsedGroups]; |
848 | ||
849 | //remaining calls the same as dealloc | |
852 | ||
853 | //remaining calls the same as dealloc | |
850 | 854 | [fInfoController release]; |
851 | 855 | [fMessageController release]; |
852 | 856 | [fPrefsController release]; |
853 | ||
857 | ||
854 | 858 | [fStatusBar release]; |
855 | 859 | [fFilterBar release]; |
856 | ||
860 | ||
857 | 861 | [fTorrents release]; |
858 | 862 | [fDisplayedTorrents release]; |
859 | ||
863 | ||
860 | 864 | [fAddWindows release]; |
861 | 865 | [fAddingTransfers release]; |
862 | ||
866 | ||
863 | 867 | [fOverlayWindow release]; |
864 | 868 | [fBadger release]; |
865 | ||
869 | ||
866 | 870 | [fAutoImportedNames release]; |
867 | ||
871 | ||
868 | 872 | [fPreviewPanel release]; |
869 | ||
873 | ||
870 | 874 | [fConfigDirectory release]; |
871 | ||
875 | ||
872 | 876 | [fFileWatcherQueue release]; |
873 | ||
877 | ||
874 | 878 | //complete cleanup |
875 | 879 | tr_sessionClose(fLib); |
876 | 880 | } |
893 | 897 | } |
894 | 898 | else |
895 | 899 | urlString = [directObject stringValue]; |
896 | ||
900 | ||
897 | 901 | if (urlString) |
898 | 902 | [self openURL: urlString]; |
899 | 903 | } |
903 | 907 | if ([[suggestedName pathExtension] caseInsensitiveCompare: @"torrent"] != NSOrderedSame) |
904 | 908 | { |
905 | 909 | [download cancel]; |
906 | ||
910 | ||
907 | 911 | [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; |
908 | 912 | if ([fPendingTorrentDownloads count] == 0) |
909 | 913 | { |
910 | 914 | [fPendingTorrentDownloads release]; |
911 | 915 | fPendingTorrentDownloads = nil; |
912 | 916 | } |
913 | ||
917 | ||
914 | 918 | NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", "Download not a torrent -> title"), |
915 | 919 | [NSString stringWithFormat: NSLocalizedString(@"It appears that the file \"%@\" from %@ is not a torrent file.", |
916 | 920 | "Download not a torrent -> message"), suggestedName, |
917 | 921 | [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]], |
918 | 922 | NSLocalizedString(@"OK", "Download not a torrent -> button"), nil, nil); |
919 | ||
923 | ||
920 | 924 | [download release]; |
921 | 925 | } |
922 | 926 | else |
936 | 940 | "Torrent download failed -> message"), |
937 | 941 | [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding], |
938 | 942 | [error localizedDescription]], NSLocalizedString(@"OK", "Torrent download failed -> button"), nil, nil); |
939 | ||
943 | ||
940 | 944 | [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; |
941 | 945 | if ([fPendingTorrentDownloads count] == 0) |
942 | 946 | { |
943 | 947 | [fPendingTorrentDownloads release]; |
944 | 948 | fPendingTorrentDownloads = nil; |
945 | 949 | } |
946 | ||
950 | ||
947 | 951 | [download release]; |
948 | 952 | } |
949 | 953 | |
950 | 954 | - (void) downloadDidFinish: (NSURLDownload *) download |
951 | 955 | { |
952 | 956 | NSString * path = [[fPendingTorrentDownloads objectForKey: [[download request] URL]] objectForKey: @"Path"]; |
953 | ||
957 | ||
954 | 958 | [self openFiles: [NSArray arrayWithObject: path] addType: ADD_URL forcePath: nil]; |
955 | ||
959 | ||
956 | 960 | //delete the torrent file after opening |
957 | 961 | [[NSFileManager defaultManager] removeItemAtPath: path error: NULL]; |
958 | ||
962 | ||
959 | 963 | [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; |
960 | 964 | if ([fPendingTorrentDownloads count] == 0) |
961 | 965 | { |
962 | 966 | [fPendingTorrentDownloads release]; |
963 | 967 | fPendingTorrentDownloads = nil; |
964 | 968 | } |
965 | ||
969 | ||
966 | 970 | [download release]; |
967 | 971 | } |
968 | 972 | |
986 | 990 | deleteTorrentFile = [fDefaults boolForKey: @"DeleteOriginalTorrent"]; |
987 | 991 | canToggleDelete = YES; |
988 | 992 | } |
989 | ||
993 | ||
990 | 994 | for (NSString * torrentPath in filenames) |
991 | 995 | { |
992 | 996 | //ensure torrent doesn't already exist |
993 | 997 | tr_ctor * ctor = tr_ctorNew(fLib); |
994 | 998 | tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]); |
995 | ||
999 | ||
996 | 1000 | tr_info info; |
997 | 1001 | const tr_parse_result result = tr_torrentParse(ctor, &info); |
998 | 1002 | tr_ctorFree(ctor); |
999 | ||
1003 | ||
1000 | 1004 | if (result != TR_PARSE_OK) |
1001 | 1005 | { |
1002 | 1006 | if (result == TR_PARSE_DUPLICATE) |
1008 | 1012 | } |
1009 | 1013 | else |
1010 | 1014 | NSAssert2(NO, @"Unknown error code (%d) when attempting to open \"%@\"", result, torrentPath); |
1011 | ||
1015 | ||
1012 | 1016 | tr_metainfoFree(&info); |
1013 | 1017 | continue; |
1014 | 1018 | } |
1015 | ||
1019 | ||
1016 | 1020 | //determine download location |
1017 | 1021 | NSString * location; |
1018 | 1022 | BOOL lockDestination = NO; //don't override the location with a group location if it has a hardcoded path |
1027 | 1031 | location = [torrentPath stringByDeletingLastPathComponent]; |
1028 | 1032 | else |
1029 | 1033 | location = nil; |
1030 | ||
1034 | ||
1031 | 1035 | //determine to show the options window |
1032 | 1036 | const BOOL showWindow = type == ADD_SHOW_OPTIONS || ([fDefaults boolForKey: @"DownloadAsk"] |
1033 | 1037 | && (info.isFolder || ![fDefaults boolForKey: @"DownloadAskMulti"]) |
1034 | 1038 | && (type != ADD_AUTO || ![fDefaults boolForKey: @"DownloadAskManual"])); |
1035 | 1039 | tr_metainfoFree(&info); |
1036 | ||
1040 | ||
1037 | 1041 | Torrent * torrent; |
1038 | 1042 | if (!(torrent = [[Torrent alloc] initWithPath: torrentPath location: location |
1039 | 1043 | deleteTorrentFile: showWindow ? NO : deleteTorrentFile lib: fLib])) |
1040 | 1044 | continue; |
1041 | ||
1045 | ||
1042 | 1046 | //change the location if the group calls for it (this has to wait until after the torrent is created) |
1043 | 1047 | if (!lockDestination && [[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]]) |
1044 | 1048 | { |
1045 | 1049 | location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]]; |
1046 | 1050 | [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic]; |
1047 | 1051 | } |
1048 | ||
1052 | ||
1049 | 1053 | //verify the data right away if it was newly created |
1050 | 1054 | if (type == ADD_CREATED) |
1051 | 1055 | [torrent resetCache]; |
1052 | ||
1056 | ||
1053 | 1057 | //show the add window or add directly |
1054 | 1058 | if (showWindow || !location) |
1055 | 1059 | { |
1057 | 1061 | lockDestination: lockDestination controller: self torrentFile: torrentPath |
1058 | 1062 | deleteTorrentCheckEnableInitially: deleteTorrentFile canToggleDelete: canToggleDelete]; |
1059 | 1063 | [addController showWindow: self]; |
1060 | ||
1064 | ||
1061 | 1065 | if (!fAddWindows) |
1062 | 1066 | fAddWindows = [[NSMutableSet alloc] init]; |
1063 | 1067 | [fAddWindows addObject: addController]; |
1067 | 1071 | { |
1068 | 1072 | if ([fDefaults boolForKey: @"AutoStartDownload"]) |
1069 | 1073 | [torrent startTransfer]; |
1070 | ||
1074 | ||
1071 | 1075 | [torrent update]; |
1072 | 1076 | [fTorrents addObject: torrent]; |
1073 | 1077 | [torrent release]; |
1074 | ||
1078 | ||
1075 | 1079 | if (!fAddingTransfers) |
1076 | 1080 | fAddingTransfers = [[NSMutableSet alloc] init]; |
1077 | 1081 | [fAddingTransfers addObject: torrent]; |
1084 | 1088 | - (void) askOpenConfirmed: (AddWindowController *) addController add: (BOOL) add |
1085 | 1089 | { |
1086 | 1090 | Torrent * torrent = [addController torrent]; |
1087 | ||
1091 | ||
1088 | 1092 | if (add) |
1089 | 1093 | { |
1090 | 1094 | [torrent setQueuePosition: [fTorrents count]]; |
1091 | ||
1095 | ||
1092 | 1096 | [torrent update]; |
1093 | 1097 | [fTorrents addObject: torrent]; |
1094 | 1098 | [torrent release]; |
1095 | ||
1099 | ||
1096 | 1100 | if (!fAddingTransfers) |
1097 | 1101 | fAddingTransfers = [[NSMutableSet alloc] init]; |
1098 | 1102 | [fAddingTransfers addObject: torrent]; |
1099 | ||
1103 | ||
1100 | 1104 | [self fullUpdateUI]; |
1101 | 1105 | } |
1102 | 1106 | else |
1104 | 1108 | [torrent closeRemoveTorrent: NO]; |
1105 | 1109 | [torrent release]; |
1106 | 1110 | } |
1107 | ||
1111 | ||
1108 | 1112 | [fAddWindows removeObject: addController]; |
1109 | 1113 | if ([fAddWindows count] == 0) |
1110 | 1114 | { |
1123 | 1127 | [self duplicateOpenMagnetAlert: address transferName: name]; |
1124 | 1128 | return; |
1125 | 1129 | } |
1126 | ||
1130 | ||
1127 | 1131 | //determine download location |
1128 | 1132 | NSString * location = nil; |
1129 | 1133 | if ([fDefaults boolForKey: @"DownloadLocationConstant"]) |
1130 | 1134 | location = [[fDefaults stringForKey: @"DownloadFolder"] stringByExpandingTildeInPath]; |
1131 | ||
1135 | ||
1132 | 1136 | Torrent * torrent; |
1133 | 1137 | if (!(torrent = [[Torrent alloc] initWithMagnetAddress: address location: location lib: fLib])) |
1134 | 1138 | { |
1135 | 1139 | [self invalidOpenMagnetAlert: address]; |
1136 | 1140 | return; |
1137 | 1141 | } |
1138 | ||
1142 | ||
1139 | 1143 | //change the location if the group calls for it (this has to wait until after the torrent is created) |
1140 | 1144 | if ([[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]]) |
1141 | 1145 | { |
1142 | 1146 | location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]]; |
1143 | 1147 | [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic]; |
1144 | 1148 | } |
1145 | ||
1149 | ||
1146 | 1150 | if ([fDefaults boolForKey: @"MagnetOpenAsk"] || !location) |
1147 | 1151 | { |
1148 | 1152 | AddMagnetWindowController * addController = [[AddMagnetWindowController alloc] initWithTorrent: torrent destination: location |
1149 | 1153 | controller: self]; |
1150 | 1154 | [addController showWindow: self]; |
1151 | ||
1155 | ||
1152 | 1156 | if (!fAddWindows) |
1153 | 1157 | fAddWindows = [[NSMutableSet alloc] init]; |
1154 | 1158 | [fAddWindows addObject: addController]; |
1158 | 1162 | { |
1159 | 1163 | if ([fDefaults boolForKey: @"AutoStartDownload"]) |
1160 | 1164 | [torrent startTransfer]; |
1161 | ||
1165 | ||
1162 | 1166 | [torrent update]; |
1163 | 1167 | [fTorrents addObject: torrent]; |
1164 | 1168 | [torrent release]; |
1165 | ||
1169 | ||
1166 | 1170 | if (!fAddingTransfers) |
1167 | 1171 | fAddingTransfers = [[NSMutableSet alloc] init]; |
1168 | 1172 | [fAddingTransfers addObject: torrent]; |
1174 | 1178 | - (void) askOpenMagnetConfirmed: (AddMagnetWindowController *) addController add: (BOOL) add |
1175 | 1179 | { |
1176 | 1180 | Torrent * torrent = [addController torrent]; |
1177 | ||
1181 | ||
1178 | 1182 | if (add) |
1179 | 1183 | { |
1180 | 1184 | [torrent setQueuePosition: [fTorrents count]]; |
1181 | ||
1185 | ||
1182 | 1186 | [torrent update]; |
1183 | 1187 | [fTorrents addObject: torrent]; |
1184 | 1188 | [torrent release]; |
1185 | ||
1189 | ||
1186 | 1190 | if (!fAddingTransfers) |
1187 | 1191 | fAddingTransfers = [[NSMutableSet alloc] init]; |
1188 | 1192 | [fAddingTransfers addObject: torrent]; |
1189 | ||
1193 | ||
1190 | 1194 | [self fullUpdateUI]; |
1191 | 1195 | } |
1192 | 1196 | else |
1194 | 1198 | [torrent closeRemoveTorrent: NO]; |
1195 | 1199 | [torrent release]; |
1196 | 1200 | } |
1197 | ||
1201 | ||
1198 | 1202 | [fAddWindows removeObject: addController]; |
1199 | 1203 | if ([fAddWindows count] == 0) |
1200 | 1204 | { |
1213 | 1217 | - (void) openFilesWithDict: (NSDictionary *) dictionary |
1214 | 1218 | { |
1215 | 1219 | [self openFiles: [dictionary objectForKey: @"Filenames"] addType: [[dictionary objectForKey: @"AddType"] intValue] forcePath: nil]; |
1216 | ||
1220 | ||
1217 | 1221 | [dictionary release]; |
1218 | 1222 | } |
1219 | 1223 | |
1228 | 1232 | - (void) openShowSheet: (id) sender |
1229 | 1233 | { |
1230 | 1234 | NSOpenPanel * panel = [NSOpenPanel openPanel]; |
1231 | ||
1235 | ||
1232 | 1236 | [panel setAllowsMultipleSelection: YES]; |
1233 | 1237 | [panel setCanChooseFiles: YES]; |
1234 | 1238 | [panel setCanChooseDirectories: NO]; |
1235 | ||
1239 | ||
1236 | 1240 | [panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]]; |
1237 | ||
1241 | ||
1238 | 1242 | [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) { |
1239 | 1243 | if (result == NSFileHandlingPanelOKButton) |
1240 | 1244 | { |
1241 | 1245 | NSMutableArray * filenames = [NSMutableArray arrayWithCapacity: [[panel URLs] count]]; |
1242 | 1246 | for (NSURL * url in [panel URLs]) |
1243 | 1247 | [filenames addObject: [url path]]; |
1244 | ||
1248 | ||
1245 | 1249 | NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: filenames, @"Filenames", |
1246 | 1250 | [NSNumber numberWithInt: sender == fOpenIgnoreDownloadFolder ? ADD_SHOW_OPTIONS : ADD_MANUAL], @"AddType", nil]; |
1247 | 1251 | [self performSelectorOnMainThread: @selector(openFilesWithDict:) withObject: dictionary waitUntilDone: NO]; |
1253 | 1257 | { |
1254 | 1258 | if (![fDefaults boolForKey: @"WarningInvalidOpen"]) |
1255 | 1259 | return; |
1256 | ||
1260 | ||
1257 | 1261 | NSAlert * alert = [[NSAlert alloc] init]; |
1258 | 1262 | [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"\"%@\" is not a valid torrent file.", |
1259 | 1263 | "Open invalid alert -> title"), filename]]; |
1262 | 1266 | "Open invalid alert -> message")]; |
1263 | 1267 | [alert setAlertStyle: NSWarningAlertStyle]; |
1264 | 1268 | [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open invalid alert -> button")]; |
1265 | ||
1269 | ||
1266 | 1270 | [alert runModal]; |
1267 | 1271 | if ([[alert suppressionButton] state] == NSOnState) |
1268 | 1272 | [fDefaults setBool: NO forKey: @"WarningInvalidOpen"]; |
1273 | 1277 | { |
1274 | 1278 | if (![fDefaults boolForKey: @"WarningInvalidOpen"]) |
1275 | 1279 | return; |
1276 | ||
1280 | ||
1277 | 1281 | NSAlert * alert = [[NSAlert alloc] init]; |
1278 | 1282 | [alert setMessageText: NSLocalizedString(@"Adding magnetized transfer failed.", "Magnet link failed -> title")]; |
1279 | 1283 | [alert setInformativeText: [NSString stringWithFormat: NSLocalizedString(@"There was an error when adding the magnet link \"%@\"." |
1280 | 1284 | " The transfer will not occur.", "Magnet link failed -> message"), address]]; |
1281 | 1285 | [alert setAlertStyle: NSWarningAlertStyle]; |
1282 | 1286 | [alert addButtonWithTitle: NSLocalizedString(@"OK", "Magnet link failed -> button")]; |
1283 | ||
1287 | ||
1284 | 1288 | [alert runModal]; |
1285 | 1289 | if ([[alert suppressionButton] state] == NSOnState) |
1286 | 1290 | [fDefaults setBool: NO forKey: @"WarningInvalidOpen"]; |
1291 | 1295 | { |
1292 | 1296 | if (![fDefaults boolForKey: @"WarningDuplicate"]) |
1293 | 1297 | return; |
1294 | ||
1298 | ||
1295 | 1299 | NSAlert * alert = [[NSAlert alloc] init]; |
1296 | 1300 | [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"A transfer of \"%@\" already exists.", |
1297 | 1301 | "Open duplicate alert -> title"), name]]; |
1301 | 1305 | [alert setAlertStyle: NSWarningAlertStyle]; |
1302 | 1306 | [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate alert -> button")]; |
1303 | 1307 | [alert setShowsSuppressionButton: YES]; |
1304 | ||
1308 | ||
1305 | 1309 | [alert runModal]; |
1306 | 1310 | if ([[alert suppressionButton] state]) |
1307 | 1311 | [fDefaults setBool: NO forKey: @"WarningDuplicate"]; |
1312 | 1316 | { |
1313 | 1317 | if (![fDefaults boolForKey: @"WarningDuplicate"]) |
1314 | 1318 | return; |
1315 | ||
1319 | ||
1316 | 1320 | NSAlert * alert = [[NSAlert alloc] init]; |
1317 | 1321 | if (name) |
1318 | 1322 | [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"A transfer of \"%@\" already exists.", |
1326 | 1330 | [alert setAlertStyle: NSWarningAlertStyle]; |
1327 | 1331 | [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate magnet alert -> button")]; |
1328 | 1332 | [alert setShowsSuppressionButton: YES]; |
1329 | ||
1333 | ||
1330 | 1334 | [alert runModal]; |
1331 | 1335 | if ([[alert suppressionButton] state]) |
1332 | 1336 | [fDefaults setBool: NO forKey: @"WarningDuplicate"]; |
1354 | 1358 | else |
1355 | 1359 | urlString = [@"http://" stringByAppendingString: urlString]; |
1356 | 1360 | } |
1357 | ||
1361 | ||
1358 | 1362 | NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: urlString] |
1359 | 1363 | cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 60]; |
1360 | ||
1364 | ||
1361 | 1365 | if ([fPendingTorrentDownloads objectForKey: [request URL]]) |
1362 | 1366 | { |
1363 | 1367 | NSLog(@"Already downloading %@", [request URL]); |
1364 | 1368 | return; |
1365 | 1369 | } |
1366 | ||
1370 | ||
1367 | 1371 | NSURLDownload * download = [[NSURLDownload alloc] initWithRequest: request delegate: self]; |
1368 | ||
1372 | ||
1369 | 1373 | if (!fPendingTorrentDownloads) |
1370 | 1374 | fPendingTorrentDownloads = [[NSMutableDictionary alloc] init]; |
1371 | 1375 | [fPendingTorrentDownloads setObject: [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"] forKey: [request URL]]; |
1377 | 1381 | if (!fUrlSheetController) |
1378 | 1382 | { |
1379 | 1383 | fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self]; |
1380 | ||
1384 | ||
1381 | 1385 | [NSApp beginSheet: [fUrlSheetController window] modalForWindow: fWindow modalDelegate: self didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil]; |
1382 | 1386 | } |
1383 | 1387 | } |
1389 | 1393 | NSString * urlString = [fUrlSheetController urlString]; |
1390 | 1394 | [self performSelectorOnMainThread: @selector(openURL:) withObject: urlString waitUntilDone: NO]; |
1391 | 1395 | } |
1392 | ||
1396 | ||
1393 | 1397 | [fUrlSheetController release]; |
1394 | 1398 | fUrlSheetController = nil; |
1395 | 1399 | } |
1407 | 1411 | - (void) resumeAllTorrents: (id) sender |
1408 | 1412 | { |
1409 | 1413 | NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [fTorrents count]]; |
1410 | ||
1414 | ||
1411 | 1415 | for (Torrent * torrent in fTorrents) |
1412 | 1416 | if (![torrent isFinishedSeeding]) |
1413 | 1417 | [torrents addObject: torrent]; |
1414 | ||
1418 | ||
1415 | 1419 | [self resumeTorrents: torrents]; |
1416 | 1420 | } |
1417 | 1421 | |
1419 | 1423 | { |
1420 | 1424 | for (Torrent * torrent in torrents) |
1421 | 1425 | [torrent startTransfer]; |
1422 | ||
1426 | ||
1423 | 1427 | [self fullUpdateUI]; |
1424 | 1428 | } |
1425 | 1429 | |
1431 | 1435 | - (void) resumeWaitingTorrents: (id) sender |
1432 | 1436 | { |
1433 | 1437 | NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [fTorrents count]]; |
1434 | ||
1438 | ||
1435 | 1439 | for (Torrent * torrent in fTorrents) |
1436 | 1440 | if ([torrent waitingToStart]) |
1437 | 1441 | [torrents addObject: torrent]; |
1438 | ||
1442 | ||
1439 | 1443 | [self resumeTorrentsNoWait: torrents]; |
1440 | 1444 | } |
1441 | 1445 | |
1444 | 1448 | //iterate through instead of all at once to ensure no conflicts |
1445 | 1449 | for (Torrent * torrent in torrents) |
1446 | 1450 | [torrent startTransferNoQueue]; |
1447 | ||
1451 | ||
1448 | 1452 | [self fullUpdateUI]; |
1449 | 1453 | } |
1450 | 1454 | |
1464 | 1468 | for (Torrent * torrent in torrents) |
1465 | 1469 | if ([torrent waitingToStart]) |
1466 | 1470 | [torrent stopTransfer]; |
1467 | ||
1471 | ||
1468 | 1472 | for (Torrent * torrent in torrents) |
1469 | 1473 | [torrent stopTransfer]; |
1470 | ||
1474 | ||
1471 | 1475 | [self fullUpdateUI]; |
1472 | 1476 | } |
1473 | 1477 | |
1488 | 1492 | { |
1489 | 1493 | NSDictionary * dict = @{ @"Torrents" : torrents, |
1490 | 1494 | @"DeleteData" : @(deleteData) }; |
1491 | ||
1495 | ||
1492 | 1496 | NSString * title, * message; |
1493 | ||
1497 | ||
1494 | 1498 | const NSInteger selected = [torrents count]; |
1495 | 1499 | if (selected == 1) |
1496 | 1500 | { |
1497 | 1501 | NSString * torrentName = [(Torrent *)[torrents objectAtIndex: 0] name]; |
1498 | ||
1502 | ||
1499 | 1503 | if (deleteData) |
1500 | 1504 | title = [NSString stringWithFormat: |
1501 | 1505 | NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list" |
1504 | 1508 | title = [NSString stringWithFormat: |
1505 | 1509 | NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list?", |
1506 | 1510 | "Removal confirm panel -> title"), torrentName]; |
1507 | ||
1511 | ||
1508 | 1512 | message = NSLocalizedString(@"This transfer is active." |
1509 | 1513 | " Once removed, continuing the transfer will require the torrent file or magnet link.", |
1510 | 1514 | "Removal confirm panel -> message"); |
1519 | 1523 | title = [NSString stringWithFormat: |
1520 | 1524 | NSLocalizedString(@"Are you sure you want to remove %@ transfers from the transfer list?", |
1521 | 1525 | "Removal confirm panel -> title"), [NSString formattedUInteger: selected]]; |
1522 | ||
1526 | ||
1523 | 1527 | if (selected == active) |
1524 | 1528 | message = [NSString stringWithFormat: NSLocalizedString(@"There are %@ active transfers.", |
1525 | 1529 | "Removal confirm panel -> message part 1"), [NSString formattedUInteger: active]]; |
1530 | 1534 | NSLocalizedString(@"Once removed, continuing the transfers will require the torrent files or magnet links.", |
1531 | 1535 | "Removal confirm panel -> message part 2")]; |
1532 | 1536 | } |
1533 | ||
1537 | ||
1534 | 1538 | NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"), |
1535 | 1539 | NSLocalizedString(@"Cancel", "Removal confirm panel -> button"), nil, fWindow, self, |
1536 | 1540 | nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), [dict retain], @"%@", message); |
1537 | 1541 | return; |
1538 | 1542 | } |
1539 | 1543 | } |
1540 | ||
1544 | ||
1541 | 1545 | [self confirmRemoveTorrents: torrents deleteData: deleteData]; |
1542 | 1546 | } |
1543 | 1547 | |
1557 | 1561 | //don't want any of these starting then stopping |
1558 | 1562 | if ([torrent waitingToStart]) |
1559 | 1563 | [torrent stopTransfer]; |
1560 | ||
1564 | ||
1561 | 1565 | //let's expand all groups that have removed items - they either don't exist anymore, are already expanded, or are collapsed (rpc) |
1562 | 1566 | [fTableView removeCollapsedGroup: [torrent groupValue]]; |
1563 | ||
1567 | ||
1564 | 1568 | //we can't assume the window is active - RPC removal, for example |
1565 | 1569 | [fBadger removeTorrent: torrent]; |
1566 | 1570 | } |
1567 | ||
1571 | ||
1568 | 1572 | //#5106 - don't try to remove torrents that have already been removed (fix for a bug, but better safe than crash anyway) |
1569 | 1573 | NSIndexSet * indexesToRemove = [torrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(Torrent * torrent, NSUInteger idx, BOOL * stop) { |
1570 | 1574 | return [fTorrents indexOfObjectIdenticalTo: torrent] != NSNotFound; |
1573 | 1577 | { |
1574 | 1578 | NSLog(@"trying to remove %ld transfers, but %ld have already been removed", [torrents count], [torrents count] - [indexesToRemove count]); |
1575 | 1579 | torrents = [torrents objectsAtIndexes: indexesToRemove]; |
1576 | ||
1580 | ||
1577 | 1581 | if ([indexesToRemove count] == 0) |
1578 | 1582 | { |
1579 | 1583 | [self fullUpdateUI]; |
1580 | 1584 | return; |
1581 | 1585 | } |
1582 | 1586 | } |
1583 | ||
1587 | ||
1584 | 1588 | [fTorrents removeObjectsInArray: torrents]; |
1585 | ||
1589 | ||
1586 | 1590 | //set up helpers to remove from the table |
1587 | 1591 | __block BOOL beganUpdate = NO; |
1588 | ||
1592 | ||
1589 | 1593 | void (^doTableRemoval)(NSMutableArray *, id) = ^(NSMutableArray * displayedTorrents, id parent) { |
1590 | 1594 | NSIndexSet * indexes = [displayedTorrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^(id obj, NSUInteger idx, BOOL * stop) { |
1591 | 1595 | return [torrents containsObject: obj]; |
1592 | 1596 | }]; |
1593 | ||
1597 | ||
1594 | 1598 | if ([indexes count] > 0) |
1595 | 1599 | { |
1596 | 1600 | if (!beganUpdate) |
1597 | 1601 | { |
1598 | 1602 | [NSAnimationContext beginGrouping]; //this has to be before we set the completion handler (#4874) |
1599 | ||
1603 | ||
1600 | 1604 | //we can't closeRemoveTorrent: until it's no longer in the GUI at all |
1601 | 1605 | [[NSAnimationContext currentContext] setCompletionHandler: ^{ |
1602 | 1606 | for (Torrent * torrent in torrents) |
1603 | 1607 | [torrent closeRemoveTorrent: deleteData]; |
1604 | 1608 | }]; |
1605 | ||
1609 | ||
1606 | 1610 | [fTableView beginUpdates]; |
1607 | 1611 | beganUpdate = YES; |
1608 | 1612 | } |
1609 | ||
1613 | ||
1610 | 1614 | [fTableView removeItemsAtIndexes: indexes inParent: parent withAnimation: NSTableViewAnimationSlideLeft]; |
1611 | 1615 | |
1612 | 1616 | [displayedTorrents removeObjectsAtIndexes: indexes]; |
1613 | 1617 | } |
1614 | 1618 | }; |
1615 | ||
1619 | ||
1616 | 1620 | //if not removed from the displayed torrents here, fullUpdateUI might cause a crash |
1617 | 1621 | if ([fDisplayedTorrents count] > 0) |
1618 | 1622 | { |
1623 | 1627 | } |
1624 | 1628 | else |
1625 | 1629 | doTableRemoval(fDisplayedTorrents, nil); |
1626 | ||
1630 | ||
1627 | 1631 | if (beganUpdate) |
1628 | 1632 | { |
1629 | 1633 | [fTableView endUpdates]; |
1630 | 1634 | [NSAnimationContext endGrouping]; |
1631 | 1635 | } |
1632 | 1636 | } |
1633 | ||
1637 | ||
1634 | 1638 | if (!beganUpdate) |
1635 | 1639 | { |
1636 | 1640 | //do here if we're not doing it at the end of the animation |
1637 | 1641 | for (Torrent * torrent in torrents) |
1638 | 1642 | [torrent closeRemoveTorrent: deleteData]; |
1639 | 1643 | } |
1640 | ||
1644 | ||
1641 | 1645 | [self fullUpdateUI]; |
1642 | 1646 | } |
1643 | 1647 | |
1654 | 1658 | - (void) clearCompleted: (id) sender |
1655 | 1659 | { |
1656 | 1660 | NSMutableArray * torrents = [NSMutableArray array]; |
1657 | ||
1661 | ||
1658 | 1662 | for (Torrent * torrent in fTorrents) |
1659 | 1663 | if ([torrent isFinishedSeeding]) |
1660 | 1664 | [torrents addObject: torrent]; |
1661 | ||
1665 | ||
1662 | 1666 | if ([fDefaults boolForKey: @"WarningRemoveCompleted"]) |
1663 | 1667 | { |
1664 | 1668 | NSString * message, * info; |
1667 | 1671 | NSString * torrentName = [(Torrent *)[torrents objectAtIndex: 0] name]; |
1668 | 1672 | message = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list?", |
1669 | 1673 | "Remove completed confirm panel -> title"), torrentName]; |
1670 | ||
1674 | ||
1671 | 1675 | info = NSLocalizedString(@"Once removed, continuing the transfer will require the torrent file or magnet link.", |
1672 | 1676 | "Remove completed confirm panel -> message"); |
1673 | 1677 | } |
1675 | 1679 | { |
1676 | 1680 | message = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove %@ completed transfers from the transfer list?", |
1677 | 1681 | "Remove completed confirm panel -> title"), [NSString formattedUInteger: [torrents count]]]; |
1678 | ||
1682 | ||
1679 | 1683 | info = NSLocalizedString(@"Once removed, continuing the transfers will require the torrent files or magnet links.", |
1680 | 1684 | "Remove completed confirm panel -> message"); |
1681 | 1685 | } |
1682 | ||
1686 | ||
1683 | 1687 | NSAlert * alert = [[[NSAlert alloc] init] autorelease]; |
1684 | 1688 | [alert setMessageText: message]; |
1685 | 1689 | [alert setInformativeText: info]; |
1687 | 1691 | [alert addButtonWithTitle: NSLocalizedString(@"Remove", "Remove completed confirm panel -> button")]; |
1688 | 1692 | [alert addButtonWithTitle: NSLocalizedString(@"Cancel", "Remove completed confirm panel -> button")]; |
1689 | 1693 | [alert setShowsSuppressionButton: YES]; |
1690 | ||
1694 | ||
1691 | 1695 | const NSInteger returnCode = [alert runModal]; |
1692 | 1696 | if ([[alert suppressionButton] state]) |
1693 | 1697 | [fDefaults setBool: NO forKey: @"WarningRemoveCompleted"]; |
1694 | ||
1698 | ||
1695 | 1699 | if (returnCode != NSAlertFirstButtonReturn) |
1696 | 1700 | return; |
1697 | 1701 | } |
1698 | ||
1702 | ||
1699 | 1703 | [self confirmRemoveTorrents: torrents deleteData: NO]; |
1700 | 1704 | } |
1701 | 1705 | |
1712 | 1716 | [panel setCanChooseFiles: NO]; |
1713 | 1717 | [panel setCanChooseDirectories: YES]; |
1714 | 1718 | [panel setCanCreateDirectories: YES]; |
1715 | ||
1719 | ||
1716 | 1720 | NSInteger count = [torrents count]; |
1717 | 1721 | if (count == 1) |
1718 | 1722 | [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for \"%@\".", |
1720 | 1724 | else |
1721 | 1725 | [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for %d data files.", |
1722 | 1726 | "Move torrent -> select destination folder"), count]]; |
1723 | ||
1727 | ||
1724 | 1728 | [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) { |
1725 | 1729 | if (result == NSFileHandlingPanelOKButton) |
1726 | 1730 | { |
1742 | 1746 | [torrents release]; |
1743 | 1747 | return; |
1744 | 1748 | } |
1745 | ||
1749 | ||
1746 | 1750 | Torrent * torrent = [torrents objectAtIndex: 0]; |
1747 | ||
1751 | ||
1748 | 1752 | if (![torrent isMagnet] && [[NSFileManager defaultManager] fileExistsAtPath: [torrent torrentLocation]]) |
1749 | 1753 | { |
1750 | 1754 | NSSavePanel * panel = [NSSavePanel savePanel]; |
1751 | 1755 | [panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]]; |
1752 | 1756 | [panel setExtensionHidden: NO]; |
1753 | ||
1757 | ||
1754 | 1758 | [panel setNameFieldStringValue: [torrent name]]; |
1755 | ||
1759 | ||
1756 | 1760 | [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) { |
1757 | 1761 | //copy torrent to new location with name of data file |
1758 | 1762 | if (result == NSFileHandlingPanelOKButton) |
1759 | 1763 | [torrent copyTorrentFileTo: [[panel URL] path]]; |
1760 | ||
1764 | ||
1761 | 1765 | [torrents removeObjectAtIndex: 0]; |
1762 | 1766 | [self performSelectorOnMainThread: @selector(copyTorrentFileForTorrents:) withObject: torrents waitUntilDone: NO]; |
1763 | 1767 | }]; |
1770 | 1774 | [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file copy alert -> button")]; |
1771 | 1775 | [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Copy of \"%@\" Cannot Be Created", |
1772 | 1776 | "Torrent file copy alert -> title"), [torrent name]]]; |
1773 | [alert setInformativeText: [NSString stringWithFormat: | |
1777 | [alert setInformativeText: [NSString stringWithFormat: | |
1774 | 1778 | NSLocalizedString(@"The torrent file (%@) cannot be found.", "Torrent file copy alert -> message"), |
1775 | 1779 | [torrent torrentLocation]]]; |
1776 | 1780 | [alert setAlertStyle: NSWarningAlertStyle]; |
1777 | ||
1781 | ||
1778 | 1782 | [alert runModal]; |
1779 | 1783 | [alert release]; |
1780 | 1784 | } |
1781 | ||
1785 | ||
1782 | 1786 | [torrents removeObjectAtIndex: 0]; |
1783 | 1787 | [self copyTorrentFileForTorrents: torrents]; |
1784 | 1788 | } |
1787 | 1791 | - (void) copyMagnetLinks: (id) sender |
1788 | 1792 | { |
1789 | 1793 | NSArray * torrents = [fTableView selectedTorrents]; |
1790 | ||
1794 | ||
1791 | 1795 | if ([torrents count] <= 0) |
1792 | 1796 | return; |
1793 | ||
1797 | ||
1794 | 1798 | NSMutableArray * links = [NSMutableArray arrayWithCapacity: [torrents count]]; |
1795 | 1799 | for (Torrent * torrent in torrents) |
1796 | 1800 | [links addObject: [torrent magnetLink]]; |
1797 | ||
1801 | ||
1798 | 1802 | NSString * text = [links componentsJoinedByString: @"\n"]; |
1799 | ||
1803 | ||
1800 | 1804 | NSPasteboard * pb = [NSPasteboard generalPasteboard]; |
1801 | 1805 | [pb clearContents]; |
1802 | 1806 | [pb writeObjects: [NSArray arrayWithObject: text]]; |
1812 | 1816 | if (location) |
1813 | 1817 | [paths addObject: [NSURL fileURLWithPath: location]]; |
1814 | 1818 | } |
1815 | ||
1819 | ||
1816 | 1820 | if ([paths count] > 0) |
1817 | 1821 | [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths]; |
1818 | 1822 | } |
1822 | 1826 | NSArray * selected = [fTableView selectedTorrents]; |
1823 | 1827 | NSAssert([selected count] == 1, @"1 transfer needs to be selected to rename, but %ld are selected", [selected count]); |
1824 | 1828 | Torrent * torrent = [selected objectAtIndex:0]; |
1825 | ||
1829 | ||
1826 | 1830 | [FileRenameSheetController presentSheetForTorrent:torrent modalForWindow: fWindow completionHandler: ^(BOOL didRename) { |
1827 | 1831 | if (didRename) |
1828 | 1832 | { |
1829 | 1833 | dispatch_async(dispatch_get_main_queue(), ^{ |
1830 | 1834 | [self fullUpdateUI]; |
1831 | ||
1835 | ||
1832 | 1836 | [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self userInfo: @{ @"Torrent" : torrent }]; |
1833 | 1837 | }); |
1834 | 1838 | } |
1853 | 1857 | { |
1854 | 1858 | for (Torrent * torrent in torrents) |
1855 | 1859 | [torrent resetCache]; |
1856 | ||
1860 | ||
1857 | 1861 | [self applyFilter]; |
1858 | 1862 | } |
1859 | 1863 | |
1884 | 1888 | { |
1885 | 1889 | [fInfoController updateInfoStats]; |
1886 | 1890 | [[fInfoController window] orderFront: nil]; |
1887 | ||
1891 | ||
1888 | 1892 | if ([fInfoController canQuickLook] && [QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]) |
1889 | 1893 | [[QLPreviewPanel sharedPreviewPanel] reloadData]; |
1890 | 1894 | } |
1891 | ||
1895 | ||
1892 | 1896 | [[fWindow toolbar] validateVisibleItems]; |
1893 | 1897 | } |
1894 | 1898 | |
1895 | 1899 | - (void) resetInfo |
1896 | 1900 | { |
1897 | 1901 | [fInfoController setInfoForTorrents: [fTableView selectedTorrents]]; |
1898 | ||
1902 | ||
1899 | 1903 | if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]) |
1900 | 1904 | [[QLPreviewPanel sharedPreviewPanel] reloadData]; |
1901 | 1905 | } |
1912 | 1916 | { |
1913 | 1917 | if (!fMessageController) |
1914 | 1918 | fMessageController = [[MessageWindowController alloc] init]; |
1915 | ||
1919 | ||
1916 | 1920 | return fMessageController; |
1917 | 1921 | } |
1918 | 1922 | |
1933 | 1937 | for (Torrent * torrent in fTorrents) |
1934 | 1938 | { |
1935 | 1939 | [torrent update]; |
1936 | ||
1940 | ||
1937 | 1941 | //pull the upload and download speeds - most consistent by using current stats |
1938 | 1942 | dlRate += [torrent downloadRate]; |
1939 | 1943 | ulRate += [torrent uploadRate]; |
1940 | ||
1944 | ||
1941 | 1945 | anyCompleted |= [torrent isFinishedSeeding]; |
1942 | 1946 | } |
1943 | ||
1947 | ||
1944 | 1948 | if (![NSApp isHidden]) |
1945 | 1949 | { |
1946 | 1950 | if ([fWindow isVisible]) |
1947 | 1951 | { |
1948 | 1952 | [self sortTorrents: NO]; |
1949 | ||
1953 | ||
1950 | 1954 | [fStatusBar updateWithDownload: dlRate upload: ulRate]; |
1951 | ||
1955 | ||
1952 | 1956 | [fClearCompletedButton setHidden: !anyCompleted]; |
1953 | 1957 | } |
1954 | 1958 | |
1956 | 1960 | if ([[fInfoController window] isVisible]) |
1957 | 1961 | [fInfoController updateInfoStats]; |
1958 | 1962 | } |
1959 | ||
1963 | ||
1960 | 1964 | //badge dock |
1961 | 1965 | [fBadger updateBadgeWithDownload: dlRate upload: ulRate]; |
1962 | 1966 | } |
1979 | 1983 | [NSString formattedUInteger: totalCount]]; |
1980 | 1984 | else |
1981 | 1985 | totalTorrentsString = NSLocalizedString(@"1 transfer", "Status bar transfer count"); |
1982 | ||
1986 | ||
1983 | 1987 | if (filtering) |
1984 | 1988 | { |
1985 | 1989 | NSUInteger count = [fTableView numberOfRows]; //have to factor in collapsed rows |
1986 | 1990 | if (count > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrent class]]) |
1987 | 1991 | count -= [fDisplayedTorrents count]; |
1988 | ||
1992 | ||
1989 | 1993 | totalTorrentsString = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@", "Status bar transfer count"), |
1990 | 1994 | [NSString formattedUInteger: count], totalTorrentsString]; |
1991 | 1995 | } |
1992 | ||
1996 | ||
1993 | 1997 | [fTotalTorrentsField setStringValue: totalTorrentsString]; |
1994 | 1998 | } |
1995 | 1999 | |
2002 | 2006 | { |
2003 | 2007 | if (![notification userInfo]) |
2004 | 2008 | return; |
2005 | ||
2009 | ||
2006 | 2010 | if ([notification activationType] == NSUserNotificationActivationTypeActionButtonClicked) //reveal |
2007 | 2011 | { |
2008 | 2012 | Torrent * torrent = [self torrentForHash: [[notification userInfo] objectForKey: @"Hash"]]; |
2038 | 2042 | row = [fTableView rowForItem: torrent]; |
2039 | 2043 | } |
2040 | 2044 | } |
2041 | ||
2045 | ||
2042 | 2046 | if (row == -1) |
2043 | 2047 | { |
2044 | 2048 | //not found - must be filtering |
2045 | 2049 | NSAssert([fDefaults boolForKey: @"FilterBar"], @"expected the filter to be enabled"); |
2046 | 2050 | [fFilterBar reset: YES]; |
2047 | ||
2051 | ||
2048 | 2052 | row = [fTableView rowForItem: torrent]; |
2049 | ||
2053 | ||
2050 | 2054 | //if it's not shown, it has to be in a collapsed row...again |
2051 | 2055 | if ([fDefaults boolForKey: @"SortByGroup"]) |
2052 | 2056 | { |
2066 | 2070 | } |
2067 | 2071 | } |
2068 | 2072 | } |
2069 | ||
2073 | ||
2070 | 2074 | NSAssert1(row != -1, @"expected a row to be found for torrent %@", torrent); |
2071 | 2075 | |
2072 | 2076 | [self showMainWindow: nil]; |
2078 | 2082 | - (Torrent *) torrentForHash: (NSString *) hash |
2079 | 2083 | { |
2080 | 2084 | NSParameterAssert(hash != nil); |
2081 | ||
2085 | ||
2082 | 2086 | __block Torrent * torrent = nil; |
2083 | 2087 | [fTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id obj, NSUInteger idx, BOOL * stop) { |
2084 | 2088 | if ([[(Torrent *)obj hashString] isEqualToString: hash]) |
2093 | 2097 | - (void) torrentFinishedDownloading: (NSNotification *) notification |
2094 | 2098 | { |
2095 | 2099 | Torrent * torrent = [notification object]; |
2096 | ||
2100 | ||
2097 | 2101 | if ([[[notification userInfo] objectForKey: @"WasRunning"] boolValue]) |
2098 | 2102 | { |
2099 | 2103 | if (!fSoundPlaying && [fDefaults boolForKey: @"PlayDownloadSound"]) |
2106 | 2110 | [sound play]; |
2107 | 2111 | } |
2108 | 2112 | } |
2109 | ||
2113 | ||
2110 | 2114 | NSString * location = [torrent dataLocation]; |
2111 | ||
2115 | ||
2112 | 2116 | NSString * notificationTitle = NSLocalizedString(@"Download Complete", "notification title"); |
2113 | 2117 | if ([NSApp isOnMountainLionOrBetter]) |
2114 | 2118 | { |
2115 | 2119 | NSUserNotification * notification = [[NSUserNotificationMtLion alloc] init]; |
2116 | 2120 | [notification setTitle: notificationTitle]; |
2117 | 2121 | [notification setInformativeText: [torrent name]]; |
2118 | ||
2122 | ||
2119 | 2123 | [notification setHasActionButton: YES]; |
2120 | 2124 | [notification setActionButtonTitle: NSLocalizedString(@"Show", "notification button")]; |
2121 | ||
2125 | ||
2122 | 2126 | NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithObject: [torrent hashString] forKey: @"Hash"]; |
2123 | 2127 | if (location) |
2124 | 2128 | [userInfo setObject: location forKey: @"Location"]; |
2125 | 2129 | [notification setUserInfo: userInfo]; |
2126 | ||
2130 | ||
2127 | 2131 | [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification]; |
2128 | 2132 | [notification release]; |
2129 | 2133 | } |
2130 | ||
2134 | ||
2131 | 2135 | NSMutableDictionary * clickContext = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
2132 | 2136 | GROWL_DOWNLOAD_COMPLETE, @"Type", nil]; |
2133 | ||
2137 | ||
2134 | 2138 | if (location) |
2135 | 2139 | [clickContext setObject: location forKey: @"Location"]; |
2136 | ||
2140 | ||
2137 | 2141 | [GrowlApplicationBridge notifyWithTitle: notificationTitle |
2138 | 2142 | description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE |
2139 | 2143 | iconData: nil priority: 0 isSticky: NO clickContext: clickContext]; |
2140 | ||
2144 | ||
2141 | 2145 | //NSLog(@"delegate: %@", [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] delegate]); |
2142 | ||
2146 | ||
2143 | 2147 | if (![fWindow isMainWindow]) |
2144 | 2148 | [fBadger addCompletedTorrent: torrent]; |
2145 | ||
2149 | ||
2146 | 2150 | //bounce download stack |
2147 | 2151 | [[NSDistributedNotificationCenter defaultCenter] postNotificationName: @"com.apple.DownloadFileFinished" |
2148 | 2152 | object: [torrent dataLocation]]; |
2149 | 2153 | } |
2150 | ||
2154 | ||
2151 | 2155 | [self fullUpdateUI]; |
2152 | 2156 | } |
2153 | 2157 | |
2159 | 2163 | - (void) torrentFinishedSeeding: (NSNotification *) notification |
2160 | 2164 | { |
2161 | 2165 | Torrent * torrent = [notification object]; |
2162 | ||
2166 | ||
2163 | 2167 | if (!fSoundPlaying && [fDefaults boolForKey: @"PlaySeedingSound"]) |
2164 | 2168 | { |
2165 | 2169 | NSSound * sound; |
2170 | 2174 | [sound play]; |
2171 | 2175 | } |
2172 | 2176 | } |
2173 | ||
2177 | ||
2174 | 2178 | NSString * location = [torrent dataLocation]; |
2175 | ||
2179 | ||
2176 | 2180 | NSString * notificationTitle = NSLocalizedString(@"Seeding Complete", "notification title"); |
2177 | 2181 | if ([NSApp isOnMountainLionOrBetter]) |
2178 | 2182 | { |
2179 | 2183 | NSUserNotification * notification = [[NSUserNotificationMtLion alloc] init]; |
2180 | 2184 | [notification setTitle: notificationTitle]; |
2181 | 2185 | [notification setInformativeText: [torrent name]]; |
2182 | ||
2186 | ||
2183 | 2187 | [notification setHasActionButton: YES]; |
2184 | 2188 | [notification setActionButtonTitle: NSLocalizedString(@"Show", "notification button")]; |
2185 | ||
2189 | ||
2186 | 2190 | NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithObject: [torrent hashString] forKey: @"Hash"]; |
2187 | 2191 | if (location) |
2188 | 2192 | [userInfo setObject: location forKey: @"Location"]; |
2189 | 2193 | [notification setUserInfo: userInfo]; |
2190 | ||
2194 | ||
2191 | 2195 | [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification]; |
2192 | 2196 | [notification release]; |
2193 | 2197 | } |
2194 | ||
2198 | ||
2195 | 2199 | NSMutableDictionary * clickContext = [NSMutableDictionary dictionaryWithObject: GROWL_SEEDING_COMPLETE forKey: @"Type"]; |
2196 | ||
2200 | ||
2197 | 2201 | if (location) |
2198 | 2202 | [clickContext setObject: location forKey: @"Location"]; |
2199 | ||
2203 | ||
2200 | 2204 | [GrowlApplicationBridge notifyWithTitle: notificationTitle |
2201 | 2205 | description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE |
2202 | 2206 | iconData: nil priority: 0 isSticky: NO clickContext: clickContext]; |
2203 | ||
2207 | ||
2204 | 2208 | //removing from the list calls fullUpdateUI |
2205 | 2209 | if ([torrent removeWhenFinishSeeding]) |
2206 | 2210 | [self confirmRemoveTorrents: @[ torrent ] deleteData: NO]; |
2208 | 2212 | { |
2209 | 2213 | if (![fWindow isMainWindow]) |
2210 | 2214 | [fBadger addCompletedTorrent: torrent]; |
2211 | ||
2215 | ||
2212 | 2216 | [self fullUpdateUI]; |
2213 | ||
2217 | ||
2214 | 2218 | if ([[fTableView selectedTorrents] containsObject: torrent]) |
2215 | 2219 | { |
2216 | 2220 | [fInfoController updateInfoStats]; |
2222 | 2226 | - (void) updateTorrentHistory |
2223 | 2227 | { |
2224 | 2228 | NSMutableArray * history = [NSMutableArray arrayWithCapacity: [fTorrents count]]; |
2225 | ||
2229 | ||
2226 | 2230 | for (Torrent * torrent in fTorrents) |
2227 | 2231 | [history addObject: [torrent history]]; |
2228 | ||
2232 | ||
2229 | 2233 | NSString * historyFile = [fConfigDirectory stringByAppendingPathComponent: TRANSFER_PLIST]; |
2230 | 2234 | [history writeToFile: historyFile atomically: YES]; |
2231 | 2235 | } |
2264 | 2268 | NSAssert1(NO, @"Unknown sort tag received: %ld", [(NSMenuItem *)sender tag]); |
2265 | 2269 | return; |
2266 | 2270 | } |
2267 | ||
2271 | ||
2268 | 2272 | [fDefaults setObject: sortType forKey: @"Sort"]; |
2269 | ||
2273 | ||
2270 | 2274 | [self sortTorrents: YES]; |
2271 | 2275 | } |
2272 | 2276 | |
2274 | 2278 | { |
2275 | 2279 | BOOL sortByGroup = ![fDefaults boolForKey: @"SortByGroup"]; |
2276 | 2280 | [fDefaults setBool: sortByGroup forKey: @"SortByGroup"]; |
2277 | ||
2281 | ||
2278 | 2282 | [self applyFilter]; |
2279 | 2283 | } |
2280 | 2284 | |
2298 | 2302 | - (void) sortTorrentsCallUpdates: (BOOL) callUpdates includeQueueOrder: (BOOL) includeQueueOrder |
2299 | 2303 | { |
2300 | 2304 | const BOOL asc = ![fDefaults boolForKey: @"SortReverse"]; |
2301 | ||
2305 | ||
2302 | 2306 | NSArray * descriptors; |
2303 | 2307 | NSSortDescriptor * nameDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"name" ascending: asc selector: @selector(localizedStandardCompare:)]; |
2304 | ||
2308 | ||
2305 | 2309 | NSString * sortType = [fDefaults stringForKey: @"Sort"]; |
2306 | 2310 | if ([sortType isEqualToString: SORT_STATE]) |
2307 | 2311 | { |
2308 | 2312 | NSSortDescriptor * stateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"stateSortKey" ascending: !asc], |
2309 | 2313 | * progressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progress" ascending: !asc], |
2310 | 2314 | * ratioDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"ratio" ascending: !asc]; |
2311 | ||
2315 | ||
2312 | 2316 | descriptors = [NSArray arrayWithObjects: stateDescriptor, progressDescriptor, ratioDescriptor, nameDescriptor, nil]; |
2313 | 2317 | } |
2314 | 2318 | else if ([sortType isEqualToString: SORT_PROGRESS]) |
2316 | 2320 | NSSortDescriptor * progressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progress" ascending: asc], |
2317 | 2321 | * ratioProgressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progressStopRatio" ascending: asc], |
2318 | 2322 | * ratioDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"ratio" ascending: asc]; |
2319 | ||
2323 | ||
2320 | 2324 | descriptors = [NSArray arrayWithObjects: progressDescriptor, ratioProgressDescriptor, ratioDescriptor, nameDescriptor, nil]; |
2321 | 2325 | } |
2322 | 2326 | else if ([sortType isEqualToString: SORT_TRACKER]) |
2323 | 2327 | { |
2324 | 2328 | NSSortDescriptor * trackerDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"trackerSortKey" ascending: asc selector: @selector(localizedCaseInsensitiveCompare:)]; |
2325 | ||
2329 | ||
2326 | 2330 | descriptors = [NSArray arrayWithObjects: trackerDescriptor, nameDescriptor, nil]; |
2327 | 2331 | } |
2328 | 2332 | else if ([sortType isEqualToString: SORT_ACTIVITY]) |
2329 | 2333 | { |
2330 | 2334 | NSSortDescriptor * rateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"totalRate" ascending: !asc]; |
2331 | 2335 | NSSortDescriptor * activityDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"dateActivityOrAdd" ascending: !asc]; |
2332 | ||
2336 | ||
2333 | 2337 | descriptors = [NSArray arrayWithObjects: rateDescriptor, activityDescriptor, nameDescriptor, nil]; |
2334 | 2338 | } |
2335 | 2339 | else if ([sortType isEqualToString: SORT_DATE]) |
2336 | 2340 | { |
2337 | 2341 | NSSortDescriptor * dateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"dateAdded" ascending: asc]; |
2338 | ||
2342 | ||
2339 | 2343 | descriptors = [NSArray arrayWithObjects: dateDescriptor, nameDescriptor, nil]; |
2340 | 2344 | } |
2341 | 2345 | else if ([sortType isEqualToString: SORT_SIZE]) |
2342 | 2346 | { |
2343 | 2347 | NSSortDescriptor * sizeDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"size" ascending: asc]; |
2344 | ||
2348 | ||
2345 | 2349 | descriptors = [NSArray arrayWithObjects: sizeDescriptor, nameDescriptor, nil]; |
2346 | 2350 | } |
2347 | 2351 | else if ([sortType isEqualToString: SORT_NAME]) |
2351 | 2355 | else |
2352 | 2356 | { |
2353 | 2357 | NSAssert1([sortType isEqualToString: SORT_ORDER], @"Unknown sort type received: %@", sortType); |
2354 | ||
2358 | ||
2355 | 2359 | if (!includeQueueOrder) |
2356 | 2360 | return; |
2357 | ||
2361 | ||
2358 | 2362 | NSSortDescriptor * orderDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"queuePosition" ascending: asc]; |
2359 | ||
2363 | ||
2360 | 2364 | descriptors = [NSArray arrayWithObject: orderDescriptor]; |
2361 | 2365 | } |
2362 | ||
2366 | ||
2363 | 2367 | BOOL beganTableUpdate = !callUpdates; |
2364 | ||
2368 | ||
2365 | 2369 | //actually sort |
2366 | 2370 | if ([fDefaults boolForKey: @"SortByGroup"]) |
2367 | 2371 | { |
2370 | 2374 | } |
2371 | 2375 | else |
2372 | 2376 | [self rearrangeTorrentTableArray: fDisplayedTorrents forParent: nil withSortDescriptors: descriptors beganTableUpdate: &beganTableUpdate]; |
2373 | ||
2377 | ||
2374 | 2378 | if (beganTableUpdate && callUpdates) |
2375 | 2379 | { |
2376 | 2380 | [fTableView endUpdates]; |
2390 | 2394 | if (result != NSOrderedSame) |
2391 | 2395 | return result; |
2392 | 2396 | } |
2393 | ||
2397 | ||
2394 | 2398 | return NSOrderedSame; |
2395 | 2399 | }]; |
2396 | ||
2400 | ||
2397 | 2401 | if (insertIndex != currentIndex) |
2398 | 2402 | { |
2399 | 2403 | if (!*beganTableUpdate) |
2401 | 2405 | *beganTableUpdate = YES; |
2402 | 2406 | [fTableView beginUpdates]; |
2403 | 2407 | } |
2404 | ||
2408 | ||
2405 | 2409 | [rearrangeArray moveObjectAtIndex: currentIndex toIndex: insertIndex]; |
2406 | 2410 | [fTableView moveItemAtIndex: currentIndex inParent: parent toIndex: insertIndex inParent: parent]; |
2407 | 2411 | } |
2408 | 2412 | } |
2409 | ||
2413 | ||
2410 | 2414 | NSAssert2([rearrangeArray isEqualToArray: [rearrangeArray sortedArrayUsingDescriptors: descriptors]], @"Torrent rearranging didn't work! %@ %@", rearrangeArray, [rearrangeArray sortedArrayUsingDescriptors: descriptors]); |
2411 | 2415 | } |
2412 | 2416 | |
2425 | 2429 | filterPause = YES; |
2426 | 2430 | else |
2427 | 2431 | filterStatus = NO; |
2428 | ||
2432 | ||
2429 | 2433 | const NSInteger groupFilterValue = [fDefaults integerForKey: @"FilterGroup"]; |
2430 | 2434 | const BOOL filterGroup = groupFilterValue != GROUP_FILTER_ALL_TAG; |
2431 | ||
2435 | ||
2432 | 2436 | NSArray * searchStrings = [fFilterBar searchStrings]; |
2433 | 2437 | if (searchStrings && [searchStrings count] == 0) |
2434 | 2438 | searchStrings = nil; |
2435 | 2439 | const BOOL filterTracker = searchStrings && [[fDefaults stringForKey: @"FilterSearchType"] isEqualToString: FILTER_TYPE_TRACKER]; |
2436 | ||
2440 | ||
2437 | 2441 | //filter & get counts of each type |
2438 | 2442 | NSIndexSet * indexesOfNonFilteredTorrents = [fTorrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(Torrent * torrent, NSUInteger idx, BOOL * stop) { |
2439 | 2443 | //check status |
2442 | 2446 | const BOOL isActive = ![torrent isStalled]; |
2443 | 2447 | if (isActive) |
2444 | 2448 | OSAtomicIncrement32(&active); |
2445 | ||
2449 | ||
2446 | 2450 | if ([torrent isSeeding]) |
2447 | 2451 | { |
2448 | 2452 | OSAtomicIncrement32(&seeding); |
2462 | 2466 | if (filterStatus && !filterPause) |
2463 | 2467 | return NO; |
2464 | 2468 | } |
2465 | ||
2469 | ||
2466 | 2470 | //checkGroup |
2467 | 2471 | if (filterGroup) |
2468 | 2472 | if ([torrent groupValue] != groupFilterValue) |
2469 | 2473 | return NO; |
2470 | ||
2474 | ||
2471 | 2475 | //check text field |
2472 | 2476 | if (searchStrings) |
2473 | 2477 | { |
2475 | 2479 | if (filterTracker) |
2476 | 2480 | { |
2477 | 2481 | NSArray * trackers = [torrent allTrackersFlat]; |
2478 | ||
2482 | ||
2479 | 2483 | //to count, we need each string in at least 1 tracker |
2480 | 2484 | [searchStrings enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id searchString, NSUInteger idx, BOOL * stop) { |
2481 | 2485 | __block BOOL found = NO; |
2503 | 2507 | } |
2504 | 2508 | }]; |
2505 | 2509 | } |
2506 | ||
2510 | ||
2507 | 2511 | if (removeTextField) |
2508 | 2512 | return NO; |
2509 | 2513 | } |
2510 | ||
2514 | ||
2511 | 2515 | return YES; |
2512 | 2516 | }]; |
2513 | ||
2517 | ||
2514 | 2518 | NSArray * allTorrents = [fTorrents objectsAtIndexes: indexesOfNonFilteredTorrents]; |
2515 | ||
2519 | ||
2516 | 2520 | //set button tooltips |
2517 | 2521 | if (fFilterBar) |
2518 | 2522 | [fFilterBar setCountAll: [fTorrents count] active: active downloading: downloading seeding: seeding paused: paused]; |
2519 | ||
2523 | ||
2520 | 2524 | //if either the previous or current lists are blank, set its value to the other |
2521 | 2525 | const BOOL groupRows = [allTorrents count] > 0 ? [fDefaults boolForKey: @"SortByGroup"] : ([fDisplayedTorrents count] > 0 && [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]]); |
2522 | 2526 | const BOOL wasGroupRows = [fDisplayedTorrents count] > 0 ? [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]] : groupRows; |
2523 | ||
2527 | ||
2524 | 2528 | #warning could probably be merged with later code somehow |
2525 | 2529 | //clear display cache for not-shown torrents |
2526 | 2530 | if ([fDisplayedTorrents count] > 0) |
2531 | 2535 | if (![allTorrents containsObject: torrent]) |
2532 | 2536 | [torrent setPreviousFinishedPieces: nil]; |
2533 | 2537 | }; |
2534 | ||
2538 | ||
2535 | 2539 | if (wasGroupRows) |
2536 | 2540 | [fDisplayedTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id obj, NSUInteger idx, BOOL * stop) { |
2537 | 2541 | [[(TorrentGroup *)obj torrents] enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: removePreviousFinishedPieces]; |
2539 | 2543 | else |
2540 | 2544 | [fDisplayedTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: removePreviousFinishedPieces]; |
2541 | 2545 | } |
2542 | ||
2546 | ||
2543 | 2547 | BOOL beganUpdates = NO; |
2544 | 2548 | |
2545 | 2549 | //don't animate torrents when first launching |
2548 | 2552 | [[NSAnimationContext currentContext] setDuration: 0]; |
2549 | 2553 | }); |
2550 | 2554 | [NSAnimationContext beginGrouping]; |
2551 | ||
2555 | ||
2552 | 2556 | //add/remove torrents (and rearrange for groups), one by one |
2553 | 2557 | if (!groupRows && !wasGroupRows) |
2554 | 2558 | { |
2555 | 2559 | NSMutableIndexSet * addIndexes = [NSMutableIndexSet indexSet], |
2556 | 2560 | * removePreviousIndexes = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])]; |
2557 | ||
2561 | ||
2558 | 2562 | //for each of the torrents to add, find if it already exists (and keep track of those we've already added & those we need to remove) |
2559 | 2563 | [allTorrents enumerateObjectsWithOptions: 0 usingBlock: ^(id objAll, NSUInteger previousIndex, BOOL * stop) { |
2560 | 2564 | const NSUInteger currentIndex = [fDisplayedTorrents indexOfObjectAtIndexes: removePreviousIndexes options: NSEnumerationConcurrent passingTest: ^(id objDisplay, NSUInteger idx, BOOL *stop) { |
2565 | 2569 | else |
2566 | 2570 | [removePreviousIndexes removeIndex: currentIndex]; |
2567 | 2571 | }]; |
2568 | ||
2572 | ||
2569 | 2573 | if ([addIndexes count] > 0 || [removePreviousIndexes count] > 0) |
2570 | 2574 | { |
2571 | 2575 | beganUpdates = YES; |
2572 | 2576 | [fTableView beginUpdates]; |
2573 | ||
2577 | ||
2574 | 2578 | //remove torrents we didn't find |
2575 | 2579 | if ([removePreviousIndexes count] > 0) |
2576 | 2580 | { |
2577 | 2581 | [fDisplayedTorrents removeObjectsAtIndexes: removePreviousIndexes]; |
2578 | 2582 | [fTableView removeItemsAtIndexes: removePreviousIndexes inParent: nil withAnimation: NSTableViewAnimationSlideDown]; |
2579 | 2583 | } |
2580 | ||
2584 | ||
2581 | 2585 | //add new torrents |
2582 | 2586 | if ([addIndexes count] > 0) |
2583 | 2587 | { |
2587 | 2591 | NSIndexSet * newAddIndexes = [allTorrents indexesOfObjectsAtIndexes: addIndexes options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) { |
2588 | 2592 | return [fAddingTransfers containsObject: obj]; |
2589 | 2593 | }]; |
2590 | ||
2594 | ||
2591 | 2595 | [addIndexes removeIndexes: newAddIndexes]; |
2592 | ||
2596 | ||
2593 | 2597 | [fDisplayedTorrents addObjectsFromArray: [allTorrents objectsAtIndexes: newAddIndexes]]; |
2594 | 2598 | [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [newAddIndexes count], [newAddIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideLeft]; |
2595 | 2599 | } |
2596 | ||
2600 | ||
2597 | 2601 | [fDisplayedTorrents addObjectsFromArray: [allTorrents objectsAtIndexes: addIndexes]]; |
2598 | 2602 | [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [addIndexes count], [addIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown]; |
2599 | 2603 | } |
2602 | 2606 | else if (groupRows && wasGroupRows) |
2603 | 2607 | { |
2604 | 2608 | NSAssert(groupRows && wasGroupRows, @"Should have had group rows and should remain with group rows"); |
2605 | ||
2609 | ||
2606 | 2610 | #warning don't always do? |
2607 | 2611 | beganUpdates = YES; |
2608 | 2612 | [fTableView beginUpdates]; |
2609 | ||
2613 | ||
2610 | 2614 | NSMutableIndexSet * unusedAllTorrentsIndexes = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [allTorrents count])]; |
2611 | ||
2615 | ||
2612 | 2616 | NSMutableDictionary * groupsByIndex = [NSMutableDictionary dictionaryWithCapacity: [fDisplayedTorrents count]]; |
2613 | 2617 | for (TorrentGroup * group in fDisplayedTorrents) |
2614 | 2618 | [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: [group groupIndex]]]; |
2615 | ||
2619 | ||
2616 | 2620 | const NSUInteger originalGroupCount = [fDisplayedTorrents count]; |
2617 | 2621 | for (NSUInteger index = 0; index < originalGroupCount; ++index) |
2618 | 2622 | { |
2619 | 2623 | TorrentGroup * group = [fDisplayedTorrents objectAtIndex: index]; |
2620 | ||
2624 | ||
2621 | 2625 | NSMutableIndexSet * removeIndexes = [NSMutableIndexSet indexSet]; |
2622 | ||
2626 | ||
2623 | 2627 | //needs to be a signed integer |
2624 | 2628 | for (NSInteger indexInGroup = 0; indexInGroup < [[group torrents] count]; ++indexInGroup) |
2625 | 2629 | { |
2632 | 2636 | else |
2633 | 2637 | { |
2634 | 2638 | BOOL markTorrentAsUsed = YES; |
2635 | ||
2639 | ||
2636 | 2640 | const NSInteger groupValue = [torrent groupValue]; |
2637 | 2641 | if (groupValue != [group groupIndex]) |
2638 | 2642 | { |
2652 | 2656 | if ([fDisplayedTorrents indexOfObject: newGroup inRange: NSMakeRange(index+1, originalGroupCount-(index+1))] != NSNotFound) |
2653 | 2657 | markTorrentAsUsed = NO; |
2654 | 2658 | } |
2655 | ||
2659 | ||
2656 | 2660 | [[group torrents] removeObjectAtIndex: indexInGroup]; |
2657 | 2661 | [[newGroup torrents] addObject: torrent]; |
2658 | 2662 | |
2659 | 2663 | [fTableView moveItemAtIndex: indexInGroup inParent: group toIndex: [[newGroup torrents] count]-1 inParent: newGroup]; |
2660 | ||
2664 | ||
2661 | 2665 | --indexInGroup; |
2662 | 2666 | } |
2663 | ||
2667 | ||
2664 | 2668 | if (markTorrentAsUsed) |
2665 | 2669 | [unusedAllTorrentsIndexes removeIndex: allIndex]; |
2666 | 2670 | } |
2667 | 2671 | } |
2668 | ||
2672 | ||
2669 | 2673 | if ([removeIndexes count] > 0) |
2670 | 2674 | { |
2671 | 2675 | [[group torrents] removeObjectsAtIndexes: removeIndexes]; |
2672 | 2676 | [fTableView removeItemsAtIndexes: removeIndexes inParent: group withAnimation: NSTableViewAnimationEffectFade]; |
2673 | 2677 | } |
2674 | 2678 | } |
2675 | ||
2679 | ||
2676 | 2680 | //add remaining new torrents |
2677 | 2681 | for (Torrent * torrent in [allTorrents objectsAtIndexes: unusedAllTorrentsIndexes]) |
2678 | 2682 | { |
2687 | 2691 | [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [fDisplayedTorrents count]-1] inParent: nil withAnimation: NSTableViewAnimationEffectFade]; |
2688 | 2692 | [fTableView isGroupCollapsed: groupValue] ? [fTableView collapseItem: group] : [fTableView expandItem: group]; |
2689 | 2693 | } |
2690 | ||
2694 | ||
2691 | 2695 | [[group torrents] addObject: torrent]; |
2692 | 2696 | |
2693 | 2697 | const BOOL newTorrent = fAddingTransfers && [fAddingTransfers containsObject: torrent]; |
2694 | 2698 | [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [[group torrents] count]-1] inParent: group withAnimation: newTorrent ? NSTableViewAnimationSlideLeft : NSTableViewAnimationSlideDown]; |
2695 | 2699 | } |
2696 | ||
2700 | ||
2697 | 2701 | //remove empty groups |
2698 | 2702 | NSIndexSet * removeGroupIndexes = [fDisplayedTorrents indexesOfObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, originalGroupCount)] options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) { |
2699 | 2703 | return [[(TorrentGroup *)obj torrents] count] == 0; |
2700 | 2704 | }]; |
2701 | ||
2705 | ||
2702 | 2706 | if ([removeGroupIndexes count] > 0) |
2703 | 2707 | { |
2704 | 2708 | [fDisplayedTorrents removeObjectsAtIndexes: removeGroupIndexes]; |
2705 | 2709 | [fTableView removeItemsAtIndexes: removeGroupIndexes inParent: nil withAnimation: NSTableViewAnimationEffectFade]; |
2706 | 2710 | } |
2707 | ||
2711 | ||
2708 | 2712 | //now that all groups are there, sort them - don't insert on the fly in case groups were reordered in prefs |
2709 | 2713 | NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES]; |
2710 | 2714 | [self rearrangeTorrentTableArray: fDisplayedTorrents forParent: nil withSortDescriptors: [NSArray arrayWithObject: groupDescriptor] beganTableUpdate: &beganUpdates]; |
2712 | 2716 | else |
2713 | 2717 | { |
2714 | 2718 | NSAssert(groupRows != wasGroupRows, @"Trying toggling group-torrent reordering when we weren't expecting to."); |
2715 | ||
2719 | ||
2716 | 2720 | //set all groups as expanded |
2717 | 2721 | [fTableView removeAllCollapsedGroups]; |
2718 | ||
2722 | ||
2719 | 2723 | //since we're not doing this the right way (boo buggy animation), we need to remember selected values |
2720 | 2724 | #warning when Lion-only and using views instead of cells, this likely won't be needed |
2721 | 2725 | NSArray * selectedValues = [fTableView selectedValues]; |
2722 | ||
2726 | ||
2723 | 2727 | beganUpdates = YES; |
2724 | 2728 | [fTableView beginUpdates]; |
2725 | 2729 | |
2726 | 2730 | [fTableView removeItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown]; |
2727 | ||
2731 | ||
2728 | 2732 | if (groupRows) |
2729 | 2733 | { |
2730 | 2734 | //a map for quickly finding groups |
2738 | 2742 | group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease]; |
2739 | 2743 | [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]]; |
2740 | 2744 | } |
2741 | ||
2745 | ||
2742 | 2746 | [[group torrents] addObject: torrent]; |
2743 | 2747 | } |
2744 | ||
2748 | ||
2745 | 2749 | [fDisplayedTorrents setArray: [groupsByIndex allValues]]; |
2746 | ||
2750 | ||
2747 | 2751 | //we need the groups to be sorted, and we can do it without moving items in the table, too! |
2748 | 2752 | NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES]; |
2749 | 2753 | [fDisplayedTorrents sortUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]]; |
2752 | 2756 | [fDisplayedTorrents setArray: allTorrents]; |
2753 | 2757 | |
2754 | 2758 | [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationEffectFade]; |
2755 | ||
2756 | if (groupRows) | |
2757 | { | |
2758 | //actually expand group rows | |
2759 | for (TorrentGroup * group in fDisplayedTorrents) | |
2760 | [fTableView expandItem: group]; | |
2761 | } | |
2762 | ||
2759 | ||
2760 | if (groupRows) | |
2761 | { | |
2762 | //actually expand group rows | |
2763 | for (TorrentGroup * group in fDisplayedTorrents) | |
2764 | [fTableView expandItem: group]; | |
2765 | } | |
2766 | ||
2763 | 2767 | if (selectedValues) |
2764 | 2768 | [fTableView selectValues: selectedValues]; |
2765 | 2769 | } |
2766 | ||
2770 | ||
2767 | 2771 | //sort the torrents (won't sort the groups, though) |
2768 | 2772 | [self sortTorrentsCallUpdates: !beganUpdates includeQueueOrder: YES]; |
2769 | 2773 | |
2770 | 2774 | if (beganUpdates) |
2771 | 2775 | [fTableView endUpdates]; |
2772 | 2776 | [fTableView setNeedsDisplay: YES]; |
2773 | ||
2777 | ||
2774 | 2778 | [NSAnimationContext endGrouping]; |
2775 | 2779 | |
2776 | 2780 | [self resetInfo]; //if group is already selected, but the torrents in it change |
2777 | ||
2781 | ||
2778 | 2782 | [self setBottomCountText: groupRows || filterStatus || filterGroup || searchStrings]; |
2779 | ||
2783 | ||
2780 | 2784 | [self setWindowSizeToFit]; |
2781 | ||
2785 | ||
2782 | 2786 | if (fAddingTransfers) |
2783 | 2787 | { |
2784 | 2788 | [fAddingTransfers release]; |
2795 | 2799 | { |
2796 | 2800 | if (fGlobalPopoverShown) |
2797 | 2801 | return; |
2798 | ||
2802 | ||
2799 | 2803 | NSPopover * popover = [[NSPopover alloc] init]; |
2800 | 2804 | [popover setBehavior: NSPopoverBehaviorTransient]; |
2801 | 2805 | GlobalOptionsPopoverViewController * viewController = [[GlobalOptionsPopoverViewController alloc] initWithHandle: fLib]; |
2802 | 2806 | [popover setContentViewController: viewController]; |
2803 | 2807 | [popover setDelegate: self]; |
2804 | ||
2808 | ||
2805 | 2809 | [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge]; |
2806 | ||
2810 | ||
2807 | 2811 | [viewController release]; |
2808 | 2812 | [popover release]; |
2809 | 2813 | } |
2825 | 2829 | { |
2826 | 2830 | for (NSInteger i = [menu numberOfItems]-1; i >= 0; i--) |
2827 | 2831 | [menu removeItemAtIndex: i]; |
2828 | ||
2832 | ||
2829 | 2833 | NSMenu * groupMenu = [[GroupsController groups] groupMenuWithTarget: self action: @selector(setGroup:) isSmall: NO]; |
2830 | ||
2834 | ||
2831 | 2835 | const NSInteger groupMenuCount = [groupMenu numberOfItems]; |
2832 | 2836 | for (NSInteger i = 0; i < groupMenuCount; i++) |
2833 | 2837 | { |
2839 | 2843 | } |
2840 | 2844 | else if (menu == fShareMenu || menu == fShareContextMenu) { |
2841 | 2845 | [menu removeAllItems]; |
2842 | ||
2846 | ||
2843 | 2847 | for (NSMenuItem * item in [[ShareTorrentFileHelper sharedHelper] menuItems]) |
2844 | 2848 | { |
2845 | 2849 | [menu addItem:item]; |
2853 | 2857 | for (Torrent * torrent in [fTableView selectedTorrents]) |
2854 | 2858 | { |
2855 | 2859 | [fTableView removeCollapsedGroup: [torrent groupValue]]; //remove old collapsed group |
2856 | ||
2860 | ||
2857 | 2861 | [torrent setGroupValue: [(NSMenuItem *)sender tag] determinationType: TorrentDeterminationUserSpecified]; |
2858 | 2862 | } |
2859 | ||
2863 | ||
2860 | 2864 | [self applyFilter]; |
2861 | 2865 | [self updateUI]; |
2862 | 2866 | [self updateTorrentHistory]; |
2881 | 2885 | |
2882 | 2886 | [fDefaults setBool: isLimited forKey: @"SpeedLimit"]; |
2883 | 2887 | [fStatusBar updateSpeedFieldsToolTips]; |
2884 | ||
2888 | ||
2885 | 2889 | if (![[dict objectForKey: @"ByUser"] boolValue]) |
2886 | 2890 | [GrowlApplicationBridge notifyWithTitle: isLimited ? NSLocalizedString(@"Speed Limit Auto Enabled", "Growl notification title") : NSLocalizedString(@"Speed Limit Auto Disabled", "Growl notification title") |
2887 | 2891 | description: NSLocalizedString(@"Bandwidth settings changed", "Growl notification description") |
2891 | 2895 | isSticky: NO |
2892 | 2896 | clickContext: nil |
2893 | 2897 | identifier: GROWL_AUTO_SPEED_LIMIT]; |
2894 | ||
2898 | ||
2895 | 2899 | [dict release]; |
2896 | 2900 | } |
2897 | 2901 | |
2903 | 2907 | -(void) VDKQueue: (VDKQueue *) queue receivedNotification: (NSString*) notification forPath: (NSString*) fpath |
2904 | 2908 | { |
2905 | 2909 | //don't assume that just because we're watching for write notification, we'll only receive write notifications |
2906 | ||
2910 | ||
2907 | 2911 | if (![fDefaults boolForKey: @"AutoImport"] || ![fDefaults stringForKey: @"AutoImportDirectory"]) |
2908 | 2912 | return; |
2909 | ||
2913 | ||
2910 | 2914 | if ([fAutoImportTimer isValid]) |
2911 | 2915 | [fAutoImportTimer invalidate]; |
2912 | 2916 | [fAutoImportTimer release]; |
2913 | ||
2917 | ||
2914 | 2918 | //check again in 10 seconds in case torrent file wasn't complete |
2915 | fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self | |
2919 | fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self | |
2916 | 2920 | selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain]; |
2917 | ||
2921 | ||
2918 | 2922 | [self checkAutoImportDirectory]; |
2919 | 2923 | } |
2920 | 2924 | |
2924 | 2928 | [fAutoImportTimer invalidate]; |
2925 | 2929 | [fAutoImportTimer release]; |
2926 | 2930 | fAutoImportTimer = nil; |
2927 | ||
2931 | ||
2928 | 2932 | [fAutoImportedNames release]; |
2929 | 2933 | fAutoImportedNames = nil; |
2930 | ||
2934 | ||
2931 | 2935 | [self checkAutoImportDirectory]; |
2932 | 2936 | } |
2933 | 2937 | |
2936 | 2940 | NSString * path; |
2937 | 2941 | if (![fDefaults boolForKey: @"AutoImport"] || !(path = [fDefaults stringForKey: @"AutoImportDirectory"])) |
2938 | 2942 | return; |
2939 | ||
2943 | ||
2940 | 2944 | path = [path stringByExpandingTildeInPath]; |
2941 | ||
2945 | ||
2942 | 2946 | NSArray * importedNames; |
2943 | 2947 | if (!(importedNames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: path error: NULL])) |
2944 | 2948 | return; |
2945 | ||
2949 | ||
2946 | 2950 | //only check files that have not been checked yet |
2947 | 2951 | NSMutableArray * newNames = [importedNames mutableCopy]; |
2948 | ||
2952 | ||
2949 | 2953 | if (fAutoImportedNames) |
2950 | 2954 | [newNames removeObjectsInArray: fAutoImportedNames]; |
2951 | 2955 | else |
2952 | 2956 | fAutoImportedNames = [[NSMutableArray alloc] init]; |
2953 | 2957 | [fAutoImportedNames setArray: importedNames]; |
2954 | ||
2958 | ||
2955 | 2959 | for (NSString * file in newNames) |
2956 | 2960 | { |
2957 | 2961 | if ([file hasPrefix: @"."]) |
2958 | 2962 | continue; |
2959 | ||
2963 | ||
2960 | 2964 | NSString * fullFile = [path stringByAppendingPathComponent: file]; |
2961 | ||
2965 | ||
2962 | 2966 | if (!([[[NSWorkspace sharedWorkspace] typeOfFile: fullFile error: NULL] isEqualToString: @"org.bittorrent.torrent"] |
2963 | 2967 | || [[fullFile pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)) |
2964 | 2968 | continue; |
2965 | ||
2969 | ||
2966 | 2970 | tr_ctor * ctor = tr_ctorNew(fLib); |
2967 | 2971 | tr_ctorSetMetainfoFromFile(ctor, [fullFile UTF8String]); |
2968 | ||
2972 | ||
2969 | 2973 | switch (tr_torrentParse(ctor, NULL)) |
2970 | 2974 | { |
2971 | 2975 | case TR_PARSE_OK: |
2972 | 2976 | [self openFiles: [NSArray arrayWithObject: fullFile] addType: ADD_AUTO forcePath: nil]; |
2973 | ||
2977 | ||
2974 | 2978 | NSString * notificationTitle = NSLocalizedString(@"Torrent File Auto Added", "notification title"); |
2975 | 2979 | if ([NSApp isOnMountainLionOrBetter]) |
2976 | 2980 | { |
2977 | 2981 | NSUserNotification* notification = [[NSUserNotificationMtLion alloc] init]; |
2978 | 2982 | [notification setTitle: notificationTitle]; |
2979 | 2983 | [notification setInformativeText: file]; |
2980 | ||
2984 | ||
2981 | 2985 | [notification setHasActionButton: NO]; |
2982 | ||
2986 | ||
2983 | 2987 | [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification]; |
2984 | 2988 | [notification release]; |
2985 | 2989 | } |
2986 | ||
2990 | ||
2987 | 2991 | [GrowlApplicationBridge notifyWithTitle: notificationTitle |
2988 | 2992 | description: file notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO |
2989 | 2993 | clickContext: nil]; |
2990 | 2994 | break; |
2991 | ||
2995 | ||
2992 | 2996 | case TR_PARSE_ERR: |
2993 | 2997 | [fAutoImportedNames removeObject: file]; |
2994 | 2998 | break; |
2995 | ||
2999 | ||
2996 | 3000 | case TR_PARSE_DUPLICATE: //let's ignore this (but silence a warning) |
2997 | 3001 | break; |
2998 | 3002 | } |
2999 | ||
3003 | ||
3000 | 3004 | tr_ctorFree(ctor); |
3001 | 3005 | } |
3002 | ||
3006 | ||
3003 | 3007 | [newNames release]; |
3004 | 3008 | } |
3005 | 3009 | |
3007 | 3011 | { |
3008 | 3012 | if (![fDefaults boolForKey: @"AutoImport"]) |
3009 | 3013 | return; |
3010 | ||
3014 | ||
3011 | 3015 | NSString * location = [(NSURL *)[notification object] path], |
3012 | 3016 | * path = [fDefaults stringForKey: @"AutoImportDirectory"]; |
3013 | ||
3017 | ||
3014 | 3018 | if (location && path && [[[location stringByDeletingLastPathComponent] stringByExpandingTildeInPath] |
3015 | 3019 | isEqualToString: [path stringByExpandingTildeInPath]]) |
3016 | 3020 | [fAutoImportedNames addObject: [location lastPathComponent]]; |
3066 | 3070 | else |
3067 | 3071 | { |
3068 | 3072 | TorrentGroup * group = (TorrentGroup *)item; |
3069 | ||
3073 | ||
3070 | 3074 | if ([fDefaults boolForKey: @"DisplayGroupRowRatio"]) |
3071 | 3075 | return [NSString stringForRatio: [group ratio]]; |
3072 | 3076 | else |
3088 | 3092 | { |
3089 | 3093 | if (![torrent isKindOfClass: [Torrent class]]) |
3090 | 3094 | return NO; |
3091 | ||
3095 | ||
3092 | 3096 | [indexSet addIndex: [fTableView rowForItem: torrent]]; |
3093 | 3097 | } |
3094 | ||
3098 | ||
3095 | 3099 | [pasteboard declareTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE] owner: self]; |
3096 | 3100 | [pasteboard setData: [NSKeyedArchiver archivedDataWithRootObject: indexSet] forType: TORRENT_TABLE_VIEW_DATA_TYPE]; |
3097 | 3101 | return YES; |
3109 | 3113 | { |
3110 | 3114 | if (!item) |
3111 | 3115 | return NSDragOperationNone; |
3112 | ||
3116 | ||
3113 | 3117 | if ([[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER]) |
3114 | 3118 | { |
3115 | 3119 | if ([item isKindOfClass: [Torrent class]]) |
3130 | 3134 | { |
3131 | 3135 | if (index == NSOutlineViewDropOnItemIndex) |
3132 | 3136 | return NSDragOperationNone; |
3133 | ||
3137 | ||
3134 | 3138 | if (item) |
3135 | 3139 | { |
3136 | 3140 | index = [fTableView rowForItem: item] + 1; |
3137 | 3141 | item = nil; |
3138 | 3142 | } |
3139 | 3143 | } |
3140 | ||
3144 | ||
3141 | 3145 | [fTableView setDropItem: item dropChildIndex: index]; |
3142 | 3146 | return NSDragOperationGeneric; |
3143 | 3147 | } |
3144 | ||
3148 | ||
3145 | 3149 | return NSDragOperationNone; |
3146 | 3150 | } |
3147 | 3151 | |
3151 | 3155 | if ([[pasteboard types] containsObject: TORRENT_TABLE_VIEW_DATA_TYPE]) |
3152 | 3156 | { |
3153 | 3157 | NSIndexSet * indexes = [NSKeyedUnarchiver unarchiveObjectWithData: [pasteboard dataForType: TORRENT_TABLE_VIEW_DATA_TYPE]]; |
3154 | ||
3158 | ||
3155 | 3159 | //get the torrents to move |
3156 | 3160 | NSMutableArray * movingTorrents = [NSMutableArray arrayWithCapacity: [indexes count]]; |
3157 | 3161 | for (NSUInteger i = [indexes firstIndex]; i != NSNotFound; i = [indexes indexGreaterThanIndex: i]) |
3158 | 3162 | { |
3159 | 3163 | Torrent * torrent = [fTableView itemAtRow: i]; |
3160 | 3164 | [movingTorrents addObject: torrent]; |
3161 | ||
3162 | //change groups | |
3163 | if (item) | |
3164 | [torrent setGroupValue: [item groupIndex] determinationType: TorrentDeterminationUserSpecified]; | |
3165 | } | |
3166 | ||
3165 | } | |
3166 | ||
3167 | //change groups | |
3168 | if (item) | |
3169 | { | |
3170 | const NSInteger groupIndex = [item groupIndex]; | |
3171 | ||
3172 | for (Torrent * torrent in movingTorrents) | |
3173 | [torrent setGroupValue: groupIndex determinationType: TorrentDeterminationUserSpecified]; | |
3174 | } | |
3175 | ||
3167 | 3176 | //reorder queue order |
3168 | 3177 | if (newRow != NSOutlineViewDropOnItemIndex) |
3169 | 3178 | { |
3179 | 3188 | break; |
3180 | 3189 | } |
3181 | 3190 | } |
3182 | ||
3191 | ||
3183 | 3192 | //remove objects to reinsert |
3184 | 3193 | [fTorrents removeObjectsInArray: movingTorrents]; |
3185 | ||
3194 | ||
3186 | 3195 | //insert objects at new location |
3187 | 3196 | const NSUInteger insertIndex = topTorrent ? [fTorrents indexOfObject: topTorrent] + 1 : 0; |
3188 | 3197 | NSIndexSet * insertIndexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(insertIndex, [movingTorrents count])]; |
3189 | 3198 | [fTorrents insertObjects: movingTorrents atIndexes: insertIndexes]; |
3190 | ||
3199 | ||
3191 | 3200 | //we need to make sure the queue order is updated in the Torrent object before we sort - safest to just reset all queue positions |
3192 | 3201 | NSUInteger i = 0; |
3193 | 3202 | for (Torrent * torrent in fTorrents) |
3195 | 3204 | [torrent setQueuePosition: i++]; |
3196 | 3205 | [torrent update]; |
3197 | 3206 | } |
3198 | ||
3207 | ||
3199 | 3208 | //do the drag animation here so that the dragged torrents are the ones that are animated as moving, and not the torrents around them |
3200 | 3209 | [fTableView beginUpdates]; |
3201 | ||
3210 | ||
3202 | 3211 | NSUInteger insertDisplayIndex = topTorrent ? [groupTorrents indexOfObject: topTorrent] + 1 : 0; |
3203 | ||
3212 | ||
3204 | 3213 | for (Torrent * torrent in movingTorrents) |
3205 | 3214 | { |
3206 | 3215 | TorrentGroup * oldParent = item ? [fTableView parentForItem: torrent] : nil; |
3207 | 3216 | NSMutableArray * oldTorrents = oldParent ? [oldParent torrents] : fDisplayedTorrents; |
3208 | 3217 | const NSUInteger oldIndex = [oldTorrents indexOfObject: torrent]; |
3209 | ||
3218 | ||
3210 | 3219 | if (item == oldParent) |
3211 | 3220 | { |
3212 | 3221 | if (oldIndex < insertDisplayIndex) |
3216 | 3225 | else |
3217 | 3226 | { |
3218 | 3227 | NSAssert(item && oldParent, @"Expected to be dragging between group rows"); |
3219 | ||
3228 | ||
3220 | 3229 | NSMutableArray * newTorrents = [(TorrentGroup *)item torrents]; |
3221 | 3230 | [newTorrents insertObject: torrent atIndex: insertDisplayIndex]; |
3222 | 3231 | [oldTorrents removeObjectAtIndex: oldIndex]; |
3223 | 3232 | } |
3224 | 3233 | |
3225 | 3234 | [fTableView moveItemAtIndex: oldIndex inParent: oldParent toIndex: insertDisplayIndex inParent: item]; |
3226 | ||
3235 | ||
3227 | 3236 | ++insertDisplayIndex; |
3228 | 3237 | } |
3229 | 3238 | |
3230 | 3239 | [fTableView endUpdates]; |
3231 | 3240 | } |
3232 | ||
3241 | ||
3233 | 3242 | [self applyFilter]; |
3234 | 3243 | } |
3235 | ||
3244 | ||
3236 | 3245 | return YES; |
3237 | 3246 | } |
3238 | 3247 | |
3263 | 3272 | if (!fOverlayWindow) |
3264 | 3273 | fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow]; |
3265 | 3274 | [fOverlayWindow setTorrents: files]; |
3266 | ||
3275 | ||
3267 | 3276 | return NSDragOperationCopy; |
3268 | 3277 | } |
3269 | 3278 | tr_ctorFree(ctor); |
3270 | 3279 | } |
3271 | 3280 | } |
3272 | ||
3281 | ||
3273 | 3282 | //create a torrent file if a single file |
3274 | 3283 | if (!torrent && [files count] == 1) |
3275 | 3284 | { |
3276 | 3285 | if (!fOverlayWindow) |
3277 | 3286 | fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow]; |
3278 | 3287 | [fOverlayWindow setFile: [[files objectAtIndex: 0] lastPathComponent]]; |
3279 | ||
3288 | ||
3280 | 3289 | return NSDragOperationCopy; |
3281 | 3290 | } |
3282 | 3291 | } |
3285 | 3294 | if (!fOverlayWindow) |
3286 | 3295 | fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow]; |
3287 | 3296 | [fOverlayWindow setURL: [[NSURL URLFromPasteboard: pasteboard] relativeString]]; |
3288 | ||
3297 | ||
3289 | 3298 | return NSDragOperationCopy; |
3290 | 3299 | } |
3291 | 3300 | else; |
3292 | ||
3301 | ||
3293 | 3302 | return NSDragOperationNone; |
3294 | 3303 | } |
3295 | 3304 | |
3303 | 3312 | { |
3304 | 3313 | if (fOverlayWindow) |
3305 | 3314 | [fOverlayWindow fadeOut]; |
3306 | ||
3315 | ||
3307 | 3316 | NSPasteboard * pasteboard = [info draggingPasteboard]; |
3308 | 3317 | if ([[pasteboard types] containsObject: NSFilenamesPboardType]) |
3309 | 3318 | { |
3310 | 3319 | BOOL torrent = NO, accept = YES; |
3311 | ||
3320 | ||
3312 | 3321 | //create an array of files that can be opened |
3313 | 3322 | NSArray * files = [pasteboard propertyListForType: NSFilenamesPboardType]; |
3314 | 3323 | NSMutableArray * filesToOpen = [NSMutableArray arrayWithCapacity: [files count]]; |
3325 | 3334 | tr_ctorFree(ctor); |
3326 | 3335 | } |
3327 | 3336 | } |
3328 | ||
3337 | ||
3329 | 3338 | if ([filesToOpen count] > 0) |
3330 | 3339 | [self application: NSApp openFiles: filesToOpen]; |
3331 | 3340 | else |
3335 | 3344 | else |
3336 | 3345 | accept = NO; |
3337 | 3346 | } |
3338 | ||
3347 | ||
3339 | 3348 | return accept; |
3340 | 3349 | } |
3341 | 3350 | else if ([[pasteboard types] containsObject: NSURLPboardType]) |
3348 | 3357 | } |
3349 | 3358 | } |
3350 | 3359 | else; |
3351 | ||
3360 | ||
3352 | 3361 | return NO; |
3353 | 3362 | } |
3354 | 3363 | |
3356 | 3365 | { |
3357 | 3366 | BOOL makeSmall = ![fDefaults boolForKey: @"SmallView"]; |
3358 | 3367 | [fDefaults setBool: makeSmall forKey: @"SmallView"]; |
3359 | ||
3368 | ||
3360 | 3369 | [fTableView setUsesAlternatingRowBackgroundColors: !makeSmall]; |
3361 | ||
3370 | ||
3362 | 3371 | [fTableView setRowHeight: makeSmall ? ROW_HEIGHT_SMALL : ROW_HEIGHT_REGULAR]; |
3363 | 3372 | |
3364 | 3373 | [fTableView beginUpdates]; |
3365 | 3374 | [fTableView noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fTableView numberOfRows])]]; |
3366 | 3375 | [fTableView endUpdates]; |
3367 | ||
3376 | ||
3368 | 3377 | //resize for larger min height if not set to auto size |
3369 | 3378 | if (![fDefaults boolForKey: @"AutoSize"]) |
3370 | 3379 | { |
3371 | 3380 | const NSSize contentSize = [[fWindow contentView] frame].size; |
3372 | ||
3381 | ||
3373 | 3382 | NSSize contentMinSize = [fWindow contentMinSize]; |
3374 | 3383 | contentMinSize.height = [self minWindowContentSizeAllowed]; |
3375 | 3384 | [fWindow setContentMinSize: contentMinSize]; |
3376 | ||
3385 | ||
3377 | 3386 | //make sure the window already isn't too small |
3378 | 3387 | if (!makeSmall && contentSize.height < contentMinSize.height) |
3379 | 3388 | { |
3381 | 3390 | CGFloat heightChange = contentMinSize.height - contentSize.height; |
3382 | 3391 | frame.size.height += heightChange; |
3383 | 3392 | frame.origin.y -= heightChange; |
3384 | ||
3393 | ||
3385 | 3394 | [fWindow setFrame: frame display: YES]; |
3386 | 3395 | } |
3387 | 3396 | } |
3404 | 3413 | - (NSRect) windowFrameByAddingHeight: (CGFloat) height checkLimits: (BOOL) check |
3405 | 3414 | { |
3406 | 3415 | NSScrollView * scrollView = [fTableView enclosingScrollView]; |
3407 | ||
3416 | ||
3408 | 3417 | //convert pixels to points |
3409 | 3418 | NSRect windowFrame = [fWindow frame]; |
3410 | 3419 | NSSize windowSize = [scrollView convertSize: windowFrame.size fromView: nil]; |
3411 | 3420 | windowSize.height += height; |
3412 | ||
3421 | ||
3413 | 3422 | if (check) |
3414 | 3423 | { |
3415 | 3424 | //we can't call minSize, since it might be set to the current size (auto size) |
3416 | 3425 | const CGFloat minHeight = [self minWindowContentSizeAllowed] |
3417 | 3426 | + (NSHeight([fWindow frame]) - NSHeight([[fWindow contentView] frame])); //contentView to window |
3418 | ||
3427 | ||
3419 | 3428 | if (windowSize.height <= minHeight) |
3420 | 3429 | windowSize.height = minHeight; |
3421 | 3430 | else |
3455 | 3464 | const BOOL prevShown = fStatusBar != nil; |
3456 | 3465 | if (show == prevShown) |
3457 | 3466 | return; |
3458 | ||
3467 | ||
3459 | 3468 | if (show) |
3460 | 3469 | { |
3461 | 3470 | fStatusBar = [[StatusBarController alloc] initWithLib: fLib]; |
3462 | ||
3471 | ||
3463 | 3472 | NSView * contentView = [fWindow contentView]; |
3464 | 3473 | const NSSize windowSize = [contentView convertSize: [fWindow frame].size fromView: nil]; |
3465 | ||
3474 | ||
3466 | 3475 | NSRect statusBarFrame = [[fStatusBar view] frame]; |
3467 | 3476 | statusBarFrame.size.width = windowSize.width; |
3468 | 3477 | [[fStatusBar view] setFrame: statusBarFrame]; |
3469 | ||
3478 | ||
3470 | 3479 | [contentView addSubview: [fStatusBar view]]; |
3471 | 3480 | [[fStatusBar view] setFrameOrigin: NSMakePoint(0.0, NSMaxY([contentView frame]))]; |
3472 | 3481 | } |
3473 | ||
3482 | ||
3474 | 3483 | CGFloat heightChange = [[fStatusBar view] frame].size.height; |
3475 | 3484 | if (!show) |
3476 | 3485 | heightChange *= -1; |
3477 | ||
3486 | ||
3478 | 3487 | //allow bar to show even if not enough room |
3479 | 3488 | if (show && ![fDefaults boolForKey: @"AutoSize"]) |
3480 | 3489 | { |
3481 | 3490 | NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO]; |
3482 | ||
3491 | ||
3483 | 3492 | NSScreen * screen = [fWindow screen]; |
3484 | 3493 | if (screen) |
3485 | 3494 | { |
3493 | 3502 | } |
3494 | 3503 | } |
3495 | 3504 | } |
3496 | ||
3505 | ||
3497 | 3506 | [self updateUI]; |
3498 | ||
3507 | ||
3499 | 3508 | NSScrollView * scrollView = [fTableView enclosingScrollView]; |
3500 | ||
3509 | ||
3501 | 3510 | //set views to not autoresize |
3502 | 3511 | const NSUInteger statsMask = [[fStatusBar view] autoresizingMask]; |
3503 | 3512 | [[fStatusBar view] setAutoresizingMask: NSViewNotSizable]; |
3509 | 3518 | } |
3510 | 3519 | const NSUInteger scrollMask = [scrollView autoresizingMask]; |
3511 | 3520 | [scrollView setAutoresizingMask: NSViewNotSizable]; |
3512 | ||
3521 | ||
3513 | 3522 | NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO]; |
3514 | [fWindow setFrame: frame display: YES animate: animate]; | |
3515 | ||
3523 | [fWindow setFrame: frame display: YES animate: animate]; | |
3524 | ||
3516 | 3525 | //re-enable autoresize |
3517 | 3526 | [[fStatusBar view] setAutoresizingMask: statsMask]; |
3518 | 3527 | if (fFilterBar) |
3519 | 3528 | [[fFilterBar view] setAutoresizingMask: filterMask]; |
3520 | 3529 | [scrollView setAutoresizingMask: scrollMask]; |
3521 | ||
3530 | ||
3522 | 3531 | if (!show) |
3523 | 3532 | { |
3524 | 3533 | [[fStatusBar view] removeFromSuperviewWithoutNeedingDisplay]; |
3525 | 3534 | [fStatusBar release]; |
3526 | 3535 | fStatusBar = nil; |
3527 | 3536 | } |
3528 | ||
3537 | ||
3529 | 3538 | if ([fDefaults boolForKey: @"AutoSize"]) |
3530 | 3539 | [self setWindowMinMaxToCurrent]; |
3531 | 3540 | else |
3540 | 3549 | - (void) toggleFilterBar: (id) sender |
3541 | 3550 | { |
3542 | 3551 | const BOOL show = fFilterBar == nil; |
3543 | ||
3552 | ||
3544 | 3553 | //disable filtering when hiding (have to do before showFilterBar:animate:) |
3545 | 3554 | if (!show) |
3546 | 3555 | [fFilterBar reset: NO]; |
3547 | ||
3556 | ||
3548 | 3557 | [self showFilterBar: show animate: YES]; |
3549 | 3558 | [fDefaults setBool: show forKey: @"FilterBar"]; |
3550 | 3559 | [[fWindow toolbar] validateVisibleItems]; |
3551 | ||
3560 | ||
3552 | 3561 | [self applyFilter]; //do even if showing to ensure tooltips are updated |
3553 | 3562 | } |
3554 | 3563 | |
3558 | 3567 | const BOOL prevShown = fFilterBar != nil; |
3559 | 3568 | if (show == prevShown) |
3560 | 3569 | return; |
3561 | ||
3570 | ||
3562 | 3571 | if (show) |
3563 | 3572 | { |
3564 | 3573 | fFilterBar = [[FilterBarController alloc] init]; |
3565 | ||
3574 | ||
3566 | 3575 | NSView * contentView = [fWindow contentView]; |
3567 | 3576 | const NSSize windowSize = [contentView convertSize: [fWindow frame].size fromView: nil]; |
3568 | ||
3577 | ||
3569 | 3578 | NSRect filterBarFrame = [[fFilterBar view] frame]; |
3570 | 3579 | filterBarFrame.size.width = windowSize.width; |
3571 | 3580 | [[fFilterBar view] setFrame: filterBarFrame]; |
3572 | ||
3581 | ||
3573 | 3582 | if (fStatusBar) |
3574 | 3583 | [contentView addSubview: [fFilterBar view] positioned: NSWindowBelow relativeTo: [fStatusBar view]]; |
3575 | 3584 | else |
3579 | 3588 | } |
3580 | 3589 | else |
3581 | 3590 | [fWindow makeFirstResponder: fTableView]; |
3582 | ||
3591 | ||
3583 | 3592 | CGFloat heightChange = NSHeight([[fFilterBar view] frame]); |
3584 | 3593 | if (!show) |
3585 | 3594 | heightChange *= -1; |
3586 | ||
3595 | ||
3587 | 3596 | //allow bar to show even if not enough room |
3588 | 3597 | if (show && ![fDefaults boolForKey: @"AutoSize"]) |
3589 | 3598 | { |
3590 | 3599 | NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO]; |
3591 | ||
3600 | ||
3592 | 3601 | NSScreen * screen = [fWindow screen]; |
3593 | 3602 | if (screen) |
3594 | 3603 | { |
3602 | 3611 | } |
3603 | 3612 | } |
3604 | 3613 | } |
3605 | ||
3614 | ||
3606 | 3615 | NSScrollView * scrollView = [fTableView enclosingScrollView]; |
3607 | 3616 | |
3608 | 3617 | //set views to not autoresize |
3610 | 3619 | const NSUInteger scrollMask = [scrollView autoresizingMask]; |
3611 | 3620 | [[fFilterBar view] setAutoresizingMask: NSViewNotSizable]; |
3612 | 3621 | [scrollView setAutoresizingMask: NSViewNotSizable]; |
3613 | ||
3622 | ||
3614 | 3623 | const NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO]; |
3615 | 3624 | [fWindow setFrame: frame display: YES animate: animate]; |
3616 | ||
3625 | ||
3617 | 3626 | //re-enable autoresize |
3618 | 3627 | [[fFilterBar view] setAutoresizingMask: filterMask]; |
3619 | 3628 | [scrollView setAutoresizingMask: scrollMask]; |
3620 | ||
3629 | ||
3621 | 3630 | if (!show) |
3622 | 3631 | { |
3623 | 3632 | [[fFilterBar view] removeFromSuperviewWithoutNeedingDisplay]; |
3624 | 3633 | [fFilterBar release]; |
3625 | 3634 | fFilterBar = nil; |
3626 | 3635 | } |
3627 | ||
3636 | ||
3628 | 3637 | if ([fDefaults boolForKey: @"AutoSize"]) |
3629 | 3638 | [self setWindowMinMaxToCurrent]; |
3630 | 3639 | else |
3665 | 3674 | { |
3666 | 3675 | NSArray * selectedTorrents = [fTableView selectedTorrents]; |
3667 | 3676 | NSMutableArray * qlArray = [NSMutableArray arrayWithCapacity: [selectedTorrents count]]; |
3668 | ||
3677 | ||
3669 | 3678 | for (Torrent * torrent in selectedTorrents) |
3670 | 3679 | if (([torrent isFolder] || [torrent isComplete]) && [torrent dataLocation]) |
3671 | 3680 | [qlArray addObject: torrent]; |
3672 | ||
3681 | ||
3673 | 3682 | return qlArray; |
3674 | 3683 | } |
3675 | 3684 | |
3696 | 3705 | [super keyDown: event]; |
3697 | 3706 | return YES; |
3698 | 3707 | }*/ |
3699 | ||
3708 | ||
3700 | 3709 | return NO; |
3701 | 3710 | } |
3702 | 3711 | |
3708 | 3717 | { |
3709 | 3718 | if (![fWindow isVisible]) |
3710 | 3719 | return NSZeroRect; |
3711 | ||
3720 | ||
3712 | 3721 | const NSInteger row = [fTableView rowForItem: item]; |
3713 | 3722 | if (row == -1) |
3714 | 3723 | return NSZeroRect; |
3715 | ||
3724 | ||
3716 | 3725 | NSRect frame = [fTableView iconRectForRow: row]; |
3717 | ||
3726 | ||
3718 | 3727 | if (!NSIntersectsRect([fTableView visibleRect], frame)) |
3719 | 3728 | return NSZeroRect; |
3720 | ||
3729 | ||
3721 | 3730 | frame.origin = [fTableView convertPoint: frame.origin toView: nil]; |
3722 | 3731 | frame = [fWindow convertRectToScreen: frame]; |
3723 | 3732 | frame.origin.y -= frame.size.height; |
3728 | 3737 | - (void) showToolbarShare: (id) sender |
3729 | 3738 | { |
3730 | 3739 | NSParameterAssert([sender isKindOfClass:[NSButton class]]); |
3731 | ||
3740 | ||
3732 | 3741 | NSSharingServicePicker * picker = [[NSSharingServicePicker alloc] initWithItems: [[ShareTorrentFileHelper sharedHelper] shareTorrentURLs]]; |
3733 | 3742 | picker.delegate = self; |
3734 | ||
3743 | ||
3735 | 3744 | [picker showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge]; |
3736 | 3745 | } |
3737 | 3746 | |
3753 | 3762 | - (id) toolbarButtonWithIdentifier: (NSString *) ident forToolbarButtonClass:(Class)class |
3754 | 3763 | { |
3755 | 3764 | ButtonToolbarItem * item = [[class alloc] initWithItemIdentifier: ident]; |
3756 | ||
3765 | ||
3757 | 3766 | NSButton * button = [[NSButton alloc] init]; |
3758 | 3767 | [button setBezelStyle: NSTexturedRoundedBezelStyle]; |
3759 | 3768 | [button setStringValue: @""]; |
3760 | ||
3769 | ||
3761 | 3770 | [item setView: button]; |
3762 | 3771 | [button release]; |
3763 | ||
3772 | ||
3764 | 3773 | const NSSize buttonSize = NSMakeSize(36.0, 25.0); |
3765 | 3774 | [item setMinSize: buttonSize]; |
3766 | 3775 | [item setMaxSize: buttonSize]; |
3767 | ||
3776 | ||
3768 | 3777 | return [item autorelease]; |
3769 | 3778 | } |
3770 | 3779 | |
3773 | 3782 | if ([ident isEqualToString: TOOLBAR_CREATE]) |
3774 | 3783 | { |
3775 | 3784 | ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; |
3776 | ||
3785 | ||
3777 | 3786 | [item setLabel: NSLocalizedString(@"Create", "Create toolbar item -> label")]; |
3778 | 3787 | [item setPaletteLabel: NSLocalizedString(@"Create Torrent File", "Create toolbar item -> palette label")]; |
3779 | 3788 | [item setToolTip: NSLocalizedString(@"Create torrent file", "Create toolbar item -> tooltip")]; |
3781 | 3790 | [item setTarget: self]; |
3782 | 3791 | [item setAction: @selector(createFile:)]; |
3783 | 3792 | [item setAutovalidates: NO]; |
3784 | ||
3793 | ||
3785 | 3794 | return item; |
3786 | 3795 | } |
3787 | 3796 | else if ([ident isEqualToString: TOOLBAR_OPEN_FILE]) |
3788 | 3797 | { |
3789 | 3798 | ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; |
3790 | ||
3799 | ||
3791 | 3800 | [item setLabel: NSLocalizedString(@"Open", "Open toolbar item -> label")]; |
3792 | 3801 | [item setPaletteLabel: NSLocalizedString(@"Open Torrent Files", "Open toolbar item -> palette label")]; |
3793 | 3802 | [item setToolTip: NSLocalizedString(@"Open torrent files", "Open toolbar item -> tooltip")]; |
3795 | 3804 | [item setTarget: self]; |
3796 | 3805 | [item setAction: @selector(openShowSheet:)]; |
3797 | 3806 | [item setAutovalidates: NO]; |
3798 | ||
3807 | ||
3799 | 3808 | return item; |
3800 | 3809 | } |
3801 | 3810 | else if ([ident isEqualToString: TOOLBAR_OPEN_WEB]) |
3802 | 3811 | { |
3803 | 3812 | ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; |
3804 | ||
3813 | ||
3805 | 3814 | [item setLabel: NSLocalizedString(@"Open Address", "Open address toolbar item -> label")]; |
3806 | 3815 | [item setPaletteLabel: NSLocalizedString(@"Open Torrent Address", "Open address toolbar item -> palette label")]; |
3807 | 3816 | [item setToolTip: NSLocalizedString(@"Open torrent web address", "Open address toolbar item -> tooltip")]; |
3809 | 3818 | [item setTarget: self]; |
3810 | 3819 | [item setAction: @selector(openURLShowSheet:)]; |
3811 | 3820 | [item setAutovalidates: NO]; |
3812 | ||
3821 | ||
3813 | 3822 | return item; |
3814 | 3823 | } |
3815 | 3824 | else if ([ident isEqualToString: TOOLBAR_REMOVE]) |
3816 | 3825 | { |
3817 | 3826 | ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; |
3818 | ||
3827 | ||
3819 | 3828 | [item setLabel: NSLocalizedString(@"Remove", "Remove toolbar item -> label")]; |
3820 | 3829 | [item setPaletteLabel: NSLocalizedString(@"Remove Selected", "Remove toolbar item -> palette label")]; |
3821 | 3830 | [item setToolTip: NSLocalizedString(@"Remove selected transfers", "Remove toolbar item -> tooltip")]; |
3823 | 3832 | [item setTarget: self]; |
3824 | 3833 | [item setAction: @selector(removeNoDelete:)]; |
3825 | 3834 | [item setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh]; |
3826 | ||
3835 | ||
3827 | 3836 | return item; |
3828 | 3837 | } |
3829 | 3838 | else if ([ident isEqualToString: TOOLBAR_INFO]) |
3830 | 3839 | { |
3831 | 3840 | ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; |
3832 | 3841 | [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled |
3833 | ||
3842 | ||
3834 | 3843 | [item setLabel: NSLocalizedString(@"Inspector", "Inspector toolbar item -> label")]; |
3835 | 3844 | [item setPaletteLabel: NSLocalizedString(@"Toggle Inspector", "Inspector toolbar item -> palette label")]; |
3836 | 3845 | [item setToolTip: NSLocalizedString(@"Toggle the torrent inspector", "Inspector toolbar item -> tooltip")]; |
3837 | 3846 | [item setImage: [NSImage imageNamed: @"ToolbarInfoTemplate"]]; |
3838 | 3847 | [item setTarget: self]; |
3839 | 3848 | [item setAction: @selector(showInfo:)]; |
3840 | ||
3849 | ||
3841 | 3850 | return item; |
3842 | 3851 | } |
3843 | 3852 | else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_ALL]) |
3844 | 3853 | { |
3845 | 3854 | GroupToolbarItem * groupItem = [[GroupToolbarItem alloc] initWithItemIdentifier: ident]; |
3846 | ||
3855 | ||
3847 | 3856 | NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect]; |
3848 | 3857 | [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]]; |
3849 | 3858 | [groupItem setView: segmentedControl]; |
3850 | 3859 | NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell]; |
3851 | ||
3860 | ||
3852 | 3861 | if ([NSApp isOnYosemiteOrBetter]) { |
3853 | 3862 | segmentedControl.segmentStyle = NSSegmentStyleSeparated; |
3854 | 3863 | } |
3855 | ||
3864 | ||
3856 | 3865 | [segmentedControl setSegmentCount: 2]; |
3857 | 3866 | [segmentedCell setTrackingMode: NSSegmentSwitchTrackingMomentary]; |
3858 | ||
3867 | ||
3859 | 3868 | const NSSize groupSize = NSMakeSize(72.0, 25.0); |
3860 | 3869 | [groupItem setMinSize: groupSize]; |
3861 | 3870 | [groupItem setMaxSize: groupSize]; |
3862 | ||
3871 | ||
3863 | 3872 | [groupItem setLabel: NSLocalizedString(@"Apply All", "All toolbar item -> label")]; |
3864 | 3873 | [groupItem setPaletteLabel: NSLocalizedString(@"Pause / Resume All", "All toolbar item -> palette label")]; |
3865 | 3874 | [groupItem setTarget: self]; |
3866 | 3875 | [groupItem setAction: @selector(allToolbarClicked:)]; |
3867 | ||
3876 | ||
3868 | 3877 | [groupItem setIdentifiers: [NSArray arrayWithObjects: TOOLBAR_PAUSE_ALL, TOOLBAR_RESUME_ALL, nil]]; |
3869 | ||
3878 | ||
3870 | 3879 | [segmentedCell setTag: TOOLBAR_PAUSE_TAG forSegment: TOOLBAR_PAUSE_TAG]; |
3871 | 3880 | [segmentedControl setImage: [NSImage imageNamed: @"ToolbarPauseAllTemplate"] forSegment: TOOLBAR_PAUSE_TAG]; |
3872 | 3881 | [segmentedCell setToolTip: NSLocalizedString(@"Pause all transfers", |
3873 | 3882 | "All toolbar item -> tooltip") forSegment: TOOLBAR_PAUSE_TAG]; |
3874 | ||
3883 | ||
3875 | 3884 | [segmentedCell setTag: TOOLBAR_RESUME_TAG forSegment: TOOLBAR_RESUME_TAG]; |
3876 | 3885 | [segmentedControl setImage: [NSImage imageNamed: @"ToolbarResumeAllTemplate"] forSegment: TOOLBAR_RESUME_TAG]; |
3877 | 3886 | [segmentedCell setToolTip: NSLocalizedString(@"Resume all transfers", |
3878 | 3887 | "All toolbar item -> tooltip") forSegment: TOOLBAR_RESUME_TAG]; |
3879 | ||
3888 | ||
3880 | 3889 | [groupItem createMenu: [NSArray arrayWithObjects: NSLocalizedString(@"Pause All", "All toolbar item -> label"), |
3881 | 3890 | NSLocalizedString(@"Resume All", "All toolbar item -> label"), nil]]; |
3882 | ||
3891 | ||
3883 | 3892 | [segmentedControl release]; |
3884 | ||
3893 | ||
3885 | 3894 | [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh]; |
3886 | ||
3895 | ||
3887 | 3896 | return [groupItem autorelease]; |
3888 | 3897 | } |
3889 | 3898 | else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_SELECTED]) |
3890 | 3899 | { |
3891 | 3900 | GroupToolbarItem * groupItem = [[GroupToolbarItem alloc] initWithItemIdentifier: ident]; |
3892 | ||
3901 | ||
3893 | 3902 | NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect]; |
3894 | 3903 | [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]]; |
3895 | 3904 | [groupItem setView: segmentedControl]; |
3896 | 3905 | NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell]; |
3897 | ||
3906 | ||
3898 | 3907 | if ([NSApp isOnYosemiteOrBetter]) { |
3899 | 3908 | segmentedControl.segmentStyle = NSSegmentStyleSeparated; |
3900 | 3909 | } |
3901 | ||
3910 | ||
3902 | 3911 | [segmentedControl setSegmentCount: 2]; |
3903 | 3912 | [segmentedCell setTrackingMode: NSSegmentSwitchTrackingMomentary]; |
3904 | ||
3913 | ||
3905 | 3914 | const NSSize groupSize = NSMakeSize(72.0, 25.0); |
3906 | 3915 | [groupItem setMinSize: groupSize]; |
3907 | 3916 | [groupItem setMaxSize: groupSize]; |
3908 | ||
3917 | ||
3909 | 3918 | [groupItem setLabel: NSLocalizedString(@"Apply Selected", "Selected toolbar item -> label")]; |
3910 | 3919 | [groupItem setPaletteLabel: NSLocalizedString(@"Pause / Resume Selected", "Selected toolbar item -> palette label")]; |
3911 | 3920 | [groupItem setTarget: self]; |
3912 | 3921 | [groupItem setAction: @selector(selectedToolbarClicked:)]; |
3913 | ||
3922 | ||
3914 | 3923 | [groupItem setIdentifiers: [NSArray arrayWithObjects: TOOLBAR_PAUSE_SELECTED, TOOLBAR_RESUME_SELECTED, nil]]; |
3915 | ||
3924 | ||
3916 | 3925 | [segmentedCell setTag: TOOLBAR_PAUSE_TAG forSegment: TOOLBAR_PAUSE_TAG]; |
3917 | 3926 | [segmentedControl setImage: [NSImage imageNamed: @"ToolbarPauseSelectedTemplate"] forSegment: TOOLBAR_PAUSE_TAG]; |
3918 | 3927 | [segmentedCell setToolTip: NSLocalizedString(@"Pause selected transfers", |
3919 | 3928 | "Selected toolbar item -> tooltip") forSegment: TOOLBAR_PAUSE_TAG]; |
3920 | ||
3929 | ||
3921 | 3930 | [segmentedCell setTag: TOOLBAR_RESUME_TAG forSegment: TOOLBAR_RESUME_TAG]; |
3922 | 3931 | [segmentedControl setImage: [NSImage imageNamed: @"ToolbarResumeSelectedTemplate"] forSegment: TOOLBAR_RESUME_TAG]; |
3923 | 3932 | [segmentedCell setToolTip: NSLocalizedString(@"Resume selected transfers", |
3924 | 3933 | "Selected toolbar item -> tooltip") forSegment: TOOLBAR_RESUME_TAG]; |
3925 | ||
3934 | ||
3926 | 3935 | [groupItem createMenu: [NSArray arrayWithObjects: NSLocalizedString(@"Pause Selected", "Selected toolbar item -> label"), |
3927 | 3936 | NSLocalizedString(@"Resume Selected", "Selected toolbar item -> label"), nil]]; |
3928 | ||
3937 | ||
3929 | 3938 | [segmentedControl release]; |
3930 | ||
3939 | ||
3931 | 3940 | [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh]; |
3932 | ||
3941 | ||
3933 | 3942 | return [groupItem autorelease]; |
3934 | 3943 | } |
3935 | 3944 | else if ([ident isEqualToString: TOOLBAR_FILTER]) |
3936 | 3945 | { |
3937 | 3946 | ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; |
3938 | 3947 | [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled |
3939 | ||
3948 | ||
3940 | 3949 | [item setLabel: NSLocalizedString(@"Filter", "Filter toolbar item -> label")]; |
3941 | 3950 | [item setPaletteLabel: NSLocalizedString(@"Toggle Filter", "Filter toolbar item -> palette label")]; |
3942 | 3951 | [item setToolTip: NSLocalizedString(@"Toggle the filter bar", "Filter toolbar item -> tooltip")]; |
3943 | 3952 | [item setImage: [NSImage imageNamed: @"ToolbarFilterTemplate"]]; |
3944 | 3953 | [item setTarget: self]; |
3945 | 3954 | [item setAction: @selector(toggleFilterBar:)]; |
3946 | ||
3955 | ||
3947 | 3956 | return item; |
3948 | 3957 | } |
3949 | 3958 | else if ([ident isEqualToString: TOOLBAR_QUICKLOOK]) |
3950 | 3959 | { |
3951 | 3960 | ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; |
3952 | 3961 | [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled |
3953 | ||
3962 | ||
3954 | 3963 | [item setLabel: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> label")]; |
3955 | 3964 | [item setPaletteLabel: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> palette label")]; |
3956 | 3965 | [item setToolTip: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> tooltip")]; |
3958 | 3967 | [item setTarget: self]; |
3959 | 3968 | [item setAction: @selector(toggleQuickLook:)]; |
3960 | 3969 | [item setVisibilityPriority: NSToolbarItemVisibilityPriorityLow]; |
3961 | ||
3970 | ||
3962 | 3971 | return item; |
3963 | 3972 | } |
3964 | 3973 | else if ([ident isEqualToString: TOOLBAR_SHARE]) |
3965 | 3974 | { |
3966 | 3975 | ShareToolbarItem * item = [self toolbarButtonWithIdentifier: ident forToolbarButtonClass: [ShareToolbarItem class]]; |
3967 | ||
3976 | ||
3968 | 3977 | [item setLabel: NSLocalizedString(@"Share", "Share toolbar item -> label")]; |
3969 | 3978 | [item setPaletteLabel: NSLocalizedString(@"Share", "Share toolbar item -> palette label")]; |
3970 | 3979 | [item setToolTip: NSLocalizedString(@"Share torrent file", "Share toolbar item -> tooltip")]; |
3971 | 3980 | [item setImage: [NSImage imageNamed: NSImageNameShareTemplate]]; |
3972 | 3981 | [item setVisibilityPriority: NSToolbarItemVisibilityPriorityLow]; |
3973 | ||
3982 | ||
3974 | 3983 | NSButton *itemButton = (NSButton *)[item view]; |
3975 | 3984 | [itemButton setTarget: self]; |
3976 | 3985 | [itemButton setAction: @selector(showToolbarShare:)]; |
3977 | 3986 | [itemButton sendActionOn:NSLeftMouseDownMask]; |
3978 | ||
3987 | ||
3979 | 3988 | return item; |
3980 | 3989 | } |
3981 | 3990 | else |
4043 | 4052 | - (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem |
4044 | 4053 | { |
4045 | 4054 | NSString * ident = [toolbarItem itemIdentifier]; |
4046 | ||
4055 | ||
4047 | 4056 | //enable remove item |
4048 | 4057 | if ([ident isEqualToString: TOOLBAR_REMOVE]) |
4049 | 4058 | return [fTableView numberOfSelectedRows] > 0; |
4074 | 4083 | return YES; |
4075 | 4084 | return NO; |
4076 | 4085 | } |
4077 | ||
4086 | ||
4078 | 4087 | //enable resume item |
4079 | 4088 | if ([ident isEqualToString: TOOLBAR_RESUME_SELECTED]) |
4080 | 4089 | { |
4083 | 4092 | return YES; |
4084 | 4093 | return NO; |
4085 | 4094 | } |
4086 | ||
4095 | ||
4087 | 4096 | //set info item |
4088 | 4097 | if ([ident isEqualToString: TOOLBAR_INFO]) |
4089 | 4098 | { |
4090 | 4099 | [(NSButton *)[toolbarItem view] setState: [[fInfoController window] isVisible]]; |
4091 | 4100 | return YES; |
4092 | 4101 | } |
4093 | ||
4102 | ||
4094 | 4103 | //set filter item |
4095 | 4104 | if ([ident isEqualToString: TOOLBAR_FILTER]) |
4096 | 4105 | { |
4097 | 4106 | [(NSButton *)[toolbarItem view] setState: fFilterBar != nil]; |
4098 | 4107 | return YES; |
4099 | 4108 | } |
4100 | ||
4109 | ||
4101 | 4110 | //set quick look item |
4102 | 4111 | if ([ident isEqualToString: TOOLBAR_QUICKLOOK]) |
4103 | 4112 | { |
4104 | 4113 | [(NSButton *)[toolbarItem view] setState: [QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]]; |
4105 | 4114 | return YES; |
4106 | 4115 | } |
4107 | ||
4116 | ||
4108 | 4117 | //enable share item |
4109 | 4118 | if ([ident isEqualToString: TOOLBAR_SHARE]) |
4110 | 4119 | return [fTableView numberOfSelectedRows] > 0; |
4111 | ||
4120 | ||
4112 | 4121 | return YES; |
4113 | 4122 | } |
4114 | 4123 | |
4115 | 4124 | - (BOOL) validateMenuItem: (NSMenuItem *) menuItem |
4116 | 4125 | { |
4117 | 4126 | SEL action = [menuItem action]; |
4118 | ||
4127 | ||
4119 | 4128 | if (action == @selector(toggleSpeedLimit:)) |
4120 | 4129 | { |
4121 | 4130 | [menuItem setState: [fDefaults boolForKey: @"SpeedLimit"] ? NSOnState : NSOffState]; |
4122 | 4131 | return YES; |
4123 | 4132 | } |
4124 | ||
4133 | ||
4125 | 4134 | //only enable some items if it is in a context menu or the window is useable |
4126 | 4135 | BOOL canUseTable = [fWindow isKeyWindow] || [[menuItem menu] supermenu] != [NSApp mainMenu]; |
4127 | 4136 | |
4128 | 4137 | //enable open items |
4129 | 4138 | if (action == @selector(openShowSheet:) || action == @selector(openURLShowSheet:)) |
4130 | 4139 | return [fWindow attachedSheet] == nil; |
4131 | ||
4140 | ||
4132 | 4141 | //enable sort options |
4133 | 4142 | if (action == @selector(setSort:)) |
4134 | 4143 | { |
4162 | 4171 | default: |
4163 | 4172 | NSAssert1(NO, @"Unknown sort tag received: %ld", [menuItem tag]); |
4164 | 4173 | } |
4165 | ||
4174 | ||
4166 | 4175 | [menuItem setState: [sortType isEqualToString: [fDefaults stringForKey: @"Sort"]] ? NSOnState : NSOffState]; |
4167 | 4176 | return [fWindow isVisible]; |
4168 | 4177 | } |
4169 | ||
4178 | ||
4170 | 4179 | if (action == @selector(setGroup:)) |
4171 | 4180 | { |
4172 | 4181 | BOOL checked = NO; |
4173 | ||
4182 | ||
4174 | 4183 | NSInteger index = [menuItem tag]; |
4175 | 4184 | for (Torrent * torrent in [fTableView selectedTorrents]) |
4176 | 4185 | if (index == [torrent groupValue]) |
4178 | 4187 | checked = YES; |
4179 | 4188 | break; |
4180 | 4189 | } |
4181 | ||
4190 | ||
4182 | 4191 | [menuItem setState: checked ? NSOnState : NSOffState]; |
4183 | 4192 | return canUseTable && [fTableView numberOfSelectedRows] > 0; |
4184 | 4193 | } |
4185 | ||
4194 | ||
4186 | 4195 | if (action == @selector(toggleSmallView:)) |
4187 | 4196 | { |
4188 | 4197 | [menuItem setState: [fDefaults boolForKey: @"SmallView"] ? NSOnState : NSOffState]; |
4189 | 4198 | return [fWindow isVisible]; |
4190 | 4199 | } |
4191 | ||
4200 | ||
4192 | 4201 | if (action == @selector(togglePiecesBar:)) |
4193 | 4202 | { |
4194 | 4203 | [menuItem setState: [fDefaults boolForKey: @"PiecesBar"] ? NSOnState : NSOffState]; |
4195 | 4204 | return [fWindow isVisible]; |
4196 | 4205 | } |
4197 | ||
4206 | ||
4198 | 4207 | if (action == @selector(toggleAvailabilityBar:)) |
4199 | 4208 | { |
4200 | 4209 | [menuItem setState: [fDefaults boolForKey: @"DisplayProgressBarAvailable"] ? NSOnState : NSOffState]; |
4201 | 4210 | return [fWindow isVisible]; |
4202 | 4211 | } |
4203 | ||
4212 | ||
4204 | 4213 | //enable show info |
4205 | 4214 | if (action == @selector(showInfo:)) |
4206 | 4215 | { |
4210 | 4219 | |
4211 | 4220 | return YES; |
4212 | 4221 | } |
4213 | ||
4222 | ||
4214 | 4223 | //enable prev/next inspector tab |
4215 | 4224 | if (action == @selector(setInfoTab:)) |
4216 | 4225 | return [[fInfoController window] isVisible]; |
4217 | ||
4226 | ||
4218 | 4227 | //enable toggle status bar |
4219 | 4228 | if (action == @selector(toggleStatusBar:)) |
4220 | 4229 | { |
4224 | 4233 | |
4225 | 4234 | return [fWindow isVisible]; |
4226 | 4235 | } |
4227 | ||
4236 | ||
4228 | 4237 | //enable toggle filter bar |
4229 | 4238 | if (action == @selector(toggleFilterBar:)) |
4230 | 4239 | { |
4234 | 4243 | |
4235 | 4244 | return [fWindow isVisible]; |
4236 | 4245 | } |
4237 | ||
4246 | ||
4238 | 4247 | //enable prev/next filter button |
4239 | 4248 | if (action == @selector(switchFilter:)) |
4240 | 4249 | return [fWindow isVisible] && fFilterBar; |
4241 | ||
4250 | ||
4242 | 4251 | //enable reveal in finder |
4243 | 4252 | if (action == @selector(revealFile:)) |
4244 | 4253 | return canUseTable && [fTableView numberOfSelectedRows] > 0; |
4245 | ||
4254 | ||
4246 | 4255 | //enable renaming file/folder |
4247 | 4256 | if (action == @selector(renameSelected:)) |
4248 | 4257 | return canUseTable && [fTableView numberOfSelectedRows] == 1; |
4251 | 4260 | if (action == @selector(removeNoDelete:) || action == @selector(removeDeleteData:)) |
4252 | 4261 | { |
4253 | 4262 | BOOL warning = NO; |
4254 | ||
4263 | ||
4255 | 4264 | for (Torrent * torrent in [fTableView selectedTorrents]) |
4256 | 4265 | { |
4257 | 4266 | if ([torrent isActive]) |
4263 | 4272 | } |
4264 | 4273 | } |
4265 | 4274 | } |
4266 | ||
4275 | ||
4267 | 4276 | //append or remove ellipsis when needed |
4268 | 4277 | NSString * title = [menuItem title], * ellipsis = [NSString ellipsis]; |
4269 | 4278 | if (warning && [fDefaults boolForKey: @"CheckRemove"]) |
4276 | 4285 | if ([title hasSuffix: ellipsis]) |
4277 | 4286 | [menuItem setTitle: [title substringToIndex: [title rangeOfString: ellipsis].location]]; |
4278 | 4287 | } |
4279 | ||
4288 | ||
4280 | 4289 | return canUseTable && [fTableView numberOfSelectedRows] > 0; |
4281 | 4290 | } |
4282 | ||
4291 | ||
4283 | 4292 | //remove all completed transfers item |
4284 | 4293 | if (action == @selector(clearCompleted:)) |
4285 | 4294 | { |
4295 | 4304 | if ([title hasSuffix: ellipsis]) |
4296 | 4305 | [menuItem setTitle: [title substringToIndex: [title rangeOfString: ellipsis].location]]; |
4297 | 4306 | } |
4298 | ||
4307 | ||
4299 | 4308 | for (Torrent * torrent in fTorrents) |
4300 | 4309 | if ([torrent isFinishedSeeding]) |
4301 | 4310 | return YES; |
4310 | 4319 | return YES; |
4311 | 4320 | return NO; |
4312 | 4321 | } |
4313 | ||
4322 | ||
4314 | 4323 | //enable resume all item |
4315 | 4324 | if (action == @selector(resumeAllTorrents:)) |
4316 | 4325 | { |
4319 | 4328 | return YES; |
4320 | 4329 | return NO; |
4321 | 4330 | } |
4322 | ||
4331 | ||
4323 | 4332 | //enable resume all waiting item |
4324 | 4333 | if (action == @selector(resumeWaitingTorrents:)) |
4325 | 4334 | { |
4326 | 4335 | if (![fDefaults boolForKey: @"Queue"] && ![fDefaults boolForKey: @"QueueSeed"]) |
4327 | 4336 | return NO; |
4328 | ||
4337 | ||
4329 | 4338 | for (Torrent * torrent in fTorrents) |
4330 | 4339 | if ([torrent waitingToStart]) |
4331 | 4340 | return YES; |
4332 | 4341 | return NO; |
4333 | 4342 | } |
4334 | ||
4343 | ||
4335 | 4344 | //enable resume selected waiting item |
4336 | 4345 | if (action == @selector(resumeSelectedTorrentsNoWait:)) |
4337 | 4346 | { |
4338 | 4347 | if (!canUseTable) |
4339 | 4348 | return NO; |
4340 | ||
4349 | ||
4341 | 4350 | for (Torrent * torrent in [fTableView selectedTorrents]) |
4342 | 4351 | if (![torrent isActive]) |
4343 | 4352 | return YES; |
4349 | 4358 | { |
4350 | 4359 | if (!canUseTable) |
4351 | 4360 | return NO; |
4352 | ||
4361 | ||
4353 | 4362 | for (Torrent * torrent in [fTableView selectedTorrents]) |
4354 | 4363 | if ([torrent isActive] || [torrent waitingToStart]) |
4355 | 4364 | return YES; |
4356 | 4365 | return NO; |
4357 | 4366 | } |
4358 | ||
4367 | ||
4359 | 4368 | //enable resume item |
4360 | 4369 | if (action == @selector(resumeSelectedTorrents:)) |
4361 | 4370 | { |
4362 | 4371 | if (!canUseTable) |
4363 | 4372 | return NO; |
4364 | ||
4373 | ||
4365 | 4374 | for (Torrent * torrent in [fTableView selectedTorrents]) |
4366 | 4375 | if (![torrent isActive] && ![torrent waitingToStart]) |
4367 | 4376 | return YES; |
4368 | 4377 | return NO; |
4369 | 4378 | } |
4370 | ||
4379 | ||
4371 | 4380 | //enable manual announce item |
4372 | 4381 | if (action == @selector(announceSelectedTorrents:)) |
4373 | 4382 | { |
4374 | 4383 | if (!canUseTable) |
4375 | 4384 | return NO; |
4376 | ||
4385 | ||
4377 | 4386 | for (Torrent * torrent in [fTableView selectedTorrents]) |
4378 | 4387 | if ([torrent canManualAnnounce]) |
4379 | 4388 | return YES; |
4380 | 4389 | return NO; |
4381 | 4390 | } |
4382 | ||
4391 | ||
4383 | 4392 | //enable reset cache item |
4384 | 4393 | if (action == @selector(verifySelectedTorrents:)) |
4385 | 4394 | { |
4386 | 4395 | if (!canUseTable) |
4387 | 4396 | return NO; |
4388 | ||
4397 | ||
4389 | 4398 | for (Torrent * torrent in [fTableView selectedTorrents]) |
4390 | 4399 | if (![torrent isMagnet]) |
4391 | 4400 | return YES; |
4392 | 4401 | return NO; |
4393 | 4402 | } |
4394 | ||
4403 | ||
4395 | 4404 | //enable move torrent file item |
4396 | 4405 | if (action == @selector(moveDataFilesSelected:)) |
4397 | 4406 | return canUseTable && [fTableView numberOfSelectedRows] > 0; |
4398 | ||
4407 | ||
4399 | 4408 | //enable copy torrent file item |
4400 | 4409 | if (action == @selector(copyTorrentFiles:)) |
4401 | 4410 | { |
4402 | 4411 | if (!canUseTable) |
4403 | 4412 | return NO; |
4404 | ||
4413 | ||
4405 | 4414 | for (Torrent * torrent in [fTableView selectedTorrents]) |
4406 | 4415 | if (![torrent isMagnet]) |
4407 | 4416 | return YES; |
4408 | 4417 | return NO; |
4409 | 4418 | } |
4410 | ||
4419 | ||
4411 | 4420 | //enable copy torrent file item |
4412 | 4421 | if (action == @selector(copyMagnetLinks:)) |
4413 | 4422 | return canUseTable && [fTableView numberOfSelectedRows] > 0; |
4414 | ||
4423 | ||
4415 | 4424 | //enable reverse sort item |
4416 | 4425 | if (action == @selector(setSortReverse:)) |
4417 | 4426 | { |
4419 | 4428 | [menuItem setState: (isReverse == [fDefaults boolForKey: @"SortReverse"]) ? NSOnState : NSOffState]; |
4420 | 4429 | return ![[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER]; |
4421 | 4430 | } |
4422 | ||
4431 | ||
4423 | 4432 | //enable group sort item |
4424 | 4433 | if (action == @selector(setSortByGroup:)) |
4425 | 4434 | { |
4426 | 4435 | [menuItem setState: [fDefaults boolForKey: @"SortByGroup"] ? NSOnState : NSOffState]; |
4427 | 4436 | return YES; |
4428 | 4437 | } |
4429 | ||
4438 | ||
4430 | 4439 | if (action == @selector(toggleQuickLook:)) |
4431 | 4440 | { |
4432 | 4441 | const BOOL visible =[QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]; |
4434 | 4443 | NSString * title = !visible ? NSLocalizedString(@"Quick Look", "View menu -> Quick Look") |
4435 | 4444 | : NSLocalizedString(@"Close Quick Look", "View menu -> Quick Look"); |
4436 | 4445 | [menuItem setTitle: title]; |
4437 | ||
4446 | ||
4438 | 4447 | return YES; |
4439 | 4448 | } |
4440 | ||
4449 | ||
4441 | 4450 | return YES; |
4442 | 4451 | } |
4443 | 4452 | |
4455 | 4464 | anyActive = YES; |
4456 | 4465 | [torrent sleep]; //have to call on all, regardless if they are active |
4457 | 4466 | } |
4458 | ||
4467 | ||
4459 | 4468 | //if there are any running transfers, wait 15 seconds for them to stop |
4460 | 4469 | if (anyActive) |
4461 | 4470 | { |
4462 | 4471 | sleep(15); |
4463 | 4472 | } |
4464 | ||
4473 | ||
4465 | 4474 | IOAllowPowerChange(fRootPort, (long) messageArgument); |
4466 | 4475 | break; |
4467 | 4476 | } |
4477 | 4486 | return; |
4478 | 4487 | } |
4479 | 4488 | } |
4480 | ||
4489 | ||
4481 | 4490 | IOAllowPowerChange(fRootPort, (long) messageArgument); |
4482 | 4491 | break; |
4483 | 4492 | |
4493 | 4502 | { |
4494 | 4503 | if (fQuitting) |
4495 | 4504 | return nil; |
4496 | ||
4505 | ||
4497 | 4506 | NSUInteger seeding = 0, downloading = 0; |
4498 | 4507 | for (Torrent * torrent in fTorrents) |
4499 | 4508 | { |
4503 | 4512 | downloading++; |
4504 | 4513 | else; |
4505 | 4514 | } |
4506 | ||
4515 | ||
4507 | 4516 | NSMenu * menu = [[NSMenu alloc] init]; |
4508 | ||
4517 | ||
4509 | 4518 | if (seeding > 0) |
4510 | 4519 | { |
4511 | 4520 | NSString * title = [NSString stringWithFormat: NSLocalizedString(@"%d Seeding", "Dock item - Seeding"), seeding]; |
4512 | 4521 | [menu addItemWithTitle: title action: nil keyEquivalent: @""]; |
4513 | 4522 | } |
4514 | ||
4523 | ||
4515 | 4524 | if (downloading > 0) |
4516 | 4525 | { |
4517 | 4526 | NSString * title = [NSString stringWithFormat: NSLocalizedString(@"%d Downloading", "Dock item - Downloading"), downloading]; |
4518 | 4527 | [menu addItemWithTitle: title action: nil keyEquivalent: @""]; |
4519 | 4528 | } |
4520 | ||
4529 | ||
4521 | 4530 | if (seeding > 0 || downloading > 0) |
4522 | 4531 | [menu addItem: [NSMenuItem separatorItem]]; |
4523 | ||
4532 | ||
4524 | 4533 | [menu addItemWithTitle: NSLocalizedString(@"Pause All", "Dock item") action: @selector(stopAllTorrents:) keyEquivalent: @""]; |
4525 | 4534 | [menu addItemWithTitle: NSLocalizedString(@"Resume All", "Dock item") action: @selector(resumeAllTorrents:) keyEquivalent: @""]; |
4526 | 4535 | [menu addItem: [NSMenuItem separatorItem]]; |
4527 | 4536 | [menu addItemWithTitle: NSLocalizedString(@"Speed Limit", "Dock item") action: @selector(toggleSpeedLimit:) keyEquivalent: @""]; |
4528 | ||
4537 | ||
4529 | 4538 | return [menu autorelease]; |
4530 | 4539 | } |
4531 | 4540 | |
4533 | 4542 | { |
4534 | 4543 | //if auto size is enabled, the current frame shouldn't need to change |
4535 | 4544 | NSRect frame = [fDefaults boolForKey: @"AutoSize"] ? [window frame] : [self sizedWindowFrame]; |
4536 | ||
4545 | ||
4537 | 4546 | frame.size.width = [fDefaults boolForKey: @"SmallView"] ? [fWindow minSize].width : WINDOW_REGULAR_WIDTH; |
4538 | 4547 | return frame; |
4539 | 4548 | } |
4543 | 4552 | if ([fDefaults boolForKey: @"AutoSize"]) |
4544 | 4553 | { |
4545 | 4554 | NSScrollView * scrollView = [fTableView enclosingScrollView]; |
4546 | ||
4555 | ||
4547 | 4556 | [scrollView setHasVerticalScroller: NO]; |
4548 | 4557 | [fWindow setFrame: [self sizedWindowFrame] display: YES animate: YES]; |
4549 | 4558 | [scrollView setHasVerticalScroller: YES]; |
4550 | ||
4559 | ||
4551 | 4560 | [self setWindowMinMaxToCurrent]; |
4552 | 4561 | } |
4553 | 4562 | } |
4556 | 4565 | { |
4557 | 4566 | NSUInteger groups = ([fDisplayedTorrents count] > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrent class]]) |
4558 | 4567 | ? [fDisplayedTorrents count] : 0; |
4559 | ||
4568 | ||
4560 | 4569 | CGFloat heightChange = (GROUP_SEPARATOR_HEIGHT + [fTableView intercellSpacing].height) * groups |
4561 | 4570 | + ([fTableView rowHeight] + [fTableView intercellSpacing].height) * ([fTableView numberOfRows] - groups) |
4562 | 4571 | - NSHeight([[fTableView enclosingScrollView] frame]); |
4563 | ||
4572 | ||
4564 | 4573 | return [self windowFrameByAddingHeight: heightChange checkLimits: YES]; |
4565 | 4574 | } |
4566 | 4575 | |
4572 | 4581 | { |
4573 | 4582 | NSSize contentMinSize = [fWindow contentMinSize]; |
4574 | 4583 | contentMinSize.height = [self minWindowContentSizeAllowed]; |
4575 | ||
4584 | ||
4576 | 4585 | [fWindow setContentMinSize: contentMinSize]; |
4577 | ||
4586 | ||
4578 | 4587 | NSSize contentMaxSize = [fWindow contentMaxSize]; |
4579 | 4588 | contentMaxSize.height = FLT_MAX; |
4580 | 4589 | [fWindow setContentMaxSize: contentMaxSize]; |
4584 | 4593 | - (void) setWindowMinMaxToCurrent |
4585 | 4594 | { |
4586 | 4595 | const CGFloat height = NSHeight([[fWindow contentView] frame]); |
4587 | ||
4596 | ||
4588 | 4597 | NSSize minSize = [fWindow contentMinSize], |
4589 | 4598 | maxSize = [fWindow contentMaxSize]; |
4590 | 4599 | minSize.height = height; |
4591 | 4600 | maxSize.height = height; |
4592 | ||
4601 | ||
4593 | 4602 | [fWindow setContentMinSize: minSize]; |
4594 | 4603 | [fWindow setContentMaxSize: maxSize]; |
4595 | 4604 | } |
4641 | 4650 | [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: FORUM_URL]]; |
4642 | 4651 | } |
4643 | 4652 | |
4644 | - (void) linkTrac: (id) sender | |
4645 | { | |
4646 | [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: TRAC_URL]]; | |
4653 | - (void) linkGitHub: (id) sender | |
4654 | { | |
4655 | [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: GITHUB_URL]]; | |
4647 | 4656 | } |
4648 | 4657 | |
4649 | 4658 | - (void) linkDonate: (id) sender |
4659 | 4668 | - (NSDictionary *) registrationDictionaryForGrowl |
4660 | 4669 | { |
4661 | 4670 | NSArray * notifications = @[GROWL_DOWNLOAD_COMPLETE, GROWL_SEEDING_COMPLETE, GROWL_AUTO_ADD, GROWL_AUTO_SPEED_LIMIT]; |
4662 | ||
4671 | ||
4663 | 4672 | return @{GROWL_NOTIFICATIONS_ALL : notifications, |
4664 | 4673 | GROWL_NOTIFICATIONS_DEFAULT : notifications }; |
4665 | 4674 | } |
4668 | 4677 | { |
4669 | 4678 | if (![clickContext isKindOfClass: [NSDictionary class]]) |
4670 | 4679 | return; |
4671 | ||
4680 | ||
4672 | 4681 | NSString * type = [clickContext objectForKey: @"Type"], * location; |
4673 | 4682 | if (([type isEqualToString: GROWL_DOWNLOAD_COMPLETE] || [type isEqualToString: GROWL_SEEDING_COMPLETE]) |
4674 | 4683 | && (location = [clickContext objectForKey: @"Location"])) |
4693 | 4702 | *stop = YES; |
4694 | 4703 | } |
4695 | 4704 | }]; |
4696 | ||
4705 | ||
4697 | 4706 | if (!torrent) |
4698 | 4707 | { |
4699 | 4708 | NSLog(@"No torrent found matching the given torrent struct from the RPC callback!"); |
4700 | 4709 | return; |
4701 | 4710 | } |
4702 | 4711 | } |
4703 | ||
4712 | ||
4704 | 4713 | dispatch_async(dispatch_get_main_queue(), ^{ |
4705 | 4714 | switch (type) |
4706 | 4715 | { |
4707 | 4716 | case TR_RPC_TORRENT_ADDED: |
4708 | 4717 | [self rpcAddTorrentStruct: torrentStruct]; |
4709 | 4718 | break; |
4710 | ||
4719 | ||
4711 | 4720 | case TR_RPC_TORRENT_STARTED: |
4712 | 4721 | case TR_RPC_TORRENT_STOPPED: |
4713 | 4722 | [self rpcStartedStoppedTorrent: torrent]; |
4714 | 4723 | break; |
4715 | ||
4724 | ||
4716 | 4725 | case TR_RPC_TORRENT_REMOVING: |
4717 | 4726 | [self rpcRemoveTorrent: torrent deleteData: NO]; |
4718 | 4727 | break; |
4719 | ||
4728 | ||
4720 | 4729 | case TR_RPC_TORRENT_TRASHING: |
4721 | 4730 | [self rpcRemoveTorrent: torrent deleteData: YES]; |
4722 | 4731 | break; |
4723 | ||
4732 | ||
4724 | 4733 | case TR_RPC_TORRENT_CHANGED: |
4725 | 4734 | [self rpcChangedTorrent: torrent]; |
4726 | 4735 | break; |
4727 | ||
4736 | ||
4728 | 4737 | case TR_RPC_TORRENT_MOVED: |
4729 | 4738 | [self rpcMovedTorrent: torrent]; |
4730 | 4739 | break; |
4731 | ||
4740 | ||
4732 | 4741 | case TR_RPC_SESSION_QUEUE_POSITIONS_CHANGED: |
4733 | 4742 | [self rpcUpdateQueue]; |
4734 | 4743 | break; |
4735 | ||
4744 | ||
4736 | 4745 | case TR_RPC_SESSION_CHANGED: |
4737 | 4746 | [fPrefsController rpcUpdatePrefs]; |
4738 | 4747 | break; |
4739 | ||
4748 | ||
4740 | 4749 | case TR_RPC_SESSION_CLOSE: |
4741 | 4750 | fQuitRequested = YES; |
4742 | 4751 | [NSApp terminate: self]; |
4743 | 4752 | break; |
4744 | ||
4753 | ||
4745 | 4754 | default: |
4746 | 4755 | NSAssert1(NO, @"Unknown RPC command received: %d", type); |
4747 | 4756 | } |
4754 | 4763 | NSString * location = nil; |
4755 | 4764 | if (tr_torrentGetDownloadDir(torrentStruct) != NULL) |
4756 | 4765 | location = [NSString stringWithUTF8String: tr_torrentGetDownloadDir(torrentStruct)]; |
4757 | ||
4766 | ||
4758 | 4767 | Torrent * torrent = [[Torrent alloc] initWithTorrentStruct: torrentStruct location: location lib: fLib]; |
4759 | ||
4768 | ||
4760 | 4769 | //change the location if the group calls for it (this has to wait until after the torrent is created) |
4761 | 4770 | if ([[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]]) |
4762 | 4771 | { |
4763 | 4772 | location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]]; |
4764 | 4773 | [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic]; |
4765 | 4774 | } |
4766 | ||
4775 | ||
4767 | 4776 | [torrent update]; |
4768 | 4777 | [fTorrents addObject: torrent]; |
4769 | 4778 | [torrent release]; |
4770 | ||
4779 | ||
4771 | 4780 | if (!fAddingTransfers) |
4772 | 4781 | fAddingTransfers = [[NSMutableSet alloc] init]; |
4773 | 4782 | [fAddingTransfers addObject: torrent]; |
4774 | ||
4783 | ||
4775 | 4784 | [self fullUpdateUI]; |
4776 | 4785 | } |
4777 | 4786 | |
4783 | 4792 | - (void) rpcStartedStoppedTorrent: (Torrent *) torrent |
4784 | 4793 | { |
4785 | 4794 | [torrent update]; |
4786 | ||
4795 | ||
4787 | 4796 | [self updateUI]; |
4788 | 4797 | [self applyFilter]; |
4789 | 4798 | [self updateTorrentHistory]; |
4792 | 4801 | - (void) rpcChangedTorrent: (Torrent *) torrent |
4793 | 4802 | { |
4794 | 4803 | [torrent update]; |
4795 | ||
4804 | ||
4796 | 4805 | if ([[fTableView selectedTorrents] containsObject: torrent]) |
4797 | 4806 | { |
4798 | 4807 | [fInfoController updateInfoStats]; //this will reload the file table |
4804 | 4813 | { |
4805 | 4814 | [torrent update]; |
4806 | 4815 | [torrent updateTimeMachineExclude]; |
4807 | ||
4816 | ||
4808 | 4817 | if ([[fTableView selectedTorrents] containsObject: torrent]) |
4809 | 4818 | [fInfoController updateInfoStats]; |
4810 | 4819 | } |
4813 | 4822 | { |
4814 | 4823 | for (Torrent * torrent in fTorrents) |
4815 | 4824 | [torrent update]; |
4816 | ||
4825 | ||
4817 | 4826 | NSSortDescriptor * descriptor = [NSSortDescriptor sortDescriptorWithKey: @"queuePosition" ascending: YES]; |
4818 | 4827 | NSArray * descriptors = [NSArray arrayWithObject: descriptor]; |
4819 | 4828 | [fTorrents sortUsingDescriptors: descriptors]; |
4820 | ||
4829 | ||
4821 | 4830 | [self sortTorrents: YES]; |
4822 | 4831 | } |
4823 | 4832 |
0 | 0 | /****************************************************************************** |
1 | * $Id: CreatorWindowController.h 13323 2012-05-28 19:43:53Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: CreatorWindowController.m 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
6 | 6 | \f0\b\fs28 \cf0 The Transmission Project |
7 | 7 | \fs24 \ |
8 | 8 | \pard\tx440\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li100\slleading40\sb40\qc |
9 | {\field{\*\fldinst{HYPERLINK "http://www.transmissionbt.com/"}}{\fldrslt | |
10 | \b0 \cf0 http://www.transmissionbt.com/}}\ | |
9 | {\field{\*\fldinst{HYPERLINK "https://transmissionbt.com/"}}{\fldrslt | |
10 | \b0 \cf0 https://transmissionbt.com/}}\ | |
11 | 11 | \pard\tx440\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li100\slleading40\sb40 |
12 | 12 | \cf0 \ |
13 | 13 | Lead Developers |
137 | 137 | <false/> |
138 | 138 | <key>RPCPort</key> |
139 | 139 | <integer>9091</integer> |
140 | <key>RPCUseHostWhitelist</key> | |
141 | <true/> | |
140 | 142 | <key>RPCUsername</key> |
141 | 143 | <string>admin</string> |
142 | 144 | <key>RPCUseWhitelist</key> |
0 | 0 | /****************************************************************************** |
1 | * $Id: DragOverlayView.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: DragOverlayView.m 13599 2012-10-29 22:16:42Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: DragOverlayWindow.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: DragOverlayWindow.m 14290 2014-06-08 22:16:01Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ExpandedPathToIconTransformer.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ExpandedPathToIconTransformer.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ExpandedPathToPathTransformer.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ExpandedPathToPathTransformer.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FileListNode.h 14036 2013-02-19 01:29:25Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FileListNode.m 14036 2013-02-19 01:29:25Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FileNameCell.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FileNameCell.m 14665 2016-01-07 17:21:12Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FileOutlineController.h 13986 2013-02-08 13:02:16Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FileOutlineController.m 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FileOutlineView.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FileOutlineView.m 14665 2016-01-07 17:21:12Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FilePriorityCell.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FilePriorityCell.m 13340 2012-06-10 02:35:58Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FilterBarController.h 13414 2012-07-25 12:49:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FilterBarController.m 13414 2012-07-25 12:49:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FilterBarView.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FilterBarView.m 14340 2014-10-16 13:01:17Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FilterButton.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: FilterButton.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: GlobalOptionsPopoverViewController.h 14226 2014-01-19 01:29:38Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: GlobalOptionsPopoverViewController.m 14635 2015-12-27 01:48:27Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: GroupToolbarItem.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: GroupToolbarItem.m 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: GroupsController.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: GroupsController.m 13340 2012-06-10 02:35:58Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: GroupsPrefsController.h 14699 2016-03-02 07:55:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: GroupsPrefsController.m 14699 2016-03-02 07:55:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
27 | 27 | <key>CFBundleExecutable</key> |
28 | 28 | <string>Transmission</string> |
29 | 29 | <key>CFBundleGetInfoString</key> |
30 | <string>VERSION_STRING_INFOPLIST (SVN_REVISION_NUM)</string> | |
30 | <string>VERSION_STRING_INFOPLIST (VCS_REVISION_NUM)</string> | |
31 | 31 | <key>CFBundleHelpBookFolder</key> |
32 | 32 | <string>TransmissionHelp</string> |
33 | 33 | <key>CFBundleHelpBookName</key> |
58 | 58 | </dict> |
59 | 59 | </array> |
60 | 60 | <key>CFBundleVersion</key> |
61 | <string>SVN_REVISION_NUM</string> | |
61 | <string>VCS_REVISION_NUM</string> | |
62 | 62 | <key>LSApplicationCategoryType</key> |
63 | 63 | <string>public.app-category.utilities</string> |
64 | 64 | <key>LSMinimumSystemVersion</key> |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoActivityViewController.h 14051 2013-03-12 03:08:59Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoActivityViewController.m 14341 2014-10-17 05:12:00Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoFileViewController.h 13296 2012-05-14 00:00:19Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoFileViewController.m 14667 2016-01-08 10:05:19Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoGeneralViewController.h 13481 2012-09-08 20:22:05Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoGeneralViewController.m 14016 2013-02-11 01:39:44Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoOptionsViewController.h 13480 2012-09-08 18:09:02Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoOptionsViewController.m 14685 2016-02-27 20:29:57Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoPeersViewController.h 14706 2016-03-03 22:27:45Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoPeersViewController.m 14706 2016-03-03 22:27:45Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoTabButtonBack.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoTabButtonBack.m 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoTabButtonCell.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoTabButtonCell.m 14631 2015-12-22 00:45:09Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoTextField.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoTextField.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoTrackersViewController.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoTrackersViewController.m 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoViewController.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2010-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoWindowController.h 14685 2016-02-27 20:29:57Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: InfoWindowController.m 14685 2016-02-27 20:29:57Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
316 | 316 | prefix = @prefix@ |
317 | 317 | program_transform_name = @program_transform_name@ |
318 | 318 | psdir = @psdir@ |
319 | runstatedir = @runstatedir@ | |
319 | 320 | sbindir = @sbindir@ |
320 | 321 | sharedstatedir = @sharedstatedir@ |
321 | 322 | srcdir = @srcdir@ |
0 | 0 | /****************************************************************************** |
1 | * $Id: MessageWindowController.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: MessageWindowController.m 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: NSApplicationAdditions.h 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: NSApplicationAdditions.m 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: NSImageAdditions.h 14226 2014-01-19 01:29:38Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: NSImageAdditions.m 14226 2014-01-19 01:29:38Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: NSMutableArrayAdditions.h 14226 2014-01-19 01:29:38Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: NSMutableArrayAdditions.m 14226 2014-01-19 01:29:38Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: NSStringAdditions.h 14341 2014-10-17 05:12:00Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: NSStringAdditions.m 14341 2014-10-17 05:12:00Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PeerProgressIndicatorCell.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PeerProgressIndicatorCell.m 13340 2012-06-10 02:35:58Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PeerTableView.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PeerTableView.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PiecesView.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PiecesView.m 14050 2013-03-12 02:56:35Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PortChecker.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PortChecker.m 13492 2012-09-10 02:37:29Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PredicateEditorRowTemplateAny.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PredicateEditorRowTemplateAny.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PrefsController.h 14161 2013-08-10 02:29:12Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PrefsController.m 14667 2016-01-08 10:05:19Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PrefsWindow.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: PrefsWindow.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ProgressGradients.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ProgressGradients.m 13253 2012-03-13 03:20:09Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: StatsWindowController.h 13318 2012-05-27 22:31:58Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: StatsWindowController.m 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: StatusBarController.h 13343 2012-06-10 13:47:32Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: StatusBarController.m 13434 2012-08-13 00:52:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: StatusBarView.h 13454 2012-08-30 02:37:00Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: StatusBarView.m 14662 2016-01-06 11:05:37Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ToolbarSegmentedCell.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: ToolbarSegmentedCell.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2007-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: Torrent.h 14587 2015-10-23 04:09:40Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: Torrent.m 14667 2016-01-08 10:05:19Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TorrentCell.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TorrentCell.m 14665 2016-01-07 17:21:12Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2006-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TorrentGroup.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TorrentGroup.m 13434 2012-08-13 00:52:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TorrentTableView.h 14705 2016-03-03 17:57:08Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TorrentTableView.m 14705 2016-03-03 17:57:08Z mikedld $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TrackerCell.h 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TrackerCell.m 13434 2012-08-13 00:52:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TrackerNode.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TrackerNode.m 14341 2014-10-17 05:12:00Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2009-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TrackerTableView.h 13251 2012-03-13 02:52:11Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: TrackerTableView.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2008-2012 Transmission authors and contributors |
4 | 4 | * |
36 | 36 | <div id="pagetitle"> |
37 | 37 | <h1>Transmission crashed, what should I do? </h1> |
38 | 38 | </div> |
39 | <p>Post the crash log on the <a href="http://forum.transmissionbt.com/viewforum.php?f=2">support forums</a> so that the issue can be fixed as quickly as possible. Crash logs are held in <i>~/Library/Logs/CrashReporter/</i>. | |
39 | <p>Post the crash log on the <a href="https://forum.transmissionbt.com/viewforum.php?f=4">support forums</a> so that the issue can be fixed as quickly as possible. Crash logs are held in <i>~/Library/Logs/CrashReporter/</i>. | |
40 | 40 | <p>If your torrents' progress are incorrect when you reopen Transmission (e.g. they are starting from 0%) then you should manually recheck them. <a href="check.html">Click here</a> for instructions. |
41 | 41 | <p> |
42 | 42 | <div id="pagetitle"> |
83 | 83 | <div id="pagetitle"> |
84 | 84 | <h1>What are 'nightlies'?</h1> |
85 | 85 | </div> |
86 | <p>Nightlies are releases on the bleeding edge of development. They normally contain new features and bugfixes, but are not officially supported (although you are more than welcome to discuss them on the <a href="http://forum.transmissionbt.com">Transmission forums</a>). You can try one out <a href="http://build.transmissionbt.com/job/trunk-mac/">here</a>. | |
86 | <p>Nightlies are releases on the bleeding edge of development. They normally contain new features and bugfixes, but are not officially supported (although you are more than welcome to discuss them on the <a href="https://forum.transmissionbt.com">Transmission forums</a>). You can try one out <a href="https://build.transmissionbt.com/job/trunk-mac/">here</a>. | |
87 | 87 | </div> |
88 | 88 | </body> |
89 | 89 |
32 | 32 | </ul> |
33 | 33 | </div> |
34 | 34 | |
35 | <p>More information is available on <a href="http://trac.transmissionbt.com/wiki/Scripts">the Transmission wiki</a>. | |
35 | <p>More information is available on <a href="https://trac.transmissionbt.com/wiki/Scripts">the Transmission wiki</a>. | |
36 | 36 | </div> |
37 | 37 | </body> |
38 | 38 |
22 | 22 | <p>If your port is still not open, even after you have enabled automatic port forwarding, here are some tips you can use which may get it working. |
23 | 23 | |
24 | 24 | <div summary="To do this" id="taskbox"> |
25 | <p>If you are still having problems, open the Message Log (in the Window menu) and post the debug output on the <a href="http://transmission.m0k.org/forum/viewforum.php?f=2">support forums</a>. | |
25 | <p>If you are still having problems, open the Message Log (in the Window menu) and post the debug output on the <a href="https://forum.transmissionbt.com/viewforum.php?f=4">support forums</a>. | |
26 | 26 | <ol> |
27 | 27 | <li>Pause your torrents</li> |
28 | 28 | <li>Clear the log and set it to 'Debug'</li> |
14 | 14 | <IMG SRC="gfx/TransWindow.png" height="auto" width="225" ALT="Image of Transmission window" BORDER="0"> |
15 | 15 | <h1><img class="icon" src="gfx/TransmissionIcon.png" alt="Transmission icon" height="32" width="32" border="0"> Transmission Help</h1> |
16 | 16 | |
17 | <h4><a href="http://www.transmissionbt.com/">www.transmissionbt.com</a></h4> | |
17 | <h4><a href="https://transmissionbt.com/">transmissionbt.com</a></h4> | |
18 | 18 | </center> |
19 | 19 | </div> |
20 | 20 | <div id="contentcenter"></div> |
32 | 32 | <p><a href="html/Index2.html">Look up topics easily</a></p> |
33 | 33 | |
34 | 34 | <h2>More Information</h2> |
35 | <p><a href="http://forum.transmissionbt.com/">Transmission Forums</a></p> | |
36 | <p><a href="http://trac.transmissionbt.com/">Trac - Wiki and Development</a></p> | |
35 | <p><a href="https://forum.transmissionbt.com/">Transmission Forums</a></p> | |
36 | <p><a href="https://github.com/transmission/transmission">GitHub - Wiki and Development</a></p> | |
37 | 37 | |
38 | 38 | </div> |
39 | 39 | </div> |
0 | 0 | /****************************************************************************** |
1 | * $Id: URLSheetWindowController.h 13254 2012-03-13 03:39:56Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: URLSheetWindowController.m 13254 2012-03-13 03:39:56Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2011-2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: WebSeedTableView.h 14226 2014-01-19 01:29:38Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2012 Transmission authors and contributors |
4 | 4 | * |
0 | 0 | /****************************************************************************** |
1 | * $Id: WebSeedTableView.m 14226 2014-01-19 01:29:38Z jordan $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2012 Transmission authors and contributors |
4 | 4 | * |
695 | 695 | </menuItem> |
696 | 696 | <menuItem title="Support og udvikling" id="3170"> |
697 | 697 | <connections> |
698 | <action selector="linkTrac:" target="206" id="3171"/> | |
698 | <action selector="linkGitHub:" target="206" id="3171"/> | |
699 | 699 | </connections> |
700 | 700 | </menuItem> |
701 | 701 | </items> |
696 | 696 | </menuItem> |
697 | 697 | <menuItem title="Support und Entwicklung" id="3170"> |
698 | 698 | <connections> |
699 | <action selector="linkTrac:" target="206" id="3171"/> | |
699 | <action selector="linkGitHub:" target="206" id="3171"/> | |
700 | 700 | </connections> |
701 | 701 | </menuItem> |
702 | 702 | </items> |
695 | 695 | </menuItem> |
696 | 696 | <menuItem title="Support & Development" id="3170"> |
697 | 697 | <connections> |
698 | <action selector="linkTrac:" target="206" id="3171"/> | |
698 | <action selector="linkGitHub:" target="206" id="3171"/> | |
699 | 699 | </connections> |
700 | 700 | </menuItem> |
701 | 701 | </items> |
695 | 695 | </menuItem> |
696 | 696 | <menuItem title="Wiki y Desarrollo de Transmission" id="3170"> |
697 | 697 | <connections> |
698 | <action selector="linkTrac:" target="206" id="3171"/> | |
698 | <action selector="linkGitHub:" target="206" id="3171"/> | |
699 | 699 | </connections> |
700 | 700 | </menuItem> |
701 | 701 | </items> |
694 | 694 | </menuItem> |
695 | 695 | <menuItem title="Support & Développement" id="3170"> |
696 | 696 | <connections> |
697 | <action selector="linkTrac:" target="206" id="3171"/> | |
697 | <action selector="linkGitHub:" target="206" id="3171"/> | |
698 | 698 | </connections> |
699 | 699 | </menuItem> |
700 | 700 | </items> |
695 | 695 | </menuItem> |
696 | 696 | <menuItem title="Supporto & sviluppo" id="3170"> |
697 | 697 | <connections> |
698 | <action selector="linkTrac:" target="206" id="3171"/> | |
698 | <action selector="linkGitHub:" target="206" id="3171"/> | |
699 | 699 | </connections> |
700 | 700 | </menuItem> |
701 | 701 | </items> |
0 | 0 | /****************************************************************************** |
1 | * $Id: main.m 13162 2012-01-14 17:12:04Z livings124 $ | |
1 | * $Id$ | |
2 | 2 | * |
3 | 3 | * Copyright (c) 2005-2012 Transmission authors and contributors |
4 | 4 | * |
694 | 694 | </menuItem> |
695 | 695 | <menuItem title="Support & ontwikkeling " id="3170"> |
696 | 696 | <connections> |
697 | <action selector="linkTrac:" target="206" id="3171"/> | |
697 | <action selector="linkGitHub:" target="206" id="3171"/> | |
698 | 698 | </connections> |
699 | 699 | </menuItem> |
700 | 700 | </items> |
695 | 695 | </menuItem> |
696 | 696 | <menuItem title="Suporte e desenvolvimento" id="3170"> |
697 | 697 | <connections> |
698 | <action selector="linkTrac:" target="206" id="3171"/> | |
698 | <action selector="linkGitHub:" target="206" id="3171"/> | |
699 | 699 | </connections> |
700 | 700 | </menuItem> |
701 | 701 | </items> |
695 | 695 | </menuItem> |
696 | 696 | <menuItem title="Transmission wiki и разработка" id="3170"> |
697 | 697 | <connections> |
698 | <action selector="linkTrac:" target="206" id="3171"/> | |
698 | <action selector="linkGitHub:" target="206" id="3171"/> | |
699 | 699 | </connections> |
700 | 700 | </menuItem> |
701 | 701 | </items> |
695 | 695 | </menuItem> |
696 | 696 | <menuItem title="Destek ve GeliÅŸtirme" id="3170"> |
697 | 697 | <connections> |
698 | <action selector="linkTrac:" target="206" id="3171"/> | |
698 | <action selector="linkGitHub:" target="206" id="3171"/> | |
699 | 699 | </connections> |
700 | 700 | </menuItem> |
701 | 701 | </items> |
0 | # $Id: bg.po 14101 2013-06-26 02:22:32Z jordan $ | |
0 | # $Id$ | |
1 | 1 | # |
2 | 2 | # Bulgarian translation of Transmission. |
3 | 3 | # This file is distributed under the same license as the Transmission package. |
0 | # $Id: fr.po 14101 2013-06-26 02:22:32Z jordan $ | |
0 | # $Id$ | |
1 | 1 | # French translation of Transmission. |
2 | 2 | # Copyright (C) 2005-2008 The Free Software Foundation, Inc. |
3 | 3 | # This file is distributed under the same license as the Transmission package. |
0 | # $Id: gl.po 14101 2013-06-26 02:22:32Z jordan $ | |
0 | # $Id$ | |
1 | 1 | # |
2 | 2 | # Galician translation of Transmission |
3 | 3 | # This file is distributed under the same license as the transmission package. |
0 | # $Id: ro.po 14101 2013-06-26 02:22:32Z jordan $ | |
0 | # $Id$ | |
1 | 1 | # SOME DESCRIPTIVE TITLE. |
2 | 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
3 | 3 | # This file is distributed under the same license as the PACKAGE package. |
0 | # $Id: ru.po 14101 2013-06-26 02:22:32Z jordan $ | |
0 | # $Id$ | |
1 | 1 | # |
2 | 2 | # Russian translation of Transmission. |
3 | 3 | # This file is distributed under the same license as the Transmission package. |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: AboutDialog.cc 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QApplication> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: AboutDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_ABOUT_DIALOG_H |
56 | 56 | <item> |
57 | 57 | <widget class="QLabel" name="linkLabel"> |
58 | 58 | <property name="text"> |
59 | <string notr="true"><a href="http://www.transmissionbt.com/">http://www.transmissionbt.com/</a></string> | |
59 | <string notr="true"><a href="https://transmissionbt.com/">https://transmissionbt.com/</a></string> | |
60 | 60 | </property> |
61 | 61 | <property name="alignment"> |
62 | 62 | <set>Qt::AlignCenter</set> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: AddData.cc 14609 2015-12-06 17:39:18Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QFile> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: AddData.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_ADD_DATA_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Application.cc 14624 2015-12-16 20:01:03Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <ctime> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Application.h 14600 2015-11-15 11:03:27Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_APPLICATION_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: BaseDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_BASE_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: ColumnResizer.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QEvent> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: ColumnResizer.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_COLUMN_RESIZER_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: ComInteropHelper.cc 14624 2015-12-16 20:01:03Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <windows.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: ComInteropHelper.h 14624 2015-12-16 20:01:03Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_COM_INTEROP_HELPER_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: CustomVariantType.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TYPES_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: DBusInteropHelper.cc 14698 2016-02-29 14:16:55Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <iostream> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: DBusInteropHelper.h 14621 2015-12-16 17:57:05Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_DBUS_INTEROP_HELPER_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: DetailsDialog.cc 14611 2015-12-06 21:07:37Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <cassert> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: DetailsDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_DETAILS_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FaviconCache.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QDir> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FaviconCache.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FAVICON_CACHE_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FileTreeDelegate.cc 14609 2015-12-06 17:39:18Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QApplication> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FileTreeDelegate.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILE_TREE_DELEGATE_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FileTreeItem.cc 14609 2015-12-06 17:39:18Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <algorithm> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FileTreeItem.h 14557 2015-08-10 19:40:58Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILE_TREE_ITEM_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FileTreeModel.cc 14609 2015-12-06 17:39:18Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <cassert> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FileTreeModel.h 14559 2015-08-16 22:07:09Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILE_TREE_MODEL_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FileTreeView.cc 14559 2015-08-16 22:07:09Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <algorithm> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FileTreeView.h 14559 2015-08-16 22:07:09Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILE_TREE_VIEW_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FilterBar.cc 14590 2015-10-24 20:56:45Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QHBoxLayout> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FilterBar.h 14590 2015-10-24 20:56:45Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILTER_BAR_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FilterBarComboBox.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QApplication> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FilterBarComboBox.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILTER_BAR_COMBO_BOX_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FilterBarComboBoxDelegate.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QAbstractItemView> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FilterBarComboBoxDelegate.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILTER_BAR_COMBO_BOX_DELEGATE_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FilterBarLineEdit.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QToolButton> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FilterBarLineEdit.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILTER_BAR_LINE_EDIT_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Filters.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "Filters.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Filters.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FILTERS_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Formatter.cc 14554 2015-07-30 06:55:28Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <libtransmission/transmission.h> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Formatter.h 14540 2015-06-12 22:41:36Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FORMATTER_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FreeSpaceLabel.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QDir> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: FreeSpaceLabel.h 14540 2015-06-12 22:41:36Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_FREE_SPACE_LABEL_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: IconToolButton.cc 14547 2015-06-28 14:18:06Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QStyle> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: IconToolButton.h 14547 2015-06-28 14:18:06Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_ICON_TOOL_BUTTON_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: InteropHelper.cc 14624 2015-12-16 20:01:03Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QVariant> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: InteropHelper.h 14624 2015-12-16 20:01:03Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_INTEROP_HELPER_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: InteropObject.cc 14621 2015-12-16 17:57:05Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "AddData.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: InteropObject.h 14624 2015-12-16 20:01:03Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_INTEROP_OBJECT_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: LicenseDialog.cc 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "LicenseDialog.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: LicenseDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_LICENSE_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: MainWindow.cc 14599 2015-11-14 14:22:57Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <cassert> |
622 | 622 | void |
623 | 623 | MainWindow::openDonate () |
624 | 624 | { |
625 | QDesktopServices::openUrl (QUrl (QLatin1String ("http://www.transmissionbt.com/donate.php"))); | |
625 | QDesktopServices::openUrl (QUrl (QLatin1String ("https://transmissionbt.com/donate/"))); | |
626 | 626 | } |
627 | 627 | |
628 | 628 | void |
634 | 634 | void |
635 | 635 | MainWindow::openHelp () |
636 | 636 | { |
637 | QDesktopServices::openUrl (QUrl (QString::fromLatin1 ("http://www.transmissionbt.com/help/gtk/%1.%2x"). | |
637 | QDesktopServices::openUrl (QUrl (QString::fromLatin1 ("https://transmissionbt.com/help/gtk/%1.%2x"). | |
638 | 638 | arg (MAJOR_VERSION).arg (MINOR_VERSION / 10))); |
639 | 639 | } |
640 | 640 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: MainWindow.h 14582 2015-10-19 20:30:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_MAIN_WINDOW_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: MakeDialog.cc 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QDir> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: MakeDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_MAKE_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: OptionsDialog.cc 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QFileInfo> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: OptionsDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_OPTIONS_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: PathButton.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QApplication> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: PathButton.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_PATH_BUTTON_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Prefs.cc 14554 2015-07-30 06:55:28Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <cassert> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Prefs.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_PREFS_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: PrefsDialog.cc 14607 2015-12-06 17:27:21Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifdef _WIN32 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: PrefsDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_PREFS_DIALOG_H |
0 | 0 | VOLUNTEERS WANTED |
1 | 1 | |
2 | 2 | - Qt developers and translators are needed |
3 | - If you find a bug, please report it at http://trac.transmissionbt.com/ | |
3 | - If you find a bug, please report it at https://github.com/transmission/transmission | |
4 | 4 | |
5 | 5 | ABOUT TRANSMISSION-QT |
6 | 6 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: RelocateDialog.cc 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QDir> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: RelocateDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_RELOCATE_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: RpcClient.cc 14634 2015-12-25 11:34:35Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <iostream> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: RpcClient.h 14608 2015-12-06 17:28:54Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_RPC_CLIENT_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Session.cc 14581 2015-10-18 18:39:14Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <cassert> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Session.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_SESSION_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: SessionDialog.cc 14562 2015-09-01 20:39:34Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "Prefs.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: SessionDialog.h 14562 2015-09-01 20:39:34Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_SESSION_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Speed.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_SPEED_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: StatsDialog.cc 14562 2015-09-01 20:39:34Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QTimer> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: StatsDialog.h 14561 2015-09-01 20:19:26Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_STATS_DIALOG_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Torrent.cc 14610 2015-12-06 18:02:37Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <cassert> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Torrent.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TORRENT_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentDelegate.cc 14555 2015-08-01 16:05:02Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QApplication> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentDelegate.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TORRENT_DELEGATE_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentDelegateMin.cc 14554 2015-07-30 06:55:28Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QApplication> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentDelegateMin.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TORRENT_DELEGATE_MIN_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentFilter.cc 14554 2015-07-30 06:55:28Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <algorithm> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentFilter.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TORRENT_FILTER_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentModel.cc 14554 2015-07-30 06:55:28Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <iostream> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentModel.h 14540 2015-06-12 22:41:36Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TORRENT_MODEL_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentView.cc 14590 2015-10-24 20:56:45Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QApplication> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TorrentView.h 14590 2015-10-24 20:56:45Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TORRENT_VIEW_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TrackerDelegate.cc 14633 2015-12-25 10:19:50Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <QAbstractTextDocumentLayout> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TrackerDelegate.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TRACKER_DELEGATE_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TrackerModel.cc 14556 2015-08-06 20:28:44Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <algorithm> // std::sort() |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TrackerModel.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TRACKER_MODEL_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TrackerModelFilter.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include "TrackerModel.h" |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: TrackerModelFilter.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_TRACKER_MODEL_FILTER_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Utils.cc 14564 2015-09-27 20:23:03Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifdef _WIN32 |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: Utils.h 14554 2015-07-30 06:55:28Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_UTILS_H |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: WatchDir.cc 14537 2015-06-10 21:27:11Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <iostream> |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: WatchDir.h 14539 2015-06-12 22:12:12Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #ifndef QTR_WATCH_DIR_H |
0 | 0 | DHT_LIBS = $${TRANSMISSION_TOP}/third-party/dht/libdht.a |
1 | 1 | LIBB64_LIBS = $${TRANSMISSION_TOP}/third-party/libb64/libb64.a |
2 | 2 | LIBUTP_LIBS = $${TRANSMISSION_TOP}/third-party/libutp/libutp.a -lrt |
3 | LIBUPNP_LIBS = -lminiupnpc | |
3 | LIBUPNP_LIBS = $${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a | |
4 | 4 | LIBNATPMP_LIBS = $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a |
22 | 22 | Show help options |
23 | 23 | .It Fl g, Fl -config-dir Ar directory |
24 | 24 | Where to look for configuration files. This can be used to swap between using the cli, daemon, gtk, and qt clients. |
25 | See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. | |
25 | See https://github.com/transmission/transmission/wiki/Configuration-Files for more information. | |
26 | 26 | .It Fl m Fl -minimized |
27 | 27 | Start minimized in notification area |
28 | 28 | .It Fl p, Fl -port Ar port |
73 | 73 | .Xr transmission-remote 1 , |
74 | 74 | .Xr transmission-show 1 |
75 | 75 | .Pp |
76 | http://www.transmissionbt.com/ | |
76 | https://transmissionbt.com/ |
376 | 376 | prefix = @prefix@ |
377 | 377 | program_transform_name = @program_transform_name@ |
378 | 378 | psdir = @psdir@ |
379 | runstatedir = @runstatedir@ | |
379 | 380 | sbindir = @sbindir@ |
380 | 381 | sharedstatedir = @sharedstatedir@ |
381 | 382 | srcdir = @srcdir@ |
374 | 374 | prefix = @prefix@ |
375 | 375 | program_transform_name = @program_transform_name@ |
376 | 376 | psdir = @psdir@ |
377 | runstatedir = @runstatedir@ | |
377 | 378 | sbindir = @sbindir@ |
378 | 379 | sharedstatedir = @sharedstatedir@ |
379 | 380 | srcdir = @srcdir@ |
375 | 375 | prefix = @prefix@ |
376 | 376 | program_transform_name = @program_transform_name@ |
377 | 377 | psdir = @psdir@ |
378 | runstatedir = @runstatedir@ | |
378 | 379 | sbindir = @sbindir@ |
379 | 380 | sharedstatedir = @sharedstatedir@ |
380 | 381 | srcdir = @srcdir@ |
375 | 375 | prefix = @prefix@ |
376 | 376 | program_transform_name = @program_transform_name@ |
377 | 377 | psdir = @psdir@ |
378 | runstatedir = @runstatedir@ | |
378 | 379 | sbindir = @sbindir@ |
379 | 380 | sharedstatedir = @sharedstatedir@ |
380 | 381 | srcdir = @srcdir@ |
374 | 374 | prefix = @prefix@ |
375 | 375 | program_transform_name = @program_transform_name@ |
376 | 376 | psdir = @psdir@ |
377 | runstatedir = @runstatedir@ | |
377 | 378 | sbindir = @sbindir@ |
378 | 379 | sharedstatedir = @sharedstatedir@ |
379 | 380 | srcdir = @srcdir@ |
379 | 379 | prefix = @prefix@ |
380 | 380 | program_transform_name = @program_transform_name@ |
381 | 381 | psdir = @psdir@ |
382 | runstatedir = @runstatedir@ | |
382 | 383 | sbindir = @sbindir@ |
383 | 384 | sharedstatedir = @sharedstatedir@ |
384 | 385 | srcdir = @srcdir@ |
7 | 7 | Release: %{release} |
8 | 8 | License: MIT |
9 | 9 | Group: Applications/Internet |
10 | URL: http://www.transmissionbt.com/ | |
10 | URL: https://transmissionbt.com/ | |
11 | 11 | Epoch: 1 |
12 | 12 | Source0: %{name}-%{version}.tar.bz2 |
13 | 13 |
19 | 19 | major_version=`echo ${user_agent_prefix} | awk -F . '{print $1}'` |
20 | 20 | minor_version=`echo ${user_agent_prefix} | awk -F . '{print $2 + 0}'` |
21 | 21 | |
22 | svn_revision_file=REVISION | |
23 | svn_revision_reliable=true | |
22 | vcs_revision= | |
23 | vcs_revision_file=REVISION | |
24 | 24 | |
25 | if [ -n "$JENKINS_URL" -a -n "$SVN_REVISION" ]; then | |
26 | # Jenkins automated build, use the set environment variables to avoid | |
27 | # version mismatches between java's svn and command line's svn | |
28 | svn_revision=$SVN_REVISION | |
29 | elif [ -d ".svn" ] && type svnversion >/dev/null 2>&1; then | |
30 | # If this is a svn tree, and svnversion is available in PATH, use it to | |
31 | # grab the version. | |
32 | svn_revision=`svnversion -n . | cut -d: -f1 | cut -dM -f1 | cut -dS -f1` | |
33 | elif [ -f "$svn_revision_file" ]; then | |
34 | svn_revision=`cat "$svn_revision_file"` | |
35 | else | |
36 | # Give up and check the source files | |
37 | svn_revision=`awk '/\\$Id: /{ if ($4>i) i=$4 } END {print i}' */*.cc */*.[chm] */*.po` | |
38 | svn_revision_reliable=false | |
25 | if [ -n "$JENKINS_URL" -a -n "$GIT_COMMIT" ]; then | |
26 | vcs_revision=$GIT_COMMIT | |
27 | elif [ -n "$TEAMCITY_PROJECT_NAME" -a -n "$BUILD_VCS_NUMBER" ]; then | |
28 | vcs_revision=$BUILD_VCS_NUMBER | |
29 | elif [ -d ".git" ] && type git >/dev/null 2>&1; then | |
30 | vcs_revision=`git rev-list --max-count=1 HEAD` | |
31 | elif [ -f "$vcs_revision_file" ]; then | |
32 | vcs_revision=`cat "$vcs_revision_file"` | |
39 | 33 | fi |
40 | 34 | |
41 | if $svn_revision_reliable; then | |
42 | [ -f "$svn_revision_file" ] && [ "`cat "$svn_revision_file"`" -eq "$svn_revision" ] || echo "$svn_revision" > "$svn_revision_file" | |
35 | vcs_revision=`echo $vcs_revision` | |
36 | ||
37 | if [ -n "$vcs_revision" ]; then | |
38 | [ -f "$vcs_revision_file" ] && [ "`cat "$vcs_revision_file"`" = "$vcs_revision" ] || echo "$vcs_revision" > "$vcs_revision_file" | |
43 | 39 | else |
44 | rm -f "$svn_revision_file" | |
40 | vcs_revision=0 | |
41 | rm -f "$vcs_revision_file" | |
45 | 42 | fi |
46 | 43 | |
44 | vcs_revision=`echo ${vcs_revision} | head -c10` | |
45 | ||
47 | 46 | cat > libtransmission/version.h.new << EOF |
47 | #pragma once | |
48 | ||
48 | 49 | #define PEERID_PREFIX "${peer_id_prefix}" |
49 | 50 | #define USERAGENT_PREFIX "${user_agent_prefix}" |
50 | #define SVN_REVISION "${svn_revision}" | |
51 | #define SVN_REVISION_NUM ${svn_revision} | |
51 | #define VCS_REVISION "${vcs_revision}" | |
52 | #define VCS_REVISION_NUM ${vcs_revision} | |
52 | 53 | #define SHORT_VERSION_STRING "${user_agent_prefix}" |
53 | #define LONG_VERSION_STRING "${user_agent_prefix} (${svn_revision})" | |
54 | #define LONG_VERSION_STRING "${user_agent_prefix} (${vcs_revision})" | |
54 | 55 | #define VERSION_STRING_INFOPLIST ${user_agent_prefix} |
55 | 56 | #define MAJOR_VERSION ${major_version} |
56 | 57 | #define MINOR_VERSION ${minor_version} |
416 | 416 | prefix = @prefix@ |
417 | 417 | program_transform_name = @program_transform_name@ |
418 | 418 | psdir = @psdir@ |
419 | runstatedir = @runstatedir@ | |
419 | 420 | sbindir = @sbindir@ |
420 | 421 | sharedstatedir = @sharedstatedir@ |
421 | 422 | srcdir = @srcdir@ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: create.c 14615 2015-12-06 22:39:14Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <stdio.h> /* fprintf() */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: edit.c 14644 2015-12-29 19:37:31Z mikedld $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <stdio.h> /* fprintf () */ |
3 | 3 | * It may be used under the GNU GPL versions 2 or 3 |
4 | 4 | * or any future license endorsed by Mnemosyne LLC. |
5 | 5 | * |
6 | * $Id: show.c 14615 2015-12-06 22:39:14Z jordan $ | |
6 | * $Id$ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <stdio.h> /* fprintf () */ |
48 | 48 | .Xr transmission-remote 1 , |
49 | 49 | .Xr transmission-show 1 |
50 | 50 | .Pp |
51 | http://www.transmissionbt.com/ | |
51 | https://transmissionbt.com/ |
43 | 43 | .Xr transmission-remote 1 , |
44 | 44 | .Xr transmission-show 1 |
45 | 45 | .Pp |
46 | http://www.transmissionbt.com/ | |
46 | https://transmissionbt.com/ |
35 | 35 | .Xr transmission-remote 1 , |
36 | 36 | .Xr transmission-show 1 |
37 | 37 | .Pp |
38 | http://www.transmissionbt.com/ | |
38 | https://transmissionbt.com/ |
407 | 407 | prefix = @prefix@ |
408 | 408 | program_transform_name = @program_transform_name@ |
409 | 409 | psdir = @psdir@ |
410 | runstatedir = @runstatedir@ | |
410 | 411 | sbindir = @sbindir@ |
411 | 412 | sharedstatedir = @sharedstatedir@ |
412 | 413 | srcdir = @srcdir@ |
347 | 347 | prefix = @prefix@ |
348 | 348 | program_transform_name = @program_transform_name@ |
349 | 349 | psdir = @psdir@ |
350 | runstatedir = @runstatedir@ | |
350 | 351 | sbindir = @sbindir@ |
351 | 352 | sharedstatedir = @sharedstatedir@ |
352 | 353 | srcdir = @srcdir@ |
407 | 407 | prefix = @prefix@ |
408 | 408 | program_transform_name = @program_transform_name@ |
409 | 409 | psdir = @psdir@ |
410 | runstatedir = @runstatedir@ | |
410 | 411 | sbindir = @sbindir@ |
411 | 412 | sharedstatedir = @sharedstatedir@ |
412 | 413 | srcdir = @srcdir@ |
347 | 347 | prefix = @prefix@ |
348 | 348 | program_transform_name = @program_transform_name@ |
349 | 349 | psdir = @psdir@ |
350 | runstatedir = @runstatedir@ | |
350 | 351 | sbindir = @sbindir@ |
351 | 352 | sharedstatedir = @sharedstatedir@ |
352 | 353 | srcdir = @srcdir@ |
698 | 698 | break; |
699 | 699 | |
700 | 700 | case 'homepage': |
701 | window.open('http://www.transmissionbt.com/'); | |
701 | window.open('https://transmissionbt.com/'); | |
702 | 702 | break; |
703 | 703 | |
704 | 704 | case 'tipjar': |
705 | window.open('http://www.transmissionbt.com/donate.php'); | |
705 | window.open('https://transmissionbt.com/donate/'); | |
706 | 706 | break; |
707 | 707 | |
708 | 708 | case 'unlimited_download_rate': |
376 | 376 | prefix = @prefix@ |
377 | 377 | program_transform_name = @program_transform_name@ |
378 | 378 | psdir = @psdir@ |
379 | runstatedir = @runstatedir@ | |
379 | 380 | sbindir = @sbindir@ |
380 | 381 | sharedstatedir = @sharedstatedir@ |
381 | 382 | srcdir = @srcdir@ |
407 | 407 | prefix = @prefix@ |
408 | 408 | program_transform_name = @program_transform_name@ |
409 | 409 | psdir = @psdir@ |
410 | runstatedir = @runstatedir@ | |
410 | 411 | sbindir = @sbindir@ |
411 | 412 | sharedstatedir = @sharedstatedir@ |
412 | 413 | srcdir = @srcdir@ |
347 | 347 | prefix = @prefix@ |
348 | 348 | program_transform_name = @program_transform_name@ |
349 | 349 | psdir = @psdir@ |
350 | runstatedir = @runstatedir@ | |
350 | 351 | sbindir = @sbindir@ |
351 | 352 | sharedstatedir = @sharedstatedir@ |
352 | 353 | srcdir = @srcdir@ |
407 | 407 | prefix = @prefix@ |
408 | 408 | program_transform_name = @program_transform_name@ |
409 | 409 | psdir = @psdir@ |
410 | runstatedir = @runstatedir@ | |
410 | 411 | sbindir = @sbindir@ |
411 | 412 | sharedstatedir = @sharedstatedir@ |
412 | 413 | srcdir = @srcdir@ |