Changeset 7910
- Timestamp:
- Feb 18, 2009, 6:40:36 PM (14 years ago)
- Location:
- branches/1.5x/gtk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5x/gtk/actions.c
r7664 r7910 121 121 { "pause-torrent", GTK_STOCK_MEDIA_PAUSE, N_( "_Pause" ), "<control>P", N_( "Pause torrent" ), G_CALLBACK( action_cb ) }, 122 122 { "pause-all-torrents", GTK_STOCK_MEDIA_PAUSE, N_( "_Pause All" ), NULL, N_( "Pause all torrents" ), G_CALLBACK( action_cb ) }, 123 { "start-all-torrents", GTK_STOCK_MEDIA_PLAY, N_( "_Start All" ), NULL, N_( "Start all torrents" ), G_CALLBACK( action_cb ) }, 123 124 { "remove-torrent", GTK_STOCK_REMOVE, NULL, "Delete", N_( "Remove torrent" ), G_CALLBACK( action_cb ) }, 124 125 { "delete-torrent", GTK_STOCK_DELETE, N_( "_Delete Files and Remove" ), "<shift>Delete", NULL, G_CALLBACK( action_cb ) }, -
branches/1.5x/gtk/main.c
r7767 r7910 209 209 refreshTorrentActions( struct cbdata * data ) 210 210 { 211 int 211 int canUpdate; 212 212 struct counts_data counts; 213 213 GtkTreeSelection * s = data->sel; … … 232 232 GtkTreeView * view = gtk_tree_selection_get_tree_view( s ); 233 233 GtkTreeModel * model = gtk_tree_view_get_model( view ); 234 const int 234 const int torrentCount = gtk_tree_model_iter_n_children( model, NULL ) != 0; 235 235 action_sensitize( "select-all", torrentCount != 0 ); 236 236 action_sensitize( "deselect-all", torrentCount != 0 ); … … 239 239 { 240 240 tr_session * session = tr_core_session( data->core ); 241 int activeCount = tr_sessionGetActiveTorrentCount( session ); 242 action_sensitize( "pause-all-torrents", activeCount != 0 ); 241 const int active = tr_sessionGetActiveTorrentCount( session ); 242 const int total = tr_sessionCountTorrents( session ); 243 action_sensitize( "pause-all-torrents", active != 0 ); 244 action_sensitize( "start-all-torrents", active != total ); 243 245 } 244 246 } … … 1377 1379 1378 1380 static void 1381 startAllTorrents( struct cbdata * data ) 1382 { 1383 tr_session * session = tr_core_session( data->core ); 1384 const char * cmd = "{ \"method\": \"torrent-start\" }"; 1385 tr_rpc_request_exec_json( session, cmd, strlen( cmd ), NULL, NULL ); 1386 } 1387 1388 static void 1379 1389 pauseAllTorrents( struct cbdata * data ) 1380 1390 { … … 1409 1419 { 1410 1420 pauseAllTorrents( data ); 1421 } 1422 else if( !strcmp( action_name, "start-all-torrents" ) ) 1423 { 1424 startAllTorrents( data ); 1411 1425 } 1412 1426 else if( !strcmp( action_name, "pause-torrent" ) ) -
branches/1.5x/gtk/ui.h
r7664 r7910 15 15 " <menuitem action='remove-torrent'/>\n" 16 16 " <menuitem action='delete-torrent'/>\n" 17 " <separator/>\n" 18 " <menuitem action='start-all-torrents'/>\n" 19 " <menuitem action='pause-all-torrents'/>\n" 17 20 " <separator/>\n" 18 21 " <menuitem action='quit'/>\n" … … 79 82 " <menuitem action='show-about-dialog'/>\n" 80 83 " <separator/>\n" 84 " <menuitem action='start-all-torrents'/>\n" 81 85 " <menuitem action='pause-all-torrents'/>\n" 82 86 " <separator/>\n"
Note: See TracChangeset
for help on using the changeset viewer.