diff --git a/capplets/keyboard/ChangeLog b/capplets/keyboard/ChangeLog index d145fd5b6..5a2234661 100644 --- a/capplets/keyboard/ChangeLog +++ b/capplets/keyboard/ChangeLog @@ -1,3 +1,9 @@ +2008-10-27 Sergey Udaltsov + + * gnome-keyboard-properties-xkblt.c, gnome-keyboard-properties.glade: + hide/show the "Default" column depending on the "layout per window" + checkbox, http://bugzilla.gnome.org/show_bug.cgi?id=555261 + 2008-10-26 Jens Granseuer * gnome-keyboard-properties-xkbot.c: (xkb_options_popup_dialog): diff --git a/capplets/keyboard/gnome-keyboard-properties-xkblt.c b/capplets/keyboard/gnome-keyboard-properties-xkblt.c index 195df59d5..bc4733469 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkblt.c +++ b/capplets/keyboard/gnome-keyboard-properties-xkblt.c @@ -208,16 +208,43 @@ xkb_layouts_enable_disable_buttons (GladeXML * dialog) (n_selected_selected_layouts > 0)); } +static GtkTreeViewColumn * +xkb_layouts_create_default_layout_column () +{ + GtkTreeViewColumn *def_column = + gtk_tree_view_column_new_with_attributes (_("Default"), + toggle_renderer, + "active", + SEL_LAYOUT_TREE_COL_DEFAULT, + NULL); + gtk_tree_view_column_set_sizing (def_column, + GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_column_set_resizable (def_column, TRUE); + gtk_tree_view_column_set_expand (def_column, FALSE); + return def_column; +} + void xkb_layouts_enable_disable_default (GladeXML * dialog, gboolean enable) { - GValue val = { 0 }; GtkWidget *tree_view = WID ("xkb_layouts_selected"); - g_value_init (&val, G_TYPE_BOOLEAN); - g_value_set_boolean (&val, enable); - g_object_set_property (G_OBJECT (toggle_renderer), "activatable", - &val); + if (enable) { + gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), + xkb_layouts_create_default_layout_column + ()); + g_object_unref (toggle_renderer); + } else { + GtkTreeViewColumn *col = + gtk_tree_view_get_column (GTK_TREE_VIEW (tree_view), + 1); + if (col != NULL) { + g_object_ref (toggle_renderer); + gtk_tree_view_column_clear (col); + gtk_tree_view_remove_column (GTK_TREE_VIEW + (tree_view), col); + } + } gtk_widget_draw (tree_view, NULL); } @@ -290,16 +317,17 @@ xkb_layouts_prepare_selected_tree (GladeXML * dialog, gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING); GtkWidget *tree_view = WID ("xkb_layouts_selected"); - GtkTreeViewColumn *desc_column, *def_column; GtkTreeSelection *selection; GtkTargetEntry self_drag_target = { "xkb_layouts_selected", GTK_TARGET_SAME_WIDGET, 0 }; + GtkTreeViewColumn *desc_column; text_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ()); toggle_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_toggle_new ()); gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE (toggle_renderer), TRUE); + g_object_ref (toggle_renderer); desc_column = gtk_tree_view_column_new_with_attributes (_("Layout"), @@ -307,12 +335,6 @@ xkb_layouts_prepare_selected_tree (GladeXML * dialog, "text", SEL_LAYOUT_TREE_COL_DESCRIPTION, NULL); - def_column = - gtk_tree_view_column_new_with_attributes (_("Default"), - toggle_renderer, - "active", - SEL_LAYOUT_TREE_COL_DEFAULT, - NULL); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); @@ -321,17 +343,11 @@ xkb_layouts_prepare_selected_tree (GladeXML * dialog, gtk_tree_view_column_set_sizing (desc_column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_column_set_sizing (def_column, - GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_column_set_resizable (desc_column, TRUE); - gtk_tree_view_column_set_resizable (def_column, TRUE); gtk_tree_view_column_set_expand (desc_column, TRUE); - gtk_tree_view_column_set_expand (def_column, FALSE); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), desc_column); - gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), - def_column); g_signal_connect_swapped (G_OBJECT (selection), "changed", G_CALLBACK diff --git a/capplets/keyboard/gnome-keyboard-properties.glade b/capplets/keyboard/gnome-keyboard-properties.glade index e120a3ad6..6916477b3 100644 --- a/capplets/keyboard/gnome-keyboard-properties.glade +++ b/capplets/keyboard/gnome-keyboard-properties.glade @@ -1,4 +1,6 @@ - + + + 5 @@ -364,7 +366,7 @@ - + True General GTK_JUSTIFY_CENTER @@ -417,6 +419,20 @@ True 6 + + + True + True + Separate _layout for each window + True + 0 + True + + + False + False + + True @@ -459,19 +475,7 @@ - - - - True - True - Separate _layout for each window - True - 0 - True - - False - False 1 @@ -1075,16 +1079,158 @@ 12 6 - + + True + 1 + <small><i>Slow</i></small> + True + GTK_JUSTIFY_CENTER + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + + True + 1 + <small><i>Slow</i></small> + True + GTK_JUSTIFY_CENTER + + + 1 + 2 + GTK_FILL + + + + + + True + True + GTK_UPDATE_DISCONTINUOUS + 1800 0 3000 10 10 0 + False + GTK_POS_RIGHT + + + 2 + 3 + GTK_FILL + + + + + True + True + GTK_UPDATE_DISCONTINUOUS + 300 10 1000 10 10 0 + 0 + False + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + True 0 - <small><i>Long</i></small> + <small><i>Fast</i></small> True GTK_JUSTIFY_CENTER 3 4 + 1 + 2 + GTK_FILL + + + + + + True + 0 + <small><i>Fast</i></small> + True + GTK_JUSTIFY_CENTER + + + 3 + 4 + GTK_FILL + + + + + + True + 0 + _Speed: + True + GTK_JUSTIFY_CENTER + mousekeys_max_speed_slide + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + 0 + A_cceleration: + True + GTK_JUSTIFY_CENTER + mousekeys_accel_time_slide + + + GTK_FILL + GTK_FILL + + + + + True + 0 + _Delay: + True + GTK_JUSTIFY_CENTER + mousekeys_init_delay_slide + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + 1 + <small><i>Short</i></small> + True + GTK_JUSTIFY_CENTER + + + 1 + 2 2 3 GTK_FILL @@ -1109,160 +1255,18 @@ - - True - 1 - <small><i>Short</i></small> - True - GTK_JUSTIFY_CENTER - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - + True 0 - _Delay: - True - GTK_JUSTIFY_CENTER - mousekeys_init_delay_slide - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - 0 - A_cceleration: - True - GTK_JUSTIFY_CENTER - mousekeys_accel_time_slide - - - GTK_FILL - GTK_FILL - - - - - True - 0 - _Speed: - True - GTK_JUSTIFY_CENTER - mousekeys_max_speed_slide - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - 0 - <small><i>Fast</i></small> + <small><i>Long</i></small> True GTK_JUSTIFY_CENTER 3 4 - GTK_FILL - - - - - - True - 0 - <small><i>Fast</i></small> - True - GTK_JUSTIFY_CENTER - - - 3 - 4 - 1 - 2 - GTK_FILL - - - - - - True - True - GTK_UPDATE_DISCONTINUOUS - 300 10 1000 10 10 0 - 0 - False - - - 2 - 3 - 1 - 2 - GTK_FILL - - - - - True - True - GTK_UPDATE_DISCONTINUOUS - 1800 0 3000 10 10 0 - False - GTK_POS_RIGHT - - - 2 - 3 - GTK_FILL - - - - - True - 1 - <small><i>Slow</i></small> - True - GTK_JUSTIFY_CENTER - - - 1 - 2 - GTK_FILL - - - - - - True - 1 - <small><i>Slow</i></small> - True - GTK_JUSTIFY_CENTER - - - 1 - 2 - 1 - 2 + 2 + 3 GTK_FILL @@ -1731,14 +1735,25 @@ 12 6 - + True - 0 - _Country: - True - xkb_countries_available + 1 + 2 + 1 + 2 + GTK_FILL + + + + + + True + + + 1 + 2 GTK_FILL @@ -1759,25 +1774,14 @@ - + True + 0 + _Country: + True + xkb_countries_available - 1 - 2 - GTK_FILL - - - - - - True - - - 1 - 2 - 1 - 2 GTK_FILL @@ -1812,14 +1816,25 @@ 12 6 - + True - 0 - _Language: - True - xkb_countries_available + 1 + 2 + 1 + 2 + GTK_FILL + + + + + + True + + + 1 + 2 GTK_FILL @@ -1840,25 +1855,14 @@ - + True + 0 + _Language: + True + xkb_countries_available - 1 - 2 - GTK_FILL - - - - - - True - - - 1 - 2 - 1 - 2 GTK_FILL @@ -1897,7 +1901,7 @@ True 6 - + True 0 Preview: @@ -1967,7 +1971,7 @@ - + True True True