Changeset 1656


Ignore:
Timestamp:
Apr 4, 2007, 12:56:17 AM (15 years ago)
Author:
joshe
Message:

Add remaining file download to properties window.

Location:
trunk/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/dialogs.c

    r1654 r1656  
    9494        uint64_t            down;
    9595        GtkLabel          * downwid;
     96        uint64_t            left;
     97        GtkLabel          * leftwid;
    9698    }                       inf;
    9799};
     
    373375makeinfotab( TrTorrent * tor, struct infowind * iw )
    374376{
    375     const int   rowcount = 16;
     377    const int   rowcount = 17;
    376378    tr_info_t * inf;
    377379    int         ii;
     
    403405    INFOLINEU( table, ii, _("Downloaded:"),   iw->inf.downwid );
    404406    INFOLINEU( table, ii, _("Uploaded:"),     iw->inf.upwid );
     407    INFOLINEU( table, ii, _("Remaining:"),    iw->inf.leftwid );
    405408
    406409    g_assert( rowcount == ii );
     
    415418{
    416419    int                 seed, leech, done;
    417     uint64_t            up, down;
     420    uint64_t            up, down, left;
    418421    tr_tracker_info_t * track;
    419422    GtkTreePath       * path;
     
    429432    gtk_tree_model_get( iw->model, &iter, MC_TRACKER, &track,
    430433                        MC_SEED, &seed, MC_LEECH, &leech, MC_DONE, &done,
    431                         MC_DOWN, &down, MC_UP, &up, -1 );
     434                        MC_DOWN, &down, MC_UP, &up, MC_LEFT, &left, -1 );
    432435
    433436    if( track != iw->inf.track || force )
     
    475478        g_free( str );
    476479        iw->inf.up = up;
     480    }
     481    if( left != iw->inf.left || force )
     482    {
     483        str = readablesize( left );
     484        gtk_label_set_text( iw->inf.leftwid, str );
     485        g_free( str );
     486        iw->inf.left = left;
    477487    }
    478488}
  • trunk/gtk/main.c

    r1654 r1656  
    380380        /* peersUploading, peersDownloading, seeders,    leechers */
    381381        G_TYPE_INT,        G_TYPE_INT,       G_TYPE_INT, G_TYPE_INT,
    382         /* completedFromTracker, downloaded,    uploaded */
    383         G_TYPE_INT,              G_TYPE_UINT64, G_TYPE_UINT64,
     382        /* completedFromTracker, downloaded,    uploaded       left */
     383        G_TYPE_INT,              G_TYPE_UINT64, G_TYPE_UINT64, G_TYPE_UINT64,
    384384        /* tracker,            the TrTorrent object */
    385385        TR_TRACKER_BOXED_TYPE, TR_TORRENT_TYPE,
     
    849849          MC_SEED,   st->seeders,              MC_LEECH,   st->leechers,
    850850          MC_DONE,   st->completedFromTracker, MC_TRACKER, st->tracker,
    851           MC_DOWN,   st->downloaded,           MC_UP,      st->uploaded, -1);
     851          MC_DOWN,   st->downloaded,           MC_UP,      st->uploaded,
     852          MC_LEFT,   st->left, -1);
    852853    } while(gtk_tree_model_iter_next(data->model, &iter));
    853854  }
  • trunk/gtk/util.h

    r1654 r1656  
    6767  MC_PROG, MC_DRATE, MC_URATE, MC_ETA, MC_PEERS,
    6868  MC_UPEERS, MC_DPEERS, MC_SEED, MC_LEECH, MC_DONE,
    69   MC_DOWN, MC_UP, MC_TRACKER, MC_TORRENT, MC_ROW_COUNT,
     69  MC_DOWN, MC_UP, MC_LEFT, MC_TRACKER, MC_TORRENT, MC_ROW_COUNT,
    7070};
    7171
Note: See TracChangeset for help on using the changeset viewer.