~ubuntu-branches/ubuntu/jaunty/transmission/jaunty-updates

« back to all changes in this revision

Viewing changes to gtk/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2009-02-27 10:51:53 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20090227105153-3d73lc7bg0pkfk00
Tags: 1.51-0ubuntu1
* New upstream bug fix release (LP: #335404)
  - Fixes transmission-daemon doesn't consider settings.json (LP: #322449) 
* Removed 01_check_notification_actions.diff: applied upstream 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: main.c 7767 2009-01-20 18:31:37Z charles $
 
2
 * $Id: main.c 7910 2009-02-18 18:40:36Z charles $
3
3
 *
4
4
 * Copyright (c) 2005-2008 Transmission authors and contributors
5
5
 *
208
208
static void
209
209
refreshTorrentActions( struct cbdata * data )
210
210
{
211
 
    int                canUpdate;
 
211
    int canUpdate;
212
212
    struct counts_data counts;
213
213
    GtkTreeSelection * s = data->sel;
214
214
 
231
231
    {
232
232
        GtkTreeView *  view = gtk_tree_selection_get_tree_view( s );
233
233
        GtkTreeModel * model = gtk_tree_view_get_model( view );
234
 
        const int  torrentCount = gtk_tree_model_iter_n_children( model, NULL ) != 0;
 
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 );
237
237
    }
238
238
 
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
}
245
247
 
1376
1378
}
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
{
1381
1391
    tr_session * session = tr_core_session( data->core );
1409
1419
    {
1410
1420
        pauseAllTorrents( data );
1411
1421
    }
 
1422
    else if( !strcmp( action_name, "start-all-torrents" ) )
 
1423
    {
 
1424
        startAllTorrents( data );
 
1425
    }
1412
1426
    else if( !strcmp( action_name, "pause-torrent" ) )
1413
1427
    {
1414
1428
        GtkTreeSelection * s = tr_window_get_selection( data->wind );