# HG changeset patch # User Mark Doliner # Date 1129780102 0 # Node ID 186d2d293ef4d73827c820a227d6260976a824a7 # Parent 8094a66d574b3674fee011e9a8d347906b930359 [gaim-migrate @ 13988] Get rid of the "Idle Tracking Method" preference. Use mouse/keyboard movement when possible, otherwise fallback to Gaim-usage. committer: Tailor Script diff -r 8094a66d574b -r 186d2d293ef4 src/gtkprefs.c --- a/src/gtkprefs.c Tue Oct 18 18:09:13 2005 +0000 +++ b/src/gtkprefs.c Thu Oct 20 03:48:22 2005 +0000 @@ -1827,19 +1827,6 @@ _("When both away and idle"), "awayidle", NULL); - vbox = gaim_gtk_make_frame (ret, _("Idle")); - dd = gaim_gtk_prefs_dropdown(vbox, _("Idle _Tracking:"), - GAIM_PREF_STRING, "/gaim/gtk/idle/method", - _("Gaim usage"), "gaim", -#ifdef USE_SCREENSAVER -#ifndef _WIN32 - _("X usage"), "system", -#else - _("Windows usage"), "system", -#endif -#endif - NULL); - button = gaim_gtk_prefs_checkbox(_("_Report idle time"), "/gaim/gtk/idle/report", vbox); @@ -2311,13 +2298,6 @@ /* Idle */ gaim_prefs_add_none("/gaim/gtk/idle"); - gaim_prefs_add_string("/gaim/gtk/idle/method", -#ifdef USE_SCREENSAVER - "system" -#else - "gaim" -#endif - ); gaim_prefs_add_bool("/gaim/gtk/idle/report", TRUE); /* Plugins */ @@ -2340,7 +2320,6 @@ } void gaim_gtk_prefs_update_old() { - const char *idle_method; /* Rename some old prefs */ gaim_prefs_rename("/gaim/gtk/logging/log_ims", "/core/logging/log_ims"); gaim_prefs_rename("/gaim/gtk/logging/log_chats", "/core/logging/log_chats"); @@ -2357,20 +2336,6 @@ gaim_prefs_rename_boolean_toggle("/gaim/gtk/conversations/ignore_formatting", "/gaim/gtk/conversations/show_incoming_formatting"); - gaim_prefs_rename("/gaim/gtk/idle/reporting_method", - "/gaim/gtk/idle/method"); - idle_method = gaim_prefs_get_string("/gaim/gtk/idle/method"); - if (idle_method == NULL || !strcmp("none", idle_method)) { - gaim_prefs_set_string("/gaim/gtk/idle/method", -#ifdef USE_SCREENSAVER - "system" -#else - "gaim" -#endif - ); - gaim_prefs_set_bool("/gaim/gtk/idle/report", FALSE); - } - /* Remove some no-longer-used prefs */ gaim_prefs_remove("/gaim/gtk/blist/auto_expand_contacts"); gaim_prefs_remove("/gaim/gtk/blist/button_style"); @@ -2382,6 +2347,7 @@ gaim_prefs_remove("/gaim/gtk/conversations/button_type"); gaim_prefs_remove("/gaim/gtk/conversations/ctrl_enter_sends"); gaim_prefs_remove("/gaim/gtk/conversations/enter_sends"); + gaim_prefs_remove("/gaim/gtk/conversations/escape_closes"); gaim_prefs_remove("/gaim/gtk/conversations/html_shortcuts"); gaim_prefs_remove("/gaim/gtk/conversations/icons_on_tabs"); gaim_prefs_remove("/gaim/gtk/conversations/send_formatting"); @@ -2400,8 +2366,8 @@ gaim_prefs_remove("/gaim/gtk/conversations/chat/raise_on_events"); gaim_prefs_remove("/gaim/gtk/conversations/ignore_fonts"); gaim_prefs_remove("/gaim/gtk/conversations/ignore_font_sizes"); + gaim_prefs_remove("/gaim/gtk/idle/method"); gaim_prefs_remove("/gaim/gtk/logging/individual_logs"); gaim_prefs_remove("/gaim/gtk/sound/signon"); gaim_prefs_remove("/gaim/gtk/sound/silent_signon"); - gaim_prefs_remove("/gaim/gtk/conversations/escape_closes"); } diff -r 8094a66d574b -r 186d2d293ef4 src/idle.c --- a/src/idle.c Tue Oct 18 18:09:13 2005 +0000 +++ b/src/idle.c Thu Oct 20 03:48:22 2005 +0000 @@ -118,7 +118,6 @@ { GaimConnection *gc = data; gboolean report_idle; - const char *idle_method; GaimAccount *account; time_t t; int idle_time; @@ -129,17 +128,20 @@ time(&t); - idle_method = gaim_prefs_get_string("/gaim/gtk/idle/method"); report_idle = gaim_prefs_get_bool("/gaim/gtk/idle/report"); #ifdef USE_SCREENSAVER - if (idle_method != NULL && !strcmp(idle_method, "system")) idle_time = get_idle_time_from_system(); - else +#else + /* + * If Gaim wasn't built with xscreensaver support, then + * fallback to calculating our idle time based on when + * we last sent a message. + */ + idle_time = t - gc->last_sent_time; #endif /* USE_SCREENSAVER */ - idle_time = t - gc->last_sent_time; - /* Should be become auto-away? */ + /* Should we become auto-away? */ if (gaim_prefs_get_bool("/core/away/away_when_idle") && (idle_time > (60 * gaim_prefs_get_int("/core/away/mins_before_away"))) && (!gc->is_auto_away))