actually set the theme.

Sat Nov 16 00:55:58 2002  Jonathan Blandford  <jrb@gnome.org>

	* gnome-theme-manager.c (meta_theme_selection_changed): actually
	set the theme.
This commit is contained in:
Jonathan Blandford 2002-11-16 05:56:46 +00:00 committed by Jonathan Blandford
parent b6e4035202
commit 9264122f11
3 changed files with 215 additions and 88 deletions

View file

@ -1,3 +1,8 @@
Sat Nov 16 00:55:58 2002 Jonathan Blandford <jrb@gnome.org>
* gnome-theme-manager.c (meta_theme_selection_changed): actually
set the theme.
Thu Nov 14 19:30:02 2002 Jonathan Blandford <jrb@gnome.org> Thu Nov 14 19:30:02 2002 Jonathan Blandford <jrb@gnome.org>
* theme-thumbnail.c (setup_theme_thumbnail_factory): add G_IO_HUP * theme-thumbnail.c (setup_theme_thumbnail_factory): add G_IO_HUP

View file

@ -37,6 +37,15 @@
static void read_themes (GladeXML *dialog); static void read_themes (GladeXML *dialog);
enum
{
META_THEME_NAME_COLUMN,
META_THEME_ID_COLUMN,
META_PIXBUF_COLUMN,
META_DEFAULT_THEME_COLUMN,
META_xN_COLUMNS
};
enum enum
{ {
THEME_NAME_COLUMN, THEME_NAME_COLUMN,
@ -118,11 +127,13 @@ load_meta_themes (GtkTreeView *tree_view,
gtk_tree_path_free (path); gtk_tree_path_free (path);
current_theme_found = TRUE; current_theme_found = TRUE;
} }
blurb = g_strdup_printf ("<span size=\"larger\" weight=\"bold\">%s</span>\n\n%s", meta_theme_info->name, meta_theme_info->comment); blurb = g_strdup_printf ("<span size=\"larger\" weight=\"bold\">%s</span>\n\n%s",
meta_theme_info->readable_name, meta_theme_info->comment);
pixbuf = generate_theme_thumbnail (meta_theme_info); pixbuf = generate_theme_thumbnail (meta_theme_info);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, gtk_list_store_set (GTK_LIST_STORE (model), &iter,
PIXBUF_COLUMN, pixbuf, PIXBUF_COLUMN, pixbuf,
THEME_NAME_COLUMN, blurb, THEME_NAME_COLUMN, blurb,
THEME_ID_COLUMN, meta_theme_info->name,
DEFAULT_THEME_COLUMN, is_default, DEFAULT_THEME_COLUMN, is_default,
-1); -1);
g_free (blurb); g_free (blurb);
@ -151,6 +162,7 @@ load_meta_themes (GtkTreeView *tree_view,
gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); gtk_list_store_prepend (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, gtk_list_store_set (GTK_LIST_STORE (model), &iter,
THEME_NAME_COLUMN, current_theme, THEME_NAME_COLUMN, current_theme,
THEME_ID_COLUMN, current_theme,
DEFAULT_THEME_COLUMN, is_default, DEFAULT_THEME_COLUMN, is_default,
-1); -1);
@ -223,6 +235,7 @@ load_theme_names (GtkTreeView *tree_view,
} }
gtk_list_store_set (GTK_LIST_STORE (model), &iter, gtk_list_store_set (GTK_LIST_STORE (model), &iter,
THEME_NAME_COLUMN, name, THEME_NAME_COLUMN, name,
THEME_ID_COLUMN, name,
DEFAULT_THEME_COLUMN, is_default, DEFAULT_THEME_COLUMN, is_default,
-1); -1);
@ -250,6 +263,7 @@ load_theme_names (GtkTreeView *tree_view,
gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); gtk_list_store_prepend (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, gtk_list_store_set (GTK_LIST_STORE (model), &iter,
THEME_NAME_COLUMN, current_theme, THEME_NAME_COLUMN, current_theme,
THEME_ID_COLUMN, current_theme,
DEFAULT_THEME_COLUMN, is_default, DEFAULT_THEME_COLUMN, is_default,
-1); -1);
@ -295,7 +309,7 @@ update_gconf_key_from_selection (GtkTreeSelection *selection,
if (gtk_tree_selection_get_selected (selection, &model, &iter)) if (gtk_tree_selection_get_selected (selection, &model, &iter))
{ {
gtk_tree_model_get (model, &iter, gtk_tree_model_get (model, &iter,
THEME_NAME_COLUMN, &new_key, THEME_ID_COLUMN, &new_key,
-1); -1);
} }
else else
@ -327,74 +341,30 @@ static void
meta_theme_setup_info (GnomeThemeMetaInfo *meta_theme_info, meta_theme_setup_info (GnomeThemeMetaInfo *meta_theme_info,
GladeXML *dialog) GladeXML *dialog)
{ {
return; GtkWidget *notebook;
notebook = WID ("meta_theme_notebook");
if (meta_theme_info == NULL) if (meta_theme_info == NULL)
{ {
gtk_widget_hide (WID ("meta_theme_extras_vbox")); gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0);
gtk_widget_hide (WID ("meta_theme_description_label"));
gtk_image_set_from_pixbuf (GTK_IMAGE (WID ("meta_theme_image")), NULL);
} }
else else
{ {
if (meta_theme_info->icon_file)
{
gtk_image_set_from_file (GTK_IMAGE (WID ("meta_theme_image")), meta_theme_info->icon_file);
}
else
{
gtk_image_set_from_pixbuf (GTK_IMAGE (WID ("meta_theme_image")), NULL);
}
if (meta_theme_info->comment)
{
gchar *real_comment;
real_comment = g_strconcat ("<span size=\"larger\" weight=\"bold\">",
meta_theme_info->comment,
"</span>", NULL);
gtk_label_set_markup (GTK_LABEL (WID ("meta_theme_description_label")),
real_comment);
g_free (real_comment);
gtk_widget_show (WID ("meta_theme_description_label"));
}
else
{
gtk_widget_hide (WID ("meta_theme_description_label"));
}
if (meta_theme_info->application_font != NULL) if (meta_theme_info->application_font != NULL)
{ {
gtk_widget_show (WID ("meta_theme_extras_vbox"));
if (meta_theme_info->background_image != NULL) if (meta_theme_info->background_image != NULL)
{ gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 3);
gtk_label_set_text (GTK_LABEL (WID ("meta_theme_info_label")),
_("This theme suggests a matching font and a background:"));
gtk_widget_show (WID ("meta_theme_background_button"));
gtk_widget_show (WID ("meta_theme_font_button"));
}
else else
{ gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1);
gtk_label_set_text (GTK_LABEL (WID ("meta_theme_info_label")),
_("This theme suggests a matching font:"));
gtk_widget_hide (WID ("meta_theme_background_button"));
gtk_widget_show (WID ("meta_theme_font_button"));
}
} }
else else
{ {
if (meta_theme_info->background_image != NULL) if (meta_theme_info->background_image != NULL)
{ gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 2);
gtk_widget_show (WID ("meta_theme_extras_vbox"));
gtk_label_set_text (GTK_LABEL (WID ("meta_theme_info_label")),
_("This theme suggests a matching background:"));
gtk_widget_show (WID ("meta_theme_background_button"));
gtk_widget_hide (WID ("meta_theme_font_button"));
}
else else
{ gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0);
gtk_widget_hide (WID ("meta_theme_extras_vbox"));
gtk_widget_hide (WID ("meta_theme_background_button"));
gtk_widget_hide (WID ("meta_theme_font_button"));
}
} }
} }
} }
@ -446,7 +416,7 @@ meta_theme_selection_changed (GtkTreeSelection *selection,
if (gtk_tree_selection_get_selected (selection, &model, &iter)) if (gtk_tree_selection_get_selected (selection, &model, &iter))
{ {
gtk_tree_model_get (model, &iter, gtk_tree_model_get (model, &iter,
THEME_NAME_COLUMN, &meta_theme_name, THEME_ID_COLUMN, &meta_theme_name,
-1); -1);
} }
else else
@ -486,7 +456,7 @@ window_theme_selection_changed (GtkTreeSelection *selection,
if (gtk_tree_selection_get_selected (selection, &model, &iter)) if (gtk_tree_selection_get_selected (selection, &model, &iter))
{ {
gtk_tree_model_get (model, &iter, gtk_tree_model_get (model, &iter,
THEME_NAME_COLUMN, &window_theme_name, THEME_ID_COLUMN, &window_theme_name,
-1); -1);
} }
else else

View file

@ -155,10 +155,10 @@
</child> </child>
<child> <child>
<widget class="GtkVBox" id="vbox12"> <widget class="GtkVBox" id="meta_theme_property_vbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">3</property>
<child> <child>
<widget class="GtkHSeparator" id="hseparator1"> <widget class="GtkHSeparator" id="hseparator1">
@ -173,9 +173,9 @@
<child> <child>
<widget class="GtkNotebook" id="meta_theme_notebook"> <widget class="GtkNotebook" id="meta_theme_notebook">
<property name="can_focus">True</property> <property name="visible">True</property>
<property name="show_tabs">True</property> <property name="show_tabs">False</property>
<property name="show_border">True</property> <property name="show_border">False</property>
<property name="tab_pos">GTK_POS_TOP</property> <property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property> <property name="scrollable">False</property>
<property name="tab_hborder">2</property> <property name="tab_hborder">2</property>
@ -183,9 +183,9 @@
<property name="enable_popup">False</property> <property name="enable_popup">False</property>
<child> <child>
<widget class="GtkLabel" id="label24"> <widget class="GtkLabel" id="label28">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">label24</property> <property name="label" translatable="yes"></property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
@ -202,6 +202,76 @@
</packing> </packing>
</child> </child>
<child>
<widget class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="label" translatable="yes">label27</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox12">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">3</property>
<child>
<widget class="GtkLabel" id="label24">
<property name="visible">True</property>
<property name="label" translatable="yes">This theme suggests a matching font:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="checkbutton1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _Font</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child> <child>
<widget class="GtkLabel" id="label19"> <widget class="GtkLabel" id="label19">
<property name="visible">True</property> <property name="visible">True</property>
@ -222,18 +292,50 @@
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label23"> <widget class="GtkVBox" id="vbox13">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">label23</property> <property name="homogeneous">False</property>
<property name="use_underline">False</property> <property name="spacing">3</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <child>
<property name="wrap">False</property> <widget class="GtkLabel" id="label25">
<property name="selectable">False</property> <property name="visible">True</property>
<property name="xalign">0.5</property> <property name="label" translatable="yes">This theme suggests a matching
<property name="yalign">0.5</property> background:</property>
<property name="xpad">0</property> <property name="use_underline">False</property>
<property name="ypad">0</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="checkbutton2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _background</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="tab_expand">False</property> <property name="tab_expand">False</property>
@ -250,7 +352,7 @@
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property> <property name="wrap">False</property>
<property name="selectable">False</property> <property name="selectable">False</property>
<property name="xalign">0.5</property> <property name="xalign">0</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
@ -261,18 +363,68 @@
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label22"> <widget class="GtkVBox" id="vbox14">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">label22</property> <property name="homogeneous">False</property>
<property name="use_underline">False</property> <property name="spacing">3</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <child>
<property name="wrap">False</property> <widget class="GtkLabel" id="label26">
<property name="selectable">False</property> <property name="visible">True</property>
<property name="xalign">0.5</property> <property name="label" translatable="yes">This theme suggests a matching
<property name="yalign">0.5</property> font and background</property>
<property name="xpad">0</property> <property name="use_underline">False</property>
<property name="ypad">0</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="checkbutton3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _Font </property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="checkbutton4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _Background</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="tab_expand">False</property> <property name="tab_expand">False</property>