1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +00:00

(gtk) minor filter improvement

This commit is contained in:
Charles Kerr 2007-12-24 19:12:52 +00:00
parent 73bd6967fe
commit f351252a5e

View file

@ -615,31 +615,13 @@ updateTorrentCount( PrivateData * p )
}
}
void
tr_window_update( TrWindow * self )
static void
updateStats( PrivateData * p )
{
PrivateData * p = get_private_data( self );
tr_handle * handle = NULL;
if( p && p->core )
handle = tr_core_handle( p->core );
if( handle )
{
char * pch;
float u, d;
char up[32], down[32], buf[128];
struct tr_session_stats stats;
/* update the speeds */
tr_torrentRates( handle, &d, &u );
tr_strlspeed( buf, d, sizeof( buf ) );
gtk_label_set_text( GTK_LABEL( p->dl_lb ), buf );
tr_strlspeed( buf, u, sizeof( buf ) );
gtk_label_set_text( GTK_LABEL( p->ul_lb ), buf );
updateTorrentCount( p );
tr_handle * handle = tr_core_handle( p->core );
/* update the stats */
pch = pref_string_get( PREF_KEY_STATUS_BAR_STATS );
@ -662,6 +644,33 @@ tr_window_update( TrWindow * self )
}
g_free( pch );
gtk_label_set_text( GTK_LABEL( p->stats_lb ), buf );
}
static void
updateSpeeds( PrivateData * p )
{
char buf[128];
float u, d;
tr_handle * handle = tr_core_handle( p->core );
tr_torrentRates( handle, &d, &u );
tr_strlspeed( buf, d, sizeof( buf ) );
gtk_label_set_text( GTK_LABEL( p->dl_lb ), buf );
tr_strlspeed( buf, u, sizeof( buf ) );
gtk_label_set_text( GTK_LABEL( p->ul_lb ), buf );
}
void
tr_window_update( TrWindow * self )
{
PrivateData * p = get_private_data( self );
if( p && p->core && tr_core_handle(p->core) )
{
updateSpeeds( p );
updateTorrentCount( p );
updateStats( p );
refilter( p );
}
}