Changeset 10066


Ignore:
Timestamp:
Feb 1, 2010, 4:54:10 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) make it easier to change the periodic refresh intervals at the code level

Location:
trunk/gtk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r9977 r10066  
    3030
    3131#define DETAILS_KEY "details-data"
    32 
    33 #define UPDATE_INTERVAL_SECONDS 2
    3432
    3533struct DetailsImpl
     
    22442242    gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), n, TRUE, TRUE, 0 );
    22452243
    2246     di->periodic_refresh_tag = gtr_timeout_add_seconds( UPDATE_INTERVAL_SECONDS,
     2244    di->periodic_refresh_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS,
    22472245                                                        periodic_refresh, di );
    22482246    gtk_widget_show_all( GTK_DIALOG( d )->vbox );
  • trunk/gtk/file-list.c

    r10052 r10066  
    2323#include "hig.h"
    2424#include "icons.h"
     25#include "tr-prefs.h"
    2526
    2627enum
     
    522523
    523524        refresh( data );
    524         data->timeout_tag = gtr_timeout_add_seconds( 2, refreshModel, data );
     525        data->timeout_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, refreshModel, data );
    525526    }
    526527
  • trunk/gtk/main.c

    r10065 r10066  
    6262#define MY_NAME "transmission"
    6363
    64 #define REFRESH_INTERVAL_SECONDS 2
    65 
    6664#if GTK_CHECK_VERSION( 2, 8, 0 )
    6765 #define SHOW_LICENSE
     
    687685
    688686    /* start model update timer */
    689     cbdata->timer = gtr_timeout_add_seconds( REFRESH_INTERVAL_SECONDS, updatemodel, cbdata );
     687    cbdata->timer = gtr_timeout_add_seconds( MAIN_WINDOW_REFRESH_INTERVAL_SECONDS, updatemodel, cbdata );
    690688    updatemodel( cbdata );
    691689
  • trunk/gtk/makemeta-ui.c

    r9968 r10066  
    2323#include "makemeta-ui.h"
    2424#include "tr-core.h"
     25#include "tr-prefs.h"
    2526#include "util.h"
    2627
     
    190191    gtk_box_pack_start( GTK_BOX( v ), w, FALSE, FALSE, 0 );
    191192
    192     ui->progress_tag = gtr_timeout_add_seconds( 1, onProgressDialogRefresh, ui );
     193    ui->progress_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, onProgressDialogRefresh, ui );
    193194    g_object_weak_ref( G_OBJECT( d ), onProgressDialogDestroyed, ui );
    194195    onProgressDialogRefresh( ui );
  • trunk/gtk/msgwin.c

    r9868 r10066  
    529529    gtk_container_add( GTK_CONTAINER( win ), vbox );
    530530
    531     data->refresh_tag = gtr_timeout_add_seconds( 2, onRefresh, data );
     531    data->refresh_tag = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, onRefresh, data );
    532532    g_object_weak_ref( G_OBJECT( win ), onWindowDestroyed, data );
    533533
  • trunk/gtk/stats.c

    r9868 r10066  
    1616#include "stats.h"
    1717#include "tr-core.h"
     18#include "tr-prefs.h"
    1819
    1920enum
     
    188189    g_object_set_data_full( G_OBJECT( d ), "data", ui, g_free );
    189190    g_signal_connect( d, "response", G_CALLBACK( dialogResponse ), ui );
    190     i = gtr_timeout_add_seconds( 1, updateStats, ui );
     191    i = gtr_timeout_add_seconds( SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS, updateStats, ui );
    191192    g_object_weak_ref( G_OBJECT( d ), dialogDestroyed, GUINT_TO_POINTER( i ) );
    192193    return d;
  • trunk/gtk/tr-prefs.h

    r9868 r10066  
    5353#define PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED          "main-window-is-maximized"
    5454
     55enum
     56{
     57    MAIN_WINDOW_REFRESH_INTERVAL_SECONDS = 1,
     58
     59    SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS = 2
     60};
     61
    5562#endif
Note: See TracChangeset for help on using the changeset viewer.