Get the theme name right.
2002-01-21 Anders Carlsson <andersca@gnu.org> * main.c: Get the theme name right.
This commit is contained in:
parent
95e2f514bd
commit
a080e40edc
2 changed files with 20 additions and 4 deletions
|
@ -1,5 +1,7 @@
|
||||||
2002-01-21 Anders Carlsson <andersca@gnu.org>
|
2002-01-21 Anders Carlsson <andersca@gnu.org>
|
||||||
|
|
||||||
|
* main.c: Get the theme name right.
|
||||||
|
|
||||||
* control/control.c (create_form): Use a GtkTreeView instead of a
|
* control/control.c (create_form): Use a GtkTreeView instead of a
|
||||||
clist.
|
clist.
|
||||||
|
|
||||||
|
|
|
@ -109,14 +109,28 @@ static gchar* get_selected_theme (void)
|
||||||
return theme;
|
return theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static gchar* get_selected_theme_name (void)
|
||||||
|
{
|
||||||
|
int index = -1;
|
||||||
|
gchar *theme;
|
||||||
|
GtkTreeView *view = GTK_TREE_VIEW (glade_xml_get_widget (xml, "tree1"));
|
||||||
|
|
||||||
|
gtk_tree_selection_selected_foreach (gtk_tree_view_get_selection (view), (GtkTreeSelectionForeachFunc) select_foreach_cb, &index);
|
||||||
|
|
||||||
|
if (index == -1)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return g_basename (themes[index]);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
apply_cb (void)
|
apply_cb (void)
|
||||||
{
|
{
|
||||||
gchar *filename = get_selected_theme ();
|
gchar *name = get_selected_theme_name ();
|
||||||
if (filename)
|
if (name)
|
||||||
{
|
{
|
||||||
gconf_client_set_string (gconf_client_get_default (), "/desktop/gnome/interface/gtk_theme", filename);
|
gconf_client_set_string (gconf_client_get_default (), "/desktop/gnome/interface/gtk_theme", name);
|
||||||
g_free (filename);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue