static void theme_selected_cb (GtkTreeSelection *selection, gpointer data) { EyesApplet *eyes_applet = data; GtkTreeModel *model; GtkTreeIter iter; gchar *theme; gchar *theme_dir; if (!gtk_tree_selection_get_selected (selection, &model, &iter)) return; gtk_tree_model_get (model, &iter, COL_THEME_DIR, &theme, -1); g_return_if_fail (theme); theme_dir = g_strdup_printf ("%s/", theme); if (!g_ascii_strncasecmp (theme_dir, eyes_applet->theme_dir, strlen (theme_dir))) { g_free (theme_dir); return; } g_free (theme_dir); destroy_eyes (eyes_applet); destroy_theme (eyes_applet); load_theme (eyes_applet, theme); setup_eyes (eyes_applet); panel_applet_gconf_set_string ( eyes_applet->applet, "theme_path", theme, NULL); g_free (theme); }
static void wireless_applet_save_properties (WirelessApplet *applet) { if (applet->device) panel_applet_gconf_set_string (PANEL_APPLET (applet), "device", applet->device, NULL); panel_applet_gconf_set_bool (PANEL_APPLET (applet), "percent", applet->show_percent, NULL); }
static void group_windows_toggled (GtkToggleButton *button, TasklistData *tasklist) { if (gtk_toggle_button_get_active (button)) { char *str; str = g_object_get_data (G_OBJECT (button), "group_value"); panel_applet_gconf_set_string (PANEL_APPLET (tasklist->applet), "group_windows", str, NULL); } }
static void megaphone_applet_preferences_response_cb (GtkWidget *dialog, gint response, MegaphoneApplet *applet) { if (response == GTK_RESPONSE_ACCEPT) { EmpathyContactListView *contact_list; EmpathyContact *contact; /* Retrieve the selected contact, if any and set it up in gconf. * GConf will notify us from the change and we will adjust ourselves */ contact_list = g_object_get_data (G_OBJECT (dialog), "contact-list"); contact = empathy_contact_list_view_dup_selected (contact_list); if (contact) { EmpathyAccount *account; const gchar *account_id; const gchar *contact_id; gchar *str; account = empathy_contact_get_account (contact); account_id = empathy_account_get_unique_name (account); contact_id = empathy_contact_get_id (contact); str = g_strconcat (account_id, "/", contact_id, NULL); panel_applet_gconf_set_string (PANEL_APPLET (applet), "avatar_token", "", NULL); panel_applet_gconf_set_string (PANEL_APPLET (applet), "contact_id", str, NULL); g_free (str); g_object_unref (contact); } } gtk_widget_destroy (dialog); }
static void megaphone_applet_update_contact (MegaphoneApplet *applet) { MegaphoneAppletPriv *priv = GET_PRIV (applet); const gchar *name; const gchar *status; gchar *tip; const gchar *avatar_token = NULL; if (priv->contact) { EmpathyAvatar *avatar; avatar = empathy_contact_get_avatar (priv->contact); if (avatar) { avatar_token = avatar->token; } } if (avatar_token) { panel_applet_gconf_set_string (PANEL_APPLET (applet), "avatar_token", avatar_token, NULL); } megaphone_applet_update_icon (applet); if (priv->contact ) { name = empathy_contact_get_name (priv->contact); status = empathy_contact_get_status (priv->contact); tip = g_strdup_printf ("<b>%s</b>: %s", name, status); gtk_widget_set_tooltip_markup (GTK_WIDGET (applet), tip); g_free (tip); } else { gtk_widget_set_tooltip_markup (GTK_WIDGET (applet), _("Please configure a contact.")); } }
void appconf_save(struct app_t *app) { CfaPreferences *prefs = app->prefs; PanelApplet *applet = app->applet; GList *cond_list, *lp; gint i; panel_applet_gconf_set_string(applet, "font_auto", cfa_preferences_get_font_name(prefs, CFA_DESIGN_FONT_NAME_AUTO), NULL); panel_applet_gconf_set_string(applet, "bg_color_auto", cfa_preferences_get_color_name(prefs, CFA_DESIGN_BG_COLOR_AUTO), NULL); panel_applet_gconf_set_string(applet, "font_color_auto", cfa_preferences_get_color_name(prefs, CFA_DESIGN_FONT_COLOR_AUTO), NULL); panel_applet_gconf_set_string(applet, "arc_color_auto", cfa_preferences_get_color_name(prefs, CFA_DESIGN_ARC_COLOR_AUTO), NULL); panel_applet_gconf_set_string(applet, "hand_color_auto", cfa_preferences_get_color_name(prefs, CFA_DESIGN_HAND_COLOR_AUTO), NULL); panel_applet_gconf_set_string(applet, "font_manual", cfa_preferences_get_font_name(prefs, CFA_DESIGN_FONT_NAME_MANUAL), NULL); panel_applet_gconf_set_string(applet, "bg_color_manual", cfa_preferences_get_color_name(prefs, CFA_DESIGN_BG_COLOR_MANUAL), NULL); panel_applet_gconf_set_string(applet, "font_color_manual", cfa_preferences_get_color_name(prefs, CFA_DESIGN_FONT_COLOR_MANUAL), NULL); panel_applet_gconf_set_string(applet, "arc_color_manual", cfa_preferences_get_color_name(prefs, CFA_DESIGN_ARC_COLOR_MANUAL), NULL); panel_applet_gconf_set_string(applet, "hand_color_manual", cfa_preferences_get_color_name(prefs, CFA_DESIGN_HAND_COLOR_MANUAL), NULL); panel_applet_gconf_set_string(applet, "drag_color_manual", cfa_preferences_get_color_name(prefs, CFA_DESIGN_DRAG_COLOR_MANUAL), NULL); cond_list = cfa_preferences_get_cond_list(prefs); panel_applet_gconf_set_int(applet, "nconds", g_list_length(cond_list), NULL); for (lp = cond_list, i = 0; lp != NULL; lp = g_list_next(lp), i++) { gchar key[64]; CfaCond *cond = lp->data; make_cond_key(key, sizeof key, i, "use_cpu"); panel_applet_gconf_set_bool(applet, key, cfa_cond_get_use_cpu(cond), NULL); make_cond_key(key, sizeof key, i, "cpu_id"); panel_applet_gconf_set_int(applet, key, cfa_cond_get_cpu_id(cond), NULL); make_cond_key(key, sizeof key, i, "use_ac"); panel_applet_gconf_set_bool(applet, key, cfa_cond_get_use_ac(cond), NULL); make_cond_key(key, sizeof key, i, "ac"); panel_applet_gconf_set_bool(applet, key, cfa_cond_get_ac(cond), NULL); make_cond_key(key, sizeof key, i, "use_battery"); panel_applet_gconf_set_bool(applet, key, cfa_cond_get_use_battery(cond), NULL); make_cond_key(key, sizeof key, i, "battery"); panel_applet_gconf_set_string(applet, key, cfa_cond_get_battery(cond), NULL); make_cond_key(key, sizeof key, i, "use_load"); panel_applet_gconf_set_bool(applet, key, cfa_cond_get_use_load(cond), NULL); make_cond_key(key, sizeof key, i, "load"); panel_applet_gconf_set_string(applet, key, cfa_cond_get_load(cond), NULL); make_cond_key(key, sizeof key, i, "use_process"); panel_applet_gconf_set_bool(applet, key, cfa_cond_get_use_process(cond), NULL); make_cond_key(key, sizeof key, i, "process"); panel_applet_gconf_set_string(applet, key, cfa_cond_get_process(cond), NULL); make_cond_key(key, sizeof key, i, "freq"); panel_applet_gconf_set_string(applet, key, cfa_cond_get_freq(cond), NULL); } panel_applet_gconf_set_bool(applet, "smooth", cfa_preferences_get_smooth(prefs), NULL); }