Changeset 9528
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/main.c
r9439 r9528 1152 1152 1153 1153 /* update the main window's statusbar and toolbar buttons */ 1154 if( data->wind )1154 if( data->wind != NULL ) 1155 1155 tr_window_update( data->wind ); 1156 1156 1157 1157 /* update the actions */ 1158 1158 refreshActions( data ); 1159 1160 /* update the status tray icon */ 1161 if( data->icon != NULL ) 1162 tr_icon_refresh( data->icon ); 1159 1163 } 1160 1164 -
trunk/gtk/tr-icon.c
r8889 r9528 25 25 } 26 26 27 void 28 tr_icon_refresh( gpointer vicon UNUSED ) 29 { 30 } 31 27 32 #else 28 29 #define UPDATE_INTERVAL_SECONDS 230 33 31 34 static void … … 49 52 } 50 53 51 static gboolean 52 refresh_tooltip_cb( gpointer data)54 void 55 tr_icon_refresh( gpointer vicon ) 53 56 { 54 57 double d; … … 60 63 char tip[1024]; 61 64 const char * idle = _( "Idle" ); 62 GtkStatusIcon * icon = GTK_STATUS_ICON( data);65 GtkStatusIcon * icon = GTK_STATUS_ICON( vicon ); 63 66 tr_session * session = tr_core_session( g_object_get_data( G_OBJECT( icon ), "tr-core" ) ); 64 67 … … 104 107 gtk_status_icon_set_tooltip( GTK_STATUS_ICON( icon ), tip ); 105 108 #endif 106 107 return TRUE;108 }109 110 static void111 closeTag( gpointer tag )112 {113 g_source_remove( GPOINTER_TO_UINT( tag ) );114 109 } 115 110 … … 117 112 tr_icon_new( TrCore * core ) 118 113 { 119 guint id;120 114 GtkStatusIcon * icon = gtk_status_icon_new_from_icon_name( 121 115 "transmission" ); … … 123 117 g_signal_connect( icon, "activate", G_CALLBACK( activated ), NULL ); 124 118 g_signal_connect( icon, "popup-menu", G_CALLBACK( popup ), NULL ); 125 id = gtr_timeout_add_seconds( UPDATE_INTERVAL_SECONDS, refresh_tooltip_cb, icon );126 119 g_object_set_data( G_OBJECT( icon ), "tr-core", core ); 127 g_object_set_data_full( G_OBJECT(128 icon ), "update-tag", GUINT_TO_POINTER(129 id ), closeTag );130 120 return icon; 131 121 } -
trunk/gtk/tr-icon.h
r8637 r9528 23 23 gpointer tr_icon_new( TrCore * core ); 24 24 25 void tr_icon_refresh( gpointer ); 26 25 27 #endif
Note: See TracChangeset
for help on using the changeset viewer.