static void
tree_selection_changed_cb (GtkTreeSelection *selection,
                           GtkWidget        *preview)
{
	GtkTreeIter   iter;
	GtkTreeModel *model;
	char         *theme;
	char         *name;

	if (! gtk_tree_selection_get_selected (selection, &model, &iter))
	{
		return;
	}

	gtk_tree_model_get (model, &iter, ID_COLUMN, &theme, NAME_COLUMN, &name, -1);

	if (theme == NULL)
	{
		g_free (name);
		return;
	}

	preview_set_theme (preview, theme, name);
	config_set_theme (theme);

	g_free (theme);
	g_free (name);
}
예제 #2
0
파일: config.c 프로젝트: sfate/volumeicon
//##############################################################################
// Static functions
//##############################################################################
static void config_load_default()
{
	if(!m_helper_program)
		config_set_helper("xterm -e 'alsamixer'");
	if(!m_channel)
		config_set_channel(NULL);
	if(!m_card)
		config_set_card("default");
	if(!m_stepsize)
		config_set_stepsize(5);
	if(!m_theme)
		config_set_theme("Default");
	if(!m_hotkey_up)
		config_set_hotkey_up("XF86AudioRaiseVolume");
	if(!m_hotkey_down)
		config_set_hotkey_down("XF86AudioLowerVolume");
	if(!m_hotkey_mute)
		config_set_hotkey_mute("XF86AudioMute");
}