Changeset 1615
- Timestamp:
- Mar 31, 2007, 7:19:27 PM (15 years ago)
- Location:
- trunk/gtk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/main.c
r1585 r1615 172 172 static void 173 173 prefschanged( GtkWidget * widget, int id, gpointer data ); 174 static void 175 setpex( tr_torrent_t * tor, void * arg ); 174 176 static gboolean 175 177 updatemodel(gpointer gdata); … … 735 737 PREF_ID_NAT, 736 738 PREF_ID_ICON, 739 PREF_ID_PEX, 737 740 }; 738 741 int ii; … … 750 753 tr_handle_t * tr; 751 754 int num; 755 gboolean boolval; 752 756 753 757 cbdata = data; … … 796 800 break; 797 801 802 case PREF_ID_PEX: 803 boolval = tr_prefs_get_bool_with_default( id ); 804 tr_torrentIterate( tr, setpex, &boolval ); 805 break; 806 798 807 case PREF_ID_DIR: 799 808 case PREF_ID_ASKDIR: … … 804 813 break; 805 814 } 815 } 816 817 void 818 setpex( tr_torrent_t * tor, void * arg ) 819 { 820 gboolean * val; 821 822 val = arg; 823 tr_torrentDisablePex( tor, !(*val) ); 806 824 } 807 825 -
trunk/gtk/tr_prefs.c
r1587 r1615 119 119 N_("Attempt to bypass NAT or firewall to allow incoming peer connections") }, 120 120 121 /* PREF_ID_PEX */ 122 { "use-peer-exchange", G_TYPE_BOOLEAN, PR_ENABLED, NULL, 123 N_("Use peer _exchange if possible"), 124 N_("Perform Azureus or \xc2\xb5Torrent compatible peer exchange with any peers which support it") }, 125 121 126 /* PREF_ID_ICON */ 122 127 { "use-tray-icon", G_TYPE_BOOLEAN, … … 178 183 { FALSE, -1, FALSE }, { FALSE, -1, FALSE }, 179 184 /* PREF_ID_NAT */ 185 { TRUE, -1, FALSE }, 186 /* PREF_ID_PEX */ 180 187 { TRUE, -1, FALSE }, 181 188 /* PREF_ID_ICON */ -
trunk/gtk/tr_prefs.h
r1504 r1615 84 84 PREF_ID_PORT, 85 85 PREF_ID_NAT, 86 PREF_ID_PEX, 86 87 PREF_ID_ICON, 87 88 PREF_ID_ADDSTD, -
trunk/gtk/tr_torrent.c
r1576 r1615 35 35 36 36 #include "tr_backend.h" 37 #include "tr_prefs.h" 37 38 #include "tr_torrent.h" 38 39 #include "util.h" … … 264 265 tr_handle_t *back; 265 266 int errcode, trflags; 267 gboolean boolval; 266 268 267 269 TR_IS_BACKEND(backend); … … 295 297 return NULL; 296 298 } 299 300 /* I should probably add a property for this but I've had enough 301 with adding useless gtk glue to this program */ 302 boolval = tr_prefs_get_bool_with_default( PREF_ID_PEX ); 303 tr_torrentDisablePex( handle, !boolval ); 297 304 298 305 ret = g_object_new(TR_TORRENT_TYPE, "torrent-handle", handle,
Note: See TracChangeset
for help on using the changeset viewer.