Esempio n. 1
0
static int
properties_load (EyesApplet *eyes_applet)
{
        gchar *theme_path = NULL;

	theme_path = mate_panel_applet_mateconf_get_string (
		eyes_applet->applet, "theme_path", NULL);

	if (theme_path == NULL)
		theme_path = g_strdup (GEYES_THEMES_DIR "Default-tiny");
	
        if (load_theme (eyes_applet, theme_path) == FALSE) {
		g_free (theme_path);

		return FALSE;
	}

        g_free (theme_path);
	
	return TRUE;
}
Esempio n. 2
0
/* Load settings from last run */
gboolean load_last_list(pqi inst)
{
	GError *err = NULL;
	register int uses; register const char *fname;
	MatePanelApplet *const applet = inst->applet;
	gboolean show_primary; int i, mode; char key[16];
	int timesec, timeusec;
	
	mode = mate_panel_applet_mateconf_get_int(applet,"mode",&err);
	if (err) { /* Couldn't find an entry for our mode. */
		resolve_item_order(inst); /* The struct is already zeroed... Just default the image. */
		return FALSE;            /* We're a brand new widget! */
	}
	show_primary = mate_panel_applet_mateconf_get_bool(applet,"show-primary",NULL);
	
	for (i = 0; ; i++)
	{
		err = NULL;
		sprintf(key,"file%d",i);
			fname = mate_panel_applet_mateconf_get_string(applet,key,&err);
		if (err || !fname) break;
		sprintf(key,"uses%d",i);
			uses = mate_panel_applet_mateconf_get_int(applet,key,&err);
		sprintf(key,"times%d",i);
			timesec =  mate_panel_applet_mateconf_get_int(applet,key,&err);
		sprintf(key,"timeu%d",i);
			timeusec = mate_panel_applet_mateconf_get_int(applet,key,&err);
		stored_item_add(inst, i, uses, fname, timesec, timeusec);
		inst->high_id = i + 1;
	}
	
	inst->mode = mode;
	inst->show_primary = show_primary;
	resolve_item_order(inst);
	return TRUE;
}