Codebase list transmission / 04db87e
New upstream version 2.93 Sandro Tosi 6 years ago
496 changed file(s) with 2207 addition(s) and 1470 deletion(s). Raw diff Collapse all Expand all
00 The Transmission Project
1 http://www.transmissionbt.com/
1 https://transmissionbt.com/
22
33 Lead Developers <dev@transmissionbt.com>
44 Jordan Lee, Mnemosyne LLC <jordan@transmissionbt.com> (Daemon, Backend, GTK+ client)
4040 # "Z" for unsupported trunk builds,
4141 # "0" for stable, supported releases
4242 # 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-")
4545
4646 string(REGEX MATCH "^([0-9]+)\\.([0-9]+).*" TR_VERSION "${TR_USER_AGENT_PREFIX}")
4747 set(TR_VERSION_MAJOR "${CMAKE_MATCH_1}")
5555 set(TR_STABLE_RELEASE 1)
5656 endif()
5757
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}")
6764 elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
6865 find_package(Git)
6966 if(GIT_FOUND)
7067 execute_process(
7168 COMMAND
72 ${GIT_EXECUTABLE} rev-list --max-count=1 --abbrev-commit HEAD
69 ${GIT_EXECUTABLE} rev-list --max-count=1 HEAD
7370 WORKING_DIRECTORY
7471 ${CMAKE_SOURCE_DIR}
7572 OUTPUT_VARIABLE
76 TR_SCM_REVISION
73 TR_VCS_REVISION
7774 OUTPUT_STRIP_TRAILING_WHITESPACE
7875 )
7976 endif()
8077 endif()
8178
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")
10287 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)
10993
11094 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
11195
402402 prefix = @prefix@
403403 program_transform_name = @program_transform_name@
404404 psdir = @psdir@
405 runstatedir = @runstatedir@
405406 sbindir = @sbindir@
406407 sharedstatedir = @sharedstatedir@
407408 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
013 === Transmission 2.92 (2016/03/06) ===
114 [http://trac.transmissionbt.com/query?milestone=2.92&group=component&order=severity All tickets closed by this release]
215 ==== Mac Client ====
77 * A headless daemon for servers and routers
88 * A web UI for remote controlling any of the above
99
10 Visit http://www.transmissionbt.com/ for more information.
10 Visit https://transmissionbt.com/ for more information.
1111
1212 BUILDING
1313
1515 for building in Xcode.
1616
1717 For a more detailed description, and dependancies, visit:
18 http://trac.transmissionbt.com/wiki/
18 https://github.com/transmission/transmission/wiki
1919
2020 Building a Transmission release from the command line:
2121
2727
2828 Building Transmission from the nightly builds:
2929
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/
3131 and follow the steps from the previous section.
3232
3333 If you're new to building programs from source code, this is typically
0 14714
0 3c5870d4f52c91bf8f73846ef2b1da74bbb22693
128128 A225A4C0187E369C00CDE823 /* ShareToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A225A4BF187E369C00CDE823 /* ShareToolbarItem.m */; };
129129 A2265F420B5EF5F40093DDA5 /* FileNameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2265F400B5EF5F40093DDA5 /* FileNameCell.m */; };
130130 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 */; };
135135 A2290D2E1442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; };
136136 A2290D2F1442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; };
137137 A2290D301442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; };
392392 A2F35BCA15C5A0A100EBF632 /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = A2F35BC915C5A0A100EBF632 /* GenerateThumbnailForURL.m */; };
393393 A2F35BCC15C5A0A100EBF632 /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = A2F35BCB15C5A0A100EBF632 /* GeneratePreviewForURL.m */; };
394394 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 */; };
396396 A2F35BDA15C5A49200EBF632 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2B6141B1395ADE9000E0975 /* libz.dylib */; };
397397 A2F35BDB15C5A4A000EBF632 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; };
398398 A2F35BE115C5A7ED00EBF632 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2F35BE015C5A7ED00EBF632 /* Cocoa.framework */; };
919919 A2725D5C0DE7507C003445E7 /* TrackerTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TrackerTableView.m; path = macosx/TrackerTableView.m; sourceTree = "<group>"; };
920920 A27476FF0CC38EE6003CC76D /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = macosx/es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
921921 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>"; };
923923 A277DA090C693D9C00DA2CD4 /* ActionOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionOn.png; path = macosx/Images/ActionOn.png; sourceTree = "<group>"; };
924924 A279E3D011C3BDC300D48B1F /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/AddMagnetWindow.xib; sourceTree = "<group>"; };
925925 A279E3D111C3BDC300D48B1F /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/InfoActivityView.xib; sourceTree = "<group>"; };
12551255 files = (
12561256 4D9A2BF009E16D21002D0FF9 /* libtransmission.a in Frameworks */,
12571257 A296EF3C11E560BD004A2781 /* libiconv.dylib in Frameworks */,
1258 A2290D1E14421CC100B95A09 /* libcrypto.0.9.8.dylib in Frameworks */,
1258 A2290D1E14421CC100B95A09 /* libcrypto.dylib in Frameworks */,
12591259 A2290D2F1442B23200B95A09 /* libcurl.4.dylib in Frameworks */,
12601260 A2B6141E1395B0EC000E0975 /* libz.dylib in Frameworks */,
12611261 A2B3FB4C0E59023000FF78FB /* Cocoa.framework in Frameworks */,
12721272 A24F19080A3A790800C9C145 /* Sparkle.framework in Frameworks */,
12731273 A261F1DC0A69A1610002815A /* Growl.framework in Frameworks */,
12741274 A296EF3B11E560A7004A2781 /* libiconv.dylib in Frameworks */,
1275 A2290D2514421D1A00B95A09 /* libcrypto.0.9.8.dylib in Frameworks */,
1275 A2290D2514421D1A00B95A09 /* libcrypto.dylib in Frameworks */,
12761276 A2290D2E1442B23200B95A09 /* libcurl.4.dylib in Frameworks */,
12771277 A2B6141F1395B0F5000E0975 /* libz.dylib in Frameworks */,
12781278 A2E669790F5B8E5A00B4251A /* Security.framework in Frameworks */,
13061306 A2F35BD415C5A19A00EBF632 /* libtransmission.a in Frameworks */,
13071307 A2F35BDB15C5A4A000EBF632 /* libiconv.dylib in Frameworks */,
13081308 A2F35BDA15C5A49200EBF632 /* libz.dylib in Frameworks */,
1309 A2F35BD715C5A46D00EBF632 /* libcrypto.0.9.8.dylib in Frameworks */,
1309 A2F35BD715C5A46D00EBF632 /* libcrypto.dylib in Frameworks */,
13101310 A2AB76EA15D8130B009EFC95 /* libcurl.4.dylib in Frameworks */,
13111311 );
13121312 runOnlyForDeploymentPostprocessing = 0;
13441344 files = (
13451345 BEFC1C050C07753500B0BB3C /* libtransmission.a in Frameworks */,
13461346 A296EF3D11E560C3004A2781 /* libiconv.dylib in Frameworks */,
1347 A2290D2014421CD000B95A09 /* libcrypto.0.9.8.dylib in Frameworks */,
1347 A2290D2014421CD000B95A09 /* libcrypto.dylib in Frameworks */,
13481348 A2290D301442B23200B95A09 /* libcurl.4.dylib in Frameworks */,
13491349 A2B6141D1395B0E3000E0975 /* libz.dylib in Frameworks */,
13501350 A2B3FB530E59027100FF78FB /* Cocoa.framework in Frameworks */,
13571357 files = (
13581358 BEFC1D2D0C0783D900B0BB3C /* libtransmission.a in Frameworks */,
13591359 A296EF3E11E560D1004A2781 /* libiconv.dylib in Frameworks */,
1360 A2290D2214421CD800B95A09 /* libcrypto.0.9.8.dylib in Frameworks */,
1360 A2290D2214421CD800B95A09 /* libcrypto.dylib in Frameworks */,
13611361 A2290D311442B23200B95A09 /* libcurl.4.dylib in Frameworks */,
13621362 A2B6141C1395ADE9000E0975 /* libz.dylib in Frameworks */,
13631363 A25E03D90E4015100086C225 /* Cocoa.framework in Frameworks */,
18371837 4DDBB71509E16B3F00284745 /* Libraries */ = {
18381838 isa = PBXGroup;
18391839 children = (
1840 A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */,
1840 A27653A714369C5C009D3CCF /* libcrypto.dylib */,
18411841 A2290D2D1442B23200B95A09 /* libcurl.4.dylib */,
18421842 A296EF3411E5605E004A2781 /* libiconv.dylib */,
18431843 A2B6141B1395ADE9000E0975 /* libz.dylib */,
1818 You have another version of autoconf. It may work, but is not guaranteed to.
1919 If you have problems, you may need to regenerate the build system entirely.
2020 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
21458
22459
23460 dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
210647
211648
212649 # 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.
215652 dnl This file is free software; the Free Software Foundation
216653 dnl gives unlimited permission to copy and/or distribute it,
217654 dnl with or without modifications, as long as this notice is preserved.
401401 prefix = @prefix@
402402 program_transform_name = @program_transform_name@
403403 psdir = @psdir@
404 runstatedir = @runstatedir@
404405 sbindir = @sbindir@
405406 sharedstatedir = @sharedstatedir@
406407 srcdir = @srcdir@
00 /******************************************************************************
1 * $Id: cli.c 14581 2015-10-18 18:39:14Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
6464 Set a script to run when the torrent finishes
6565 .It Fl g, Fl -config-dir Ar directory
6666 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.
6868 .It Fl h, Fl -help
6969 Prints a short usage summary.
7070 .It Fl m, Fl -portmap
132132 .Xr transmission-remote 1 ,
133133 .Xr transmission-show 1
134134 .Pp
135 http://www.transmissionbt.com/
135 https://transmissionbt.com/
00 #! /bin/sh
11 # 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'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
2626 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
2727 #
2828 # 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
3030 #
3131 # Please send patches to <config-patches@gnu.org>.
3232
4949 GNU config.guess ($timestamp)
5050
5151 Originally written by Per Bothner.
52 Copyright 1992-2015 Free Software Foundation, Inc.
52 Copyright 1992-2016 Free Software Foundation, Inc.
5353
5454 This is free software; see the source for copying conditions. There is NO
5555 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
185185 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
186186 esac
187187 # 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.
189189 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)
191194 eval $set_cc_for_build
192195 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
193196 | grep -q __ELF__
236239 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
237240 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
238241 exit ;;
242 *:LibertyBSD:*:*)
243 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
244 echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
245 exit ;;
239246 *:ekkoBSD:*:*)
240247 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
241248 exit ;;
267274 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
268275 case "$ALPHA_CPU_TYPE" in
269276 "EV4 (21064)")
270 UNAME_MACHINE="alpha" ;;
277 UNAME_MACHINE=alpha ;;
271278 "EV4.5 (21064)")
272 UNAME_MACHINE="alpha" ;;
279 UNAME_MACHINE=alpha ;;
273280 "LCA4 (21066/21068)")
274 UNAME_MACHINE="alpha" ;;
281 UNAME_MACHINE=alpha ;;
275282 "EV5 (21164)")
276 UNAME_MACHINE="alphaev5" ;;
283 UNAME_MACHINE=alphaev5 ;;
277284 "EV5.6 (21164A)")
278 UNAME_MACHINE="alphaev56" ;;
285 UNAME_MACHINE=alphaev56 ;;
279286 "EV5.6 (21164PC)")
280 UNAME_MACHINE="alphapca56" ;;
287 UNAME_MACHINE=alphapca56 ;;
281288 "EV5.7 (21164PC)")
282 UNAME_MACHINE="alphapca57" ;;
289 UNAME_MACHINE=alphapca57 ;;
283290 "EV6 (21264)")
284 UNAME_MACHINE="alphaev6" ;;
291 UNAME_MACHINE=alphaev6 ;;
285292 "EV6.7 (21264A)")
286 UNAME_MACHINE="alphaev67" ;;
293 UNAME_MACHINE=alphaev67 ;;
287294 "EV6.8CB (21264C)")
288 UNAME_MACHINE="alphaev68" ;;
295 UNAME_MACHINE=alphaev68 ;;
289296 "EV6.8AL (21264B)")
290 UNAME_MACHINE="alphaev68" ;;
297 UNAME_MACHINE=alphaev68 ;;
291298 "EV6.8CX (21264D)")
292 UNAME_MACHINE="alphaev68" ;;
299 UNAME_MACHINE=alphaev68 ;;
293300 "EV6.9A (21264/EV69A)")
294 UNAME_MACHINE="alphaev69" ;;
301 UNAME_MACHINE=alphaev69 ;;
295302 "EV7 (21364)")
296 UNAME_MACHINE="alphaev7" ;;
303 UNAME_MACHINE=alphaev7 ;;
297304 "EV7.9 (21364A)")
298 UNAME_MACHINE="alphaev79" ;;
305 UNAME_MACHINE=alphaev79 ;;
299306 esac
300307 # A Pn.n version is a patched version.
301308 # A Vn.n version is a released version.
302309 # A Tn.n version is a released field test version.
303310 # A Xn.n version is an unreleased experimental baselevel.
304311 # 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`
306313 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
307314 exitcode=$?
308315 trap '' 0
375382 exit ;;
376383 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
377384 eval $set_cc_for_build
378 SUN_ARCH="i386"
385 SUN_ARCH=i386
379386 # If there is a compiler, see if it is configured for 64-bit objects.
380387 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
381388 # This test works for both compilers.
382 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
389 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
383390 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) | \
385392 grep IS_64BIT_ARCH >/dev/null
386393 then
387 SUN_ARCH="x86_64"
394 SUN_ARCH=x86_64
388395 fi
389396 fi
390397 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
409416 exit ;;
410417 sun*:*:4.2BSD:*)
411418 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
413420 case "`/bin/arch`" in
414421 sun3)
415422 echo m68k-sun-sunos${UNAME_RELEASE}
634641 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
635642 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
636643 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
639646 532) # CPU_PA_RISC2_0
640647 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
644651 esac ;;
645652 esac
646653 fi
679686 exit (0);
680687 }
681688 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`
683690 test -z "$HP_ARCH" && HP_ARCH=hppa
684691 fi ;;
685692 esac
686 if [ ${HP_ARCH} = "hppa2.0w" ]
693 if [ ${HP_ARCH} = hppa2.0w ]
687694 then
688695 eval $set_cc_for_build
689696
696703 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
697704 # => hppa64-hp-hpux11.23
698705
699 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
706 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
700707 grep -q __LP64__
701708 then
702 HP_ARCH="hppa2.0w"
709 HP_ARCH=hppa2.0w
703710 else
704 HP_ARCH="hppa64"
711 HP_ARCH=hppa64
705712 fi
706713 fi
707714 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
806813 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
807814 exit ;;
808815 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/\///'`
811818 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
812819 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
813820 exit ;;
814821 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/ /_/'`
817824 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
818825 exit ;;
819826 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
895902 exit ;;
896903 *:GNU/*:*:*)
897904 # 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}
899906 exit ;;
900907 i*86:Minix:*:*)
901908 echo ${UNAME_MACHINE}-pc-minix
918925 EV68*) UNAME_MACHINE=alphaev68 ;;
919926 esac
920927 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
922929 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
923930 exit ;;
924931 arc:Linux:*:* | arceb:Linux:*:*)
992999 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
9931000 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
9941001 ;;
1002 mips64el:Linux:*:*)
1003 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1004 exit ;;
9951005 openrisc*:Linux:*:*)
9961006 echo or1k-unknown-linux-${LIBC}
9971007 exit ;;
10241034 ppcle:Linux:*:*)
10251035 echo powerpcle-unknown-linux-${LIBC}
10261036 exit ;;
1037 riscv32:Linux:*:* | riscv64:Linux:*:*)
1038 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1039 exit ;;
10271040 s390:Linux:*:* | s390x:Linux:*:*)
10281041 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
10291042 exit ;;
10431056 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
10441057 exit ;;
10451058 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}
10581060 exit ;;
10591061 xtensa*:Linux:*:*)
10601062 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
12821284 SX-8R:SUPER-UX:*:*)
12831285 echo sx8r-nec-superux${UNAME_RELEASE}
12841286 exit ;;
1287 SX-ACE:SUPER-UX:*:*)
1288 echo sxace-nec-superux${UNAME_RELEASE}
1289 exit ;;
12851290 Power*:Rhapsody:*:*)
12861291 echo powerpc-apple-rhapsody${UNAME_RELEASE}
12871292 exit ;;
12951300 UNAME_PROCESSOR=powerpc
12961301 fi
12971302 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
12991304 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) | \
13011306 grep IS_64BIT_ARCH >/dev/null
13021307 then
13031308 case $UNAME_PROCESSOR in
13191324 exit ;;
13201325 *:procnto*:*:* | *:QNX:[0123456789]*:*)
13211326 UNAME_PROCESSOR=`uname -p`
1322 if test "$UNAME_PROCESSOR" = "x86"; then
1327 if test "$UNAME_PROCESSOR" = x86; then
13231328 UNAME_PROCESSOR=i386
13241329 UNAME_MACHINE=pc
13251330 fi
13501355 # "uname -m" is not consistent, so use $cputype instead. 386
13511356 # is converted to i386 for consistency with other x86
13521357 # operating systems.
1353 if test "$cputype" = "386"; then
1358 if test "$cputype" = 386; then
13541359 UNAME_MACHINE=i386
13551360 else
13561361 UNAME_MACHINE="$cputype"
13921397 echo i386-pc-xenix
13931398 exit ;;
13941399 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/ .*$//'`
13961401 exit ;;
13971402 i*86:rdos:*:*)
13981403 echo ${UNAME_MACHINE}-pc-rdos
14111416 cat >&2 <<EOF
14121417 $0: unable to guess system type
14131418
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
14191424 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.
14261430
14271431 config.guess timestamp = $timestamp
14281432
00 #! /bin/sh
11 # 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'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
3232 # Otherwise, we print the canonical config type on stdout and succeed.
3333
3434 # 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
3636
3737 # This file is supposed to be the same for all GNU packages
3838 # and recognize all the CPU types, system types and aliases
6666 version="\
6767 GNU config.sub ($timestamp)
6868
69 Copyright 1992-2015 Free Software Foundation, Inc.
69 Copyright 1992-2016 Free Software Foundation, Inc.
7070
7171 This is free software; see the source for copying conditions. There is NO
7272 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
116116 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
117117 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
118118 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
119 kopensolaris*-gnu* | \
119 kopensolaris*-gnu* | cloudabi*-eabi* | \
120120 storm-chaos* | os2-emx* | rtmk-nova*)
121121 os=-$maybe_os
122122 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
257257 | be32 | be64 \
258258 | bfin \
259259 | c4x | c8051 | clipper \
260 | d10v | d30v | dlx | dsp16xx | dvp \
260 | d10v | d30v | dlx | dsp16xx \
261261 | e2k | epiphany \
262262 | fido | fr30 | frv | ft32 \
263263 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
300300 | open8 | or1k | or1knd | or32 \
301301 | pdp10 | pdp11 | pj | pjl \
302302 | powerpc | powerpc64 | powerpc64le | powerpcle \
303 | pru \
303304 | pyramid \
304305 | riscv32 | riscv64 \
305306 | rl78 | rx \
427428 | orion-* \
428429 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
429430 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
431 | pru-* \
430432 | pyramid-* \
431433 | riscv32-* | riscv64-* \
432434 | rl78-* | romp-* | rs6000-* | rx-* \
642644 basic_machine=m68k-bull
643645 os=-sysv3
644646 ;;
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 ;;
645655 ebmon29k)
646656 basic_machine=a29k-amd
647657 os=-ebmon
826836 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
827837 basic_machine=m68k-atari
828838 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
847839 ;;
848840 mips3*-*)
849841 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
10391031 ppc-* | ppcbe-*)
10401032 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
10411033 ;;
1042 ppcle | powerpclittle | ppc-le | powerpc-little)
1034 ppcle | powerpclittle)
10431035 basic_machine=powerpcle-unknown
10441036 ;;
10451037 ppcle-* | powerpclittle-*)
10491041 ;;
10501042 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
10511043 ;;
1052 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1044 ppc64le | powerpc64little)
10531045 basic_machine=powerpc64le-unknown
10541046 ;;
10551047 ppc64le-* | powerpc64little-*)
13991391 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
14001392 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
14011393 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1402 | -bitrig* | -openbsd* | -solidbsd* \
1394 | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
14031395 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
14041396 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
14051397 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
14061398 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
14071399 | -chorusos* | -chorusrdb* | -cegcc* \
14081400 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1409 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1401 | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
14101402 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
14111403 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
14121404 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
14131405 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1414 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \
1406 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
14151407 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
14161408 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
14171409 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
14181410 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1419 | -onefs* | -tirtos*)
1411 | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
14201412 # Remember, each alternative MUST END IN *, to match a version number.
14211413 ;;
14221414 -qnx*)
15481540 ;;
15491541 -nacl*)
15501542 ;;
1543 -ios)
1544 ;;
15511545 -none)
15521546 ;;
15531547 *)
00 #! /bin/sh
11 # 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.
33 #
4 # Report bugs to <http://trac.transmissionbt.com/newticket>.
4 # Report bugs to <https://github.com/transmission/transmission>.
55 #
66 #
77 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
274274 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
275275 else
276276 $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
278278 $0: system, including any error possibly output before this
279279 $0: message. Then install a modern shell, or manually run
280280 $0: the script under such a shell if you do have one."
589589 # Identity of this package.
590590 PACKAGE_NAME='transmission'
591591 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'
595595 PACKAGE_URL=''
596596
597597 ac_unique_file="libtransmission/transmission.h"
873873 docdir
874874 oldincludedir
875875 includedir
876 runstatedir
876877 localstatedir
877878 sharedstatedir
878879 sysconfdir
992993 sysconfdir='${prefix}/etc'
993994 sharedstatedir='${prefix}/com'
994995 localstatedir='${prefix}/var'
996 runstatedir='${localstatedir}/run'
995997 includedir='${prefix}/include'
996998 oldincludedir='/usr/include'
997999 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
12441246 | -silent | --silent | --silen | --sile | --sil)
12451247 silent=yes ;;
12461248
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
12471258 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
12481259 ac_prev=sbindir ;;
12491260 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
13811392 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
13821393 datadir sysconfdir sharedstatedir localstatedir includedir \
13831394 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1384 libdir localedir mandir
1395 libdir localedir mandir runstatedir
13851396 do
13861397 eval ac_val=\$$ac_var
13871398 # Remove trailing slashes.
14941505 # Omit some internal or obsolete options to make the list less imposing.
14951506 # This message is too long to be a string in the A/UX 3.1 sh.
14961507 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.
14981509
14991510 Usage: $0 [OPTION]... [VAR=VALUE]...
15001511
15341545 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
15351546 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
15361547 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1548 --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
15371549 --libdir=DIR object code libraries [EPREFIX/lib]
15381550 --includedir=DIR C header files [PREFIX/include]
15391551 --oldincludedir=DIR C header files for non-gcc [/usr/include]
15641576
15651577 if test -n "$ac_init_help"; then
15661578 case $ac_init_help in
1567 short | recursive ) echo "Configuration of transmission 2.92:";;
1579 short | recursive ) echo "Configuration of transmission 2.93:";;
15681580 esac
15691581 cat <<\_ACEOF
15701582
16671679 Use these variables to override the choices made by `configure' or to help
16681680 it to find libraries and programs with nonstandard names/locations.
16691681
1670 Report bugs to <http://trac.transmissionbt.com/newticket>.
1682 Report bugs to <https://github.com/transmission/transmission>.
16711683 _ACEOF
16721684 ac_status=$?
16731685 fi
17301742 test -n "$ac_init_help" && exit $ac_status
17311743 if $ac_init_version; then
17321744 cat <<\_ACEOF
1733 transmission configure 2.92
1745 transmission configure 2.93
17341746 generated by GNU Autoconf 2.69
17351747
17361748 Copyright (C) 2012 Free Software Foundation, Inc.
21962208 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
21972209 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
21982210 $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 ## ----------------------------------------------------------- ##"
22022214 ) | sed "s/^/$as_me: WARNING: /" >&2
22032215 ;;
22042216 esac
22662278 This file contains any messages produced by compilers while
22672279 running configure, to aid debugging if configure makes a mistake.
22682280
2269 It was created by transmission $as_me 2.92, which was
2281 It was created by transmission $as_me 2.93, which was
22702282 generated by GNU Autoconf 2.69. Invocation command line was
22712283
22722284 $ $0 $@
26142626 ac_compiler_gnu=$ac_cv_c_compiler_gnu
26152627
26162628
2617 USERAGENT_PREFIX=2.92
2618
2619 PEERID_PREFIX=-TR2920-
2629 USERAGENT_PREFIX=2.93
2630
2631 PEERID_PREFIX=-TR2930-
26202632
26212633
26222634 # Check whether --enable-silent-rules was given.
31383150
31393151 # Define the identity of the package.
31403152 PACKAGE='transmission'
3141 VERSION='2.92'
3153 VERSION='2.93'
31423154
31433155
31443156 cat >>confdefs.h <<_ACEOF
56645676 lt_cv_deplibs_check_method=pass_all
56655677 ;;
56665678
5667 netbsd*)
5679 netbsd* | netbsdelf*-gnu)
56685680 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
56695681 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
56705682 else
93579369 openbsd* | bitrig*)
93589370 with_gnu_ld=no
93599371 ;;
9372 linux* | k*bsd*-gnu | gnu*)
9373 link_all_deplibs=no
9374 ;;
93609375 esac
93619376
93629377 ld_shlibs=yes
96119626 fi
96129627 ;;
96139628
9614 netbsd*)
9629 netbsd* | netbsdelf*-gnu)
96159630 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
96169631 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
96179632 wlarc=
1028110296 if test yes = "$lt_cv_irix_exported_symbol"; then
1028210297 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'
1028310298 fi
10299 link_all_deplibs=no
1028410300 else
1028510301 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'
1028610302 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'
1030210318 esac
1030310319 ;;
1030410320
10305 netbsd*)
10321 netbsd* | netbsdelf*-gnu)
1030610322 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
1030710323 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
1030810324 else
1117711193 *) objformat=elf ;;
1117811194 esac
1117911195 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
1118811197 case $version_type in
1118911198 freebsd-elf*)
1119011199 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
1119511204 freebsd-*)
1119611205 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
1119711206 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
1120411207 ;;
1120511208 esac
1120611209 shlibpath_var=LD_LIBRARY_PATH
1142811431 # people can always --disable-shared, the test was removed, and we
1142911432 # assume the GNU/Linux dynamic linker is in use.
1143011433 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'
1143111446 ;;
1143211447
1143311448 netbsd*)
1567215687 ;;
1567315688 esac
1567415689 ;;
15675 netbsd*)
15690 netbsd* | netbsdelf*-gnu)
1567615691 ;;
1567715692 *qnx* | *nto*)
1567815693 # QNX uses GNU C++, but need to define -shared option too, otherwise
1604716062 ;;
1604816063 esac
1604916064 ;;
16065 linux* | k*bsd*-gnu | gnu*)
16066 link_all_deplibs_CXX=no
16067 ;;
1605016068 *)
1605116069 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
1605216070 ;;
1650016518 *) objformat=elf ;;
1650116519 esac
1650216520 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
1651116522 case $version_type in
1651216523 freebsd-elf*)
1651316524 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
1651816529 freebsd-*)
1651916530 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
1652016531 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
1652716532 ;;
1652816533 esac
1652916534 shlibpath_var=LD_LIBRARY_PATH
1675316758 dynamic_linker='GNU/Linux ld.so'
1675416759 ;;
1675516760
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
1675616773 netbsd*)
1675716774 version_type=sunos
1675816775 need_lib_prefix=no
1878118798 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1878218799 since some C++ compilers masquerading as C compilers
1878318800 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))
1878518802 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1878618803 && LARGE_OFF_T % 2147483647 == 1)
1878718804 ? 1 : -1];
1882718844 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1882818845 since some C++ compilers masquerading as C compilers
1882918846 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))
1883118848 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1883218849 && LARGE_OFF_T % 2147483647 == 1)
1883318850 ? 1 : -1];
1885118868 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1885218869 since some C++ compilers masquerading as C compilers
1885318870 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))
1885518872 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1885618873 && LARGE_OFF_T % 2147483647 == 1)
1885718874 ? 1 : -1];
1889618913 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1889718914 since some C++ compilers masquerading as C compilers
1889818915 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))
1890018917 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1890118918 && LARGE_OFF_T % 2147483647 == 1)
1890218919 ? 1 : -1];
1892018937 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1892118938 since some C++ compilers masquerading as C compilers
1892218939 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))
1892418941 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1892518942 && LARGE_OFF_T % 2147483647 == 1)
1892618943 ? 1 : -1];
2197721994 # report actual input values of CONFIG_FILES etc. instead of their
2197821995 # values after options handling.
2197921996 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
2198121998 generated by GNU Autoconf 2.69. Invocation command line was
2198221999
2198322000 CONFIG_FILES = $CONFIG_FILES
2202822045 Configuration commands:
2202922046 $config_commands
2203022047
22031 Report bugs to <http://trac.transmissionbt.com/newticket>."
22048 Report bugs to <https://github.com/transmission/transmission>."
2203222049
2203322050 _ACEOF
2203422051 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2203522052 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2203622053 ac_cs_version="\\
22037 transmission config.status 2.92
22054 transmission config.status 2.93
2203822055 configured by $0, generated by GNU Autoconf 2.69,
2203922056 with options \\"\$ac_cs_config\\"
2204022057
2310323120 cat <<_LT_EOF >> "$cfgfile"
2310423121 #! $SHELL
2310523122 # Generated automatically by $as_me ($PACKAGE) $VERSION
23106 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2310723123 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
2310823124
2310923125 # Provide generalized library-building support services.
22 dnl "Z" for unsupported trunk builds,
33 dnl "0" for stable, supported releases
44 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])
99 AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix])
1010 AC_SUBST(PEERID_PREFIX,[peer_id_prefix])
1111
421421 prefix = @prefix@
422422 program_transform_name = @program_transform_name@
423423 psdir = @psdir@
424 runstatedir = @runstatedir@
424425 sbindir = @sbindir@
425426 sharedstatedir = @sharedstatedir@
426427 srcdir = @srcdir@
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: daemon-posix.c 14641 2015-12-29 00:42:40Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: daemon-win32.c 14700 2016-03-02 16:15:06Z mikedld $
6 * $Id$
77 */
88
99 #include <process.h> /* _beginthreadex () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: daemon.c 14675 2016-01-25 22:09:49Z mikedld $
6 * $Id$
77 */
88
99 #include <errno.h>
7979 getUsage (void)
8080 {
8181 return "Transmission " LONG_VERSION_STRING
82 " http://www.transmissionbt.com/\n"
82 " https://transmissionbt.com/\n"
8383 "A fast and easy BitTorrent client\n"
8484 "\n"
8585 MY_NAME " is a headless Transmission session\n"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: daemon.h 14485 2015-04-04 17:43:56Z mikedld $
6 * $Id$
77 */
88
99 #ifndef DTR_DAEMON_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: remote.c 14707 2016-03-05 17:27:40Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
197197 return
198198 MY_NAME" "LONG_VERSION_STRING"\n"
199199 "A fast and easy BitTorrent client\n"
200 "http://www.transmissionbt.com/\n"
200 "https://transmissionbt.com/\n"
201201 "\n"
202202 "Usage: " MY_NAME
203203 " [host] [options]\n"
5858 Run in the foreground and print errors to stderr.
5959 .It Fl g Fl -config-dir Ar directory
6060 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.
6262 .It Fl er Fl -encryption-required
6363 Encrypt all peer connections.
6464 .It Fl ep Fl -encryption-preferred
147147 nor
148148 .Op Fl g
149149 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.
151151 .El
152152 .Sh AUTHORS
153153 .An -nosplit
165165 .Xr transmission-remote 1 ,
166166 .Xr transmission-show 1
167167 .Pp
168 http://www.transmissionbt.com/
168 https://transmissionbt.com/
407407 .Xr transmission-remote 1 ,
408408 .Xr transmission-show 1
409409 .Pp
410 http://www.transmissionbt.com/
410 https://transmissionbt.com/
316316 prefix = @prefix@
317317 program_transform_name = @program_transform_name@
318318 psdir = @psdir@
319 runstatedir = @runstatedir@
319320 sbindir = @sbindir@
320321 sharedstatedir = @sharedstatedir@
321322 srcdir = @srcdir@
6464
6565 So, the correct way to handle a 409 response is to update your
6666 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.
6782
6883 3. Torrent Requests
6984
465465 prefix = @prefix@
466466 program_transform_name = @program_transform_name@
467467 psdir = @psdir@
468 runstatedir = @runstatedir@
468469 sbindir = @sbindir@
469470 sharedstatedir = @sharedstatedir@
470471 srcdir = @srcdir@
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: actions.c 14681 2016-02-23 04:34:57Z mikedld $
6 * $Id$
77 */
88
99 #include <string.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: actions.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_ACTIONS_H
00 /******************************************************************************
1 * $Id: conf.c 14526 2015-05-09 11:56:35Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: conf.h 13683 2012-12-22 20:35:19Z jordan $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: details.c 14552 2015-07-13 00:32:48Z mikedld $
6 * $Id$
77 */
88
99 #include <limits.h> /* INT_MAX */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: details.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_TORRENT_DETAILS_H
00 /******************************************************************************
1 * $Id: dialogs.c 13625 2012-12-05 17:29:46Z jordan $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: dialogs.h 13625 2012-12-05 17:29:46Z jordan $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: favicon.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <glib/gstdio.h> /* g_remove () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: favicon.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_FAVICON_CACHE_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: file-list.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <limits.h> /* INT_MAX */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: file-list.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTK_TORRENT_FILE_LIST_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: filter.c 14613 2015-12-06 22:13:10Z jordan $
6 * $Id$
77 */
88
99 #include <stdlib.h> /* qsort () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: filter.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_FILTER_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: hig.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <gtk/gtk.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: hig.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_HIG_H
318318 prefix = @prefix@
319319 program_transform_name = @program_transform_name@
320320 psdir = @psdir@
321 runstatedir = @runstatedir@
321322 sbindir = @sbindir@
322323 sharedstatedir = @sharedstatedir@
323324 srcdir = @srcdir@
22 * "There is no problem for me, you can license my code
33 * under whatever licence you wish :)"
44 *
5 * $Id: icons.c 14613 2015-12-06 22:13:10Z jordan $
5 * $Id$
66 */
77
88 #include <glib.h>
22 * "There is no problem for me, you can license
33 * my code under whatever licence you wish :)"
44 *
5 * $Id: icons.h 13625 2012-12-05 17:29:46Z jordan $
5 * $Id$
66 */
77
88 #ifndef GTR_ICONS_H
00 /******************************************************************************
1 * $Id: main.c 14689 2016-02-27 23:18:02Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
13621362 static void
13631363 show_about_dialog (GtkWindow * parent)
13641364 {
1365 const char * uri = "http://www.transmissionbt.com/";
1365 const char * uri = "https://transmissionbt.com/";
13661366 const char * authors[] = { "Jordan Lee (Backend; GTK+)",
13671367 "Mitchell Livingston (Backend; OS X)",
13681368 NULL };
15461546 }
15471547 else if (!g_strcmp0 (action_name, "donate"))
15481548 {
1549 gtr_open_uri ("http://www.transmissionbt.com/donate.php");
1549 gtr_open_uri ("https://transmissionbt.com/donate/");
15501550 }
15511551 else if (!g_strcmp0 (action_name, "pause-all-torrents"))
15521552 {
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: makemeta-ui.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <glib/gi18n.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: makemeta-ui.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_TORRENT_CREATION_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: msgwin.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <errno.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: msgwin.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: notify.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <gio/gio.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: notify.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_NOTIFY_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: open-dialog.c 14666 2016-01-07 19:20:14Z mikedld $
6 * $Id$
77 */
88
99 #include <glib/gi18n.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: open-dialog.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_OPEN_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: relocate.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <libtransmission/transmission.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: relocate.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_RELOCATE_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: stats.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <glib/gi18n.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: stats.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_STATS_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: torrent-cell-renderer.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <limits.h> /* INT_MAX */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: torrent-cell-renderer.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_TORRENT_CELL_RENDERER_H
00 /******************************************************************************
1 * $Id: tr-core.c 14587 2015-10-23 04:09:40Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: tr-core.h 14681 2016-02-23 04:34:57Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: tr-icon.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: tr-icon.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_ICON_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: tr-prefs.c 14639 2015-12-28 23:52:26Z mikedld $
6 * $Id$
77 */
88
99 #include <ctype.h> /* isspace */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: tr-prefs.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef GTR_PREFS_H
00 /******************************************************************************
1 * $Id: tr-window.c 14519 2015-05-03 10:30:35Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: tr-window.h 13625 2012-12-05 17:29:46Z jordan $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
0 .\" $Id: transmission-gtk.1 11626 2011-01-03 05:58:58Z jordan $
0 .\" $Id$
11 .\"
22 .\" Copyright (c) 2007 Joshua Elsasser
33 .\"
4848 Start minimized in notification area
4949 .It Fl g, Fl -config-dir Ar directory
5050 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.
5252 .El
5353 .Pp
5454 Multiple .torrent files may be added at startup
9090 .Xr transmission-remote 1 ,
9191 .Xr transmission-show 1
9292 .Pp
93 http://www.transmissionbt.com/
93 https://transmissionbt.com/
15951595
15961596 #define G_HAS_CONSTRUCTORS 1
15971597
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) \
15991621 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")) \
16011625 __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) \
16051629 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")) \
16071633 __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;
16091635
16101636 #elif defined (_MSC_VER)
16111637
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: util.c 14587 2015-10-23 04:09:40Z mikedld $
6 * $Id$
77 */
88
99 #include <ctype.h> /* isxdigit () */
352352
353353 if (!uri)
354354 {
355 const char * fmt = "http://www.transmissionbt.com/help/gtk/%d.%dx";
355 const char * fmt = "https://transmissionbt.com/help/gtk/%d.%dx";
356356 uri = g_strdup_printf (fmt, MAJOR_VERSION, MINOR_VERSION / 10);
357357 }
358358
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: util.h 14587 2015-10-23 04:09:40Z mikedld $
6 * $Id$
77 */
88
99 #ifndef GTR_UTIL_H
00 #!/bin/sh
11 # install - install a program, script, or datafile
22
3 scriptversion=2013-12-25.23; # UTC
3 scriptversion=2014-09-12.12; # UTC
44
55 # This originates from X11R5 (mit/util/scripts/install.sh), which was
66 # later released in X11R6 (xc/config/util/install.sh) with the
323323 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
324324 ;;
325325 *)
326 # $RANDOM is not portable (e.g. dash); use it when possible to
327 # lower collision chance
326328 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.
329334 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
331337 then
332338 if test -z "$dir_arg" || {
333339 # Check for POSIX incompatibilities with -m.
334340 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
335341 # other-writable bit of parent directory when it shouldn't.
336342 # 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"`
338345 case $ls_ld_tmpdir in
339346 d????-?r-*) different_mode=700;;
340347 d????-?--*) different_mode=755;;
341348 *) false;;
342349 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"`
345352 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
346353 }
347354 }
348355 then posix_mkdir=:
349356 fi
350 rmdir "$tmpdir/d" "$tmpdir"
357 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
351358 else
352359 # 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
354361 fi
355362 trap '' 0;;
356363 esac;;
822822 prefix = @prefix@
823823 program_transform_name = @program_transform_name@
824824 psdir = @psdir@
825 runstatedir = @runstatedir@
825826 sbindir = @sbindir@
826827 sharedstatedir = @sharedstatedir@
827828 srcdir = @srcdir@
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: announcer-common.h 14521 2015-05-04 19:58:34Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __LIBTRANSMISSION_ANNOUNCER_MODULE__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: announcer-http.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <limits.h> /* USHRT_MAX */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: announcer-udp.c 14648 2015-12-31 14:17:37Z mikedld $
6 * $Id$
77 */
88
99 #define __LIBTRANSMISSION_ANNOUNCER_MODULE__
658658 }
659659
660660 static void
661 tau_tracker_upkeep (struct tau_tracker * tracker)
661 tau_tracker_upkeep_ex (struct tau_tracker * tracker,
662 bool timeout_reqs)
662663 {
663664 const time_t now = tr_time ();
664665 const bool closing = tracker->close_at != 0;
716717 return;
717718 }
718719
719 tau_tracker_timeout_reqs (tracker);
720 if (timeout_reqs)
721 tau_tracker_timeout_reqs (tracker);
720722
721723 if ((tracker->addr != NULL) && (tracker->connection_expiration_time > now))
722724 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);
723731 }
724732
725733 /****
956964 response_func,
957965 user_data);
958966 tr_ptrArrayAppend (&tracker->announces, r);
959 tau_tracker_upkeep (tracker);
967 tau_tracker_upkeep_ex (tracker, false);
960968 }
961969
962970 void
971979 response_func,
972980 user_data);
973981 tr_ptrArrayAppend (&tracker->scrapes, r);
974 tau_tracker_upkeep (tracker);
975 }
982 tau_tracker_upkeep_ex (tracker, false);
983 }
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: announcer.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
14241424 char * url = tier->currentTracker->scrape;
14251425 const uint8_t * hash = tier->tor->info.hash;
14261426
1427 assert (url != NULL);
1428
14271429 /* if there's a request with this scrape URL and a free slot, use it */
14281430 for (j=0; j<request_count; ++j)
14291431 {
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: announcer.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: bandwidth.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: bandwidth.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: bitfield-test.c 14669 2016-01-08 11:12:22Z mikedld $
6 * $Id$
77 */
88
99 #include <string.h> /* strlen () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: bitfield.c 14646 2015-12-31 05:22:42Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: bitfield.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: blocklist-test.c 14382 2014-12-13 15:22:39Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: blocklist.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: blocklist.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: cache.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <stdlib.h> /* qsort () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: cache.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: clients-test.c 14286 2014-06-07 15:07:51Z jordan $
6 * $Id$
77 */
88
99 #include "transmission.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: clients.c 14546 2015-06-26 21:22:27Z mikedld $
6 * $Id$
77 */
88
99 /* thanks amc1! */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: clients.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: completion.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: completion.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto-test.c 14429 2015-01-03 21:35:20Z mikedld $
6 * $Id$
77 */
88
99 #include <string.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto-utils-cyassl.c 14442 2015-01-07 13:20:56Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto-utils-fallback.c 14370 2014-12-11 05:11:02Z mikedld $
6 * $Id$
77 */
88
99 /* This file is designed specifically to be included by other source files to
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto-utils-openssl.c 14640 2015-12-28 23:53:55Z mikedld $
6 * $Id$
77 */
88
99 #ifdef __APPLE__
229229 ****
230230 ***/
231231
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
232287 tr_dh_ctx_t
233288 tr_dh_new (const uint8_t * prime_num,
234289 size_t prime_num_length,
236291 size_t generator_num_length)
237292 {
238293 DH * handle = DH_new ();
294 BIGNUM * p, * g;
239295
240296 assert (prime_num != NULL);
241297 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))
245304 {
305 BN_free (p);
306 BN_free (g);
246307 DH_free (handle);
247308 handle = NULL;
248309 }
267328 {
268329 DH * handle = raw_handle;
269330 int dh_size, my_public_key_length;
331 const BIGNUM * hand_pub_key;
270332
271333 assert (handle != NULL);
272334 assert (public_key != NULL);
273335
274 handle->length = private_key_length * 8;
336
337 DH_set_length(handle, private_key_length * 8);
275338
276339 if (!check_result (DH_generate_key (handle)))
277340 return false;
278341
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);
280345 dh_size = DH_size (handle);
281346
282347 tr_dh_align_key (public_key, my_public_key_length, dh_size);
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto-utils-polarssl.c 14444 2015-01-07 14:05:58Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto-utils.c 14618 2015-12-13 01:29:39Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
132132 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
133133 "./";
134134
135 assert (plain_text != NULL);
136
135137 size_t i;
136138 unsigned char salt[saltval_len];
137139 uint8_t sha[SHA_DIGEST_LENGTH];
154156 tr_ssha1_matches (const char * ssha1,
155157 const char * plain_text)
156158 {
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;
163168
164169 /* 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];
170174
171175 /* 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;
185180 }
186181
187182 /***
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto-utils.h 14422 2015-01-01 21:16:36Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_CRYPTO_UTILS_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto.c 14476 2015-03-15 11:43:32Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: crypto.h 14360 2014-12-04 20:45:18Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_ENCRYPTION_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: error-test.c 14657 2016-01-03 21:03:54Z mikedld $
6 * $Id$
77 */
88
99 #include "transmission.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: error-types.h 14492 2015-04-11 10:58:08Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_ERROR_TYPES_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: error.c 14369 2014-12-10 18:58:12Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: error.h 14369 2014-12-10 18:58:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_ERROR_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: fdlimit.c 14548 2015-07-01 00:54:41Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
222222 /* If the file already exists and it's too large, truncate it.
223223 * This is a fringe case that happens if a torrent's been updated
224224 * and one of the updated torrent's files is smaller.
225 * http://trac.transmissionbt.com/ticket/2228
225 * https://trac.transmissionbt.com/ticket/2228
226226 * https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/318249
227227 */
228228 if (resize_needed && !tr_sys_file_truncate (fd, file_size, &error))
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: fdlimit.h 14479 2015-03-18 07:34:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: file-posix.c 14640 2015-12-28 23:53:55Z mikedld $
6 * $Id$
77 */
88
99 #if defined (HAVE_MKDTEMP) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 700)
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: file-test.c 14658 2016-01-04 05:04:55Z mikedld $
6 * $Id$
77 */
88
99 #include <string.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: file-win32.c 14588 2015-10-23 05:29:47Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: file.c 14493 2015-04-11 14:54:01Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: file.h 14584 2015-10-20 21:22:19Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_FILE_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: handshake.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
425425
426426 /* compute the secret */
427427 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);
429430
430431 /* now send these: HASH ('req1', S), HASH ('req2', SKEY) xor HASH ('req3', S),
431432 * ENCRYPT (VC, crypto_provide, len (PadC), PadC, len (IA)), ENCRYPT (IA) */
741742
742743 /* read the incoming peer's public key */
743744 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
745748 computeRequestHash (handshake, "req1", handshake->myReq1);
746749
747750 /* send our public key to the peer */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: handshake.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: history-test.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <string.h> /* memset () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: history.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: history.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: inout.c 14476 2015-03-15 11:43:32Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: inout.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: json-test.c 14640 2015-12-28 23:53:55Z mikedld $
6 * $Id$
77 */
88
99 #include <string.h> /* strlen () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: libtransmission-test.c 14581 2015-10-18 18:39:14Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: libtransmission-test.h 14382 2014-12-13 15:22:39Z mikedld $
6 * $Id$
77 */
88
99 /* Note VERBOSE needs to be (un)defined before including this file */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: list.c 14319 2014-07-06 20:06:45Z jordan $
6 * $Id$
77 */
88
99 #include "transmission.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: list.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: log.c 14620 2015-12-13 10:34:53Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: log.h 14476 2015-03-15 11:43:32Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_LOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: magnet-test.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include "transmission.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: magnet.c 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: magnet.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: makemeta-test.c 14428 2015-01-02 11:15:31Z mikedld $
6 * $Id$
77 */
88
99 #include "libtransmission-test.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: makemeta.c 14355 2014-12-04 12:13:59Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: makemeta.h 14294 2014-06-10 00:43:21Z jordan $
6 * $Id$
77 */
88
99 #ifndef TR_MAKEMETA_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: metainfo-test.c 14428 2015-01-02 11:15:31Z mikedld $
6 * $Id$
77 */
88
99 #include "libtransmission-test.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: metainfo.c 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: metainfo.h 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: move-test.c 14587 2015-10-23 04:09:40Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: natpmp.c 14532 2015-05-31 22:13:31Z mikedld $
6 * $Id$
77 */
88
99 #include <errno.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: natpmp_local.h 14369 2014-12-10 18:58:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
00 /******************************************************************************
11 *
2 * $Id: net.c 14578 2015-10-16 19:49:07Z mikedld $
2 * $Id$
33 *
44 * Copyright (c) Transmission authors and contributors
55 *
00 /******************************************************************************
1 * $Id: net.h 14574 2015-10-11 16:35:51Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) Transmission authors and contributors
44 *
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: peer-common.h 14382 2014-12-13 15:22:39Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: peer-io.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: peer-io.h 14479 2015-03-18 07:34:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: peer-mgr.c 14666 2016-01-07 19:20:14Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: peer-mgr.h 14479 2015-03-18 07:34:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: peer-msgs-test.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <stdio.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: peer-msgs.c 14666 2016-01-07 19:20:14Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: peer-msgs.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: platform-quota.c 14480 2015-03-19 06:08:06Z mikedld $
6 * $Id$
77 */
88
99 #include <errno.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: platform-quota.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: platform.c 14633 2015-12-25 10:19:50Z mikedld $
6 * $Id$
77 */
88
99 #define _XOPEN_SOURCE 600 /* needed for recursive locks. */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: platform.h 14532 2015-05-31 22:13:31Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: port-forwarding.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: port-forwarding.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: ptrarray.c 14592 2015-10-25 17:13:14Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: ptrarray.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: quark-test.c 14669 2016-01-08 11:12:22Z mikedld $
6 * $Id$
77 */
88
99 #include <string.h> /* strlen() */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: quark.c 14666 2016-01-07 19:20:14Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
288288 { "rpc-authentication-required", 27 },
289289 { "rpc-bind-address", 16 },
290290 { "rpc-enabled", 11 },
291 { "rpc-host-whitelist", 18 },
292 { "rpc-host-whitelist-enabled", 26 },
291293 { "rpc-password", 12 },
292294 { "rpc-port", 8 },
293295 { "rpc-url", 7 },
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: quark.h 14369 2014-12-10 18:58:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_QUARK_H
290290 TR_KEY_rpc_authentication_required,
291291 TR_KEY_rpc_bind_address,
292292 TR_KEY_rpc_enabled,
293 TR_KEY_rpc_host_whitelist,
294 TR_KEY_rpc_host_whitelist_enabled,
293295 TR_KEY_rpc_password,
294296 TR_KEY_rpc_port,
295297 TR_KEY_rpc_url,
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: rename-test.c 14491 2015-04-11 10:51:59Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: resume.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <string.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: resume.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: rpc-server.c 14663 2016-01-07 15:28:58Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
5151 bool isEnabled;
5252 bool isPasswordEnabled;
5353 bool isWhitelistEnabled;
54 bool isHostWhitelistEnabled;
5455 tr_port port;
5556 char * url;
5657 struct in_addr bindAddress;
6263 char * password;
6364 char * whitelistStr;
6465 tr_list * whitelist;
66 tr_list * hostWhitelist;
6567
6668 char * sessionId;
6769 time_t sessionIdExpiresAt;
584586 if (tr_wildmat (address, l->data))
585587 return true;
586588
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);
587644 return false;
588645 }
589646
661718 {
662719 handle_upload (req, server);
663720 }
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 }
664737 #ifdef REQUIRE_SESSION_ID
665738 else if (!test_session_id (server, req))
666739 {
673746 "<li> When you get this 409 error message, resend your request with the updated header"
674747 "</ol></p>"
675748 "<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> "
677750 "attacks.</p>"
678751 "<p><code>%s: %s</code></p>",
679752 TR_RPC_SESSION_ID_HEADER, sessionId);
874947 return server->url ? server->url : "";
875948 }
876949
877 void
878 tr_rpcSetWhitelist (tr_rpc_server * server, const char * whitelistStr)
950 static void
951 tr_rpcSetList (const char * whitelistStr, tr_list ** list)
879952 {
880953 void * tmp;
881954 const char * walk;
882955
883 /* keep the string */
884 tmp = server->whitelistStr;
885 server->whitelistStr = tr_strdup (whitelistStr);
886 tr_free (tmp);
887
888956 /* clear out the old whitelist entries */
889 while ((tmp = tr_list_pop_front (&server->whitelist)))
957 while ((tmp = tr_list_pop_front (list)))
890958 tr_free (tmp);
891959
892960 /* build the new whitelist entries */
895963 const char * delimiters = " ,;";
896964 const size_t len = strcspn (walk, delimiters);
897965 char * token = tr_strndup (walk, len);
898 tr_list_append (&server->whitelist, token);
966 tr_list_append (list, token);
899967 if (strcspn (token, "+-") < len)
900968 tr_logAddNamedInfo (MY_NAME, "Adding address to whitelist: %s (And it has a '+' or '-'! Are you using an old ACL by mistake?)", token);
901969 else
908976 }
909977 }
910978
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
911996 const char*
912997 tr_rpcGetWhitelist (const tr_rpc_server * server)
913998 {
9271012 tr_rpcGetWhitelistEnabled (const tr_rpc_server * server)
9281013 {
9291014 return server->isWhitelistEnabled;
1015 }
1016
1017 void
1018 tr_rpcSetHostWhitelistEnabled(tr_rpc_server * server, bool isEnabled)
1019 {
1020 server->isHostWhitelistEnabled = isEnabled;
9301021 }
9311022
9321023 /****
10621153 else
10631154 tr_rpcSetWhitelistEnabled (s, boolVal);
10641155
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
10651168 key = TR_KEY_rpc_authentication_required;
10661169 if (!tr_variantDictFindBool (settings, key, &boolVal))
10671170 missing_settings_key (key);
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: rpc-server.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
4848
4949 const char* tr_rpcGetWhitelist (const tr_rpc_server * server);
5050
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
5157 void tr_rpcSetPassword (tr_rpc_server * server,
5258 const char * password);
5359
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: rpc-test.c 14633 2015-12-25 10:19:50Z mikedld $
6 * $Id$
77 */
88
99 #include "transmission.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: rpcimpl.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: rpcimpl.h 14633 2015-12-25 10:19:50Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_RPC_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: session-test.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include <stdio.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: session.c 14666 2016-01-07 19:20:14Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
358358 tr_variantDictAddStr (d, TR_KEY_rpc_username, "");
359359 tr_variantDictAddStr (d, TR_KEY_rpc_whitelist, TR_DEFAULT_RPC_WHITELIST);
360360 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);
361363 tr_variantDictAddInt (d, TR_KEY_rpc_port, atoi (TR_DEFAULT_RPC_PORT_STR));
362364 tr_variantDictAddStr (d, TR_KEY_rpc_url, TR_DEFAULT_RPC_URL_STR);
363365 tr_variantDictAddBool (d, TR_KEY_scrape_paused_torrents_enabled, true);
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: session.h 14581 2015-10-18 18:39:14Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: stats.c 14491 2015-04-11 10:51:59Z mikedld $
6 * $Id$
77 */
88
99 #include "transmission.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: torrent-ctor.c 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #include <errno.h> /* EINVAL */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: torrent-magnet.c 14664 2016-01-07 17:12:14Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: torrent-magnet.h 14664 2016-01-07 17:12:14Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: torrent.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <errno.h> /* EINVAL */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: torrent.h 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
1818 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919 * THE SOFTWARE.
2020 *
21 * $Id: tr-dht.c 14536 2015-06-08 19:54:51Z mikedld $
21 * $Id$
2222 *
2323 */
2424
1818 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919 * THE SOFTWARE.
2020 *
21 * $Id: tr-dht.h 14532 2015-05-31 22:13:31Z mikedld $
21 * $Id$
2222 *
2323 */
2424
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: tr-getopt-test.c 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #include "transmission.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: tr-getopt.c 14615 2015-12-06 22:39:14Z jordan $
6 * $Id$
77 */
88
99 #include <ctype.h> /* isspace () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: tr-getopt.h 14615 2015-12-06 22:39:14Z jordan $
6 * $Id$
77 */
88
99 #ifndef TR_GETOPT_H
6262 * This module implements the Local Peer Discovery (LPD) protocol as supported by the
6363 * uTorrent client application. A typical LPD datagram is 119 bytes long.
6464 *
65 * $Id: tr-lpd.c 14641 2015-12-29 00:42:40Z mikedld $
65 * $Id$
6666 */
6767
6868 static void event_callback (evutil_socket_t, short, void*);
2626 #ifndef _TR_LPD_H
2727 #define _TR_LPD_H
2828
29 /* $Id: tr-lpd.h 14321 2014-07-08 00:15:12Z jordan $ */
29 /* $Id$ */
3030
3131 int tr_lpdInit (tr_session*, tr_address*);
3232 void tr_lpdUninit (tr_session*);
33 * It may be used under the 3-Clause BSD License, the GNU Public License v2,
44 * or v3, or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: transmission.h 14645 2015-12-29 19:44:50Z mikedld $
6 * $Id$
77 */
88
99 /*
122122 #define TR_DEFAULT_BIND_ADDRESS_IPV4 "0.0.0.0"
123123 #define TR_DEFAULT_BIND_ADDRESS_IPV6 "::"
124124 #define TR_DEFAULT_RPC_WHITELIST "127.0.0.1"
125 #define TR_DEFAULT_RPC_HOST_WHITELIST ""
125126 #define TR_DEFAULT_RPC_PORT_STR "9091"
126127 #define TR_DEFAULT_RPC_URL_STR "/transmission/"
127128 #define TR_DEFAULT_PEER_PORT_STR "51413"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: trevent.c 14648 2015-12-31 14:17:37Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: trevent.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: upnp.c 14565 2015-10-04 04:53:18Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: upnp.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: utils-test.c 14678 2016-02-07 11:54:01Z mikedld $
6 * $Id$
77 */
88
99 #include <limits.h> /* INT_MAX */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: utils.c 14682 2016-02-23 05:07:43Z mikedld $
6 * $Id$
77 */
88
99 #ifdef HAVE_MEMMEM
635635 {
636636 static const char hex[] = "0123456789abcdef";
637637 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;
646642
647643 *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 }
648651 }
649652
650653 void
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: utils.h 14641 2015-12-29 00:42:40Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_UTILS_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: variant-benc.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: variant-common.h 14521 2015-05-04 19:58:34Z mikedld $
6 * $Id$
77 */
88
99 #ifndef __LIBTRANSMISSION_VARIANT_MODULE__
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: variant-json.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: variant-test.c 14666 2016-01-07 19:20:14Z mikedld $
6 * $Id$
77 */
88
99 #include <ctype.h> /* isspace () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: variant.c 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #if defined (HAVE_USELOCALE) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 700)
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: variant.h 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_VARIANT_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: verify.c 14543 2015-06-23 21:16:33Z mikedld $
6 * $Id$
77 */
88
99 #if defined (HAVE_POSIX_FADVISE) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 600)
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: verify.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #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
79 #define MAJOR_VERSION 2
8 #define MINOR_VERSION 92
10 #define MINOR_VERSION 93
911 #define TR_STABLE_RELEASE 1
0 #ifndef TR_VERSION_H
1 #define TR_VERSION_H
0 #pragma once
21
32 #define PEERID_PREFIX "${TR_PEER_ID_PREFIX}"
43 #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}
76 #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})"
98 #define VERSION_STRING_INFOPLIST ${TR_USER_AGENT_PREFIX}
109 #define MAJOR_VERSION ${TR_VERSION_MAJOR}
1110 #define MINOR_VERSION ${TR_VERSION_MINOR}
1312 #cmakedefine TR_BETA_RELEASE 1
1413 #cmakedefine TR_NIGHTLY_RELEASE 1
1514 #cmakedefine TR_STABLE_RELEASE 1
16
17 #endif /* TR_VERSION_H */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: watchdir-common.h 14651 2016-01-02 14:28:59Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_WATCHDIR_COMMON_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: watchdir-generic.c 14651 2016-01-02 14:28:59Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: watchdir-inotify.c 14651 2016-01-02 14:28:59Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: watchdir-kqueue.c 14651 2016-01-02 14:28:59Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: watchdir-test.c 14675 2016-01-25 22:09:49Z mikedld $
6 * $Id$
77 */
88
99 #include <event2/event.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: watchdir-win32.c 14653 2016-01-02 15:26:23Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: watchdir.c 14674 2016-01-25 21:48:58Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: watchdir.h 14674 2016-01-25 21:48:58Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_WATCHDIR_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: web.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <assert.h>
593593 case 415: return "Unsupported Media Type";
594594 case 416: return "Requested Range Not Satisfiable";
595595 case 417: return "Expectation Failed";
596 case 421: return "Misdirected Request";
596597 case 500: return "Internal Server Error";
597598 case 501: return "Not Implemented";
598599 case 502: return "Bad Gateway";
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: web.h 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #ifndef TR_HTTP_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: webseed.c 14619 2015-12-13 10:23:22Z mikedld $
6 * $Id$
77 */
88
99 #include <string.h> /* strlen () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: webseed.h 14241 2014-01-21 03:10:30Z jordan $
6 * $Id$
77 */
88
99 #ifndef __TRANSMISSION__
3030
3131 PROGRAM=libtool
3232 PACKAGE=libtool
33 VERSION=2.4.6
33 VERSION="2.4.6 Debian-2.4.6-2"
3434 package_revision=2.4.6
3535
3636
20672067 compiler: $LTCC
20682068 compiler flags: $LTCFLAGS
20692069 linker: $LD (gnu? $with_gnu_ld)
2070 version: $progname (GNU libtool) 2.4.6
2070 version: $progname $scriptversion Debian-2.4.6-2
20712071 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
20722072 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
20732073
20742074 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/>.
20762076 General help using GNU software: <http://www.gnu.org/gethelp/>."
20772077 exit 0
20782078 }
72717271 # -tp=* Portland pgcc target processor selection
72727272 # --sysroot=* for sysroot support
72737273 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7274 # -fuse-ld=* Linker select flags for GCC
7274 # -specs=* GCC specs files
72757275 # -stdlib=* select c++ std lib with clang
7276 # -fsanitize=* Clang/GCC memory and address sanitizer
72767277 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
72777278 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
72787279 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
7279 -fuse-ld=*)
7280 -specs=*|-fsanitize=*)
72807281 func_quote_for_eval "$arg"
72817282 arg=$func_quote_for_eval_result
72827283 func_append compile_command " $arg"
75697570 case $pass in
75707571 dlopen) libs=$dlfiles ;;
75717572 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 ;;
75737577 esac
75747578 fi
75757579 if test lib,dlpreopen = "$linkmode,$pass"; then
78887892 # It is a libtool convenience library, so add in its objects.
78897893 func_append convenience " $ladir/$objdir/$old_library"
78907894 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
78917905 elif test prog != "$linkmode" && test lib != "$linkmode"; then
78927906 func_fatal_error "'$lib' is not a convenience library"
78937907 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
79047908 continue
79057909 fi # $pass = conv
79067910
88238827 age=$number_minor
88248828 revision=$number_minor
88258829 lt_irix_increment=no
8830 ;;
8831 *)
8832 func_fatal_configuration "$modename: unknown library version type '$version_type'"
88268833 ;;
88278834 esac
88288835 ;;
3535 dnl try to pull in the installed version of these macros
3636 dnl when running aclocal in the glib directory.
3737 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])
4040 dnl
4141 dnl At the end, if we're not within glib, we'll define the public
4242 dnl definitions in terms of our private definitions.
727727 cat <<_LT_EOF >> "$cfgfile"
728728 #! $SHELL
729729 # Generated automatically by $as_me ($PACKAGE) $VERSION
730 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
731730 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
732731
733732 # Provide generalized library-building support services.
26652664 *) objformat=elf ;;
26662665 esac
26672666 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
26762668 case $version_type in
26772669 freebsd-elf*)
26782670 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26832675 freebsd-*)
26842676 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
26852677 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
26922678 ;;
26932679 esac
26942680 shlibpath_var=LD_LIBRARY_PATH
28972883 # people can always --disable-shared, the test was removed, and we
28982884 # assume the GNU/Linux dynamic linker is in use.
28992885 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'
29002898 ;;
29012899
29022900 netbsd*)
35583556 lt_cv_deplibs_check_method=pass_all
35593557 ;;
35603558
3561 netbsd*)
3559 netbsd* | netbsdelf*-gnu)
35623560 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35633561 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35643562 else
44364434 ;;
44374435 esac
44384436 ;;
4439 netbsd*)
4437 netbsd* | netbsdelf*-gnu)
44404438 ;;
44414439 *qnx* | *nto*)
44424440 # QNX uses GNU C++, but need to define -shared option too, otherwise
49484946 ;;
49494947 esac
49504948 ;;
4949 linux* | k*bsd*-gnu | gnu*)
4950 _LT_TAGVAR(link_all_deplibs, $1)=no
4951 ;;
49514952 *)
49524953 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49534954 ;;
50095010 ;;
50105011 openbsd* | bitrig*)
50115012 with_gnu_ld=no
5013 ;;
5014 linux* | k*bsd*-gnu | gnu*)
5015 _LT_TAGVAR(link_all_deplibs, $1)=no
50125016 ;;
50135017 esac
50145018
52645268 fi
52655269 ;;
52665270
5267 netbsd*)
5271 netbsd* | netbsdelf*-gnu)
52685272 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
52695273 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
52705274 wlarc=
57855789 if test yes = "$lt_cv_irix_exported_symbol"; then
57865790 _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'
57875791 fi
5792 _LT_TAGVAR(link_all_deplibs, $1)=no
57885793 else
57895794 _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'
57905795 _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'
58065811 esac
58075812 ;;
58085813
5809 netbsd*)
5814 netbsd* | netbsdelf*-gnu)
58105815 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58115816 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
58125817 else
00 /******************************************************************************
1 * $Id: AboutWindowController.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: AboutWindowController.m 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: AddMagnetWindowController.h 13602 2012-10-30 00:22:10Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: AddMagnetWindowController.m 13602 2012-10-30 00:22:10Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: AddWindowController.h 13602 2012-10-30 00:22:10Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: AddWindowController.m 14587 2015-10-23 04:09:40Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BadgeView.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BadgeView.m 13340 2012-06-10 02:35:58Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: Badger.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: Badger.m 13571 2012-10-15 02:12:44Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BlocklistDownloader.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BlocklistDownloader.m 13326 2012-05-29 01:03:21Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BlocklistDownloaderViewController.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BlocklistDownloaderViewController.m 13253 2012-03-13 03:20:09Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BlocklistScheduler.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BlocklistScheduler.m 13492 2012-09-10 02:37:29Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BonjourController.h 13491 2012-09-10 02:01:07Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: BonjourController.m 13491 2012-09-10 02:01:07Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ButtonToolbarItem.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ButtonToolbarItem.m 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ColorTextField.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ColorTextField.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: Controller.h 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
258258
259259 - (void) linkHomepage: (id) sender;
260260 - (void) linkForums: (id) sender;
261 - (void) linkTrac: (id) sender;
261 - (void) linkGitHub: (id) sender;
262262 - (void) linkDonate: (id) sender;
263263
264264 - (void) rpcCallback: (tr_rpc_callback_type) type forTorrentStruct: (struct tr_torrent *) torrentStruct;
00 /******************************************************************************
1 * $Id: Controller.m 14712 2016-03-06 19:45:41Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
132132
133133 #define TRANSFER_PLIST @"Transfers.plist"
134134
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/"
139139
140140 #define DONATE_NAG_TIME (60 * 60 * 24 * 7)
141141
227227 {
228228 if ([krFilePath length] == 0 || ![fileManager fileExistsAtPath: krFilePath])
229229 continue;
230
230
231231 if (![fileManager removeItemAtPath: krFilePath error: NULL])
232232 NSLog(@"Unable to remove ransomware file at %@, please do so manually", krFilePath);
233233 }
257257 [alert setInformativeText: NSLocalizedString(@"There is already a copy of Transmission running. "
258258 "This copy cannot be opened until that instance is quit.", "Transmission already running alert -> message")];
259259 [alert setAlertStyle: NSCriticalAlertStyle];
260
260
261261 [alert runModal];
262262 [alert release];
263
263
264264 //kill ourselves right away
265265 exit(0);
266266 }
267
267
268268 [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithContentsOfFile:
269269 [[NSBundle mainBundle] pathForResource: @"Defaults" ofType: @"plist"]]];
270
270
271271 //set custom value transformers
272272 ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease];
273273 [NSValueTransformer setValueTransformer: pathTransformer forName: @"ExpandedPathToPathTransformer"];
274
274
275275 ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease];
276276 [NSValueTransformer setValueTransformer: iconTransformer forName: @"ExpandedPathToIconTransformer"];
277
277
278278 //cover our asses
279279 if ([[NSUserDefaults standardUserDefaults] boolForKey: @"WarningLegal"])
280280 {
287287 " You and you alone are fully responsible for exercising proper judgement and abiding by your local laws.",
288288 "Legal alert -> message")];
289289 [alert setAlertStyle: NSInformationalAlertStyle];
290
290
291291 if ([alert runModal] == NSAlertSecondButtonReturn)
292292 exit(0);
293293 [alert release];
294
294
295295 [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningLegal"];
296296 }
297297 }
301301 if ((self = [super init]))
302302 {
303303 fDefaults = [NSUserDefaults standardUserDefaults];
304
304
305305 //checks for old version speeds of -1
306306 if ([fDefaults integerForKey: @"UploadLimit"] < 0)
307307 {
313313 [fDefaults removeObjectForKey: @"DownloadLimit"];
314314 [fDefaults setBool: NO forKey: @"CheckDownload"];
315315 }
316
316
317317 //upgrading from versions < 2.40: clear recent items
318318 [[NSDocumentController sharedDocumentController] clearRecentDocuments: nil];
319
319
320320 tr_variant settings;
321321 tr_variantInitDict(&settings, 41);
322322 tr_sessionGetDefaultSettings(&settings);
323
323
324324 const BOOL usesSpeedLimitSched = [fDefaults boolForKey: @"SpeedLimitAuto"];
325325 if (!usesSpeedLimitSched)
326326 tr_variantDictAddBool(&settings, TR_KEY_alt_speed_enabled, [fDefaults boolForKey: @"SpeedLimit"]);
327
327
328328 tr_variantDictAddInt(&settings, TR_KEY_alt_speed_up, [fDefaults integerForKey: @"SpeedLimitUploadLimit"]);
329329 tr_variantDictAddInt(&settings, TR_KEY_alt_speed_down, [fDefaults integerForKey: @"SpeedLimitDownloadLimit"]);
330
330
331331 tr_variantDictAddBool(&settings, TR_KEY_alt_speed_time_enabled, [fDefaults boolForKey: @"SpeedLimitAuto"]);
332332 tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_begin, [PrefsController dateToTimeSum:
333333 [fDefaults objectForKey: @"SpeedLimitAutoOnDate"]]);
334334 tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_end, [PrefsController dateToTimeSum:
335335 [fDefaults objectForKey: @"SpeedLimitAutoOffDate"]]);
336336 tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_day, [fDefaults integerForKey: @"SpeedLimitAutoDay"]);
337
337
338338 tr_variantDictAddInt(&settings, TR_KEY_speed_limit_down, [fDefaults integerForKey: @"DownloadLimit"]);
339339 tr_variantDictAddBool(&settings, TR_KEY_speed_limit_down_enabled, [fDefaults boolForKey: @"CheckDownload"]);
340340 tr_variantDictAddInt(&settings, TR_KEY_speed_limit_up, [fDefaults integerForKey: @"UploadLimit"]);
341341 tr_variantDictAddBool(&settings, TR_KEY_speed_limit_up_enabled, [fDefaults boolForKey: @"CheckUpload"]);
342
342
343343 //hidden prefs
344344 if ([fDefaults objectForKey: @"BindAddressIPv4"])
345345 tr_variantDictAddStr(&settings, TR_KEY_bind_address_ipv4, [[fDefaults stringForKey: @"BindAddressIPv4"] UTF8String]);
346346 if ([fDefaults objectForKey: @"BindAddressIPv6"])
347347 tr_variantDictAddStr(&settings, TR_KEY_bind_address_ipv6, [[fDefaults stringForKey: @"BindAddressIPv6"] UTF8String]);
348
348
349349 tr_variantDictAddBool(&settings, TR_KEY_blocklist_enabled, [fDefaults boolForKey: @"BlocklistNew"]);
350350 if ([fDefaults objectForKey: @"BlocklistURL"])
351351 tr_variantDictAddStr(&settings, TR_KEY_blocklist_url, [[fDefaults stringForKey: @"BlocklistURL"] UTF8String]);
363363 tr_variantDictAddInt(&settings, TR_KEY_message_level, TR_LOG_DEBUG);
364364 tr_variantDictAddInt(&settings, TR_KEY_peer_limit_global, [fDefaults integerForKey: @"PeersTotal"]);
365365 tr_variantDictAddInt(&settings, TR_KEY_peer_limit_per_torrent, [fDefaults integerForKey: @"PeersTorrent"]);
366
366
367367 const BOOL randomPort = [fDefaults boolForKey: @"RandomPort"];
368368 tr_variantDictAddBool(&settings, TR_KEY_peer_port_random_on_start, randomPort);
369369 if (!randomPort)
370370 tr_variantDictAddInt(&settings, TR_KEY_peer_port, [fDefaults integerForKey: @"BindPort"]);
371
371
372372 //hidden pref
373373 if ([fDefaults objectForKey: @"PeerSocketTOS"])
374374 tr_variantDictAddStr(&settings, TR_KEY_peer_socket_tos, [[fDefaults stringForKey: @"PeerSocketTOS"] UTF8String]);
375
375
376376 tr_variantDictAddBool(&settings, TR_KEY_pex_enabled, [fDefaults boolForKey: @"PEXGlobal"]);
377377 tr_variantDictAddBool(&settings, TR_KEY_port_forwarding_enabled, [fDefaults boolForKey: @"NatTraversal"]);
378378 tr_variantDictAddBool(&settings, TR_KEY_queue_stalled_enabled, [fDefaults boolForKey: @"CheckStalled"]);
385385 tr_variantDictAddInt(&settings, TR_KEY_rpc_port, [fDefaults integerForKey: @"RPCPort"]);
386386 tr_variantDictAddStr(&settings, TR_KEY_rpc_username, [[fDefaults stringForKey: @"RPCUsername"] UTF8String]);
387387 tr_variantDictAddBool(&settings, TR_KEY_rpc_whitelist_enabled, [fDefaults boolForKey: @"RPCUseWhitelist"]);
388 tr_variantDictAddBool(&settings, TR_KEY_rpc_host_whitelist_enabled, [fDefaults boolForKey: @"RPCUseHostWhitelist"]);
388389 tr_variantDictAddBool(&settings, TR_KEY_seed_queue_enabled, [fDefaults boolForKey: @"QueueSeed"]);
389390 tr_variantDictAddInt(&settings, TR_KEY_seed_queue_size, [fDefaults integerForKey: @"QueueSeedNumber"]);
390391 tr_variantDictAddBool(&settings, TR_KEY_start_added_torrents, [fDefaults boolForKey: @"AutoStartDownload"]);
391392 tr_variantDictAddBool(&settings, TR_KEY_script_torrent_done_enabled, [fDefaults boolForKey: @"DoneScriptEnabled"]);
392393 tr_variantDictAddStr(&settings, TR_KEY_script_torrent_done_filename, [[fDefaults stringForKey: @"DoneScriptPath"] UTF8String]);
393394 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
396400 NSString * kbString, * mbString, * gbString, * tbString;
397401 if ([NSApp isOnMountainLionOrBetter])
398402 {
399403 NSByteCountFormatter * unitFormatter = [[NSByteCountFormatterMtLion alloc] init];
400404 [unitFormatter setIncludesCount: NO];
401405 [unitFormatter setAllowsNonnumericFormatting: NO];
402
406
403407 [unitFormatter setAllowedUnits: NSByteCountFormatterUseKB];
404408 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
406410 [unitFormatter setAllowedUnits: NSByteCountFormatterUseMB];
407411 mbString = [unitFormatter stringFromByteCount: 17];
408
412
409413 [unitFormatter setAllowedUnits: NSByteCountFormatterUseGB];
410414 gbString = [unitFormatter stringFromByteCount: 17];
411
415
412416 [unitFormatter setAllowedUnits: NSByteCountFormatterUseTB];
413417 tbString = [unitFormatter stringFromByteCount: 17];
414
418
415419 [unitFormatter release];
416420 }
417421 else
421425 gbString = NSLocalizedString(@"GB", "file/memory size - gigabytes");
422426 tbString = NSLocalizedString(@"TB", "file/memory size - terabytes");
423427 }
424
428
425429 tr_formatter_size_init(1000, [kbString UTF8String],
426430 [mbString UTF8String],
427431 [gbString UTF8String],
436440 [mbString UTF8String],
437441 [gbString UTF8String],
438442 [tbString UTF8String]);
439
443
440444 const char * configDir = tr_getDefaultConfigDir("Transmission");
441445 fLib = tr_sessionInit(configDir, YES, &settings);
442446 tr_variantFree(&settings);
443
447
444448 fConfigDirectory = [[NSString alloc] initWithUTF8String: configDir];
445
449
446450 [NSApp setDelegate: self];
447
451
448452 //register for magnet URLs (has to be in init)
449453 [[NSAppleEventManager sharedAppleEventManager] setEventHandler: self andSelector: @selector(handleOpenContentsEvent:replyEvent:)
450454 forEventClass: kInternetEventClass andEventID: kAEGetURL];
451
455
452456 fTorrents = [[NSMutableArray alloc] init];
453457 fDisplayedTorrents = [[NSMutableArray alloc] init];
454
458
455459 fInfoController = [[InfoWindowController alloc] init];
456
460
457461 //needs to be done before init-ing the prefs controller
458462 fFileWatcherQueue = [[VDKQueue alloc] init];
459463 [fFileWatcherQueue setDelegate: self];
460
464
461465 fPrefsController = [[PrefsController alloc] initWithHandle: fLib];
462
466
463467 fQuitting = NO;
464468 fGlobalPopoverShown = NO;
465469 fSoundPlaying = NO;
466
470
467471 tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self);
468472 if (usesSpeedLimitSched)
469473 [fDefaults setBool: tr_sessionUsesAltSpeed(fLib) forKey: @"SpeedLimit"];
470
474
471475 tr_sessionSetRPCCallback(fLib, rpcCallback, self);
472
476
473477 [GrowlApplicationBridge setGrowlDelegate: self];
474
478
475479 [[SUUpdater sharedUpdater] setDelegate: self];
476480 fQuitRequested = NO;
477
481
478482 fPauseOnLaunch = (GetCurrentKeyModifiers() & (optionKey | rightOptionKey)) != 0;
479483 }
480484 return self;
489493 [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly];
490494 [fWindow setToolbar: toolbar];
491495 [toolbar release];
492
496
493497 [fWindow setDelegate: self]; //do manually to avoid placement issue
494
498
495499 [fWindow makeFirstResponder: fTableView];
496500 [fWindow setExcludedFromWindowsMenu: YES];
497
501
498502 //set table size
499503 const BOOL small = [fDefaults boolForKey: @"SmallView"];
500504 if (small)
501505 [fTableView setRowHeight: ROW_HEIGHT_SMALL];
502506 [fTableView setUsesAlternatingRowBackgroundColors: !small];
503
507
504508 [fWindow setContentBorderThickness: NSMinY([[fTableView enclosingScrollView] frame]) forEdge: NSMinYEdge];
505509 [fWindow setMovableByWindowBackground: YES];
506
510
507511 [[fTotalTorrentsField cell] setBackgroundStyle: NSBackgroundStyleRaised];
508
512
509513 //set up filter bar
510514 [self showFilterBar: [fDefaults boolForKey: @"FilterBar"] animate: NO];
511
515
512516 //set up status bar
513517 [self showStatusBar: [fDefaults boolForKey: @"StatusBar"] animate: NO];
514
518
515519 [fActionButton setToolTip: NSLocalizedString(@"Shortcuts for changing global settings.",
516520 "Main window -> 1st bottom left button (action) tooltip")];
517521 [fSpeedLimitButton setToolTip: NSLocalizedString(@"Speed Limit overrides the total bandwidth limits with its own limits.",
518522 "Main window -> 2nd bottom left button (turtle) tooltip")];
519523 [fClearCompletedButton setToolTip: NSLocalizedString(@"Remove all transfers that have completed seeding.",
520524 "Main window -> 3rd bottom left button (remove all) tooltip")];
521
525
522526 [fTableView registerForDraggedTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE]];
523527 [fWindow registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, NSURLPboardType, nil]];
524
528
525529 //sort the sort menu items (localization is from strings file)
526530 NSMutableArray * sortMenuItems = [NSMutableArray arrayWithCapacity: 7];
527531 NSUInteger sortMenuIndex = 0;
542546 ++sortMenuIndex;
543547 }
544548 }
545
549
546550 [sortMenuItems sortUsingDescriptors: [NSArray arrayWithObject: [NSSortDescriptor sortDescriptorWithKey: @"title" ascending: YES selector: @selector(localizedCompare:)]]];
547
551
548552 for (NSMenuItem * item in sortMenuItems)
549553 [fSortMenu insertItem: item atIndex: sortMenuIndex++];
550
554
551555 //you would think this would be called later in this method from updateUI, but it's not reached in awakeFromNib
552556 //this must be called after showStatusBar:
553557 [fStatusBar updateWithDownload: 0.0 upload: 0.0];
554558
555559 //this should also be after the rest of the setup
556560 [self updateForAutoSize];
557
561
558562 //register for sleep notifications
559563 IONotificationPortRef notify;
560564 io_object_t iterator;
562566 CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes);
563567 else
564568 NSLog(@"Could not IORegisterForSystemPower");
565
569
566570 //load previous transfers
567571 NSString * historyFile = [fConfigDirectory stringByAppendingPathComponent: TRANSFER_PLIST];
568572 NSArray * history = [NSArray arrayWithContentsOfFile: historyFile];
572576 if ((history = [fDefaults arrayForKey: @"History"]))
573577 [fDefaults removeObjectForKey: @"History"];
574578 }
575
579
576580 if (history)
577581 {
578582 NSMutableArray * waitToStartTorrents = [NSMutableArray arrayWithCapacity: (([history count] > 0 && !fPauseOnLaunch) ? [history count]-1 : 0)]; //theoretical max without doing a lot of work
579
583
580584 for (NSDictionary * historyItem in history)
581585 {
582586 Torrent * torrent;
583587 if ((torrent = [[Torrent alloc] initWithHistory: historyItem lib: fLib forcePause: fPauseOnLaunch]))
584588 {
585589 [fTorrents addObject: torrent];
586
590
587591 NSNumber * waitToStart;
588592 if (!fPauseOnLaunch && (waitToStart = [historyItem objectForKey: @"WaitToStart"]) && [waitToStart boolValue])
589593 [waitToStartTorrents addObject: torrent];
590
594
591595 [torrent release];
592596 }
593597 }
594
598
595599 //now that all are loaded, let's set those in the queue to waiting
596600 for (Torrent * torrent in waitToStartTorrents)
597601 [torrent startTransfer];
598602 }
599
603
600604 fBadger = [[Badger alloc] initWithLib: fLib];
601
605
602606 if ([NSApp isOnMountainLionOrBetter])
603607 [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] setDelegate: self];
604
608
605609 // remove Share menu items
606610 if (![NSApp isOnMountainLionOrBetter]) {
607611 [[fShareMenuItem menu] removeItem:fShareMenuItem];
608612 [[fShareContextMenuItem menu] removeItem:fShareContextMenuItem];
609613 }
610
614
611615 //observe notifications
612616 NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
613
617
614618 [nc addObserver: self selector: @selector(updateUI)
615619 name: @"UpdateUI" object: nil];
616
620
617621 [nc addObserver: self selector: @selector(torrentFinishedDownloading:)
618622 name: @"TorrentFinishedDownloading" object: nil];
619
623
620624 [nc addObserver: self selector: @selector(torrentRestartedDownloading:)
621625 name: @"TorrentRestartedDownloading" object: nil];
622
626
623627 [nc addObserver: self selector: @selector(torrentFinishedSeeding:)
624628 name: @"TorrentFinishedSeeding" object: nil];
625
629
626630 [nc addObserver: self selector: @selector(applyFilter)
627631 name: kTorrentDidChangeGroupNotification object: nil];
628
632
629633 //avoids need of setting delegate
630634 [nc addObserver: self selector: @selector(torrentTableViewSelectionDidChange:)
631635 name: NSOutlineViewSelectionDidChangeNotification object: fTableView];
632
636
633637 [nc addObserver: self selector: @selector(changeAutoImport)
634638 name: @"AutoImportSettingChange" object: nil];
635
639
636640 [nc addObserver: self selector: @selector(updateForAutoSize)
637641 name: @"AutoSizeSettingChange" object: nil];
638
642
639643 [nc addObserver: self selector: @selector(updateForExpandCollape)
640644 name: @"OutlineExpandCollapse" object: nil];
641
645
642646 [nc addObserver: fWindow selector: @selector(makeKeyWindow)
643647 name: @"MakeWindowKey" object: nil];
644
648
645649 #warning rename
646650 [nc addObserver: self selector: @selector(fullUpdateUI)
647651 name: @"UpdateQueue" object: nil];
648
652
649653 [nc addObserver: self selector: @selector(applyFilter)
650654 name: @"ApplyFilter" object: nil];
651
655
652656 //open newly created torrent file
653657 [nc addObserver: self selector: @selector(beginCreateFile:)
654658 name: @"BeginCreateTorrentFile" object: nil];
655
659
656660 //open newly created torrent file
657661 [nc addObserver: self selector: @selector(openCreatedFile:)
658662 name: @"OpenCreatedTorrentFile" object: nil];
659
663
660664 [nc addObserver: self selector: @selector(applyFilter)
661665 name: @"UpdateGroups" object: nil];
662666
666670 selector: @selector(updateUI) userInfo: nil repeats: YES] retain];
667671 [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode];
668672 [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode];
669
673
670674 [self applyFilter];
671
675
672676 [fWindow makeKeyAndOrderFront: nil];
673
677
674678 if ([fDefaults boolForKey: @"InfoVisible"])
675679 [self showInfo: nil];
676680 }
678682 - (void) applicationDidFinishLaunching: (NSNotification *) notification
679683 {
680684 [NSApp setServicesProvider: self];
681
685
682686 //register for dock icon drags (has to be in applicationDidFinishLaunching: to work)
683687 [[NSAppleEventManager sharedAppleEventManager] setEventHandler: self andSelector: @selector(handleOpenContentsEvent:replyEvent:)
684688 forEventClass: kCoreEventClass andEventID: kAEOpenContents];
685
689
686690 //if we were opened from a user notification, do the corresponding action
687691 if ([NSApp isOnMountainLionOrBetter])
688692 {
690694 if (launchNotification)
691695 [self userNotificationCenter: nil didActivateNotification: launchNotification];
692696 }
693
697
694698 //auto importing
695699 [self checkAutoImportDirectory];
696
700
697701 //registering the Web UI to Bonjour
698702 if ([fDefaults boolForKey: @"RPC"] && [fDefaults boolForKey: @"RPCWebDiscovery"])
699703 [[BonjourController defaultController] startWithPort: [fDefaults integerForKey: @"RPCPort"]];
700
704
701705 //shamelessly ask for donations
702706 if ([fDefaults boolForKey: @"WarningDonate"])
703707 {
704708 tr_session_stats stats;
705709 tr_sessionGetCumulativeStats(fLib, &stats);
706710 const BOOL firstLaunch = stats.sessionCount <= 1;
707
711
708712 NSDate * lastDonateDate = [fDefaults objectForKey: @"DonateAskDate"];
709713 const BOOL timePassed = !lastDonateDate || (-1 * [lastDonateDate timeIntervalSinceNow]) >= DONATE_NAG_TIME;
710
714
711715 if (!firstLaunch && timePassed)
712716 {
713717 [fDefaults setObject: [NSDate date] forKey: @"DonateAskDate"];
714
718
715719 NSAlert * alert = [[NSAlert alloc] init];
716720 [alert setMessageText: NSLocalizedString(@"Support open-source indie software", "Donation beg -> title")];
717
721
718722 NSString * donateMessage = [NSString stringWithFormat: @"%@\n\n%@",
719723 NSLocalizedString(@"Transmission is a full-featured torrent application."
720724 " A lot of time and effort have gone into development, coding, and refinement."
721725 " If you enjoy using it, please consider showing your love with a donation.", "Donation beg -> message"),
722726 NSLocalizedString(@"Donate or not, there will be no difference to your torrenting experience.", "Donation beg -> message")];
723
727
724728 [alert setInformativeText: donateMessage];
725729 [alert setAlertStyle: NSInformationalAlertStyle];
726
730
727731 [alert addButtonWithTitle: [NSLocalizedString(@"Donate", "Donation beg -> button") stringByAppendingEllipsis]];
728732 NSButton * noDonateButton = [alert addButtonWithTitle: NSLocalizedString(@"Nope", "Donation beg -> button")];
729733 [noDonateButton setKeyEquivalent: @"\e"]; //escape key
730
734
731735 const BOOL allowNeverAgain = lastDonateDate != nil; //hide the "don't show again" check the first time - give them time to try the app
732736 [alert setShowsSuppressionButton: allowNeverAgain];
733737 if (allowNeverAgain)
734738 [[alert suppressionButton] setTitle: NSLocalizedString(@"Don't bug me about this ever again.", "Donation beg -> button")];
735
739
736740 const NSInteger donateResult = [alert runModal];
737741 if (donateResult == NSAlertFirstButtonReturn)
738742 [self linkDonate: self];
739
743
740744 if (allowNeverAgain)
741745 [fDefaults setBool: ([[alert suppressionButton] state] != NSOnState) forKey: @"WarningDonate"];
742
746
743747 [alert release];
744748 }
745749 }
750754 NSWindow * mainWindow = [NSApp mainWindow];
751755 if (!mainWindow || ![mainWindow isVisible])
752756 [fWindow makeKeyAndOrderFront: nil];
753
757
754758 return NO;
755759 }
756760
766770 if (![torrent allDownloaded])
767771 downloading++;
768772 }
769
773
770774 if ([fDefaults boolForKey: @"CheckQuitDownloading"] ? downloading > 0 : active > 0)
771775 {
772776 NSString * message = active == 1
782786 return NSTerminateLater;
783787 }
784788 }
785
789
786790 return NSTerminateNow;
787791 }
788792
794798 - (void) applicationWillTerminate: (NSNotification *) notification
795799 {
796800 fQuitting = YES;
797
801
798802 //stop the Bonjour service
799803 if ([BonjourController defaultControllerExists])
800804 [[BonjourController defaultController] stop];
802806 //stop blocklist download
803807 if ([BlocklistDownloader isRunning])
804808 [[BlocklistDownloader downloader] cancelDownload];
805
809
806810 //stop timers and notification checking
807811 [[NSNotificationCenter defaultCenter] removeObserver: self];
808
812
809813 [fTimer invalidate];
810814 [fTimer release];
811
815
812816 if (fAutoImportTimer)
813 {
817 {
814818 if ([fAutoImportTimer isValid])
815819 [fAutoImportTimer invalidate];
816820 [fAutoImportTimer release];
817821 }
818
822
819823 [fBadger setQuitting];
820
824
821825 //remove all torrent downloads
822826 if (fPendingTorrentDownloads)
823827 {
829833 }
830834 [fPendingTorrentDownloads release];
831835 }
832
836
833837 //remember window states and close all windows
834838 [fDefaults setBool: [[fInfoController window] isVisible] forKey: @"InfoVisible"];
835
839
836840 if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible])
837841 [[QLPreviewPanel sharedPreviewPanel] updateController];
838
842
839843 for (NSWindow * window in [NSApp windows])
840844 [window close];
841
845
842846 [self showStatusBar: NO animate: NO];
843847 [self showFilterBar: NO animate: NO];
844
848
845849 //save history
846850 [self updateTorrentHistory];
847851 [fTableView saveCollapsedGroups];
848
849 //remaining calls the same as dealloc
852
853 //remaining calls the same as dealloc
850854 [fInfoController release];
851855 [fMessageController release];
852856 [fPrefsController release];
853
857
854858 [fStatusBar release];
855859 [fFilterBar release];
856
860
857861 [fTorrents release];
858862 [fDisplayedTorrents release];
859
863
860864 [fAddWindows release];
861865 [fAddingTransfers release];
862
866
863867 [fOverlayWindow release];
864868 [fBadger release];
865
869
866870 [fAutoImportedNames release];
867
871
868872 [fPreviewPanel release];
869
873
870874 [fConfigDirectory release];
871
875
872876 [fFileWatcherQueue release];
873
877
874878 //complete cleanup
875879 tr_sessionClose(fLib);
876880 }
893897 }
894898 else
895899 urlString = [directObject stringValue];
896
900
897901 if (urlString)
898902 [self openURL: urlString];
899903 }
903907 if ([[suggestedName pathExtension] caseInsensitiveCompare: @"torrent"] != NSOrderedSame)
904908 {
905909 [download cancel];
906
910
907911 [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
908912 if ([fPendingTorrentDownloads count] == 0)
909913 {
910914 [fPendingTorrentDownloads release];
911915 fPendingTorrentDownloads = nil;
912916 }
913
917
914918 NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", "Download not a torrent -> title"),
915919 [NSString stringWithFormat: NSLocalizedString(@"It appears that the file \"%@\" from %@ is not a torrent file.",
916920 "Download not a torrent -> message"), suggestedName,
917921 [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]],
918922 NSLocalizedString(@"OK", "Download not a torrent -> button"), nil, nil);
919
923
920924 [download release];
921925 }
922926 else
936940 "Torrent download failed -> message"),
937941 [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding],
938942 [error localizedDescription]], NSLocalizedString(@"OK", "Torrent download failed -> button"), nil, nil);
939
943
940944 [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
941945 if ([fPendingTorrentDownloads count] == 0)
942946 {
943947 [fPendingTorrentDownloads release];
944948 fPendingTorrentDownloads = nil;
945949 }
946
950
947951 [download release];
948952 }
949953
950954 - (void) downloadDidFinish: (NSURLDownload *) download
951955 {
952956 NSString * path = [[fPendingTorrentDownloads objectForKey: [[download request] URL]] objectForKey: @"Path"];
953
957
954958 [self openFiles: [NSArray arrayWithObject: path] addType: ADD_URL forcePath: nil];
955
959
956960 //delete the torrent file after opening
957961 [[NSFileManager defaultManager] removeItemAtPath: path error: NULL];
958
962
959963 [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
960964 if ([fPendingTorrentDownloads count] == 0)
961965 {
962966 [fPendingTorrentDownloads release];
963967 fPendingTorrentDownloads = nil;
964968 }
965
969
966970 [download release];
967971 }
968972
986990 deleteTorrentFile = [fDefaults boolForKey: @"DeleteOriginalTorrent"];
987991 canToggleDelete = YES;
988992 }
989
993
990994 for (NSString * torrentPath in filenames)
991995 {
992996 //ensure torrent doesn't already exist
993997 tr_ctor * ctor = tr_ctorNew(fLib);
994998 tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]);
995
999
9961000 tr_info info;
9971001 const tr_parse_result result = tr_torrentParse(ctor, &info);
9981002 tr_ctorFree(ctor);
999
1003
10001004 if (result != TR_PARSE_OK)
10011005 {
10021006 if (result == TR_PARSE_DUPLICATE)
10081012 }
10091013 else
10101014 NSAssert2(NO, @"Unknown error code (%d) when attempting to open \"%@\"", result, torrentPath);
1011
1015
10121016 tr_metainfoFree(&info);
10131017 continue;
10141018 }
1015
1019
10161020 //determine download location
10171021 NSString * location;
10181022 BOOL lockDestination = NO; //don't override the location with a group location if it has a hardcoded path
10271031 location = [torrentPath stringByDeletingLastPathComponent];
10281032 else
10291033 location = nil;
1030
1034
10311035 //determine to show the options window
10321036 const BOOL showWindow = type == ADD_SHOW_OPTIONS || ([fDefaults boolForKey: @"DownloadAsk"]
10331037 && (info.isFolder || ![fDefaults boolForKey: @"DownloadAskMulti"])
10341038 && (type != ADD_AUTO || ![fDefaults boolForKey: @"DownloadAskManual"]));
10351039 tr_metainfoFree(&info);
1036
1040
10371041 Torrent * torrent;
10381042 if (!(torrent = [[Torrent alloc] initWithPath: torrentPath location: location
10391043 deleteTorrentFile: showWindow ? NO : deleteTorrentFile lib: fLib]))
10401044 continue;
1041
1045
10421046 //change the location if the group calls for it (this has to wait until after the torrent is created)
10431047 if (!lockDestination && [[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]])
10441048 {
10451049 location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]];
10461050 [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic];
10471051 }
1048
1052
10491053 //verify the data right away if it was newly created
10501054 if (type == ADD_CREATED)
10511055 [torrent resetCache];
1052
1056
10531057 //show the add window or add directly
10541058 if (showWindow || !location)
10551059 {
10571061 lockDestination: lockDestination controller: self torrentFile: torrentPath
10581062 deleteTorrentCheckEnableInitially: deleteTorrentFile canToggleDelete: canToggleDelete];
10591063 [addController showWindow: self];
1060
1064
10611065 if (!fAddWindows)
10621066 fAddWindows = [[NSMutableSet alloc] init];
10631067 [fAddWindows addObject: addController];
10671071 {
10681072 if ([fDefaults boolForKey: @"AutoStartDownload"])
10691073 [torrent startTransfer];
1070
1074
10711075 [torrent update];
10721076 [fTorrents addObject: torrent];
10731077 [torrent release];
1074
1078
10751079 if (!fAddingTransfers)
10761080 fAddingTransfers = [[NSMutableSet alloc] init];
10771081 [fAddingTransfers addObject: torrent];
10841088 - (void) askOpenConfirmed: (AddWindowController *) addController add: (BOOL) add
10851089 {
10861090 Torrent * torrent = [addController torrent];
1087
1091
10881092 if (add)
10891093 {
10901094 [torrent setQueuePosition: [fTorrents count]];
1091
1095
10921096 [torrent update];
10931097 [fTorrents addObject: torrent];
10941098 [torrent release];
1095
1099
10961100 if (!fAddingTransfers)
10971101 fAddingTransfers = [[NSMutableSet alloc] init];
10981102 [fAddingTransfers addObject: torrent];
1099
1103
11001104 [self fullUpdateUI];
11011105 }
11021106 else
11041108 [torrent closeRemoveTorrent: NO];
11051109 [torrent release];
11061110 }
1107
1111
11081112 [fAddWindows removeObject: addController];
11091113 if ([fAddWindows count] == 0)
11101114 {
11231127 [self duplicateOpenMagnetAlert: address transferName: name];
11241128 return;
11251129 }
1126
1130
11271131 //determine download location
11281132 NSString * location = nil;
11291133 if ([fDefaults boolForKey: @"DownloadLocationConstant"])
11301134 location = [[fDefaults stringForKey: @"DownloadFolder"] stringByExpandingTildeInPath];
1131
1135
11321136 Torrent * torrent;
11331137 if (!(torrent = [[Torrent alloc] initWithMagnetAddress: address location: location lib: fLib]))
11341138 {
11351139 [self invalidOpenMagnetAlert: address];
11361140 return;
11371141 }
1138
1142
11391143 //change the location if the group calls for it (this has to wait until after the torrent is created)
11401144 if ([[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]])
11411145 {
11421146 location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]];
11431147 [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic];
11441148 }
1145
1149
11461150 if ([fDefaults boolForKey: @"MagnetOpenAsk"] || !location)
11471151 {
11481152 AddMagnetWindowController * addController = [[AddMagnetWindowController alloc] initWithTorrent: torrent destination: location
11491153 controller: self];
11501154 [addController showWindow: self];
1151
1155
11521156 if (!fAddWindows)
11531157 fAddWindows = [[NSMutableSet alloc] init];
11541158 [fAddWindows addObject: addController];
11581162 {
11591163 if ([fDefaults boolForKey: @"AutoStartDownload"])
11601164 [torrent startTransfer];
1161
1165
11621166 [torrent update];
11631167 [fTorrents addObject: torrent];
11641168 [torrent release];
1165
1169
11661170 if (!fAddingTransfers)
11671171 fAddingTransfers = [[NSMutableSet alloc] init];
11681172 [fAddingTransfers addObject: torrent];
11741178 - (void) askOpenMagnetConfirmed: (AddMagnetWindowController *) addController add: (BOOL) add
11751179 {
11761180 Torrent * torrent = [addController torrent];
1177
1181
11781182 if (add)
11791183 {
11801184 [torrent setQueuePosition: [fTorrents count]];
1181
1185
11821186 [torrent update];
11831187 [fTorrents addObject: torrent];
11841188 [torrent release];
1185
1189
11861190 if (!fAddingTransfers)
11871191 fAddingTransfers = [[NSMutableSet alloc] init];
11881192 [fAddingTransfers addObject: torrent];
1189
1193
11901194 [self fullUpdateUI];
11911195 }
11921196 else
11941198 [torrent closeRemoveTorrent: NO];
11951199 [torrent release];
11961200 }
1197
1201
11981202 [fAddWindows removeObject: addController];
11991203 if ([fAddWindows count] == 0)
12001204 {
12131217 - (void) openFilesWithDict: (NSDictionary *) dictionary
12141218 {
12151219 [self openFiles: [dictionary objectForKey: @"Filenames"] addType: [[dictionary objectForKey: @"AddType"] intValue] forcePath: nil];
1216
1220
12171221 [dictionary release];
12181222 }
12191223
12281232 - (void) openShowSheet: (id) sender
12291233 {
12301234 NSOpenPanel * panel = [NSOpenPanel openPanel];
1231
1235
12321236 [panel setAllowsMultipleSelection: YES];
12331237 [panel setCanChooseFiles: YES];
12341238 [panel setCanChooseDirectories: NO];
1235
1239
12361240 [panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]];
1237
1241
12381242 [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) {
12391243 if (result == NSFileHandlingPanelOKButton)
12401244 {
12411245 NSMutableArray * filenames = [NSMutableArray arrayWithCapacity: [[panel URLs] count]];
12421246 for (NSURL * url in [panel URLs])
12431247 [filenames addObject: [url path]];
1244
1248
12451249 NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: filenames, @"Filenames",
12461250 [NSNumber numberWithInt: sender == fOpenIgnoreDownloadFolder ? ADD_SHOW_OPTIONS : ADD_MANUAL], @"AddType", nil];
12471251 [self performSelectorOnMainThread: @selector(openFilesWithDict:) withObject: dictionary waitUntilDone: NO];
12531257 {
12541258 if (![fDefaults boolForKey: @"WarningInvalidOpen"])
12551259 return;
1256
1260
12571261 NSAlert * alert = [[NSAlert alloc] init];
12581262 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"\"%@\" is not a valid torrent file.",
12591263 "Open invalid alert -> title"), filename]];
12621266 "Open invalid alert -> message")];
12631267 [alert setAlertStyle: NSWarningAlertStyle];
12641268 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open invalid alert -> button")];
1265
1269
12661270 [alert runModal];
12671271 if ([[alert suppressionButton] state] == NSOnState)
12681272 [fDefaults setBool: NO forKey: @"WarningInvalidOpen"];
12731277 {
12741278 if (![fDefaults boolForKey: @"WarningInvalidOpen"])
12751279 return;
1276
1280
12771281 NSAlert * alert = [[NSAlert alloc] init];
12781282 [alert setMessageText: NSLocalizedString(@"Adding magnetized transfer failed.", "Magnet link failed -> title")];
12791283 [alert setInformativeText: [NSString stringWithFormat: NSLocalizedString(@"There was an error when adding the magnet link \"%@\"."
12801284 " The transfer will not occur.", "Magnet link failed -> message"), address]];
12811285 [alert setAlertStyle: NSWarningAlertStyle];
12821286 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Magnet link failed -> button")];
1283
1287
12841288 [alert runModal];
12851289 if ([[alert suppressionButton] state] == NSOnState)
12861290 [fDefaults setBool: NO forKey: @"WarningInvalidOpen"];
12911295 {
12921296 if (![fDefaults boolForKey: @"WarningDuplicate"])
12931297 return;
1294
1298
12951299 NSAlert * alert = [[NSAlert alloc] init];
12961300 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"A transfer of \"%@\" already exists.",
12971301 "Open duplicate alert -> title"), name]];
13011305 [alert setAlertStyle: NSWarningAlertStyle];
13021306 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate alert -> button")];
13031307 [alert setShowsSuppressionButton: YES];
1304
1308
13051309 [alert runModal];
13061310 if ([[alert suppressionButton] state])
13071311 [fDefaults setBool: NO forKey: @"WarningDuplicate"];
13121316 {
13131317 if (![fDefaults boolForKey: @"WarningDuplicate"])
13141318 return;
1315
1319
13161320 NSAlert * alert = [[NSAlert alloc] init];
13171321 if (name)
13181322 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"A transfer of \"%@\" already exists.",
13261330 [alert setAlertStyle: NSWarningAlertStyle];
13271331 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate magnet alert -> button")];
13281332 [alert setShowsSuppressionButton: YES];
1329
1333
13301334 [alert runModal];
13311335 if ([[alert suppressionButton] state])
13321336 [fDefaults setBool: NO forKey: @"WarningDuplicate"];
13541358 else
13551359 urlString = [@"http://" stringByAppendingString: urlString];
13561360 }
1357
1361
13581362 NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: urlString]
13591363 cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 60];
1360
1364
13611365 if ([fPendingTorrentDownloads objectForKey: [request URL]])
13621366 {
13631367 NSLog(@"Already downloading %@", [request URL]);
13641368 return;
13651369 }
1366
1370
13671371 NSURLDownload * download = [[NSURLDownload alloc] initWithRequest: request delegate: self];
1368
1372
13691373 if (!fPendingTorrentDownloads)
13701374 fPendingTorrentDownloads = [[NSMutableDictionary alloc] init];
13711375 [fPendingTorrentDownloads setObject: [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"] forKey: [request URL]];
13771381 if (!fUrlSheetController)
13781382 {
13791383 fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self];
1380
1384
13811385 [NSApp beginSheet: [fUrlSheetController window] modalForWindow: fWindow modalDelegate: self didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil];
13821386 }
13831387 }
13891393 NSString * urlString = [fUrlSheetController urlString];
13901394 [self performSelectorOnMainThread: @selector(openURL:) withObject: urlString waitUntilDone: NO];
13911395 }
1392
1396
13931397 [fUrlSheetController release];
13941398 fUrlSheetController = nil;
13951399 }
14071411 - (void) resumeAllTorrents: (id) sender
14081412 {
14091413 NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [fTorrents count]];
1410
1414
14111415 for (Torrent * torrent in fTorrents)
14121416 if (![torrent isFinishedSeeding])
14131417 [torrents addObject: torrent];
1414
1418
14151419 [self resumeTorrents: torrents];
14161420 }
14171421
14191423 {
14201424 for (Torrent * torrent in torrents)
14211425 [torrent startTransfer];
1422
1426
14231427 [self fullUpdateUI];
14241428 }
14251429
14311435 - (void) resumeWaitingTorrents: (id) sender
14321436 {
14331437 NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [fTorrents count]];
1434
1438
14351439 for (Torrent * torrent in fTorrents)
14361440 if ([torrent waitingToStart])
14371441 [torrents addObject: torrent];
1438
1442
14391443 [self resumeTorrentsNoWait: torrents];
14401444 }
14411445
14441448 //iterate through instead of all at once to ensure no conflicts
14451449 for (Torrent * torrent in torrents)
14461450 [torrent startTransferNoQueue];
1447
1451
14481452 [self fullUpdateUI];
14491453 }
14501454
14641468 for (Torrent * torrent in torrents)
14651469 if ([torrent waitingToStart])
14661470 [torrent stopTransfer];
1467
1471
14681472 for (Torrent * torrent in torrents)
14691473 [torrent stopTransfer];
1470
1474
14711475 [self fullUpdateUI];
14721476 }
14731477
14881492 {
14891493 NSDictionary * dict = @{ @"Torrents" : torrents,
14901494 @"DeleteData" : @(deleteData) };
1491
1495
14921496 NSString * title, * message;
1493
1497
14941498 const NSInteger selected = [torrents count];
14951499 if (selected == 1)
14961500 {
14971501 NSString * torrentName = [(Torrent *)[torrents objectAtIndex: 0] name];
1498
1502
14991503 if (deleteData)
15001504 title = [NSString stringWithFormat:
15011505 NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list"
15041508 title = [NSString stringWithFormat:
15051509 NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list?",
15061510 "Removal confirm panel -> title"), torrentName];
1507
1511
15081512 message = NSLocalizedString(@"This transfer is active."
15091513 " Once removed, continuing the transfer will require the torrent file or magnet link.",
15101514 "Removal confirm panel -> message");
15191523 title = [NSString stringWithFormat:
15201524 NSLocalizedString(@"Are you sure you want to remove %@ transfers from the transfer list?",
15211525 "Removal confirm panel -> title"), [NSString formattedUInteger: selected]];
1522
1526
15231527 if (selected == active)
15241528 message = [NSString stringWithFormat: NSLocalizedString(@"There are %@ active transfers.",
15251529 "Removal confirm panel -> message part 1"), [NSString formattedUInteger: active]];
15301534 NSLocalizedString(@"Once removed, continuing the transfers will require the torrent files or magnet links.",
15311535 "Removal confirm panel -> message part 2")];
15321536 }
1533
1537
15341538 NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"),
15351539 NSLocalizedString(@"Cancel", "Removal confirm panel -> button"), nil, fWindow, self,
15361540 nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), [dict retain], @"%@", message);
15371541 return;
15381542 }
15391543 }
1540
1544
15411545 [self confirmRemoveTorrents: torrents deleteData: deleteData];
15421546 }
15431547
15571561 //don't want any of these starting then stopping
15581562 if ([torrent waitingToStart])
15591563 [torrent stopTransfer];
1560
1564
15611565 //let's expand all groups that have removed items - they either don't exist anymore, are already expanded, or are collapsed (rpc)
15621566 [fTableView removeCollapsedGroup: [torrent groupValue]];
1563
1567
15641568 //we can't assume the window is active - RPC removal, for example
15651569 [fBadger removeTorrent: torrent];
15661570 }
1567
1571
15681572 //#5106 - don't try to remove torrents that have already been removed (fix for a bug, but better safe than crash anyway)
15691573 NSIndexSet * indexesToRemove = [torrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(Torrent * torrent, NSUInteger idx, BOOL * stop) {
15701574 return [fTorrents indexOfObjectIdenticalTo: torrent] != NSNotFound;
15731577 {
15741578 NSLog(@"trying to remove %ld transfers, but %ld have already been removed", [torrents count], [torrents count] - [indexesToRemove count]);
15751579 torrents = [torrents objectsAtIndexes: indexesToRemove];
1576
1580
15771581 if ([indexesToRemove count] == 0)
15781582 {
15791583 [self fullUpdateUI];
15801584 return;
15811585 }
15821586 }
1583
1587
15841588 [fTorrents removeObjectsInArray: torrents];
1585
1589
15861590 //set up helpers to remove from the table
15871591 __block BOOL beganUpdate = NO;
1588
1592
15891593 void (^doTableRemoval)(NSMutableArray *, id) = ^(NSMutableArray * displayedTorrents, id parent) {
15901594 NSIndexSet * indexes = [displayedTorrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^(id obj, NSUInteger idx, BOOL * stop) {
15911595 return [torrents containsObject: obj];
15921596 }];
1593
1597
15941598 if ([indexes count] > 0)
15951599 {
15961600 if (!beganUpdate)
15971601 {
15981602 [NSAnimationContext beginGrouping]; //this has to be before we set the completion handler (#4874)
1599
1603
16001604 //we can't closeRemoveTorrent: until it's no longer in the GUI at all
16011605 [[NSAnimationContext currentContext] setCompletionHandler: ^{
16021606 for (Torrent * torrent in torrents)
16031607 [torrent closeRemoveTorrent: deleteData];
16041608 }];
1605
1609
16061610 [fTableView beginUpdates];
16071611 beganUpdate = YES;
16081612 }
1609
1613
16101614 [fTableView removeItemsAtIndexes: indexes inParent: parent withAnimation: NSTableViewAnimationSlideLeft];
16111615
16121616 [displayedTorrents removeObjectsAtIndexes: indexes];
16131617 }
16141618 };
1615
1619
16161620 //if not removed from the displayed torrents here, fullUpdateUI might cause a crash
16171621 if ([fDisplayedTorrents count] > 0)
16181622 {
16231627 }
16241628 else
16251629 doTableRemoval(fDisplayedTorrents, nil);
1626
1630
16271631 if (beganUpdate)
16281632 {
16291633 [fTableView endUpdates];
16301634 [NSAnimationContext endGrouping];
16311635 }
16321636 }
1633
1637
16341638 if (!beganUpdate)
16351639 {
16361640 //do here if we're not doing it at the end of the animation
16371641 for (Torrent * torrent in torrents)
16381642 [torrent closeRemoveTorrent: deleteData];
16391643 }
1640
1644
16411645 [self fullUpdateUI];
16421646 }
16431647
16541658 - (void) clearCompleted: (id) sender
16551659 {
16561660 NSMutableArray * torrents = [NSMutableArray array];
1657
1661
16581662 for (Torrent * torrent in fTorrents)
16591663 if ([torrent isFinishedSeeding])
16601664 [torrents addObject: torrent];
1661
1665
16621666 if ([fDefaults boolForKey: @"WarningRemoveCompleted"])
16631667 {
16641668 NSString * message, * info;
16671671 NSString * torrentName = [(Torrent *)[torrents objectAtIndex: 0] name];
16681672 message = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list?",
16691673 "Remove completed confirm panel -> title"), torrentName];
1670
1674
16711675 info = NSLocalizedString(@"Once removed, continuing the transfer will require the torrent file or magnet link.",
16721676 "Remove completed confirm panel -> message");
16731677 }
16751679 {
16761680 message = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove %@ completed transfers from the transfer list?",
16771681 "Remove completed confirm panel -> title"), [NSString formattedUInteger: [torrents count]]];
1678
1682
16791683 info = NSLocalizedString(@"Once removed, continuing the transfers will require the torrent files or magnet links.",
16801684 "Remove completed confirm panel -> message");
16811685 }
1682
1686
16831687 NSAlert * alert = [[[NSAlert alloc] init] autorelease];
16841688 [alert setMessageText: message];
16851689 [alert setInformativeText: info];
16871691 [alert addButtonWithTitle: NSLocalizedString(@"Remove", "Remove completed confirm panel -> button")];
16881692 [alert addButtonWithTitle: NSLocalizedString(@"Cancel", "Remove completed confirm panel -> button")];
16891693 [alert setShowsSuppressionButton: YES];
1690
1694
16911695 const NSInteger returnCode = [alert runModal];
16921696 if ([[alert suppressionButton] state])
16931697 [fDefaults setBool: NO forKey: @"WarningRemoveCompleted"];
1694
1698
16951699 if (returnCode != NSAlertFirstButtonReturn)
16961700 return;
16971701 }
1698
1702
16991703 [self confirmRemoveTorrents: torrents deleteData: NO];
17001704 }
17011705
17121716 [panel setCanChooseFiles: NO];
17131717 [panel setCanChooseDirectories: YES];
17141718 [panel setCanCreateDirectories: YES];
1715
1719
17161720 NSInteger count = [torrents count];
17171721 if (count == 1)
17181722 [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for \"%@\".",
17201724 else
17211725 [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for %d data files.",
17221726 "Move torrent -> select destination folder"), count]];
1723
1727
17241728 [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) {
17251729 if (result == NSFileHandlingPanelOKButton)
17261730 {
17421746 [torrents release];
17431747 return;
17441748 }
1745
1749
17461750 Torrent * torrent = [torrents objectAtIndex: 0];
1747
1751
17481752 if (![torrent isMagnet] && [[NSFileManager defaultManager] fileExistsAtPath: [torrent torrentLocation]])
17491753 {
17501754 NSSavePanel * panel = [NSSavePanel savePanel];
17511755 [panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]];
17521756 [panel setExtensionHidden: NO];
1753
1757
17541758 [panel setNameFieldStringValue: [torrent name]];
1755
1759
17561760 [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) {
17571761 //copy torrent to new location with name of data file
17581762 if (result == NSFileHandlingPanelOKButton)
17591763 [torrent copyTorrentFileTo: [[panel URL] path]];
1760
1764
17611765 [torrents removeObjectAtIndex: 0];
17621766 [self performSelectorOnMainThread: @selector(copyTorrentFileForTorrents:) withObject: torrents waitUntilDone: NO];
17631767 }];
17701774 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file copy alert -> button")];
17711775 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Copy of \"%@\" Cannot Be Created",
17721776 "Torrent file copy alert -> title"), [torrent name]]];
1773 [alert setInformativeText: [NSString stringWithFormat:
1777 [alert setInformativeText: [NSString stringWithFormat:
17741778 NSLocalizedString(@"The torrent file (%@) cannot be found.", "Torrent file copy alert -> message"),
17751779 [torrent torrentLocation]]];
17761780 [alert setAlertStyle: NSWarningAlertStyle];
1777
1781
17781782 [alert runModal];
17791783 [alert release];
17801784 }
1781
1785
17821786 [torrents removeObjectAtIndex: 0];
17831787 [self copyTorrentFileForTorrents: torrents];
17841788 }
17871791 - (void) copyMagnetLinks: (id) sender
17881792 {
17891793 NSArray * torrents = [fTableView selectedTorrents];
1790
1794
17911795 if ([torrents count] <= 0)
17921796 return;
1793
1797
17941798 NSMutableArray * links = [NSMutableArray arrayWithCapacity: [torrents count]];
17951799 for (Torrent * torrent in torrents)
17961800 [links addObject: [torrent magnetLink]];
1797
1801
17981802 NSString * text = [links componentsJoinedByString: @"\n"];
1799
1803
18001804 NSPasteboard * pb = [NSPasteboard generalPasteboard];
18011805 [pb clearContents];
18021806 [pb writeObjects: [NSArray arrayWithObject: text]];
18121816 if (location)
18131817 [paths addObject: [NSURL fileURLWithPath: location]];
18141818 }
1815
1819
18161820 if ([paths count] > 0)
18171821 [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths];
18181822 }
18221826 NSArray * selected = [fTableView selectedTorrents];
18231827 NSAssert([selected count] == 1, @"1 transfer needs to be selected to rename, but %ld are selected", [selected count]);
18241828 Torrent * torrent = [selected objectAtIndex:0];
1825
1829
18261830 [FileRenameSheetController presentSheetForTorrent:torrent modalForWindow: fWindow completionHandler: ^(BOOL didRename) {
18271831 if (didRename)
18281832 {
18291833 dispatch_async(dispatch_get_main_queue(), ^{
18301834 [self fullUpdateUI];
1831
1835
18321836 [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self userInfo: @{ @"Torrent" : torrent }];
18331837 });
18341838 }
18531857 {
18541858 for (Torrent * torrent in torrents)
18551859 [torrent resetCache];
1856
1860
18571861 [self applyFilter];
18581862 }
18591863
18841888 {
18851889 [fInfoController updateInfoStats];
18861890 [[fInfoController window] orderFront: nil];
1887
1891
18881892 if ([fInfoController canQuickLook] && [QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible])
18891893 [[QLPreviewPanel sharedPreviewPanel] reloadData];
18901894 }
1891
1895
18921896 [[fWindow toolbar] validateVisibleItems];
18931897 }
18941898
18951899 - (void) resetInfo
18961900 {
18971901 [fInfoController setInfoForTorrents: [fTableView selectedTorrents]];
1898
1902
18991903 if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible])
19001904 [[QLPreviewPanel sharedPreviewPanel] reloadData];
19011905 }
19121916 {
19131917 if (!fMessageController)
19141918 fMessageController = [[MessageWindowController alloc] init];
1915
1919
19161920 return fMessageController;
19171921 }
19181922
19331937 for (Torrent * torrent in fTorrents)
19341938 {
19351939 [torrent update];
1936
1940
19371941 //pull the upload and download speeds - most consistent by using current stats
19381942 dlRate += [torrent downloadRate];
19391943 ulRate += [torrent uploadRate];
1940
1944
19411945 anyCompleted |= [torrent isFinishedSeeding];
19421946 }
1943
1947
19441948 if (![NSApp isHidden])
19451949 {
19461950 if ([fWindow isVisible])
19471951 {
19481952 [self sortTorrents: NO];
1949
1953
19501954 [fStatusBar updateWithDownload: dlRate upload: ulRate];
1951
1955
19521956 [fClearCompletedButton setHidden: !anyCompleted];
19531957 }
19541958
19561960 if ([[fInfoController window] isVisible])
19571961 [fInfoController updateInfoStats];
19581962 }
1959
1963
19601964 //badge dock
19611965 [fBadger updateBadgeWithDownload: dlRate upload: ulRate];
19621966 }
19791983 [NSString formattedUInteger: totalCount]];
19801984 else
19811985 totalTorrentsString = NSLocalizedString(@"1 transfer", "Status bar transfer count");
1982
1986
19831987 if (filtering)
19841988 {
19851989 NSUInteger count = [fTableView numberOfRows]; //have to factor in collapsed rows
19861990 if (count > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrent class]])
19871991 count -= [fDisplayedTorrents count];
1988
1992
19891993 totalTorrentsString = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@", "Status bar transfer count"),
19901994 [NSString formattedUInteger: count], totalTorrentsString];
19911995 }
1992
1996
19931997 [fTotalTorrentsField setStringValue: totalTorrentsString];
19941998 }
19951999
20022006 {
20032007 if (![notification userInfo])
20042008 return;
2005
2009
20062010 if ([notification activationType] == NSUserNotificationActivationTypeActionButtonClicked) //reveal
20072011 {
20082012 Torrent * torrent = [self torrentForHash: [[notification userInfo] objectForKey: @"Hash"]];
20382042 row = [fTableView rowForItem: torrent];
20392043 }
20402044 }
2041
2045
20422046 if (row == -1)
20432047 {
20442048 //not found - must be filtering
20452049 NSAssert([fDefaults boolForKey: @"FilterBar"], @"expected the filter to be enabled");
20462050 [fFilterBar reset: YES];
2047
2051
20482052 row = [fTableView rowForItem: torrent];
2049
2053
20502054 //if it's not shown, it has to be in a collapsed row...again
20512055 if ([fDefaults boolForKey: @"SortByGroup"])
20522056 {
20662070 }
20672071 }
20682072 }
2069
2073
20702074 NSAssert1(row != -1, @"expected a row to be found for torrent %@", torrent);
20712075
20722076 [self showMainWindow: nil];
20782082 - (Torrent *) torrentForHash: (NSString *) hash
20792083 {
20802084 NSParameterAssert(hash != nil);
2081
2085
20822086 __block Torrent * torrent = nil;
20832087 [fTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id obj, NSUInteger idx, BOOL * stop) {
20842088 if ([[(Torrent *)obj hashString] isEqualToString: hash])
20932097 - (void) torrentFinishedDownloading: (NSNotification *) notification
20942098 {
20952099 Torrent * torrent = [notification object];
2096
2100
20972101 if ([[[notification userInfo] objectForKey: @"WasRunning"] boolValue])
20982102 {
20992103 if (!fSoundPlaying && [fDefaults boolForKey: @"PlayDownloadSound"])
21062110 [sound play];
21072111 }
21082112 }
2109
2113
21102114 NSString * location = [torrent dataLocation];
2111
2115
21122116 NSString * notificationTitle = NSLocalizedString(@"Download Complete", "notification title");
21132117 if ([NSApp isOnMountainLionOrBetter])
21142118 {
21152119 NSUserNotification * notification = [[NSUserNotificationMtLion alloc] init];
21162120 [notification setTitle: notificationTitle];
21172121 [notification setInformativeText: [torrent name]];
2118
2122
21192123 [notification setHasActionButton: YES];
21202124 [notification setActionButtonTitle: NSLocalizedString(@"Show", "notification button")];
2121
2125
21222126 NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithObject: [torrent hashString] forKey: @"Hash"];
21232127 if (location)
21242128 [userInfo setObject: location forKey: @"Location"];
21252129 [notification setUserInfo: userInfo];
2126
2130
21272131 [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification];
21282132 [notification release];
21292133 }
2130
2134
21312135 NSMutableDictionary * clickContext = [NSMutableDictionary dictionaryWithObjectsAndKeys:
21322136 GROWL_DOWNLOAD_COMPLETE, @"Type", nil];
2133
2137
21342138 if (location)
21352139 [clickContext setObject: location forKey: @"Location"];
2136
2140
21372141 [GrowlApplicationBridge notifyWithTitle: notificationTitle
21382142 description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE
21392143 iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
2140
2144
21412145 //NSLog(@"delegate: %@", [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] delegate]);
2142
2146
21432147 if (![fWindow isMainWindow])
21442148 [fBadger addCompletedTorrent: torrent];
2145
2149
21462150 //bounce download stack
21472151 [[NSDistributedNotificationCenter defaultCenter] postNotificationName: @"com.apple.DownloadFileFinished"
21482152 object: [torrent dataLocation]];
21492153 }
2150
2154
21512155 [self fullUpdateUI];
21522156 }
21532157
21592163 - (void) torrentFinishedSeeding: (NSNotification *) notification
21602164 {
21612165 Torrent * torrent = [notification object];
2162
2166
21632167 if (!fSoundPlaying && [fDefaults boolForKey: @"PlaySeedingSound"])
21642168 {
21652169 NSSound * sound;
21702174 [sound play];
21712175 }
21722176 }
2173
2177
21742178 NSString * location = [torrent dataLocation];
2175
2179
21762180 NSString * notificationTitle = NSLocalizedString(@"Seeding Complete", "notification title");
21772181 if ([NSApp isOnMountainLionOrBetter])
21782182 {
21792183 NSUserNotification * notification = [[NSUserNotificationMtLion alloc] init];
21802184 [notification setTitle: notificationTitle];
21812185 [notification setInformativeText: [torrent name]];
2182
2186
21832187 [notification setHasActionButton: YES];
21842188 [notification setActionButtonTitle: NSLocalizedString(@"Show", "notification button")];
2185
2189
21862190 NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithObject: [torrent hashString] forKey: @"Hash"];
21872191 if (location)
21882192 [userInfo setObject: location forKey: @"Location"];
21892193 [notification setUserInfo: userInfo];
2190
2194
21912195 [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification];
21922196 [notification release];
21932197 }
2194
2198
21952199 NSMutableDictionary * clickContext = [NSMutableDictionary dictionaryWithObject: GROWL_SEEDING_COMPLETE forKey: @"Type"];
2196
2200
21972201 if (location)
21982202 [clickContext setObject: location forKey: @"Location"];
2199
2203
22002204 [GrowlApplicationBridge notifyWithTitle: notificationTitle
22012205 description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE
22022206 iconData: nil priority: 0 isSticky: NO clickContext: clickContext];
2203
2207
22042208 //removing from the list calls fullUpdateUI
22052209 if ([torrent removeWhenFinishSeeding])
22062210 [self confirmRemoveTorrents: @[ torrent ] deleteData: NO];
22082212 {
22092213 if (![fWindow isMainWindow])
22102214 [fBadger addCompletedTorrent: torrent];
2211
2215
22122216 [self fullUpdateUI];
2213
2217
22142218 if ([[fTableView selectedTorrents] containsObject: torrent])
22152219 {
22162220 [fInfoController updateInfoStats];
22222226 - (void) updateTorrentHistory
22232227 {
22242228 NSMutableArray * history = [NSMutableArray arrayWithCapacity: [fTorrents count]];
2225
2229
22262230 for (Torrent * torrent in fTorrents)
22272231 [history addObject: [torrent history]];
2228
2232
22292233 NSString * historyFile = [fConfigDirectory stringByAppendingPathComponent: TRANSFER_PLIST];
22302234 [history writeToFile: historyFile atomically: YES];
22312235 }
22642268 NSAssert1(NO, @"Unknown sort tag received: %ld", [(NSMenuItem *)sender tag]);
22652269 return;
22662270 }
2267
2271
22682272 [fDefaults setObject: sortType forKey: @"Sort"];
2269
2273
22702274 [self sortTorrents: YES];
22712275 }
22722276
22742278 {
22752279 BOOL sortByGroup = ![fDefaults boolForKey: @"SortByGroup"];
22762280 [fDefaults setBool: sortByGroup forKey: @"SortByGroup"];
2277
2281
22782282 [self applyFilter];
22792283 }
22802284
22982302 - (void) sortTorrentsCallUpdates: (BOOL) callUpdates includeQueueOrder: (BOOL) includeQueueOrder
22992303 {
23002304 const BOOL asc = ![fDefaults boolForKey: @"SortReverse"];
2301
2305
23022306 NSArray * descriptors;
23032307 NSSortDescriptor * nameDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"name" ascending: asc selector: @selector(localizedStandardCompare:)];
2304
2308
23052309 NSString * sortType = [fDefaults stringForKey: @"Sort"];
23062310 if ([sortType isEqualToString: SORT_STATE])
23072311 {
23082312 NSSortDescriptor * stateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"stateSortKey" ascending: !asc],
23092313 * progressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progress" ascending: !asc],
23102314 * ratioDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"ratio" ascending: !asc];
2311
2315
23122316 descriptors = [NSArray arrayWithObjects: stateDescriptor, progressDescriptor, ratioDescriptor, nameDescriptor, nil];
23132317 }
23142318 else if ([sortType isEqualToString: SORT_PROGRESS])
23162320 NSSortDescriptor * progressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progress" ascending: asc],
23172321 * ratioProgressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progressStopRatio" ascending: asc],
23182322 * ratioDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"ratio" ascending: asc];
2319
2323
23202324 descriptors = [NSArray arrayWithObjects: progressDescriptor, ratioProgressDescriptor, ratioDescriptor, nameDescriptor, nil];
23212325 }
23222326 else if ([sortType isEqualToString: SORT_TRACKER])
23232327 {
23242328 NSSortDescriptor * trackerDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"trackerSortKey" ascending: asc selector: @selector(localizedCaseInsensitiveCompare:)];
2325
2329
23262330 descriptors = [NSArray arrayWithObjects: trackerDescriptor, nameDescriptor, nil];
23272331 }
23282332 else if ([sortType isEqualToString: SORT_ACTIVITY])
23292333 {
23302334 NSSortDescriptor * rateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"totalRate" ascending: !asc];
23312335 NSSortDescriptor * activityDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"dateActivityOrAdd" ascending: !asc];
2332
2336
23332337 descriptors = [NSArray arrayWithObjects: rateDescriptor, activityDescriptor, nameDescriptor, nil];
23342338 }
23352339 else if ([sortType isEqualToString: SORT_DATE])
23362340 {
23372341 NSSortDescriptor * dateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"dateAdded" ascending: asc];
2338
2342
23392343 descriptors = [NSArray arrayWithObjects: dateDescriptor, nameDescriptor, nil];
23402344 }
23412345 else if ([sortType isEqualToString: SORT_SIZE])
23422346 {
23432347 NSSortDescriptor * sizeDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"size" ascending: asc];
2344
2348
23452349 descriptors = [NSArray arrayWithObjects: sizeDescriptor, nameDescriptor, nil];
23462350 }
23472351 else if ([sortType isEqualToString: SORT_NAME])
23512355 else
23522356 {
23532357 NSAssert1([sortType isEqualToString: SORT_ORDER], @"Unknown sort type received: %@", sortType);
2354
2358
23552359 if (!includeQueueOrder)
23562360 return;
2357
2361
23582362 NSSortDescriptor * orderDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"queuePosition" ascending: asc];
2359
2363
23602364 descriptors = [NSArray arrayWithObject: orderDescriptor];
23612365 }
2362
2366
23632367 BOOL beganTableUpdate = !callUpdates;
2364
2368
23652369 //actually sort
23662370 if ([fDefaults boolForKey: @"SortByGroup"])
23672371 {
23702374 }
23712375 else
23722376 [self rearrangeTorrentTableArray: fDisplayedTorrents forParent: nil withSortDescriptors: descriptors beganTableUpdate: &beganTableUpdate];
2373
2377
23742378 if (beganTableUpdate && callUpdates)
23752379 {
23762380 [fTableView endUpdates];
23902394 if (result != NSOrderedSame)
23912395 return result;
23922396 }
2393
2397
23942398 return NSOrderedSame;
23952399 }];
2396
2400
23972401 if (insertIndex != currentIndex)
23982402 {
23992403 if (!*beganTableUpdate)
24012405 *beganTableUpdate = YES;
24022406 [fTableView beginUpdates];
24032407 }
2404
2408
24052409 [rearrangeArray moveObjectAtIndex: currentIndex toIndex: insertIndex];
24062410 [fTableView moveItemAtIndex: currentIndex inParent: parent toIndex: insertIndex inParent: parent];
24072411 }
24082412 }
2409
2413
24102414 NSAssert2([rearrangeArray isEqualToArray: [rearrangeArray sortedArrayUsingDescriptors: descriptors]], @"Torrent rearranging didn't work! %@ %@", rearrangeArray, [rearrangeArray sortedArrayUsingDescriptors: descriptors]);
24112415 }
24122416
24252429 filterPause = YES;
24262430 else
24272431 filterStatus = NO;
2428
2432
24292433 const NSInteger groupFilterValue = [fDefaults integerForKey: @"FilterGroup"];
24302434 const BOOL filterGroup = groupFilterValue != GROUP_FILTER_ALL_TAG;
2431
2435
24322436 NSArray * searchStrings = [fFilterBar searchStrings];
24332437 if (searchStrings && [searchStrings count] == 0)
24342438 searchStrings = nil;
24352439 const BOOL filterTracker = searchStrings && [[fDefaults stringForKey: @"FilterSearchType"] isEqualToString: FILTER_TYPE_TRACKER];
2436
2440
24372441 //filter & get counts of each type
24382442 NSIndexSet * indexesOfNonFilteredTorrents = [fTorrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(Torrent * torrent, NSUInteger idx, BOOL * stop) {
24392443 //check status
24422446 const BOOL isActive = ![torrent isStalled];
24432447 if (isActive)
24442448 OSAtomicIncrement32(&active);
2445
2449
24462450 if ([torrent isSeeding])
24472451 {
24482452 OSAtomicIncrement32(&seeding);
24622466 if (filterStatus && !filterPause)
24632467 return NO;
24642468 }
2465
2469
24662470 //checkGroup
24672471 if (filterGroup)
24682472 if ([torrent groupValue] != groupFilterValue)
24692473 return NO;
2470
2474
24712475 //check text field
24722476 if (searchStrings)
24732477 {
24752479 if (filterTracker)
24762480 {
24772481 NSArray * trackers = [torrent allTrackersFlat];
2478
2482
24792483 //to count, we need each string in at least 1 tracker
24802484 [searchStrings enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id searchString, NSUInteger idx, BOOL * stop) {
24812485 __block BOOL found = NO;
25032507 }
25042508 }];
25052509 }
2506
2510
25072511 if (removeTextField)
25082512 return NO;
25092513 }
2510
2514
25112515 return YES;
25122516 }];
2513
2517
25142518 NSArray * allTorrents = [fTorrents objectsAtIndexes: indexesOfNonFilteredTorrents];
2515
2519
25162520 //set button tooltips
25172521 if (fFilterBar)
25182522 [fFilterBar setCountAll: [fTorrents count] active: active downloading: downloading seeding: seeding paused: paused];
2519
2523
25202524 //if either the previous or current lists are blank, set its value to the other
25212525 const BOOL groupRows = [allTorrents count] > 0 ? [fDefaults boolForKey: @"SortByGroup"] : ([fDisplayedTorrents count] > 0 && [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]]);
25222526 const BOOL wasGroupRows = [fDisplayedTorrents count] > 0 ? [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]] : groupRows;
2523
2527
25242528 #warning could probably be merged with later code somehow
25252529 //clear display cache for not-shown torrents
25262530 if ([fDisplayedTorrents count] > 0)
25312535 if (![allTorrents containsObject: torrent])
25322536 [torrent setPreviousFinishedPieces: nil];
25332537 };
2534
2538
25352539 if (wasGroupRows)
25362540 [fDisplayedTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id obj, NSUInteger idx, BOOL * stop) {
25372541 [[(TorrentGroup *)obj torrents] enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: removePreviousFinishedPieces];
25392543 else
25402544 [fDisplayedTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: removePreviousFinishedPieces];
25412545 }
2542
2546
25432547 BOOL beganUpdates = NO;
25442548
25452549 //don't animate torrents when first launching
25482552 [[NSAnimationContext currentContext] setDuration: 0];
25492553 });
25502554 [NSAnimationContext beginGrouping];
2551
2555
25522556 //add/remove torrents (and rearrange for groups), one by one
25532557 if (!groupRows && !wasGroupRows)
25542558 {
25552559 NSMutableIndexSet * addIndexes = [NSMutableIndexSet indexSet],
25562560 * removePreviousIndexes = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])];
2557
2561
25582562 //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)
25592563 [allTorrents enumerateObjectsWithOptions: 0 usingBlock: ^(id objAll, NSUInteger previousIndex, BOOL * stop) {
25602564 const NSUInteger currentIndex = [fDisplayedTorrents indexOfObjectAtIndexes: removePreviousIndexes options: NSEnumerationConcurrent passingTest: ^(id objDisplay, NSUInteger idx, BOOL *stop) {
25652569 else
25662570 [removePreviousIndexes removeIndex: currentIndex];
25672571 }];
2568
2572
25692573 if ([addIndexes count] > 0 || [removePreviousIndexes count] > 0)
25702574 {
25712575 beganUpdates = YES;
25722576 [fTableView beginUpdates];
2573
2577
25742578 //remove torrents we didn't find
25752579 if ([removePreviousIndexes count] > 0)
25762580 {
25772581 [fDisplayedTorrents removeObjectsAtIndexes: removePreviousIndexes];
25782582 [fTableView removeItemsAtIndexes: removePreviousIndexes inParent: nil withAnimation: NSTableViewAnimationSlideDown];
25792583 }
2580
2584
25812585 //add new torrents
25822586 if ([addIndexes count] > 0)
25832587 {
25872591 NSIndexSet * newAddIndexes = [allTorrents indexesOfObjectsAtIndexes: addIndexes options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) {
25882592 return [fAddingTransfers containsObject: obj];
25892593 }];
2590
2594
25912595 [addIndexes removeIndexes: newAddIndexes];
2592
2596
25932597 [fDisplayedTorrents addObjectsFromArray: [allTorrents objectsAtIndexes: newAddIndexes]];
25942598 [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [newAddIndexes count], [newAddIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideLeft];
25952599 }
2596
2600
25972601 [fDisplayedTorrents addObjectsFromArray: [allTorrents objectsAtIndexes: addIndexes]];
25982602 [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [addIndexes count], [addIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown];
25992603 }
26022606 else if (groupRows && wasGroupRows)
26032607 {
26042608 NSAssert(groupRows && wasGroupRows, @"Should have had group rows and should remain with group rows");
2605
2609
26062610 #warning don't always do?
26072611 beganUpdates = YES;
26082612 [fTableView beginUpdates];
2609
2613
26102614 NSMutableIndexSet * unusedAllTorrentsIndexes = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [allTorrents count])];
2611
2615
26122616 NSMutableDictionary * groupsByIndex = [NSMutableDictionary dictionaryWithCapacity: [fDisplayedTorrents count]];
26132617 for (TorrentGroup * group in fDisplayedTorrents)
26142618 [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: [group groupIndex]]];
2615
2619
26162620 const NSUInteger originalGroupCount = [fDisplayedTorrents count];
26172621 for (NSUInteger index = 0; index < originalGroupCount; ++index)
26182622 {
26192623 TorrentGroup * group = [fDisplayedTorrents objectAtIndex: index];
2620
2624
26212625 NSMutableIndexSet * removeIndexes = [NSMutableIndexSet indexSet];
2622
2626
26232627 //needs to be a signed integer
26242628 for (NSInteger indexInGroup = 0; indexInGroup < [[group torrents] count]; ++indexInGroup)
26252629 {
26322636 else
26332637 {
26342638 BOOL markTorrentAsUsed = YES;
2635
2639
26362640 const NSInteger groupValue = [torrent groupValue];
26372641 if (groupValue != [group groupIndex])
26382642 {
26522656 if ([fDisplayedTorrents indexOfObject: newGroup inRange: NSMakeRange(index+1, originalGroupCount-(index+1))] != NSNotFound)
26532657 markTorrentAsUsed = NO;
26542658 }
2655
2659
26562660 [[group torrents] removeObjectAtIndex: indexInGroup];
26572661 [[newGroup torrents] addObject: torrent];
26582662
26592663 [fTableView moveItemAtIndex: indexInGroup inParent: group toIndex: [[newGroup torrents] count]-1 inParent: newGroup];
2660
2664
26612665 --indexInGroup;
26622666 }
2663
2667
26642668 if (markTorrentAsUsed)
26652669 [unusedAllTorrentsIndexes removeIndex: allIndex];
26662670 }
26672671 }
2668
2672
26692673 if ([removeIndexes count] > 0)
26702674 {
26712675 [[group torrents] removeObjectsAtIndexes: removeIndexes];
26722676 [fTableView removeItemsAtIndexes: removeIndexes inParent: group withAnimation: NSTableViewAnimationEffectFade];
26732677 }
26742678 }
2675
2679
26762680 //add remaining new torrents
26772681 for (Torrent * torrent in [allTorrents objectsAtIndexes: unusedAllTorrentsIndexes])
26782682 {
26872691 [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [fDisplayedTorrents count]-1] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
26882692 [fTableView isGroupCollapsed: groupValue] ? [fTableView collapseItem: group] : [fTableView expandItem: group];
26892693 }
2690
2694
26912695 [[group torrents] addObject: torrent];
26922696
26932697 const BOOL newTorrent = fAddingTransfers && [fAddingTransfers containsObject: torrent];
26942698 [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [[group torrents] count]-1] inParent: group withAnimation: newTorrent ? NSTableViewAnimationSlideLeft : NSTableViewAnimationSlideDown];
26952699 }
2696
2700
26972701 //remove empty groups
26982702 NSIndexSet * removeGroupIndexes = [fDisplayedTorrents indexesOfObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, originalGroupCount)] options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) {
26992703 return [[(TorrentGroup *)obj torrents] count] == 0;
27002704 }];
2701
2705
27022706 if ([removeGroupIndexes count] > 0)
27032707 {
27042708 [fDisplayedTorrents removeObjectsAtIndexes: removeGroupIndexes];
27052709 [fTableView removeItemsAtIndexes: removeGroupIndexes inParent: nil withAnimation: NSTableViewAnimationEffectFade];
27062710 }
2707
2711
27082712 //now that all groups are there, sort them - don't insert on the fly in case groups were reordered in prefs
27092713 NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES];
27102714 [self rearrangeTorrentTableArray: fDisplayedTorrents forParent: nil withSortDescriptors: [NSArray arrayWithObject: groupDescriptor] beganTableUpdate: &beganUpdates];
27122716 else
27132717 {
27142718 NSAssert(groupRows != wasGroupRows, @"Trying toggling group-torrent reordering when we weren't expecting to.");
2715
2719
27162720 //set all groups as expanded
27172721 [fTableView removeAllCollapsedGroups];
2718
2722
27192723 //since we're not doing this the right way (boo buggy animation), we need to remember selected values
27202724 #warning when Lion-only and using views instead of cells, this likely won't be needed
27212725 NSArray * selectedValues = [fTableView selectedValues];
2722
2726
27232727 beganUpdates = YES;
27242728 [fTableView beginUpdates];
27252729
27262730 [fTableView removeItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown];
2727
2731
27282732 if (groupRows)
27292733 {
27302734 //a map for quickly finding groups
27382742 group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
27392743 [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]];
27402744 }
2741
2745
27422746 [[group torrents] addObject: torrent];
27432747 }
2744
2748
27452749 [fDisplayedTorrents setArray: [groupsByIndex allValues]];
2746
2750
27472751 //we need the groups to be sorted, and we can do it without moving items in the table, too!
27482752 NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES];
27492753 [fDisplayedTorrents sortUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]];
27522756 [fDisplayedTorrents setArray: allTorrents];
27532757
27542758 [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
27632767 if (selectedValues)
27642768 [fTableView selectValues: selectedValues];
27652769 }
2766
2770
27672771 //sort the torrents (won't sort the groups, though)
27682772 [self sortTorrentsCallUpdates: !beganUpdates includeQueueOrder: YES];
27692773
27702774 if (beganUpdates)
27712775 [fTableView endUpdates];
27722776 [fTableView setNeedsDisplay: YES];
2773
2777
27742778 [NSAnimationContext endGrouping];
27752779
27762780 [self resetInfo]; //if group is already selected, but the torrents in it change
2777
2781
27782782 [self setBottomCountText: groupRows || filterStatus || filterGroup || searchStrings];
2779
2783
27802784 [self setWindowSizeToFit];
2781
2785
27822786 if (fAddingTransfers)
27832787 {
27842788 [fAddingTransfers release];
27952799 {
27962800 if (fGlobalPopoverShown)
27972801 return;
2798
2802
27992803 NSPopover * popover = [[NSPopover alloc] init];
28002804 [popover setBehavior: NSPopoverBehaviorTransient];
28012805 GlobalOptionsPopoverViewController * viewController = [[GlobalOptionsPopoverViewController alloc] initWithHandle: fLib];
28022806 [popover setContentViewController: viewController];
28032807 [popover setDelegate: self];
2804
2808
28052809 [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge];
2806
2810
28072811 [viewController release];
28082812 [popover release];
28092813 }
28252829 {
28262830 for (NSInteger i = [menu numberOfItems]-1; i >= 0; i--)
28272831 [menu removeItemAtIndex: i];
2828
2832
28292833 NSMenu * groupMenu = [[GroupsController groups] groupMenuWithTarget: self action: @selector(setGroup:) isSmall: NO];
2830
2834
28312835 const NSInteger groupMenuCount = [groupMenu numberOfItems];
28322836 for (NSInteger i = 0; i < groupMenuCount; i++)
28332837 {
28392843 }
28402844 else if (menu == fShareMenu || menu == fShareContextMenu) {
28412845 [menu removeAllItems];
2842
2846
28432847 for (NSMenuItem * item in [[ShareTorrentFileHelper sharedHelper] menuItems])
28442848 {
28452849 [menu addItem:item];
28532857 for (Torrent * torrent in [fTableView selectedTorrents])
28542858 {
28552859 [fTableView removeCollapsedGroup: [torrent groupValue]]; //remove old collapsed group
2856
2860
28572861 [torrent setGroupValue: [(NSMenuItem *)sender tag] determinationType: TorrentDeterminationUserSpecified];
28582862 }
2859
2863
28602864 [self applyFilter];
28612865 [self updateUI];
28622866 [self updateTorrentHistory];
28812885
28822886 [fDefaults setBool: isLimited forKey: @"SpeedLimit"];
28832887 [fStatusBar updateSpeedFieldsToolTips];
2884
2888
28852889 if (![[dict objectForKey: @"ByUser"] boolValue])
28862890 [GrowlApplicationBridge notifyWithTitle: isLimited ? NSLocalizedString(@"Speed Limit Auto Enabled", "Growl notification title") : NSLocalizedString(@"Speed Limit Auto Disabled", "Growl notification title")
28872891 description: NSLocalizedString(@"Bandwidth settings changed", "Growl notification description")
28912895 isSticky: NO
28922896 clickContext: nil
28932897 identifier: GROWL_AUTO_SPEED_LIMIT];
2894
2898
28952899 [dict release];
28962900 }
28972901
29032907 -(void) VDKQueue: (VDKQueue *) queue receivedNotification: (NSString*) notification forPath: (NSString*) fpath
29042908 {
29052909 //don't assume that just because we're watching for write notification, we'll only receive write notifications
2906
2910
29072911 if (![fDefaults boolForKey: @"AutoImport"] || ![fDefaults stringForKey: @"AutoImportDirectory"])
29082912 return;
2909
2913
29102914 if ([fAutoImportTimer isValid])
29112915 [fAutoImportTimer invalidate];
29122916 [fAutoImportTimer release];
2913
2917
29142918 //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
29162920 selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain];
2917
2921
29182922 [self checkAutoImportDirectory];
29192923 }
29202924
29242928 [fAutoImportTimer invalidate];
29252929 [fAutoImportTimer release];
29262930 fAutoImportTimer = nil;
2927
2931
29282932 [fAutoImportedNames release];
29292933 fAutoImportedNames = nil;
2930
2934
29312935 [self checkAutoImportDirectory];
29322936 }
29332937
29362940 NSString * path;
29372941 if (![fDefaults boolForKey: @"AutoImport"] || !(path = [fDefaults stringForKey: @"AutoImportDirectory"]))
29382942 return;
2939
2943
29402944 path = [path stringByExpandingTildeInPath];
2941
2945
29422946 NSArray * importedNames;
29432947 if (!(importedNames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: path error: NULL]))
29442948 return;
2945
2949
29462950 //only check files that have not been checked yet
29472951 NSMutableArray * newNames = [importedNames mutableCopy];
2948
2952
29492953 if (fAutoImportedNames)
29502954 [newNames removeObjectsInArray: fAutoImportedNames];
29512955 else
29522956 fAutoImportedNames = [[NSMutableArray alloc] init];
29532957 [fAutoImportedNames setArray: importedNames];
2954
2958
29552959 for (NSString * file in newNames)
29562960 {
29572961 if ([file hasPrefix: @"."])
29582962 continue;
2959
2963
29602964 NSString * fullFile = [path stringByAppendingPathComponent: file];
2961
2965
29622966 if (!([[[NSWorkspace sharedWorkspace] typeOfFile: fullFile error: NULL] isEqualToString: @"org.bittorrent.torrent"]
29632967 || [[fullFile pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame))
29642968 continue;
2965
2969
29662970 tr_ctor * ctor = tr_ctorNew(fLib);
29672971 tr_ctorSetMetainfoFromFile(ctor, [fullFile UTF8String]);
2968
2972
29692973 switch (tr_torrentParse(ctor, NULL))
29702974 {
29712975 case TR_PARSE_OK:
29722976 [self openFiles: [NSArray arrayWithObject: fullFile] addType: ADD_AUTO forcePath: nil];
2973
2977
29742978 NSString * notificationTitle = NSLocalizedString(@"Torrent File Auto Added", "notification title");
29752979 if ([NSApp isOnMountainLionOrBetter])
29762980 {
29772981 NSUserNotification* notification = [[NSUserNotificationMtLion alloc] init];
29782982 [notification setTitle: notificationTitle];
29792983 [notification setInformativeText: file];
2980
2984
29812985 [notification setHasActionButton: NO];
2982
2986
29832987 [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification];
29842988 [notification release];
29852989 }
2986
2990
29872991 [GrowlApplicationBridge notifyWithTitle: notificationTitle
29882992 description: file notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO
29892993 clickContext: nil];
29902994 break;
2991
2995
29922996 case TR_PARSE_ERR:
29932997 [fAutoImportedNames removeObject: file];
29942998 break;
2995
2999
29963000 case TR_PARSE_DUPLICATE: //let's ignore this (but silence a warning)
29973001 break;
29983002 }
2999
3003
30003004 tr_ctorFree(ctor);
30013005 }
3002
3006
30033007 [newNames release];
30043008 }
30053009
30073011 {
30083012 if (![fDefaults boolForKey: @"AutoImport"])
30093013 return;
3010
3014
30113015 NSString * location = [(NSURL *)[notification object] path],
30123016 * path = [fDefaults stringForKey: @"AutoImportDirectory"];
3013
3017
30143018 if (location && path && [[[location stringByDeletingLastPathComponent] stringByExpandingTildeInPath]
30153019 isEqualToString: [path stringByExpandingTildeInPath]])
30163020 [fAutoImportedNames addObject: [location lastPathComponent]];
30663070 else
30673071 {
30683072 TorrentGroup * group = (TorrentGroup *)item;
3069
3073
30703074 if ([fDefaults boolForKey: @"DisplayGroupRowRatio"])
30713075 return [NSString stringForRatio: [group ratio]];
30723076 else
30883092 {
30893093 if (![torrent isKindOfClass: [Torrent class]])
30903094 return NO;
3091
3095
30923096 [indexSet addIndex: [fTableView rowForItem: torrent]];
30933097 }
3094
3098
30953099 [pasteboard declareTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE] owner: self];
30963100 [pasteboard setData: [NSKeyedArchiver archivedDataWithRootObject: indexSet] forType: TORRENT_TABLE_VIEW_DATA_TYPE];
30973101 return YES;
31093113 {
31103114 if (!item)
31113115 return NSDragOperationNone;
3112
3116
31133117 if ([[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER])
31143118 {
31153119 if ([item isKindOfClass: [Torrent class]])
31303134 {
31313135 if (index == NSOutlineViewDropOnItemIndex)
31323136 return NSDragOperationNone;
3133
3137
31343138 if (item)
31353139 {
31363140 index = [fTableView rowForItem: item] + 1;
31373141 item = nil;
31383142 }
31393143 }
3140
3144
31413145 [fTableView setDropItem: item dropChildIndex: index];
31423146 return NSDragOperationGeneric;
31433147 }
3144
3148
31453149 return NSDragOperationNone;
31463150 }
31473151
31513155 if ([[pasteboard types] containsObject: TORRENT_TABLE_VIEW_DATA_TYPE])
31523156 {
31533157 NSIndexSet * indexes = [NSKeyedUnarchiver unarchiveObjectWithData: [pasteboard dataForType: TORRENT_TABLE_VIEW_DATA_TYPE]];
3154
3158
31553159 //get the torrents to move
31563160 NSMutableArray * movingTorrents = [NSMutableArray arrayWithCapacity: [indexes count]];
31573161 for (NSUInteger i = [indexes firstIndex]; i != NSNotFound; i = [indexes indexGreaterThanIndex: i])
31583162 {
31593163 Torrent * torrent = [fTableView itemAtRow: i];
31603164 [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
31673176 //reorder queue order
31683177 if (newRow != NSOutlineViewDropOnItemIndex)
31693178 {
31793188 break;
31803189 }
31813190 }
3182
3191
31833192 //remove objects to reinsert
31843193 [fTorrents removeObjectsInArray: movingTorrents];
3185
3194
31863195 //insert objects at new location
31873196 const NSUInteger insertIndex = topTorrent ? [fTorrents indexOfObject: topTorrent] + 1 : 0;
31883197 NSIndexSet * insertIndexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(insertIndex, [movingTorrents count])];
31893198 [fTorrents insertObjects: movingTorrents atIndexes: insertIndexes];
3190
3199
31913200 //we need to make sure the queue order is updated in the Torrent object before we sort - safest to just reset all queue positions
31923201 NSUInteger i = 0;
31933202 for (Torrent * torrent in fTorrents)
31953204 [torrent setQueuePosition: i++];
31963205 [torrent update];
31973206 }
3198
3207
31993208 //do the drag animation here so that the dragged torrents are the ones that are animated as moving, and not the torrents around them
32003209 [fTableView beginUpdates];
3201
3210
32023211 NSUInteger insertDisplayIndex = topTorrent ? [groupTorrents indexOfObject: topTorrent] + 1 : 0;
3203
3212
32043213 for (Torrent * torrent in movingTorrents)
32053214 {
32063215 TorrentGroup * oldParent = item ? [fTableView parentForItem: torrent] : nil;
32073216 NSMutableArray * oldTorrents = oldParent ? [oldParent torrents] : fDisplayedTorrents;
32083217 const NSUInteger oldIndex = [oldTorrents indexOfObject: torrent];
3209
3218
32103219 if (item == oldParent)
32113220 {
32123221 if (oldIndex < insertDisplayIndex)
32163225 else
32173226 {
32183227 NSAssert(item && oldParent, @"Expected to be dragging between group rows");
3219
3228
32203229 NSMutableArray * newTorrents = [(TorrentGroup *)item torrents];
32213230 [newTorrents insertObject: torrent atIndex: insertDisplayIndex];
32223231 [oldTorrents removeObjectAtIndex: oldIndex];
32233232 }
32243233
32253234 [fTableView moveItemAtIndex: oldIndex inParent: oldParent toIndex: insertDisplayIndex inParent: item];
3226
3235
32273236 ++insertDisplayIndex;
32283237 }
32293238
32303239 [fTableView endUpdates];
32313240 }
3232
3241
32333242 [self applyFilter];
32343243 }
3235
3244
32363245 return YES;
32373246 }
32383247
32633272 if (!fOverlayWindow)
32643273 fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow];
32653274 [fOverlayWindow setTorrents: files];
3266
3275
32673276 return NSDragOperationCopy;
32683277 }
32693278 tr_ctorFree(ctor);
32703279 }
32713280 }
3272
3281
32733282 //create a torrent file if a single file
32743283 if (!torrent && [files count] == 1)
32753284 {
32763285 if (!fOverlayWindow)
32773286 fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow];
32783287 [fOverlayWindow setFile: [[files objectAtIndex: 0] lastPathComponent]];
3279
3288
32803289 return NSDragOperationCopy;
32813290 }
32823291 }
32853294 if (!fOverlayWindow)
32863295 fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow];
32873296 [fOverlayWindow setURL: [[NSURL URLFromPasteboard: pasteboard] relativeString]];
3288
3297
32893298 return NSDragOperationCopy;
32903299 }
32913300 else;
3292
3301
32933302 return NSDragOperationNone;
32943303 }
32953304
33033312 {
33043313 if (fOverlayWindow)
33053314 [fOverlayWindow fadeOut];
3306
3315
33073316 NSPasteboard * pasteboard = [info draggingPasteboard];
33083317 if ([[pasteboard types] containsObject: NSFilenamesPboardType])
33093318 {
33103319 BOOL torrent = NO, accept = YES;
3311
3320
33123321 //create an array of files that can be opened
33133322 NSArray * files = [pasteboard propertyListForType: NSFilenamesPboardType];
33143323 NSMutableArray * filesToOpen = [NSMutableArray arrayWithCapacity: [files count]];
33253334 tr_ctorFree(ctor);
33263335 }
33273336 }
3328
3337
33293338 if ([filesToOpen count] > 0)
33303339 [self application: NSApp openFiles: filesToOpen];
33313340 else
33353344 else
33363345 accept = NO;
33373346 }
3338
3347
33393348 return accept;
33403349 }
33413350 else if ([[pasteboard types] containsObject: NSURLPboardType])
33483357 }
33493358 }
33503359 else;
3351
3360
33523361 return NO;
33533362 }
33543363
33563365 {
33573366 BOOL makeSmall = ![fDefaults boolForKey: @"SmallView"];
33583367 [fDefaults setBool: makeSmall forKey: @"SmallView"];
3359
3368
33603369 [fTableView setUsesAlternatingRowBackgroundColors: !makeSmall];
3361
3370
33623371 [fTableView setRowHeight: makeSmall ? ROW_HEIGHT_SMALL : ROW_HEIGHT_REGULAR];
33633372
33643373 [fTableView beginUpdates];
33653374 [fTableView noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fTableView numberOfRows])]];
33663375 [fTableView endUpdates];
3367
3376
33683377 //resize for larger min height if not set to auto size
33693378 if (![fDefaults boolForKey: @"AutoSize"])
33703379 {
33713380 const NSSize contentSize = [[fWindow contentView] frame].size;
3372
3381
33733382 NSSize contentMinSize = [fWindow contentMinSize];
33743383 contentMinSize.height = [self minWindowContentSizeAllowed];
33753384 [fWindow setContentMinSize: contentMinSize];
3376
3385
33773386 //make sure the window already isn't too small
33783387 if (!makeSmall && contentSize.height < contentMinSize.height)
33793388 {
33813390 CGFloat heightChange = contentMinSize.height - contentSize.height;
33823391 frame.size.height += heightChange;
33833392 frame.origin.y -= heightChange;
3384
3393
33853394 [fWindow setFrame: frame display: YES];
33863395 }
33873396 }
34043413 - (NSRect) windowFrameByAddingHeight: (CGFloat) height checkLimits: (BOOL) check
34053414 {
34063415 NSScrollView * scrollView = [fTableView enclosingScrollView];
3407
3416
34083417 //convert pixels to points
34093418 NSRect windowFrame = [fWindow frame];
34103419 NSSize windowSize = [scrollView convertSize: windowFrame.size fromView: nil];
34113420 windowSize.height += height;
3412
3421
34133422 if (check)
34143423 {
34153424 //we can't call minSize, since it might be set to the current size (auto size)
34163425 const CGFloat minHeight = [self minWindowContentSizeAllowed]
34173426 + (NSHeight([fWindow frame]) - NSHeight([[fWindow contentView] frame])); //contentView to window
3418
3427
34193428 if (windowSize.height <= minHeight)
34203429 windowSize.height = minHeight;
34213430 else
34553464 const BOOL prevShown = fStatusBar != nil;
34563465 if (show == prevShown)
34573466 return;
3458
3467
34593468 if (show)
34603469 {
34613470 fStatusBar = [[StatusBarController alloc] initWithLib: fLib];
3462
3471
34633472 NSView * contentView = [fWindow contentView];
34643473 const NSSize windowSize = [contentView convertSize: [fWindow frame].size fromView: nil];
3465
3474
34663475 NSRect statusBarFrame = [[fStatusBar view] frame];
34673476 statusBarFrame.size.width = windowSize.width;
34683477 [[fStatusBar view] setFrame: statusBarFrame];
3469
3478
34703479 [contentView addSubview: [fStatusBar view]];
34713480 [[fStatusBar view] setFrameOrigin: NSMakePoint(0.0, NSMaxY([contentView frame]))];
34723481 }
3473
3482
34743483 CGFloat heightChange = [[fStatusBar view] frame].size.height;
34753484 if (!show)
34763485 heightChange *= -1;
3477
3486
34783487 //allow bar to show even if not enough room
34793488 if (show && ![fDefaults boolForKey: @"AutoSize"])
34803489 {
34813490 NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO];
3482
3491
34833492 NSScreen * screen = [fWindow screen];
34843493 if (screen)
34853494 {
34933502 }
34943503 }
34953504 }
3496
3505
34973506 [self updateUI];
3498
3507
34993508 NSScrollView * scrollView = [fTableView enclosingScrollView];
3500
3509
35013510 //set views to not autoresize
35023511 const NSUInteger statsMask = [[fStatusBar view] autoresizingMask];
35033512 [[fStatusBar view] setAutoresizingMask: NSViewNotSizable];
35093518 }
35103519 const NSUInteger scrollMask = [scrollView autoresizingMask];
35113520 [scrollView setAutoresizingMask: NSViewNotSizable];
3512
3521
35133522 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
35163525 //re-enable autoresize
35173526 [[fStatusBar view] setAutoresizingMask: statsMask];
35183527 if (fFilterBar)
35193528 [[fFilterBar view] setAutoresizingMask: filterMask];
35203529 [scrollView setAutoresizingMask: scrollMask];
3521
3530
35223531 if (!show)
35233532 {
35243533 [[fStatusBar view] removeFromSuperviewWithoutNeedingDisplay];
35253534 [fStatusBar release];
35263535 fStatusBar = nil;
35273536 }
3528
3537
35293538 if ([fDefaults boolForKey: @"AutoSize"])
35303539 [self setWindowMinMaxToCurrent];
35313540 else
35403549 - (void) toggleFilterBar: (id) sender
35413550 {
35423551 const BOOL show = fFilterBar == nil;
3543
3552
35443553 //disable filtering when hiding (have to do before showFilterBar:animate:)
35453554 if (!show)
35463555 [fFilterBar reset: NO];
3547
3556
35483557 [self showFilterBar: show animate: YES];
35493558 [fDefaults setBool: show forKey: @"FilterBar"];
35503559 [[fWindow toolbar] validateVisibleItems];
3551
3560
35523561 [self applyFilter]; //do even if showing to ensure tooltips are updated
35533562 }
35543563
35583567 const BOOL prevShown = fFilterBar != nil;
35593568 if (show == prevShown)
35603569 return;
3561
3570
35623571 if (show)
35633572 {
35643573 fFilterBar = [[FilterBarController alloc] init];
3565
3574
35663575 NSView * contentView = [fWindow contentView];
35673576 const NSSize windowSize = [contentView convertSize: [fWindow frame].size fromView: nil];
3568
3577
35693578 NSRect filterBarFrame = [[fFilterBar view] frame];
35703579 filterBarFrame.size.width = windowSize.width;
35713580 [[fFilterBar view] setFrame: filterBarFrame];
3572
3581
35733582 if (fStatusBar)
35743583 [contentView addSubview: [fFilterBar view] positioned: NSWindowBelow relativeTo: [fStatusBar view]];
35753584 else
35793588 }
35803589 else
35813590 [fWindow makeFirstResponder: fTableView];
3582
3591
35833592 CGFloat heightChange = NSHeight([[fFilterBar view] frame]);
35843593 if (!show)
35853594 heightChange *= -1;
3586
3595
35873596 //allow bar to show even if not enough room
35883597 if (show && ![fDefaults boolForKey: @"AutoSize"])
35893598 {
35903599 NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO];
3591
3600
35923601 NSScreen * screen = [fWindow screen];
35933602 if (screen)
35943603 {
36023611 }
36033612 }
36043613 }
3605
3614
36063615 NSScrollView * scrollView = [fTableView enclosingScrollView];
36073616
36083617 //set views to not autoresize
36103619 const NSUInteger scrollMask = [scrollView autoresizingMask];
36113620 [[fFilterBar view] setAutoresizingMask: NSViewNotSizable];
36123621 [scrollView setAutoresizingMask: NSViewNotSizable];
3613
3622
36143623 const NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO];
36153624 [fWindow setFrame: frame display: YES animate: animate];
3616
3625
36173626 //re-enable autoresize
36183627 [[fFilterBar view] setAutoresizingMask: filterMask];
36193628 [scrollView setAutoresizingMask: scrollMask];
3620
3629
36213630 if (!show)
36223631 {
36233632 [[fFilterBar view] removeFromSuperviewWithoutNeedingDisplay];
36243633 [fFilterBar release];
36253634 fFilterBar = nil;
36263635 }
3627
3636
36283637 if ([fDefaults boolForKey: @"AutoSize"])
36293638 [self setWindowMinMaxToCurrent];
36303639 else
36653674 {
36663675 NSArray * selectedTorrents = [fTableView selectedTorrents];
36673676 NSMutableArray * qlArray = [NSMutableArray arrayWithCapacity: [selectedTorrents count]];
3668
3677
36693678 for (Torrent * torrent in selectedTorrents)
36703679 if (([torrent isFolder] || [torrent isComplete]) && [torrent dataLocation])
36713680 [qlArray addObject: torrent];
3672
3681
36733682 return qlArray;
36743683 }
36753684
36963705 [super keyDown: event];
36973706 return YES;
36983707 }*/
3699
3708
37003709 return NO;
37013710 }
37023711
37083717 {
37093718 if (![fWindow isVisible])
37103719 return NSZeroRect;
3711
3720
37123721 const NSInteger row = [fTableView rowForItem: item];
37133722 if (row == -1)
37143723 return NSZeroRect;
3715
3724
37163725 NSRect frame = [fTableView iconRectForRow: row];
3717
3726
37183727 if (!NSIntersectsRect([fTableView visibleRect], frame))
37193728 return NSZeroRect;
3720
3729
37213730 frame.origin = [fTableView convertPoint: frame.origin toView: nil];
37223731 frame = [fWindow convertRectToScreen: frame];
37233732 frame.origin.y -= frame.size.height;
37283737 - (void) showToolbarShare: (id) sender
37293738 {
37303739 NSParameterAssert([sender isKindOfClass:[NSButton class]]);
3731
3740
37323741 NSSharingServicePicker * picker = [[NSSharingServicePicker alloc] initWithItems: [[ShareTorrentFileHelper sharedHelper] shareTorrentURLs]];
37333742 picker.delegate = self;
3734
3743
37353744 [picker showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
37363745 }
37373746
37533762 - (id) toolbarButtonWithIdentifier: (NSString *) ident forToolbarButtonClass:(Class)class
37543763 {
37553764 ButtonToolbarItem * item = [[class alloc] initWithItemIdentifier: ident];
3756
3765
37573766 NSButton * button = [[NSButton alloc] init];
37583767 [button setBezelStyle: NSTexturedRoundedBezelStyle];
37593768 [button setStringValue: @""];
3760
3769
37613770 [item setView: button];
37623771 [button release];
3763
3772
37643773 const NSSize buttonSize = NSMakeSize(36.0, 25.0);
37653774 [item setMinSize: buttonSize];
37663775 [item setMaxSize: buttonSize];
3767
3776
37683777 return [item autorelease];
37693778 }
37703779
37733782 if ([ident isEqualToString: TOOLBAR_CREATE])
37743783 {
37753784 ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident];
3776
3785
37773786 [item setLabel: NSLocalizedString(@"Create", "Create toolbar item -> label")];
37783787 [item setPaletteLabel: NSLocalizedString(@"Create Torrent File", "Create toolbar item -> palette label")];
37793788 [item setToolTip: NSLocalizedString(@"Create torrent file", "Create toolbar item -> tooltip")];
37813790 [item setTarget: self];
37823791 [item setAction: @selector(createFile:)];
37833792 [item setAutovalidates: NO];
3784
3793
37853794 return item;
37863795 }
37873796 else if ([ident isEqualToString: TOOLBAR_OPEN_FILE])
37883797 {
37893798 ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident];
3790
3799
37913800 [item setLabel: NSLocalizedString(@"Open", "Open toolbar item -> label")];
37923801 [item setPaletteLabel: NSLocalizedString(@"Open Torrent Files", "Open toolbar item -> palette label")];
37933802 [item setToolTip: NSLocalizedString(@"Open torrent files", "Open toolbar item -> tooltip")];
37953804 [item setTarget: self];
37963805 [item setAction: @selector(openShowSheet:)];
37973806 [item setAutovalidates: NO];
3798
3807
37993808 return item;
38003809 }
38013810 else if ([ident isEqualToString: TOOLBAR_OPEN_WEB])
38023811 {
38033812 ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident];
3804
3813
38053814 [item setLabel: NSLocalizedString(@"Open Address", "Open address toolbar item -> label")];
38063815 [item setPaletteLabel: NSLocalizedString(@"Open Torrent Address", "Open address toolbar item -> palette label")];
38073816 [item setToolTip: NSLocalizedString(@"Open torrent web address", "Open address toolbar item -> tooltip")];
38093818 [item setTarget: self];
38103819 [item setAction: @selector(openURLShowSheet:)];
38113820 [item setAutovalidates: NO];
3812
3821
38133822 return item;
38143823 }
38153824 else if ([ident isEqualToString: TOOLBAR_REMOVE])
38163825 {
38173826 ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident];
3818
3827
38193828 [item setLabel: NSLocalizedString(@"Remove", "Remove toolbar item -> label")];
38203829 [item setPaletteLabel: NSLocalizedString(@"Remove Selected", "Remove toolbar item -> palette label")];
38213830 [item setToolTip: NSLocalizedString(@"Remove selected transfers", "Remove toolbar item -> tooltip")];
38233832 [item setTarget: self];
38243833 [item setAction: @selector(removeNoDelete:)];
38253834 [item setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
3826
3835
38273836 return item;
38283837 }
38293838 else if ([ident isEqualToString: TOOLBAR_INFO])
38303839 {
38313840 ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident];
38323841 [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled
3833
3842
38343843 [item setLabel: NSLocalizedString(@"Inspector", "Inspector toolbar item -> label")];
38353844 [item setPaletteLabel: NSLocalizedString(@"Toggle Inspector", "Inspector toolbar item -> palette label")];
38363845 [item setToolTip: NSLocalizedString(@"Toggle the torrent inspector", "Inspector toolbar item -> tooltip")];
38373846 [item setImage: [NSImage imageNamed: @"ToolbarInfoTemplate"]];
38383847 [item setTarget: self];
38393848 [item setAction: @selector(showInfo:)];
3840
3849
38413850 return item;
38423851 }
38433852 else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_ALL])
38443853 {
38453854 GroupToolbarItem * groupItem = [[GroupToolbarItem alloc] initWithItemIdentifier: ident];
3846
3855
38473856 NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect];
38483857 [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]];
38493858 [groupItem setView: segmentedControl];
38503859 NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell];
3851
3860
38523861 if ([NSApp isOnYosemiteOrBetter]) {
38533862 segmentedControl.segmentStyle = NSSegmentStyleSeparated;
38543863 }
3855
3864
38563865 [segmentedControl setSegmentCount: 2];
38573866 [segmentedCell setTrackingMode: NSSegmentSwitchTrackingMomentary];
3858
3867
38593868 const NSSize groupSize = NSMakeSize(72.0, 25.0);
38603869 [groupItem setMinSize: groupSize];
38613870 [groupItem setMaxSize: groupSize];
3862
3871
38633872 [groupItem setLabel: NSLocalizedString(@"Apply All", "All toolbar item -> label")];
38643873 [groupItem setPaletteLabel: NSLocalizedString(@"Pause / Resume All", "All toolbar item -> palette label")];
38653874 [groupItem setTarget: self];
38663875 [groupItem setAction: @selector(allToolbarClicked:)];
3867
3876
38683877 [groupItem setIdentifiers: [NSArray arrayWithObjects: TOOLBAR_PAUSE_ALL, TOOLBAR_RESUME_ALL, nil]];
3869
3878
38703879 [segmentedCell setTag: TOOLBAR_PAUSE_TAG forSegment: TOOLBAR_PAUSE_TAG];
38713880 [segmentedControl setImage: [NSImage imageNamed: @"ToolbarPauseAllTemplate"] forSegment: TOOLBAR_PAUSE_TAG];
38723881 [segmentedCell setToolTip: NSLocalizedString(@"Pause all transfers",
38733882 "All toolbar item -> tooltip") forSegment: TOOLBAR_PAUSE_TAG];
3874
3883
38753884 [segmentedCell setTag: TOOLBAR_RESUME_TAG forSegment: TOOLBAR_RESUME_TAG];
38763885 [segmentedControl setImage: [NSImage imageNamed: @"ToolbarResumeAllTemplate"] forSegment: TOOLBAR_RESUME_TAG];
38773886 [segmentedCell setToolTip: NSLocalizedString(@"Resume all transfers",
38783887 "All toolbar item -> tooltip") forSegment: TOOLBAR_RESUME_TAG];
3879
3888
38803889 [groupItem createMenu: [NSArray arrayWithObjects: NSLocalizedString(@"Pause All", "All toolbar item -> label"),
38813890 NSLocalizedString(@"Resume All", "All toolbar item -> label"), nil]];
3882
3891
38833892 [segmentedControl release];
3884
3893
38853894 [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
3886
3895
38873896 return [groupItem autorelease];
38883897 }
38893898 else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_SELECTED])
38903899 {
38913900 GroupToolbarItem * groupItem = [[GroupToolbarItem alloc] initWithItemIdentifier: ident];
3892
3901
38933902 NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect];
38943903 [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]];
38953904 [groupItem setView: segmentedControl];
38963905 NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell];
3897
3906
38983907 if ([NSApp isOnYosemiteOrBetter]) {
38993908 segmentedControl.segmentStyle = NSSegmentStyleSeparated;
39003909 }
3901
3910
39023911 [segmentedControl setSegmentCount: 2];
39033912 [segmentedCell setTrackingMode: NSSegmentSwitchTrackingMomentary];
3904
3913
39053914 const NSSize groupSize = NSMakeSize(72.0, 25.0);
39063915 [groupItem setMinSize: groupSize];
39073916 [groupItem setMaxSize: groupSize];
3908
3917
39093918 [groupItem setLabel: NSLocalizedString(@"Apply Selected", "Selected toolbar item -> label")];
39103919 [groupItem setPaletteLabel: NSLocalizedString(@"Pause / Resume Selected", "Selected toolbar item -> palette label")];
39113920 [groupItem setTarget: self];
39123921 [groupItem setAction: @selector(selectedToolbarClicked:)];
3913
3922
39143923 [groupItem setIdentifiers: [NSArray arrayWithObjects: TOOLBAR_PAUSE_SELECTED, TOOLBAR_RESUME_SELECTED, nil]];
3915
3924
39163925 [segmentedCell setTag: TOOLBAR_PAUSE_TAG forSegment: TOOLBAR_PAUSE_TAG];
39173926 [segmentedControl setImage: [NSImage imageNamed: @"ToolbarPauseSelectedTemplate"] forSegment: TOOLBAR_PAUSE_TAG];
39183927 [segmentedCell setToolTip: NSLocalizedString(@"Pause selected transfers",
39193928 "Selected toolbar item -> tooltip") forSegment: TOOLBAR_PAUSE_TAG];
3920
3929
39213930 [segmentedCell setTag: TOOLBAR_RESUME_TAG forSegment: TOOLBAR_RESUME_TAG];
39223931 [segmentedControl setImage: [NSImage imageNamed: @"ToolbarResumeSelectedTemplate"] forSegment: TOOLBAR_RESUME_TAG];
39233932 [segmentedCell setToolTip: NSLocalizedString(@"Resume selected transfers",
39243933 "Selected toolbar item -> tooltip") forSegment: TOOLBAR_RESUME_TAG];
3925
3934
39263935 [groupItem createMenu: [NSArray arrayWithObjects: NSLocalizedString(@"Pause Selected", "Selected toolbar item -> label"),
39273936 NSLocalizedString(@"Resume Selected", "Selected toolbar item -> label"), nil]];
3928
3937
39293938 [segmentedControl release];
3930
3939
39313940 [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
3932
3941
39333942 return [groupItem autorelease];
39343943 }
39353944 else if ([ident isEqualToString: TOOLBAR_FILTER])
39363945 {
39373946 ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident];
39383947 [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled
3939
3948
39403949 [item setLabel: NSLocalizedString(@"Filter", "Filter toolbar item -> label")];
39413950 [item setPaletteLabel: NSLocalizedString(@"Toggle Filter", "Filter toolbar item -> palette label")];
39423951 [item setToolTip: NSLocalizedString(@"Toggle the filter bar", "Filter toolbar item -> tooltip")];
39433952 [item setImage: [NSImage imageNamed: @"ToolbarFilterTemplate"]];
39443953 [item setTarget: self];
39453954 [item setAction: @selector(toggleFilterBar:)];
3946
3955
39473956 return item;
39483957 }
39493958 else if ([ident isEqualToString: TOOLBAR_QUICKLOOK])
39503959 {
39513960 ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident];
39523961 [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled
3953
3962
39543963 [item setLabel: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> label")];
39553964 [item setPaletteLabel: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> palette label")];
39563965 [item setToolTip: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> tooltip")];
39583967 [item setTarget: self];
39593968 [item setAction: @selector(toggleQuickLook:)];
39603969 [item setVisibilityPriority: NSToolbarItemVisibilityPriorityLow];
3961
3970
39623971 return item;
39633972 }
39643973 else if ([ident isEqualToString: TOOLBAR_SHARE])
39653974 {
39663975 ShareToolbarItem * item = [self toolbarButtonWithIdentifier: ident forToolbarButtonClass: [ShareToolbarItem class]];
3967
3976
39683977 [item setLabel: NSLocalizedString(@"Share", "Share toolbar item -> label")];
39693978 [item setPaletteLabel: NSLocalizedString(@"Share", "Share toolbar item -> palette label")];
39703979 [item setToolTip: NSLocalizedString(@"Share torrent file", "Share toolbar item -> tooltip")];
39713980 [item setImage: [NSImage imageNamed: NSImageNameShareTemplate]];
39723981 [item setVisibilityPriority: NSToolbarItemVisibilityPriorityLow];
3973
3982
39743983 NSButton *itemButton = (NSButton *)[item view];
39753984 [itemButton setTarget: self];
39763985 [itemButton setAction: @selector(showToolbarShare:)];
39773986 [itemButton sendActionOn:NSLeftMouseDownMask];
3978
3987
39793988 return item;
39803989 }
39813990 else
40434052 - (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem
40444053 {
40454054 NSString * ident = [toolbarItem itemIdentifier];
4046
4055
40474056 //enable remove item
40484057 if ([ident isEqualToString: TOOLBAR_REMOVE])
40494058 return [fTableView numberOfSelectedRows] > 0;
40744083 return YES;
40754084 return NO;
40764085 }
4077
4086
40784087 //enable resume item
40794088 if ([ident isEqualToString: TOOLBAR_RESUME_SELECTED])
40804089 {
40834092 return YES;
40844093 return NO;
40854094 }
4086
4095
40874096 //set info item
40884097 if ([ident isEqualToString: TOOLBAR_INFO])
40894098 {
40904099 [(NSButton *)[toolbarItem view] setState: [[fInfoController window] isVisible]];
40914100 return YES;
40924101 }
4093
4102
40944103 //set filter item
40954104 if ([ident isEqualToString: TOOLBAR_FILTER])
40964105 {
40974106 [(NSButton *)[toolbarItem view] setState: fFilterBar != nil];
40984107 return YES;
40994108 }
4100
4109
41014110 //set quick look item
41024111 if ([ident isEqualToString: TOOLBAR_QUICKLOOK])
41034112 {
41044113 [(NSButton *)[toolbarItem view] setState: [QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]];
41054114 return YES;
41064115 }
4107
4116
41084117 //enable share item
41094118 if ([ident isEqualToString: TOOLBAR_SHARE])
41104119 return [fTableView numberOfSelectedRows] > 0;
4111
4120
41124121 return YES;
41134122 }
41144123
41154124 - (BOOL) validateMenuItem: (NSMenuItem *) menuItem
41164125 {
41174126 SEL action = [menuItem action];
4118
4127
41194128 if (action == @selector(toggleSpeedLimit:))
41204129 {
41214130 [menuItem setState: [fDefaults boolForKey: @"SpeedLimit"] ? NSOnState : NSOffState];
41224131 return YES;
41234132 }
4124
4133
41254134 //only enable some items if it is in a context menu or the window is useable
41264135 BOOL canUseTable = [fWindow isKeyWindow] || [[menuItem menu] supermenu] != [NSApp mainMenu];
41274136
41284137 //enable open items
41294138 if (action == @selector(openShowSheet:) || action == @selector(openURLShowSheet:))
41304139 return [fWindow attachedSheet] == nil;
4131
4140
41324141 //enable sort options
41334142 if (action == @selector(setSort:))
41344143 {
41624171 default:
41634172 NSAssert1(NO, @"Unknown sort tag received: %ld", [menuItem tag]);
41644173 }
4165
4174
41664175 [menuItem setState: [sortType isEqualToString: [fDefaults stringForKey: @"Sort"]] ? NSOnState : NSOffState];
41674176 return [fWindow isVisible];
41684177 }
4169
4178
41704179 if (action == @selector(setGroup:))
41714180 {
41724181 BOOL checked = NO;
4173
4182
41744183 NSInteger index = [menuItem tag];
41754184 for (Torrent * torrent in [fTableView selectedTorrents])
41764185 if (index == [torrent groupValue])
41784187 checked = YES;
41794188 break;
41804189 }
4181
4190
41824191 [menuItem setState: checked ? NSOnState : NSOffState];
41834192 return canUseTable && [fTableView numberOfSelectedRows] > 0;
41844193 }
4185
4194
41864195 if (action == @selector(toggleSmallView:))
41874196 {
41884197 [menuItem setState: [fDefaults boolForKey: @"SmallView"] ? NSOnState : NSOffState];
41894198 return [fWindow isVisible];
41904199 }
4191
4200
41924201 if (action == @selector(togglePiecesBar:))
41934202 {
41944203 [menuItem setState: [fDefaults boolForKey: @"PiecesBar"] ? NSOnState : NSOffState];
41954204 return [fWindow isVisible];
41964205 }
4197
4206
41984207 if (action == @selector(toggleAvailabilityBar:))
41994208 {
42004209 [menuItem setState: [fDefaults boolForKey: @"DisplayProgressBarAvailable"] ? NSOnState : NSOffState];
42014210 return [fWindow isVisible];
42024211 }
4203
4212
42044213 //enable show info
42054214 if (action == @selector(showInfo:))
42064215 {
42104219
42114220 return YES;
42124221 }
4213
4222
42144223 //enable prev/next inspector tab
42154224 if (action == @selector(setInfoTab:))
42164225 return [[fInfoController window] isVisible];
4217
4226
42184227 //enable toggle status bar
42194228 if (action == @selector(toggleStatusBar:))
42204229 {
42244233
42254234 return [fWindow isVisible];
42264235 }
4227
4236
42284237 //enable toggle filter bar
42294238 if (action == @selector(toggleFilterBar:))
42304239 {
42344243
42354244 return [fWindow isVisible];
42364245 }
4237
4246
42384247 //enable prev/next filter button
42394248 if (action == @selector(switchFilter:))
42404249 return [fWindow isVisible] && fFilterBar;
4241
4250
42424251 //enable reveal in finder
42434252 if (action == @selector(revealFile:))
42444253 return canUseTable && [fTableView numberOfSelectedRows] > 0;
4245
4254
42464255 //enable renaming file/folder
42474256 if (action == @selector(renameSelected:))
42484257 return canUseTable && [fTableView numberOfSelectedRows] == 1;
42514260 if (action == @selector(removeNoDelete:) || action == @selector(removeDeleteData:))
42524261 {
42534262 BOOL warning = NO;
4254
4263
42554264 for (Torrent * torrent in [fTableView selectedTorrents])
42564265 {
42574266 if ([torrent isActive])
42634272 }
42644273 }
42654274 }
4266
4275
42674276 //append or remove ellipsis when needed
42684277 NSString * title = [menuItem title], * ellipsis = [NSString ellipsis];
42694278 if (warning && [fDefaults boolForKey: @"CheckRemove"])
42764285 if ([title hasSuffix: ellipsis])
42774286 [menuItem setTitle: [title substringToIndex: [title rangeOfString: ellipsis].location]];
42784287 }
4279
4288
42804289 return canUseTable && [fTableView numberOfSelectedRows] > 0;
42814290 }
4282
4291
42834292 //remove all completed transfers item
42844293 if (action == @selector(clearCompleted:))
42854294 {
42954304 if ([title hasSuffix: ellipsis])
42964305 [menuItem setTitle: [title substringToIndex: [title rangeOfString: ellipsis].location]];
42974306 }
4298
4307
42994308 for (Torrent * torrent in fTorrents)
43004309 if ([torrent isFinishedSeeding])
43014310 return YES;
43104319 return YES;
43114320 return NO;
43124321 }
4313
4322
43144323 //enable resume all item
43154324 if (action == @selector(resumeAllTorrents:))
43164325 {
43194328 return YES;
43204329 return NO;
43214330 }
4322
4331
43234332 //enable resume all waiting item
43244333 if (action == @selector(resumeWaitingTorrents:))
43254334 {
43264335 if (![fDefaults boolForKey: @"Queue"] && ![fDefaults boolForKey: @"QueueSeed"])
43274336 return NO;
4328
4337
43294338 for (Torrent * torrent in fTorrents)
43304339 if ([torrent waitingToStart])
43314340 return YES;
43324341 return NO;
43334342 }
4334
4343
43354344 //enable resume selected waiting item
43364345 if (action == @selector(resumeSelectedTorrentsNoWait:))
43374346 {
43384347 if (!canUseTable)
43394348 return NO;
4340
4349
43414350 for (Torrent * torrent in [fTableView selectedTorrents])
43424351 if (![torrent isActive])
43434352 return YES;
43494358 {
43504359 if (!canUseTable)
43514360 return NO;
4352
4361
43534362 for (Torrent * torrent in [fTableView selectedTorrents])
43544363 if ([torrent isActive] || [torrent waitingToStart])
43554364 return YES;
43564365 return NO;
43574366 }
4358
4367
43594368 //enable resume item
43604369 if (action == @selector(resumeSelectedTorrents:))
43614370 {
43624371 if (!canUseTable)
43634372 return NO;
4364
4373
43654374 for (Torrent * torrent in [fTableView selectedTorrents])
43664375 if (![torrent isActive] && ![torrent waitingToStart])
43674376 return YES;
43684377 return NO;
43694378 }
4370
4379
43714380 //enable manual announce item
43724381 if (action == @selector(announceSelectedTorrents:))
43734382 {
43744383 if (!canUseTable)
43754384 return NO;
4376
4385
43774386 for (Torrent * torrent in [fTableView selectedTorrents])
43784387 if ([torrent canManualAnnounce])
43794388 return YES;
43804389 return NO;
43814390 }
4382
4391
43834392 //enable reset cache item
43844393 if (action == @selector(verifySelectedTorrents:))
43854394 {
43864395 if (!canUseTable)
43874396 return NO;
4388
4397
43894398 for (Torrent * torrent in [fTableView selectedTorrents])
43904399 if (![torrent isMagnet])
43914400 return YES;
43924401 return NO;
43934402 }
4394
4403
43954404 //enable move torrent file item
43964405 if (action == @selector(moveDataFilesSelected:))
43974406 return canUseTable && [fTableView numberOfSelectedRows] > 0;
4398
4407
43994408 //enable copy torrent file item
44004409 if (action == @selector(copyTorrentFiles:))
44014410 {
44024411 if (!canUseTable)
44034412 return NO;
4404
4413
44054414 for (Torrent * torrent in [fTableView selectedTorrents])
44064415 if (![torrent isMagnet])
44074416 return YES;
44084417 return NO;
44094418 }
4410
4419
44114420 //enable copy torrent file item
44124421 if (action == @selector(copyMagnetLinks:))
44134422 return canUseTable && [fTableView numberOfSelectedRows] > 0;
4414
4423
44154424 //enable reverse sort item
44164425 if (action == @selector(setSortReverse:))
44174426 {
44194428 [menuItem setState: (isReverse == [fDefaults boolForKey: @"SortReverse"]) ? NSOnState : NSOffState];
44204429 return ![[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER];
44214430 }
4422
4431
44234432 //enable group sort item
44244433 if (action == @selector(setSortByGroup:))
44254434 {
44264435 [menuItem setState: [fDefaults boolForKey: @"SortByGroup"] ? NSOnState : NSOffState];
44274436 return YES;
44284437 }
4429
4438
44304439 if (action == @selector(toggleQuickLook:))
44314440 {
44324441 const BOOL visible =[QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible];
44344443 NSString * title = !visible ? NSLocalizedString(@"Quick Look", "View menu -> Quick Look")
44354444 : NSLocalizedString(@"Close Quick Look", "View menu -> Quick Look");
44364445 [menuItem setTitle: title];
4437
4446
44384447 return YES;
44394448 }
4440
4449
44414450 return YES;
44424451 }
44434452
44554464 anyActive = YES;
44564465 [torrent sleep]; //have to call on all, regardless if they are active
44574466 }
4458
4467
44594468 //if there are any running transfers, wait 15 seconds for them to stop
44604469 if (anyActive)
44614470 {
44624471 sleep(15);
44634472 }
4464
4473
44654474 IOAllowPowerChange(fRootPort, (long) messageArgument);
44664475 break;
44674476 }
44774486 return;
44784487 }
44794488 }
4480
4489
44814490 IOAllowPowerChange(fRootPort, (long) messageArgument);
44824491 break;
44834492
44934502 {
44944503 if (fQuitting)
44954504 return nil;
4496
4505
44974506 NSUInteger seeding = 0, downloading = 0;
44984507 for (Torrent * torrent in fTorrents)
44994508 {
45034512 downloading++;
45044513 else;
45054514 }
4506
4515
45074516 NSMenu * menu = [[NSMenu alloc] init];
4508
4517
45094518 if (seeding > 0)
45104519 {
45114520 NSString * title = [NSString stringWithFormat: NSLocalizedString(@"%d Seeding", "Dock item - Seeding"), seeding];
45124521 [menu addItemWithTitle: title action: nil keyEquivalent: @""];
45134522 }
4514
4523
45154524 if (downloading > 0)
45164525 {
45174526 NSString * title = [NSString stringWithFormat: NSLocalizedString(@"%d Downloading", "Dock item - Downloading"), downloading];
45184527 [menu addItemWithTitle: title action: nil keyEquivalent: @""];
45194528 }
4520
4529
45214530 if (seeding > 0 || downloading > 0)
45224531 [menu addItem: [NSMenuItem separatorItem]];
4523
4532
45244533 [menu addItemWithTitle: NSLocalizedString(@"Pause All", "Dock item") action: @selector(stopAllTorrents:) keyEquivalent: @""];
45254534 [menu addItemWithTitle: NSLocalizedString(@"Resume All", "Dock item") action: @selector(resumeAllTorrents:) keyEquivalent: @""];
45264535 [menu addItem: [NSMenuItem separatorItem]];
45274536 [menu addItemWithTitle: NSLocalizedString(@"Speed Limit", "Dock item") action: @selector(toggleSpeedLimit:) keyEquivalent: @""];
4528
4537
45294538 return [menu autorelease];
45304539 }
45314540
45334542 {
45344543 //if auto size is enabled, the current frame shouldn't need to change
45354544 NSRect frame = [fDefaults boolForKey: @"AutoSize"] ? [window frame] : [self sizedWindowFrame];
4536
4545
45374546 frame.size.width = [fDefaults boolForKey: @"SmallView"] ? [fWindow minSize].width : WINDOW_REGULAR_WIDTH;
45384547 return frame;
45394548 }
45434552 if ([fDefaults boolForKey: @"AutoSize"])
45444553 {
45454554 NSScrollView * scrollView = [fTableView enclosingScrollView];
4546
4555
45474556 [scrollView setHasVerticalScroller: NO];
45484557 [fWindow setFrame: [self sizedWindowFrame] display: YES animate: YES];
45494558 [scrollView setHasVerticalScroller: YES];
4550
4559
45514560 [self setWindowMinMaxToCurrent];
45524561 }
45534562 }
45564565 {
45574566 NSUInteger groups = ([fDisplayedTorrents count] > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrent class]])
45584567 ? [fDisplayedTorrents count] : 0;
4559
4568
45604569 CGFloat heightChange = (GROUP_SEPARATOR_HEIGHT + [fTableView intercellSpacing].height) * groups
45614570 + ([fTableView rowHeight] + [fTableView intercellSpacing].height) * ([fTableView numberOfRows] - groups)
45624571 - NSHeight([[fTableView enclosingScrollView] frame]);
4563
4572
45644573 return [self windowFrameByAddingHeight: heightChange checkLimits: YES];
45654574 }
45664575
45724581 {
45734582 NSSize contentMinSize = [fWindow contentMinSize];
45744583 contentMinSize.height = [self minWindowContentSizeAllowed];
4575
4584
45764585 [fWindow setContentMinSize: contentMinSize];
4577
4586
45784587 NSSize contentMaxSize = [fWindow contentMaxSize];
45794588 contentMaxSize.height = FLT_MAX;
45804589 [fWindow setContentMaxSize: contentMaxSize];
45844593 - (void) setWindowMinMaxToCurrent
45854594 {
45864595 const CGFloat height = NSHeight([[fWindow contentView] frame]);
4587
4596
45884597 NSSize minSize = [fWindow contentMinSize],
45894598 maxSize = [fWindow contentMaxSize];
45904599 minSize.height = height;
45914600 maxSize.height = height;
4592
4601
45934602 [fWindow setContentMinSize: minSize];
45944603 [fWindow setContentMaxSize: maxSize];
45954604 }
46414650 [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: FORUM_URL]];
46424651 }
46434652
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]];
46474656 }
46484657
46494658 - (void) linkDonate: (id) sender
46594668 - (NSDictionary *) registrationDictionaryForGrowl
46604669 {
46614670 NSArray * notifications = @[GROWL_DOWNLOAD_COMPLETE, GROWL_SEEDING_COMPLETE, GROWL_AUTO_ADD, GROWL_AUTO_SPEED_LIMIT];
4662
4671
46634672 return @{GROWL_NOTIFICATIONS_ALL : notifications,
46644673 GROWL_NOTIFICATIONS_DEFAULT : notifications };
46654674 }
46684677 {
46694678 if (![clickContext isKindOfClass: [NSDictionary class]])
46704679 return;
4671
4680
46724681 NSString * type = [clickContext objectForKey: @"Type"], * location;
46734682 if (([type isEqualToString: GROWL_DOWNLOAD_COMPLETE] || [type isEqualToString: GROWL_SEEDING_COMPLETE])
46744683 && (location = [clickContext objectForKey: @"Location"]))
46934702 *stop = YES;
46944703 }
46954704 }];
4696
4705
46974706 if (!torrent)
46984707 {
46994708 NSLog(@"No torrent found matching the given torrent struct from the RPC callback!");
47004709 return;
47014710 }
47024711 }
4703
4712
47044713 dispatch_async(dispatch_get_main_queue(), ^{
47054714 switch (type)
47064715 {
47074716 case TR_RPC_TORRENT_ADDED:
47084717 [self rpcAddTorrentStruct: torrentStruct];
47094718 break;
4710
4719
47114720 case TR_RPC_TORRENT_STARTED:
47124721 case TR_RPC_TORRENT_STOPPED:
47134722 [self rpcStartedStoppedTorrent: torrent];
47144723 break;
4715
4724
47164725 case TR_RPC_TORRENT_REMOVING:
47174726 [self rpcRemoveTorrent: torrent deleteData: NO];
47184727 break;
4719
4728
47204729 case TR_RPC_TORRENT_TRASHING:
47214730 [self rpcRemoveTorrent: torrent deleteData: YES];
47224731 break;
4723
4732
47244733 case TR_RPC_TORRENT_CHANGED:
47254734 [self rpcChangedTorrent: torrent];
47264735 break;
4727
4736
47284737 case TR_RPC_TORRENT_MOVED:
47294738 [self rpcMovedTorrent: torrent];
47304739 break;
4731
4740
47324741 case TR_RPC_SESSION_QUEUE_POSITIONS_CHANGED:
47334742 [self rpcUpdateQueue];
47344743 break;
4735
4744
47364745 case TR_RPC_SESSION_CHANGED:
47374746 [fPrefsController rpcUpdatePrefs];
47384747 break;
4739
4748
47404749 case TR_RPC_SESSION_CLOSE:
47414750 fQuitRequested = YES;
47424751 [NSApp terminate: self];
47434752 break;
4744
4753
47454754 default:
47464755 NSAssert1(NO, @"Unknown RPC command received: %d", type);
47474756 }
47544763 NSString * location = nil;
47554764 if (tr_torrentGetDownloadDir(torrentStruct) != NULL)
47564765 location = [NSString stringWithUTF8String: tr_torrentGetDownloadDir(torrentStruct)];
4757
4766
47584767 Torrent * torrent = [[Torrent alloc] initWithTorrentStruct: torrentStruct location: location lib: fLib];
4759
4768
47604769 //change the location if the group calls for it (this has to wait until after the torrent is created)
47614770 if ([[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]])
47624771 {
47634772 location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]];
47644773 [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic];
47654774 }
4766
4775
47674776 [torrent update];
47684777 [fTorrents addObject: torrent];
47694778 [torrent release];
4770
4779
47714780 if (!fAddingTransfers)
47724781 fAddingTransfers = [[NSMutableSet alloc] init];
47734782 [fAddingTransfers addObject: torrent];
4774
4783
47754784 [self fullUpdateUI];
47764785 }
47774786
47834792 - (void) rpcStartedStoppedTorrent: (Torrent *) torrent
47844793 {
47854794 [torrent update];
4786
4795
47874796 [self updateUI];
47884797 [self applyFilter];
47894798 [self updateTorrentHistory];
47924801 - (void) rpcChangedTorrent: (Torrent *) torrent
47934802 {
47944803 [torrent update];
4795
4804
47964805 if ([[fTableView selectedTorrents] containsObject: torrent])
47974806 {
47984807 [fInfoController updateInfoStats]; //this will reload the file table
48044813 {
48054814 [torrent update];
48064815 [torrent updateTimeMachineExclude];
4807
4816
48084817 if ([[fTableView selectedTorrents] containsObject: torrent])
48094818 [fInfoController updateInfoStats];
48104819 }
48134822 {
48144823 for (Torrent * torrent in fTorrents)
48154824 [torrent update];
4816
4825
48174826 NSSortDescriptor * descriptor = [NSSortDescriptor sortDescriptorWithKey: @"queuePosition" ascending: YES];
48184827 NSArray * descriptors = [NSArray arrayWithObject: descriptor];
48194828 [fTorrents sortUsingDescriptors: descriptors];
4820
4829
48214830 [self sortTorrents: YES];
48224831 }
48234832
00 /******************************************************************************
1 * $Id: CreatorWindowController.h 13323 2012-05-28 19:43:53Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: CreatorWindowController.m 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
66 \f0\b\fs28 \cf0 The Transmission Project
77 \fs24 \
88 \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/}}\
1111 \pard\tx440\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li100\slleading40\sb40
1212 \cf0 \
1313 Lead Developers
137137 <false/>
138138 <key>RPCPort</key>
139139 <integer>9091</integer>
140 <key>RPCUseHostWhitelist</key>
141 <true/>
140142 <key>RPCUsername</key>
141143 <string>admin</string>
142144 <key>RPCUseWhitelist</key>
00 /******************************************************************************
1 * $Id: DragOverlayView.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: DragOverlayView.m 13599 2012-10-29 22:16:42Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: DragOverlayWindow.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: DragOverlayWindow.m 14290 2014-06-08 22:16:01Z jordan $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ExpandedPathToIconTransformer.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ExpandedPathToIconTransformer.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ExpandedPathToPathTransformer.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ExpandedPathToPathTransformer.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FileListNode.h 14036 2013-02-19 01:29:25Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FileListNode.m 14036 2013-02-19 01:29:25Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FileNameCell.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FileNameCell.m 14665 2016-01-07 17:21:12Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FileOutlineController.h 13986 2013-02-08 13:02:16Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FileOutlineController.m 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FileOutlineView.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FileOutlineView.m 14665 2016-01-07 17:21:12Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FilePriorityCell.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FilePriorityCell.m 13340 2012-06-10 02:35:58Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FilterBarController.h 13414 2012-07-25 12:49:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FilterBarController.m 13414 2012-07-25 12:49:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FilterBarView.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FilterBarView.m 14340 2014-10-16 13:01:17Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FilterButton.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: FilterButton.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: GlobalOptionsPopoverViewController.h 14226 2014-01-19 01:29:38Z jordan $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: GlobalOptionsPopoverViewController.m 14635 2015-12-27 01:48:27Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: GroupToolbarItem.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: GroupToolbarItem.m 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: GroupsController.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: GroupsController.m 13340 2012-06-10 02:35:58Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: GroupsPrefsController.h 14699 2016-03-02 07:55:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: GroupsPrefsController.m 14699 2016-03-02 07:55:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
2727 <key>CFBundleExecutable</key>
2828 <string>Transmission</string>
2929 <key>CFBundleGetInfoString</key>
30 <string>VERSION_STRING_INFOPLIST (SVN_REVISION_NUM)</string>
30 <string>VERSION_STRING_INFOPLIST (VCS_REVISION_NUM)</string>
3131 <key>CFBundleHelpBookFolder</key>
3232 <string>TransmissionHelp</string>
3333 <key>CFBundleHelpBookName</key>
5858 </dict>
5959 </array>
6060 <key>CFBundleVersion</key>
61 <string>SVN_REVISION_NUM</string>
61 <string>VCS_REVISION_NUM</string>
6262 <key>LSApplicationCategoryType</key>
6363 <string>public.app-category.utilities</string>
6464 <key>LSMinimumSystemVersion</key>
00 /******************************************************************************
1 * $Id: InfoActivityViewController.h 14051 2013-03-12 03:08:59Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoActivityViewController.m 14341 2014-10-17 05:12:00Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoFileViewController.h 13296 2012-05-14 00:00:19Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoFileViewController.m 14667 2016-01-08 10:05:19Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoGeneralViewController.h 13481 2012-09-08 20:22:05Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoGeneralViewController.m 14016 2013-02-11 01:39:44Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoOptionsViewController.h 13480 2012-09-08 18:09:02Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoOptionsViewController.m 14685 2016-02-27 20:29:57Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoPeersViewController.h 14706 2016-03-03 22:27:45Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoPeersViewController.m 14706 2016-03-03 22:27:45Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoTabButtonBack.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoTabButtonBack.m 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoTabButtonCell.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoTabButtonCell.m 14631 2015-12-22 00:45:09Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoTextField.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoTextField.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoTrackersViewController.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoTrackersViewController.m 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoViewController.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2010-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoWindowController.h 14685 2016-02-27 20:29:57Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: InfoWindowController.m 14685 2016-02-27 20:29:57Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
316316 prefix = @prefix@
317317 program_transform_name = @program_transform_name@
318318 psdir = @psdir@
319 runstatedir = @runstatedir@
319320 sbindir = @sbindir@
320321 sharedstatedir = @sharedstatedir@
321322 srcdir = @srcdir@
00 /******************************************************************************
1 * $Id: MessageWindowController.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: MessageWindowController.m 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: NSApplicationAdditions.h 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: NSApplicationAdditions.m 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: NSImageAdditions.h 14226 2014-01-19 01:29:38Z jordan $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: NSImageAdditions.m 14226 2014-01-19 01:29:38Z jordan $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: NSMutableArrayAdditions.h 14226 2014-01-19 01:29:38Z jordan $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: NSMutableArrayAdditions.m 14226 2014-01-19 01:29:38Z jordan $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: NSStringAdditions.h 14341 2014-10-17 05:12:00Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: NSStringAdditions.m 14341 2014-10-17 05:12:00Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PeerProgressIndicatorCell.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PeerProgressIndicatorCell.m 13340 2012-06-10 02:35:58Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PeerTableView.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PeerTableView.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PiecesView.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PiecesView.m 14050 2013-03-12 02:56:35Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PortChecker.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PortChecker.m 13492 2012-09-10 02:37:29Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PredicateEditorRowTemplateAny.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PredicateEditorRowTemplateAny.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PrefsController.h 14161 2013-08-10 02:29:12Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PrefsController.m 14667 2016-01-08 10:05:19Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PrefsWindow.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: PrefsWindow.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ProgressGradients.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ProgressGradients.m 13253 2012-03-13 03:20:09Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: StatsWindowController.h 13318 2012-05-27 22:31:58Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: StatsWindowController.m 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: StatusBarController.h 13343 2012-06-10 13:47:32Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: StatusBarController.m 13434 2012-08-13 00:52:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: StatusBarView.h 13454 2012-08-30 02:37:00Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: StatusBarView.m 14662 2016-01-06 11:05:37Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ToolbarSegmentedCell.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: ToolbarSegmentedCell.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2007-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: Torrent.h 14587 2015-10-23 04:09:40Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: Torrent.m 14667 2016-01-08 10:05:19Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TorrentCell.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TorrentCell.m 14665 2016-01-07 17:21:12Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2006-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TorrentGroup.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TorrentGroup.m 13434 2012-08-13 00:52:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TorrentTableView.h 14705 2016-03-03 17:57:08Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TorrentTableView.m 14705 2016-03-03 17:57:08Z mikedld $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TrackerCell.h 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TrackerCell.m 13434 2012-08-13 00:52:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TrackerNode.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TrackerNode.m 14341 2014-10-17 05:12:00Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2009-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TrackerTableView.h 13251 2012-03-13 02:52:11Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: TrackerTableView.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2008-2012 Transmission authors and contributors
44 *
3636 <div id="pagetitle">
3737 <h1>Transmission crashed, what should I do? </h1>
3838 </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>.
4040 <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.
4141 <p>
4242 <div id="pagetitle">
8383 <div id="pagetitle">
8484 <h1>What are 'nightlies'?</h1>
8585 </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>.
8787 </div>
8888 </body>
8989
3232 </ul>
3333 </div>
3434
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>.
3636 </div>
3737 </body>
3838
2222 <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.
2323
2424 <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>.
2626 <ol>
2727 <li>Pause your torrents</li>
2828 <li>Clear the log and set it to 'Debug'</li>
1414 <IMG SRC="gfx/TransWindow.png" height="auto" width="225" ALT="Image of Transmission window" BORDER="0">
1515 <h1><img class="icon" src="gfx/TransmissionIcon.png" alt="Transmission icon" height="32" width="32" border="0"> Transmission Help</h1>
1616
17 <h4><a href="http://www.transmissionbt.com/">www.transmissionbt.com</a></h4>
17 <h4><a href="https://transmissionbt.com/">transmissionbt.com</a></h4>
1818 </center>
1919 </div>
2020 <div id="contentcenter"></div>
3232 <p><a href="html/Index2.html">Look up topics easily</a></p>
3333
3434 <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>
3737
3838 </div>
3939 </div>
00 /******************************************************************************
1 * $Id: URLSheetWindowController.h 13254 2012-03-13 03:39:56Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: URLSheetWindowController.m 13254 2012-03-13 03:39:56Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2011-2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: WebSeedTableView.h 14226 2014-01-19 01:29:38Z jordan $
1 * $Id$
22 *
33 * Copyright (c) 2012 Transmission authors and contributors
44 *
00 /******************************************************************************
1 * $Id: WebSeedTableView.m 14226 2014-01-19 01:29:38Z jordan $
1 * $Id$
22 *
33 * Copyright (c) 2012 Transmission authors and contributors
44 *
695695 </menuItem>
696696 <menuItem title="Support og udvikling" id="3170">
697697 <connections>
698 <action selector="linkTrac:" target="206" id="3171"/>
698 <action selector="linkGitHub:" target="206" id="3171"/>
699699 </connections>
700700 </menuItem>
701701 </items>
696696 </menuItem>
697697 <menuItem title="Support und Entwicklung" id="3170">
698698 <connections>
699 <action selector="linkTrac:" target="206" id="3171"/>
699 <action selector="linkGitHub:" target="206" id="3171"/>
700700 </connections>
701701 </menuItem>
702702 </items>
695695 </menuItem>
696696 <menuItem title="Support &amp; Development" id="3170">
697697 <connections>
698 <action selector="linkTrac:" target="206" id="3171"/>
698 <action selector="linkGitHub:" target="206" id="3171"/>
699699 </connections>
700700 </menuItem>
701701 </items>
695695 </menuItem>
696696 <menuItem title="Wiki y Desarrollo de Transmission" id="3170">
697697 <connections>
698 <action selector="linkTrac:" target="206" id="3171"/>
698 <action selector="linkGitHub:" target="206" id="3171"/>
699699 </connections>
700700 </menuItem>
701701 </items>
694694 </menuItem>
695695 <menuItem title="Support &amp; Développement" id="3170">
696696 <connections>
697 <action selector="linkTrac:" target="206" id="3171"/>
697 <action selector="linkGitHub:" target="206" id="3171"/>
698698 </connections>
699699 </menuItem>
700700 </items>
695695 </menuItem>
696696 <menuItem title="Supporto &amp; sviluppo" id="3170">
697697 <connections>
698 <action selector="linkTrac:" target="206" id="3171"/>
698 <action selector="linkGitHub:" target="206" id="3171"/>
699699 </connections>
700700 </menuItem>
701701 </items>
00 /******************************************************************************
1 * $Id: main.m 13162 2012-01-14 17:12:04Z livings124 $
1 * $Id$
22 *
33 * Copyright (c) 2005-2012 Transmission authors and contributors
44 *
694694 </menuItem>
695695 <menuItem title="Support &amp; ontwikkeling " id="3170">
696696 <connections>
697 <action selector="linkTrac:" target="206" id="3171"/>
697 <action selector="linkGitHub:" target="206" id="3171"/>
698698 </connections>
699699 </menuItem>
700700 </items>
695695 </menuItem>
696696 <menuItem title="Suporte e desenvolvimento" id="3170">
697697 <connections>
698 <action selector="linkTrac:" target="206" id="3171"/>
698 <action selector="linkGitHub:" target="206" id="3171"/>
699699 </connections>
700700 </menuItem>
701701 </items>
695695 </menuItem>
696696 <menuItem title="Transmission wiki и разработка" id="3170">
697697 <connections>
698 <action selector="linkTrac:" target="206" id="3171"/>
698 <action selector="linkGitHub:" target="206" id="3171"/>
699699 </connections>
700700 </menuItem>
701701 </items>
695695 </menuItem>
696696 <menuItem title="Destek ve GeliÅŸtirme" id="3170">
697697 <connections>
698 <action selector="linkTrac:" target="206" id="3171"/>
698 <action selector="linkGitHub:" target="206" id="3171"/>
699699 </connections>
700700 </menuItem>
701701 </items>
0 # $Id: bg.po 14101 2013-06-26 02:22:32Z jordan $
0 # $Id$
11 #
22 # Bulgarian translation of Transmission.
33 # 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$
11 # French translation of Transmission.
22 # Copyright (C) 2005-2008 The Free Software Foundation, Inc.
33 # 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$
11 #
22 # Galician translation of Transmission
33 # 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$
11 # SOME DESCRIPTIVE TITLE.
22 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33 # 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$
11 #
22 # Russian translation of Transmission.
33 # This file is distributed under the same license as the Transmission package.
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: AboutDialog.cc 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #include <QApplication>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: AboutDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_ABOUT_DIALOG_H
5656 <item>
5757 <widget class="QLabel" name="linkLabel">
5858 <property name="text">
59 <string notr="true">&lt;a href=&quot;http://www.transmissionbt.com/&quot;&gt;http://www.transmissionbt.com/&lt;/a&gt;</string>
59 <string notr="true">&lt;a href=&quot;https://transmissionbt.com/&quot;&gt;https://transmissionbt.com/&lt;/a&gt;</string>
6060 </property>
6161 <property name="alignment">
6262 <set>Qt::AlignCenter</set>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: AddData.cc 14609 2015-12-06 17:39:18Z jordan $
6 * $Id$
77 */
88
99 #include <QFile>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: AddData.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_ADD_DATA_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Application.cc 14624 2015-12-16 20:01:03Z mikedld $
6 * $Id$
77 */
88
99 #include <ctime>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Application.h 14600 2015-11-15 11:03:27Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_APPLICATION_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: BaseDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_BASE_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: ColumnResizer.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include <QEvent>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: ColumnResizer.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_COLUMN_RESIZER_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: ComInteropHelper.cc 14624 2015-12-16 20:01:03Z mikedld $
6 * $Id$
77 */
88
99 #include <windows.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: ComInteropHelper.h 14624 2015-12-16 20:01:03Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_COM_INTEROP_HELPER_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: CustomVariantType.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TYPES_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: DBusInteropHelper.cc 14698 2016-02-29 14:16:55Z mikedld $
6 * $Id$
77 */
88
99 #include <iostream>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: DBusInteropHelper.h 14621 2015-12-16 17:57:05Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_DBUS_INTEROP_HELPER_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: DetailsDialog.cc 14611 2015-12-06 21:07:37Z jordan $
6 * $Id$
77 */
88
99 #include <cassert>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: DetailsDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_DETAILS_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FaviconCache.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include <QDir>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FaviconCache.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FAVICON_CACHE_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FileTreeDelegate.cc 14609 2015-12-06 17:39:18Z jordan $
6 * $Id$
77 */
88
99 #include <QApplication>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FileTreeDelegate.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILE_TREE_DELEGATE_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FileTreeItem.cc 14609 2015-12-06 17:39:18Z jordan $
6 * $Id$
77 */
88
99 #include <algorithm>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FileTreeItem.h 14557 2015-08-10 19:40:58Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILE_TREE_ITEM_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FileTreeModel.cc 14609 2015-12-06 17:39:18Z jordan $
6 * $Id$
77 */
88
99 #include <cassert>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FileTreeModel.h 14559 2015-08-16 22:07:09Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILE_TREE_MODEL_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FileTreeView.cc 14559 2015-08-16 22:07:09Z mikedld $
6 * $Id$
77 */
88
99 #include <algorithm>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FileTreeView.h 14559 2015-08-16 22:07:09Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILE_TREE_VIEW_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FilterBar.cc 14590 2015-10-24 20:56:45Z mikedld $
6 * $Id$
77 */
88
99 #include <QHBoxLayout>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FilterBar.h 14590 2015-10-24 20:56:45Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILTER_BAR_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FilterBarComboBox.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include <QApplication>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FilterBarComboBox.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILTER_BAR_COMBO_BOX_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FilterBarComboBoxDelegate.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include <QAbstractItemView>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FilterBarComboBoxDelegate.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILTER_BAR_COMBO_BOX_DELEGATE_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FilterBarLineEdit.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include <QToolButton>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FilterBarLineEdit.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILTER_BAR_LINE_EDIT_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Filters.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include "Filters.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Filters.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FILTERS_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Formatter.cc 14554 2015-07-30 06:55:28Z mikedld $
6 * $Id$
77 */
88
99 #include <libtransmission/transmission.h>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Formatter.h 14540 2015-06-12 22:41:36Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FORMATTER_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FreeSpaceLabel.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include <QDir>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: FreeSpaceLabel.h 14540 2015-06-12 22:41:36Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_FREE_SPACE_LABEL_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: IconToolButton.cc 14547 2015-06-28 14:18:06Z mikedld $
6 * $Id$
77 */
88
99 #include <QStyle>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: IconToolButton.h 14547 2015-06-28 14:18:06Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_ICON_TOOL_BUTTON_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: InteropHelper.cc 14624 2015-12-16 20:01:03Z mikedld $
6 * $Id$
77 */
88
99 #include <QVariant>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: InteropHelper.h 14624 2015-12-16 20:01:03Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_INTEROP_HELPER_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: InteropObject.cc 14621 2015-12-16 17:57:05Z mikedld $
6 * $Id$
77 */
88
99 #include "AddData.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: InteropObject.h 14624 2015-12-16 20:01:03Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_INTEROP_OBJECT_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: LicenseDialog.cc 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #include "LicenseDialog.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: LicenseDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_LICENSE_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: MainWindow.cc 14599 2015-11-14 14:22:57Z mikedld $
6 * $Id$
77 */
88
99 #include <cassert>
622622 void
623623 MainWindow::openDonate ()
624624 {
625 QDesktopServices::openUrl (QUrl (QLatin1String ("http://www.transmissionbt.com/donate.php")));
625 QDesktopServices::openUrl (QUrl (QLatin1String ("https://transmissionbt.com/donate/")));
626626 }
627627
628628 void
634634 void
635635 MainWindow::openHelp ()
636636 {
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").
638638 arg (MAJOR_VERSION).arg (MINOR_VERSION / 10)));
639639 }
640640
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: MainWindow.h 14582 2015-10-19 20:30:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_MAIN_WINDOW_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: MakeDialog.cc 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #include <QDir>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: MakeDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_MAKE_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: OptionsDialog.cc 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #include <QFileInfo>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: OptionsDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_OPTIONS_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: PathButton.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include <QApplication>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: PathButton.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_PATH_BUTTON_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Prefs.cc 14554 2015-07-30 06:55:28Z mikedld $
6 * $Id$
77 */
88
99 #include <cassert>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Prefs.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_PREFS_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: PrefsDialog.cc 14607 2015-12-06 17:27:21Z jordan $
6 * $Id$
77 */
88
99 #ifdef _WIN32
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: PrefsDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_PREFS_DIALOG_H
00 VOLUNTEERS WANTED
11
22 - 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
44
55 ABOUT TRANSMISSION-QT
66
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: RelocateDialog.cc 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #include <QDir>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: RelocateDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_RELOCATE_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: RpcClient.cc 14634 2015-12-25 11:34:35Z mikedld $
6 * $Id$
77 */
88
99 #include <iostream>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: RpcClient.h 14608 2015-12-06 17:28:54Z jordan $
6 * $Id$
77 */
88
99 #ifndef QTR_RPC_CLIENT_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Session.cc 14581 2015-10-18 18:39:14Z mikedld $
6 * $Id$
77 */
88
99 #include <cassert>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Session.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_SESSION_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: SessionDialog.cc 14562 2015-09-01 20:39:34Z mikedld $
6 * $Id$
77 */
88
99 #include "Prefs.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: SessionDialog.h 14562 2015-09-01 20:39:34Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_SESSION_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Speed.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_SPEED_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: StatsDialog.cc 14562 2015-09-01 20:39:34Z mikedld $
6 * $Id$
77 */
88
99 #include <QTimer>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: StatsDialog.h 14561 2015-09-01 20:19:26Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_STATS_DIALOG_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Torrent.cc 14610 2015-12-06 18:02:37Z jordan $
6 * $Id$
77 */
88
99 #include <cassert>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Torrent.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TORRENT_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentDelegate.cc 14555 2015-08-01 16:05:02Z mikedld $
6 * $Id$
77 */
88
99 #include <QApplication>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentDelegate.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TORRENT_DELEGATE_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentDelegateMin.cc 14554 2015-07-30 06:55:28Z mikedld $
6 * $Id$
77 */
88
99 #include <QApplication>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentDelegateMin.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TORRENT_DELEGATE_MIN_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentFilter.cc 14554 2015-07-30 06:55:28Z mikedld $
6 * $Id$
77 */
88
99 #include <algorithm>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentFilter.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TORRENT_FILTER_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentModel.cc 14554 2015-07-30 06:55:28Z mikedld $
6 * $Id$
77 */
88
99 #include <iostream>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentModel.h 14540 2015-06-12 22:41:36Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TORRENT_MODEL_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentView.cc 14590 2015-10-24 20:56:45Z mikedld $
6 * $Id$
77 */
88
99 #include <QApplication>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TorrentView.h 14590 2015-10-24 20:56:45Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TORRENT_VIEW_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TrackerDelegate.cc 14633 2015-12-25 10:19:50Z mikedld $
6 * $Id$
77 */
88
99 #include <QAbstractTextDocumentLayout>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TrackerDelegate.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TRACKER_DELEGATE_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TrackerModel.cc 14556 2015-08-06 20:28:44Z mikedld $
6 * $Id$
77 */
88
99 #include <algorithm> // std::sort()
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TrackerModel.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TRACKER_MODEL_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TrackerModelFilter.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include "TrackerModel.h"
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: TrackerModelFilter.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_TRACKER_MODEL_FILTER_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Utils.cc 14564 2015-09-27 20:23:03Z mikedld $
6 * $Id$
77 */
88
99 #ifdef _WIN32
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: Utils.h 14554 2015-07-30 06:55:28Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_UTILS_H
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: WatchDir.cc 14537 2015-06-10 21:27:11Z mikedld $
6 * $Id$
77 */
88
99 #include <iostream>
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: WatchDir.h 14539 2015-06-12 22:12:12Z mikedld $
6 * $Id$
77 */
88
99 #ifndef QTR_WATCH_DIR_H
00 DHT_LIBS = $${TRANSMISSION_TOP}/third-party/dht/libdht.a
11 LIBB64_LIBS = $${TRANSMISSION_TOP}/third-party/libb64/libb64.a
22 LIBUTP_LIBS = $${TRANSMISSION_TOP}/third-party/libutp/libutp.a -lrt
3 LIBUPNP_LIBS = -lminiupnpc
3 LIBUPNP_LIBS = $${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a
44 LIBNATPMP_LIBS = $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a
2222 Show help options
2323 .It Fl g, Fl -config-dir Ar directory
2424 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.
2626 .It Fl m Fl -minimized
2727 Start minimized in notification area
2828 .It Fl p, Fl -port Ar port
7373 .Xr transmission-remote 1 ,
7474 .Xr transmission-show 1
7575 .Pp
76 http://www.transmissionbt.com/
76 https://transmissionbt.com/
376376 prefix = @prefix@
377377 program_transform_name = @program_transform_name@
378378 psdir = @psdir@
379 runstatedir = @runstatedir@
379380 sbindir = @sbindir@
380381 sharedstatedir = @sharedstatedir@
381382 srcdir = @srcdir@
374374 prefix = @prefix@
375375 program_transform_name = @program_transform_name@
376376 psdir = @psdir@
377 runstatedir = @runstatedir@
377378 sbindir = @sbindir@
378379 sharedstatedir = @sharedstatedir@
379380 srcdir = @srcdir@
375375 prefix = @prefix@
376376 program_transform_name = @program_transform_name@
377377 psdir = @psdir@
378 runstatedir = @runstatedir@
378379 sbindir = @sbindir@
379380 sharedstatedir = @sharedstatedir@
380381 srcdir = @srcdir@
375375 prefix = @prefix@
376376 program_transform_name = @program_transform_name@
377377 psdir = @psdir@
378 runstatedir = @runstatedir@
378379 sbindir = @sbindir@
379380 sharedstatedir = @sharedstatedir@
380381 srcdir = @srcdir@
374374 prefix = @prefix@
375375 program_transform_name = @program_transform_name@
376376 psdir = @psdir@
377 runstatedir = @runstatedir@
377378 sbindir = @sbindir@
378379 sharedstatedir = @sharedstatedir@
379380 srcdir = @srcdir@
379379 prefix = @prefix@
380380 program_transform_name = @program_transform_name@
381381 psdir = @psdir@
382 runstatedir = @runstatedir@
382383 sbindir = @sbindir@
383384 sharedstatedir = @sharedstatedir@
384385 srcdir = @srcdir@
77 Release: %{release}
88 License: MIT
99 Group: Applications/Internet
10 URL: http://www.transmissionbt.com/
10 URL: https://transmissionbt.com/
1111 Epoch: 1
1212 Source0: %{name}-%{version}.tar.bz2
1313
1919 major_version=`echo ${user_agent_prefix} | awk -F . '{print $1}'`
2020 minor_version=`echo ${user_agent_prefix} | awk -F . '{print $2 + 0}'`
2121
22 svn_revision_file=REVISION
23 svn_revision_reliable=true
22 vcs_revision=
23 vcs_revision_file=REVISION
2424
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"`
3933 fi
4034
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"
4339 else
44 rm -f "$svn_revision_file"
40 vcs_revision=0
41 rm -f "$vcs_revision_file"
4542 fi
4643
44 vcs_revision=`echo ${vcs_revision} | head -c10`
45
4746 cat > libtransmission/version.h.new << EOF
47 #pragma once
48
4849 #define PEERID_PREFIX "${peer_id_prefix}"
4950 #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}
5253 #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})"
5455 #define VERSION_STRING_INFOPLIST ${user_agent_prefix}
5556 #define MAJOR_VERSION ${major_version}
5657 #define MINOR_VERSION ${minor_version}
416416 prefix = @prefix@
417417 program_transform_name = @program_transform_name@
418418 psdir = @psdir@
419 runstatedir = @runstatedir@
419420 sbindir = @sbindir@
420421 sharedstatedir = @sharedstatedir@
421422 srcdir = @srcdir@
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: create.c 14615 2015-12-06 22:39:14Z jordan $
6 * $Id$
77 */
88
99 #include <stdio.h> /* fprintf() */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: edit.c 14644 2015-12-29 19:37:31Z mikedld $
6 * $Id$
77 */
88
99 #include <stdio.h> /* fprintf () */
33 * It may be used under the GNU GPL versions 2 or 3
44 * or any future license endorsed by Mnemosyne LLC.
55 *
6 * $Id: show.c 14615 2015-12-06 22:39:14Z jordan $
6 * $Id$
77 */
88
99 #include <stdio.h> /* fprintf () */
4848 .Xr transmission-remote 1 ,
4949 .Xr transmission-show 1
5050 .Pp
51 http://www.transmissionbt.com/
51 https://transmissionbt.com/
4343 .Xr transmission-remote 1 ,
4444 .Xr transmission-show 1
4545 .Pp
46 http://www.transmissionbt.com/
46 https://transmissionbt.com/
3535 .Xr transmission-remote 1 ,
3636 .Xr transmission-show 1
3737 .Pp
38 http://www.transmissionbt.com/
38 https://transmissionbt.com/
407407 prefix = @prefix@
408408 program_transform_name = @program_transform_name@
409409 psdir = @psdir@
410 runstatedir = @runstatedir@
410411 sbindir = @sbindir@
411412 sharedstatedir = @sharedstatedir@
412413 srcdir = @srcdir@
347347 prefix = @prefix@
348348 program_transform_name = @program_transform_name@
349349 psdir = @psdir@
350 runstatedir = @runstatedir@
350351 sbindir = @sbindir@
351352 sharedstatedir = @sharedstatedir@
352353 srcdir = @srcdir@
407407 prefix = @prefix@
408408 program_transform_name = @program_transform_name@
409409 psdir = @psdir@
410 runstatedir = @runstatedir@
410411 sbindir = @sbindir@
411412 sharedstatedir = @sharedstatedir@
412413 srcdir = @srcdir@
347347 prefix = @prefix@
348348 program_transform_name = @program_transform_name@
349349 psdir = @psdir@
350 runstatedir = @runstatedir@
350351 sbindir = @sbindir@
351352 sharedstatedir = @sharedstatedir@
352353 srcdir = @srcdir@
698698 break;
699699
700700 case 'homepage':
701 window.open('http://www.transmissionbt.com/');
701 window.open('https://transmissionbt.com/');
702702 break;
703703
704704 case 'tipjar':
705 window.open('http://www.transmissionbt.com/donate.php');
705 window.open('https://transmissionbt.com/donate/');
706706 break;
707707
708708 case 'unlimited_download_rate':
376376 prefix = @prefix@
377377 program_transform_name = @program_transform_name@
378378 psdir = @psdir@
379 runstatedir = @runstatedir@
379380 sbindir = @sbindir@
380381 sharedstatedir = @sharedstatedir@
381382 srcdir = @srcdir@
407407 prefix = @prefix@
408408 program_transform_name = @program_transform_name@
409409 psdir = @psdir@
410 runstatedir = @runstatedir@
410411 sbindir = @sbindir@
411412 sharedstatedir = @sharedstatedir@
412413 srcdir = @srcdir@
347347 prefix = @prefix@
348348 program_transform_name = @program_transform_name@
349349 psdir = @psdir@
350 runstatedir = @runstatedir@
350351 sbindir = @sbindir@
351352 sharedstatedir = @sharedstatedir@
352353 srcdir = @srcdir@
407407 prefix = @prefix@
408408 program_transform_name = @program_transform_name@
409409 psdir = @psdir@
410 runstatedir = @runstatedir@
410411 sbindir = @sbindir@
411412 sharedstatedir = @sharedstatedir@
412413 srcdir = @srcdir@
407407 prefix = @prefix@
408408 program_transform_name = @program_transform_name@
409409 psdir = @psdir@
410 runstatedir = @runstatedir@
410411 sbindir = @sbindir@
411412 sharedstatedir = @sharedstatedir@
412413 srcdir = @srcdir@
347347 prefix = @prefix@
348348 program_transform_name = @program_transform_name@
349349 psdir = @psdir@
350 runstatedir = @runstatedir@
350351 sbindir = @sbindir@
351352 sharedstatedir = @sharedstatedir@
352353 srcdir = @srcdir@