diff -rc rhythmbox-0.12.5-orig/plugins/status-icon/rb-status-icon-plugin.c rhythmbox-0.12.5/plugins/status-icon/rb-status-icon-plugin.c *** rhythmbox-0.12.5-orig/plugins/status-icon/rb-status-icon-plugin.c 2009-09-16 17:04:49.000000000 -0400 --- rhythmbox-0.12.5/plugins/status-icon/rb-status-icon-plugin.c 2009-11-03 16:45:59.000000000 -0500 *************** *** 67,72 **** --- 67,73 ---- #define CONF_STATUS_ICON_MODE CONF_PLUGIN_SETTINGS "/status-icon-mode" #define CONF_MOUSE_WHEEL_MODE CONF_PLUGIN_SETTINGS "/mouse-wheel-mode" #define CONF_WINDOW_VISIBILITY CONF_PLUGIN_SETTINGS "/window-visible" + #define CONF_MINIMIZE_TO_TRAY CONF_PLUGIN_SETTINGS "/minimize-to-tray" #define CONF_OLD_ICON_MODE "/apps/rhythmbox/plugins/dontreallyclose/active" #define CONF_OLD_NOTIFICATIONS "/apps/rhythmbox/ui/show_notifications" *************** *** 106,111 **** --- 107,115 ---- WHEEL_SONG } wheel_mode; + /* minimize-to-tray option */ + gboolean minimize_mode; + /* current playing data */ char *current_title; char *current_album_and_artist; /* from _album_ by _artist_ */ *************** *** 127,132 **** --- 131,137 ---- GtkWidget *notify_combo; GtkWidget *icon_combo; GtkWidget *wheel_combo; + GtkWidget *minimize_checkbox; RBShellPlayer *shell_player; RBShell *shell; *************** *** 994,999 **** --- 999,1005 ---- static gboolean window_delete_event_cb (GtkWindow *window, GdkEvent *event, RBStatusIconPlugin *plugin) { + if (!plugin->priv->minimize_mode) return FALSE; switch (plugin->priv->icon_mode) { case ICON_NEVER: *************** *** 1002,1008 **** return FALSE; case ICON_OWNS_WINDOW: ! rb_debug ("window deleted, but let's just hide it instead"); close_to_tray (plugin); gtk_window_iconify (window); return TRUE; --- 1008,1014 ---- return FALSE; case ICON_OWNS_WINDOW: ! rb_debug ("minimize-to-tray enabled, hiding instead of closing"); close_to_tray (plugin); gtk_window_iconify (window); return TRUE; *************** *** 1128,1133 **** --- 1134,1148 ---- } static void + minimize_mode_config_changed_cb (GtkToggleButton *widget, RBStatusIconPlugin *plugin) + { + if (plugin->priv->syncing_config_widgets) + return; + + eel_gconf_set_integer (CONF_MINIMIZE_TO_TRAY, gtk_toggle_button_get_active (widget)); + } + + static void config_response_cb (GtkWidget *dialog, gint response, RBStatusIconPlugin *plugin) { gtk_widget_hide (dialog); *************** *** 1203,1209 **** gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->wheel_combo), plugin->priv->wheel_mode); plugin->priv->syncing_config_widgets = FALSE; } ! } } --- 1218,1235 ---- gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->wheel_combo), plugin->priv->wheel_mode); plugin->priv->syncing_config_widgets = FALSE; } ! } else if (g_str_equal (gconf_entry_get_key (entry), CONF_MINIMIZE_TO_TRAY)) { ! plugin->priv->minimize_mode = gconf_value_get_int (gconf_entry_get_value (entry)); ! rb_debug (plugin->priv->minimize_mode ? "minimize-to-tray is active" : "minimize-to-tray is disabled"); ! ! sync_actions (plugin); ! ! if (plugin->priv->minimize_checkbox != NULL) { ! plugin->priv->syncing_config_widgets = TRUE; ! gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (plugin->priv->minimize_checkbox), plugin->priv->minimize_mode); ! plugin->priv->syncing_config_widgets = FALSE; ! } ! } } *************** *** 1242,1247 **** --- 1268,1274 ---- plugin->priv->icon_combo = GTK_WIDGET (gtk_builder_get_object (builder, "statusiconmode")); plugin->priv->notify_combo = GTK_WIDGET (gtk_builder_get_object (builder, "notificationmode")); plugin->priv->wheel_combo = GTK_WIDGET (gtk_builder_get_object (builder, "mousewheelmode")); + plugin->priv->minimize_checkbox = GTK_WIDGET (gtk_builder_get_object (builder, "minimizemode")); g_signal_connect_object (plugin->priv->notify_combo, "changed", G_CALLBACK (notification_config_changed_cb), *************** *** 1254,1262 **** --- 1281,1294 ---- "changed", G_CALLBACK (mouse_wheel_config_changed_cb), plugin, 0); + g_signal_connect_object (plugin->priv->minimize_checkbox, + "toggled", + G_CALLBACK (minimize_mode_config_changed_cb), + plugin, 0); gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->notify_combo), plugin->priv->notify_mode); gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->icon_combo), plugin->priv->icon_mode); gtk_combo_box_set_active (GTK_COMBO_BOX (plugin->priv->wheel_combo), plugin->priv->wheel_mode); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (plugin->priv->minimize_checkbox), plugin->priv->minimize_mode); g_object_unref (builder); return plugin->priv->config_dialog; *************** *** 1337,1342 **** --- 1369,1375 ---- plugin->priv->icon_mode = eel_gconf_get_integer (CONF_STATUS_ICON_MODE); plugin->priv->notify_mode = eel_gconf_get_integer (CONF_NOTIFICATION_MODE); plugin->priv->wheel_mode = eel_gconf_get_integer (CONF_MOUSE_WHEEL_MODE); + plugin->priv->minimize_mode = eel_gconf_get_boolean (CONF_MINIMIZE_TO_TRAY); /* create status icon */ create_status_icon (plugin); diff -rc rhythmbox-0.12.5-orig/plugins/status-icon/status-icon-preferences.ui rhythmbox-0.12.5/plugins/status-icon/status-icon-preferences.ui *** rhythmbox-0.12.5-orig/plugins/status-icon/status-icon-preferences.ui 2009-09-16 17:04:49.000000000 -0400 --- rhythmbox-0.12.5/plugins/status-icon/status-icon-preferences.ui 2009-11-03 16:17:44.000000000 -0500 *************** *** 94,195 **** ! True ! 3 ! 2 ! 12 ! 6 ! True ! 0 ! _Status icon: ! True ! ! ! 1 ! 2 ! GTK_FILL ! GTK_FILL ! ! ! ! ! True ! statusiconmodel ! ! ! 0 ! - - - 1 - 2 - 1 - 2 - - - - - True - 0 - _Notifications: - True - - - GTK_FILL - GTK_FILL - - - - - True - notificationmodel ! ! ! 0 ! - - - 1 - 2 - - - - - True - 0 - _Mouse wheel: - True - - - 2 - 5 - GTK_FILL - GTK_FILL - - - - - True - mousewheelmodel ! ! ! 0 ! ! 2 ! 5 ! 1 ! 2 --- 94,229 ---- ! True ! vertical ! True ! 6 ! 2 ! 12 ! 6 ! ! True ! 0 ! _Status icon: ! True ! ! ! 1 ! 2 ! GTK_FILL ! GTK_FILL ! ! ! True ! statusiconmodel ! ! ! ! 0 ! ! ! ! ! 1 ! 2 ! 1 ! 2 ! ! ! ! ! True ! 0 ! _Notifications: ! True ! ! ! GTK_FILL ! GTK_FILL ! ! ! ! ! True ! notificationmodel ! ! ! ! 0 ! ! ! ! ! 1 ! 2 ! ! ! ! ! True ! 0 ! _Mouse wheel: ! True ! ! ! 2 ! 5 ! GTK_FILL ! GTK_FILL ! ! ! ! ! True ! mousewheelmodel ! ! ! ! 0 ! ! ! ! ! 1 ! 2 ! 2 ! 5 ! ! ! ! ! Minimize to Tray ! True ! True ! False ! True ! ! ! 1 ! 2 ! 5 ! 6 ! ! ! True ! 0.37000000476837158 ! ! ! 5 ! 6 ! ! 0