diff --git a/capplets/display/ChangeLog b/capplets/display/ChangeLog index 43108ef45..af2fc4449 100644 --- a/capplets/display/ChangeLog +++ b/capplets/display/ChangeLog @@ -1,3 +1,7 @@ +Tue Jul 29 01:35:31 2008 Søren Sandmann + + * xrandr-capplet.c: Add a check box to turn on and off display icon. + Tue Jul 15 18:48:43 2008 Søren Sandmann * xrandr-capplet.c: Don't allow dragging when there is only one diff --git a/capplets/display/display-capplet.glade b/capplets/display/display-capplet.glade index 5ccc11f0a..45d6e4eac 100644 --- a/capplets/display/display-capplet.glade +++ b/capplets/display/display-capplet.glade @@ -1,387 +1,265 @@ - - - + + + - - - 18 - Monitor Resolution Settings - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - -11 - - - - - - True - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - True - -10 - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 24 - 0 - 0 - - - - True - False - 12 - - - - True - True - Mirror Screens - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - - - - 0 - True - True - - - - - - True - 0.5 - 0.5 - 1 - 1 - 12 - 12 - 24 - 24 - - - - True - 2 - 4 - False - 12 - 12 - - - - True - _Resolution - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Re_fresh Rate: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - False - True - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - True - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - Include _Panel - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - panel_checkbox - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - R_otation - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 1 - 2 - fill - - - - - - - True - Normal + + 18 + Monitor Resolution Settings + GDK_WINDOW_TYPE_HINT_DIALOG + False + + + True + + + True + 24 + + + True + 12 + + + True + True + Mirror Screens + True + 0 + True + + + False + False + + + + + True + + + + + + 1 + + + + + True + 12 + 12 + 24 + 24 + + + True + 2 + 4 + 12 + 12 + + + True + True + 0 + True + + + + + + 3 + 4 + GTK_FILL + + + + + + True + Normal Left Right Upside-down - False - True - - - 3 - 4 - 1 - 2 - fill - - - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - - - - 3 - 4 - 0 - 1 - fill - - - - - - - - 0 - False - True - - - - - - True - True - _Detect Displays - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - - 0 - True - True - - - - - - + + + 3 + 4 + 1 + 2 + GTK_FILL + + + + + True + 0 + R_otation + True + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + + True + 0 + Include _Panel + True + panel_checkbox + + + 2 + 3 + GTK_FILL + + + + + + True + + + 1 + 2 + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Re_fresh Rate: + True + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + _Resolution + True + + + GTK_FILL + + + + + + + + False + 2 + + + + + True + True + _Detect Displays + True + 0 + + + False + False + 3 + + + + + True + True + _Show Displays in Panel + True + 0 + True + + + 4 + + + + + + + 1 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-help + True + -11 + + + + + True + True + True + gtk-apply + True + -10 + + + 1 + + + + + True + True + True + gtk-close + True + -7 + + + 2 + + + + + False + GTK_PACK_END + + + + + diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 74a3a5e80..c8c88d102 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -31,6 +31,7 @@ #include #include #include +#include typedef struct App App; typedef struct GrabInfo GrabInfo; @@ -49,9 +50,11 @@ struct App GtkWidget *panel_checkbox; GtkWidget *panel_label; GtkWidget *clone_checkbox; + GtkWidget *show_icon_checkbox; GtkWidget *area; gboolean ignore_gui_changes; + GConfClient *client; }; static void rebuild_gui (App *app); @@ -1615,6 +1618,19 @@ on_detect_displays (GtkWidget *widget, gpointer data) gnome_rr_screen_refresh (app->screen); } +#define SHOW_ICON_KEY "/apps/gnome_settings_daemon/xrandr/show_notification_icon" + + +static void +on_show_icon_toggled (GtkWidget *widget, gpointer data) +{ + GtkToggleButton *tb = GTK_TOGGLE_BUTTON (widget); + App *app = data; + + gconf_client_set_bool (app->client, SHOW_ICON_KEY, + gtk_toggle_button_get_active (tb), NULL); +} + static void run_application (App *app) { @@ -1631,7 +1647,8 @@ run_application (App *app) g_warning ("Could not open " GLADE_FILE); return; } - + + app->client = gconf_client_get_default (); app->screen = gnome_rr_screen_new (gdk_screen_get_default(), on_screen_changed, app); @@ -1659,6 +1676,13 @@ run_application (App *app) g_signal_connect (glade_xml_get_widget (xml, "detect_displays_button"), "clicked", G_CALLBACK (on_detect_displays), app); + + app->show_icon_checkbox = glade_xml_get_widget (xml, "show_notification_icon"); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->show_icon_checkbox), + gconf_client_get_bool (app->client, SHOW_ICON_KEY, NULL)); + + g_signal_connect (app->show_icon_checkbox, "toggled", G_CALLBACK (on_show_icon_toggled), app); app->panel_checkbox = glade_xml_get_widget (xml, "panel_checkbox"); app->panel_label = glade_xml_get_widget (xml, "panel_label");