Changeset 8671
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/add-dialog.c
r8669 r8671 124 124 tr_torrentStart( tr_torrent_handle( data->gtor ) ); 125 125 126 tr_core_add_torrent( data->core, data->gtor );126 tr_core_add_torrent( data->core, data->gtor, FALSE ); 127 127 128 128 if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( data->trash_check ) ) ) … … 427 427 GSList * l = gtk_file_chooser_get_filenames( chooser ); 428 428 429 tr_core_add_list( core, l, start, prompt );429 tr_core_add_list( core, l, start, prompt, FALSE ); 430 430 } 431 431 -
trunk/gtk/main.c
r8669 r8671 301 301 { 302 302 case TR_RPC_TORRENT_ADDED: 303 tr_core_add_torrent( cbdata->core, 304 tr_torrent_new_preexisting( tor ) ); 303 tr_core_add_torrent( cbdata->core, tr_torrent_new_preexisting( tor ), TRUE ); 305 304 break; 306 305 … … 518 517 /* add torrents from command-line and saved state */ 519 518 tr_core_load( cbdata->core, forcepause ); 520 tr_core_add_list( cbdata->core, torrentFiles, start, prompt );519 tr_core_add_list( cbdata->core, torrentFiles, start, prompt, TRUE ); 521 520 torrentFiles = NULL; 522 521 tr_core_torrents_added( cbdata->core ); … … 794 793 { 795 794 paths = g_slist_reverse( paths ); 796 tr_core_add_list_defaults( data->core, paths );795 tr_core_add_list_defaults( data->core, paths, TRUE ); 797 796 tr_core_torrents_added( data->core ); 798 797 } -
trunk/gtk/notify.c
r8670 r8671 23 23 #ifndef HAVE_LIBNOTIFY 24 24 25 void 26 tr_notify_init( void ) { } 27 void 28 tr_notify_send( TrTorrent * tor UNUSED ) { } 25 void tr_notify_init( void ) { } 26 void tr_notify_send( TrTorrent * tor UNUSED ) { } 27 void tr_notify_added( const char * name UNUSED ) { } 29 28 30 29 #else … … 114 113 } 115 114 115 void 116 tr_notify_added( const char * name ) 117 { 118 if( pref_flag_get( PREF_KEY_SHOW_DESKTOP_NOTIFICATION ) ) 119 { 120 NotifyNotification * n = notify_notification_new( 121 _( "Torrent Added" ), name, "transmission", NULL ); 122 notify_notification_set_timeout( n, NOTIFY_EXPIRES_DEFAULT ); 123 notify_notification_show( n, NULL ); 124 } 125 } 126 116 127 #endif -
trunk/gtk/notify.h
r7658 r8671 20 20 void tr_notify_send( TrTorrent * tor ); 21 21 22 void tr_notify_added( const char * name ); 23 22 24 #endif -
trunk/gtk/tr-core.c
r8669 r8671 41 41 42 42 #include "conf.h" 43 #include "notify.h" 43 44 #include "tr-core.h" 44 45 #ifdef HAVE_DBUS_GLIB … … 470 471 471 472 core->priv->adding_from_watch_dir = TRUE; 472 tr_core_add_list_defaults( core, core->priv->monitor_files );473 tr_core_add_list_defaults( core, core->priv->monitor_files, TRUE ); 473 474 core->priv->adding_from_watch_dir = FALSE; 474 475 … … 785 786 786 787 void 787 tr_core_add_torrent( TrCore * self, 788 TrTorrent * gtor ) 788 tr_core_add_torrent( TrCore * self, 789 TrTorrent * gtor, 790 gboolean doNotify ) 789 791 { 790 792 const tr_info * inf = tr_torrent_info( gtor ); … … 803 805 -1 ); 804 806 807 if( doNotify ) 808 tr_notify_added( inf->name ); 809 805 810 /* cleanup */ 806 811 g_object_unref( G_OBJECT( gtor ) ); … … 825 830 torrents = tr_sessionLoadTorrents ( tr_core_session( self ), ctor, &count ); 826 831 for( i = 0; i < count; ++i ) 827 tr_core_add_torrent( self, tr_torrent_new_preexisting( torrents[i] ) );832 tr_core_add_torrent( self, tr_torrent_new_preexisting( torrents[i] ), FALSE ); 828 833 829 834 tr_free( torrents ); … … 854 859 855 860 static int 856 add_ctor( TrCore * core, tr_ctor * ctor, gboolean doPrompt )861 add_ctor( TrCore * core, tr_ctor * ctor, gboolean doPrompt, gboolean doNotify ) 857 862 { 858 863 tr_info inf; … … 880 885 tr_session * session = tr_core_session( core ); 881 886 TrTorrent * gtor = tr_torrent_new_ctor( session, ctor, &err ); 882 g_message( "creating a gtorrent" );883 887 if( !err ) 884 tr_core_add_torrent( core, gtor );888 tr_core_add_torrent( core, gtor, doNotify ); 885 889 } 886 890 tr_metainfoFree( &inf ); … … 919 923 920 924 if( !err ) 921 err = add_ctor( core, ctor, do_prompt );925 err = add_ctor( core, ctor, do_prompt, TRUE ); 922 926 923 927 tr_free( file_contents ); … … 933 937 const char * filename, 934 938 gboolean doStart, 935 gboolean doPrompt ) 939 gboolean doPrompt, 940 gboolean doNotify ) 936 941 { 937 942 tr_session * session = tr_core_session( core ); … … 944 949 tr_ctorSetMetainfoFromFile( ctor, filename ); 945 950 946 err = add_ctor( core, ctor, doPrompt );951 err = add_ctor( core, ctor, doPrompt, doNotify ); 947 952 if( err == TR_EINVALID ) 948 953 tr_core_errsig( core, TR_EINVALID, filename ); … … 961 966 962 967 void 963 tr_core_add_list( TrCore * core, 964 GSList * torrentFiles, 965 pref_flag_t start, 966 pref_flag_t prompt ) 968 tr_core_add_list( TrCore * core, 969 GSList * torrentFiles, 970 pref_flag_t start, 971 pref_flag_t prompt, 972 gboolean doNotify ) 967 973 { 968 974 const gboolean doStart = pref_flag_eval( start, PREF_KEY_START ); … … 971 977 972 978 for( l = torrentFiles; l != NULL; l = l->next ) 973 add_filename( core, l->data, doStart, doPrompt );979 add_filename( core, l->data, doStart, doPrompt, doNotify ); 974 980 975 981 tr_core_torrents_added( core ); -
trunk/gtk/tr-core.h
r8669 r8671 135 135 GSList * torrentFiles, 136 136 pref_flag_t start, 137 pref_flag_t prompt ); 138 139 #define tr_core_add_list_defaults( c, l ) \ 140 tr_core_add_list( c, l, PREF_FLAG_DEFAULT, PREF_FLAG_DEFAULT ) 137 pref_flag_t prompt, 138 gboolean doNotify ); 139 140 #define tr_core_add_list_defaults( c, l, doNotify ) \ 141 tr_core_add_list( c, l, PREF_FLAG_DEFAULT, PREF_FLAG_DEFAULT, doNotify ) 141 142 142 143 … … 148 149 149 150 /** Add a torrent. */ 150 void tr_core_add_torrent( TrCore*, TrTorrent* );151 void tr_core_add_torrent( TrCore*, TrTorrent*, gboolean doNotify ); 151 152 152 153 /** Present the main window */ -
trunk/gtk/tr-prefs.c
r8557 r8671 539 539 hig_workarea_add_row( t, &row, s, w, NULL ); 540 540 541 s = _( "Use peer e_xchange (PEX)" );541 s = _( "Use PE_X to find more peers" ); 542 542 w = new_check_button( s, TR_PREFS_KEY_PEX_ENABLED, core ); 543 s = _( "PEX is a tool for exchanging peer lists with the peers you're connected to." ); 544 gtr_widget_set_tooltip_text( w, s ); 543 545 hig_workarea_add_wide_control( t, &row, w ); 544 546 545 s = _( "Use _ distributed hash table (DHT)" );547 s = _( "Use _DHT to find more peers" ); 546 548 w = new_check_button( s, TR_PREFS_KEY_DHT_ENABLED, core ); 549 s = _( "DHT is a tool for finding peers without a tracker." ); 550 gtr_widget_set_tooltip_text( w, s ); 547 551 hig_workarea_add_wide_control( t, &row, w ); 548 552
Note: See TracChangeset
for help on using the changeset viewer.