From 8e8f10d92bbc13cd19fd2e0dd514963d70c761e2 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 8 Oct 2008 21:16:53 +0000 Subject: [PATCH] Correct some HIG problems. Remove/#if 0 some unused code. Bug #551511. 2008-10-08 Christian Persch * display-capplet.glade: Correct some HIG problems. * xrandr-capplet.c: (show_error), (add_key), (run_application): Remove/#if 0 some unused code. Bug #551511. svn path=/trunk/; revision=9050 --- capplets/display/ChangeLog | 6 + capplets/display/Makefile.am | 4 +- capplets/display/display-capplet.glade | 600 ++++++++++++++----------- capplets/display/xrandr-capplet.c | 31 +- 4 files changed, 362 insertions(+), 279 deletions(-) diff --git a/capplets/display/ChangeLog b/capplets/display/ChangeLog index be11a7c2e..dacfe645d 100644 --- a/capplets/display/ChangeLog +++ b/capplets/display/ChangeLog @@ -1,3 +1,9 @@ +2008-10-08 Christian Persch + + * display-capplet.glade: Correct some HIG problems. + * xrandr-capplet.c: (show_error), (add_key), (run_application): + Remove/#if 0 some unused code. Bug #551511. + 2008-10-07 Jens Granseuer * xrandr-capplet.c: (paint_output): fix preview orientation when using diff --git a/capplets/display/Makefile.am b/capplets/display/Makefile.am index 193fd6544..d8f7d105e 100644 --- a/capplets/display/Makefile.am +++ b/capplets/display/Makefile.am @@ -15,8 +15,8 @@ gnome_display_properties_SOURCES = \ gnome_display_properties_LDFLAGS = -export-dynamic gnome_display_properties_LDADD = \ - $(DISPLAY_CAPPLET_LIBS) \ - $(top_builddir)/capplets/common/libcommon.la + $(top_builddir)/capplets/common/libcommon.la \ + $(DISPLAY_CAPPLET_LIBS) @INTLTOOL_DESKTOP_RULE@ diff --git a/capplets/display/display-capplet.glade b/capplets/display/display-capplet.glade index 45d6e4eac..9fbb6f840 100644 --- a/capplets/display/display-capplet.glade +++ b/capplets/display/display-capplet.glade @@ -1,265 +1,347 @@ - - - + + + - - 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 + + + 5 + 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 + 2 + + + + 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 + + + + + + 5 + 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 + 2 + 4 + False + 6 + 12 + + + + True + Include _Panel + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 2 + 4 + 0 + 1 + shrink|fill + + + + + + + True + _Resolution + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + shrink|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 + shrink|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 + shrink|fill + + + + + + + True + False + True + + + 1 + 2 + 0 + 1 + expand|shrink|fill + + + + + + + True + False + True + + + 1 + 2 + 1 + 2 + + + + + + + True + Normal Left Right Upside-down - - - 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 - - - - - + False + True + + + 3 + 4 + 1 + 2 + + + + + + 0 + False + True + + + + + + True + True + _Detect Displays + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + _Show Displays in Panel + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 13356ebac..bd25d569e 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -50,7 +50,6 @@ struct App GtkWidget *refresh_combo; GtkWidget *rotation_combo; GtkWidget *panel_checkbox; - GtkWidget *panel_label; GtkWidget *clone_checkbox; GtkWidget *show_icon_checkbox; @@ -69,7 +68,7 @@ show_error (const char *err) NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, - GTK_BUTTONS_OK, err); + GTK_BUTTONS_OK, "%s", err); gtk_window_set_title (GTK_WINDOW (dialog), ""); @@ -259,16 +258,14 @@ add_key (GtkWidget *widget, if (!info.found) { GtkTreeIter iter; - gtk_list_store_append (store, &iter); - - gtk_list_store_set (store, &iter, - 0, text, - 1, width, - 2, height, - 3, rate, - 4, width * height, - 5, rotation, - -1); + gtk_list_store_insert_with_values (store, &iter, -1, + 0, text, + 1, width, + 2, height, + 3, rate, + 4, width * height, + 5, rotation, + -1); retval = TRUE; } @@ -445,8 +442,6 @@ rebuild_rotation_combo (App *app) combo_select (app->rotation_combo, N_("Normal")); } -#define idle_free_printf(x) idle_free (g_strdup_printf (x)) - static void rebuild_rate_combo (App *app) { @@ -507,6 +502,7 @@ count_active_outputs (App *app) return count; } +#if 0 static int count_all_outputs (GnomeRRConfig *config) { @@ -517,6 +513,7 @@ count_all_outputs (GnomeRRConfig *config) return i; } +#endif static void rebuild_resolution_combo (App *app) @@ -1658,6 +1655,7 @@ apply (App *app) } } +#if 0 /* Returns whether the graphics driver doesn't advertise RANDR 1.2 features, and just 1.0 */ static gboolean driver_is_randr_10 (GnomeRRConfig *config) @@ -1678,6 +1676,7 @@ driver_is_randr_10 (GnomeRRConfig *config) return (count_all_outputs (config) == 1 && strcmp (config->outputs[0]->name, "default") == 0); } +#endif static void on_detect_displays (GtkWidget *widget, gpointer data) @@ -1762,7 +1761,6 @@ run_application (App *app) 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"); make_text_combo (app->resolution_combo, 4); make_text_combo (app->refresh_combo, 3); @@ -1788,10 +1786,7 @@ run_application (App *app) gtk_container_add (GTK_CONTAINER (align), app->area); on_screen_changed (app->screen, app); - rebuild_gui (app); - gtk_widget_hide (app->panel_checkbox); - gtk_widget_hide (app->panel_label); g_object_unref (xml); restart: