gint saveOptions() { if(SHASH("username") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/username", SHASH("username"), NULL); if((SHASH("password") != NULL) && (iSHASH("savepw") == TRUE)) gconf_client_set_string(gcfg, GCONF_BASE"/password", SHASH("password"), NULL); if(SHASH("domain") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/domain", SHASH("domain"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/savepw", iSHASH("savepw"), NULL); gconf_client_set_int(gcfg, GCONF_BASE"/rdp_protocol", iSHASH("rdp_protocol"), NULL); if(SHASH("geometry") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/geometry", SHASH("geometry"), NULL); if(SHASH("keymap") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/keymap", SHASH("keymap"), NULL); gconf_client_set_int(gcfg, GCONF_BASE"/colorsize", iSHASH("colorsize"), NULL); gconf_client_set_int(gcfg, GCONF_BASE"/sound", iSHASH("sound"), NULL); if(SHASH("program") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/program", SHASH("program"), NULL); if(SHASH("ppath") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/ppath", SHASH("ppath"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/runprog", iSHASH("runprog"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/bitmapupd", iSHASH("bitmapupd"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/motionevt", iSHASH("motionevt"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/hidewmdecoration", iSHASH("hidewmdecoration"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/noencryption", iSHASH("noencryption"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/wmkeybindings", iSHASH("wmkeybindings"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/attconsole", iSHASH("attconsole"), NULL); if(SHASH("clientname") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/clientname", SHASH("clientname"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/usessh", iSHASH("usessh"), NULL); if(SHASH("sshuser") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/sshuser", SHASH("sshuser"), NULL); if(SHASH("sshhost") != NULL) gconf_client_set_string(gcfg, GCONF_BASE"/sshhost", SHASH("sshhost"), NULL); gconf_client_set_bool(gcfg, GCONF_BASE"/showopts", iSHASH("showopts"), NULL); return(0); }
static gboolean accessibility_enabled (MTClosure *mt, gint spi_status) { gint ret; if (spi_status != 0) { ret = mt_common_show_dialog (_("Assistive Technology Support is not Enabled"), _("Mousetweaks requires assistive technologies to be enabled " "in your session." "\n\n" "To enable support for assistive technologies and restart " "your session, press \"Enable and Log Out\"."), MT_MESSAGE_LOGOUT); if (ret == GTK_RESPONSE_ACCEPT) { gconf_client_set_bool (mt->client, GNOME_A11Y_KEY, TRUE, NULL); mt_main_request_logout (mt); } else { /* reset the selected option again */ if (gconf_client_get_bool (mt->client, OPT_DELAY, NULL)) gconf_client_set_bool (mt->client, OPT_DELAY, FALSE, NULL); if (gconf_client_get_bool (mt->client, OPT_DWELL, NULL)) gconf_client_set_bool (mt->client, OPT_DWELL, FALSE, NULL); } return FALSE; } return TRUE; }
NS_IMETHODIMP nsGConfService::SetAppForProtocol(const nsACString &aScheme, const nsACString &aCommand) { nsCAutoString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); key.Append("/command"); PRBool res = gconf_client_set_string(mClient, key.get(), PromiseFlatCString(aCommand).get(), nsnull); if (res) { key.Replace(key.Length() - 7, 7, NS_LITERAL_CSTRING("enabled")); res = gconf_client_set_bool(mClient, key.get(), PR_TRUE, nsnull); if (res) { key.Replace(key.Length() - 7, 7, NS_LITERAL_CSTRING("needs_terminal")); res = gconf_client_set_bool(mClient, key.get(), PR_FALSE, nsnull); if (res) { key.Replace(key.Length() - 14, 14, NS_LITERAL_CSTRING("command-id")); res = gconf_client_unset(mClient, key.get(), nsnull); } } } return res ? NS_OK : NS_ERROR_FAILURE; }
/* Performs a scheduled dimensions-to-prefs sync for a window binding */ static gboolean window_binding_perform_scheduled_sync (WindowBinding *binding) { if (binding->bind_size) { gint width, height; gchar *key; GdkWindowState state; GdkWindow *window; window = gtk_widget_get_window (GTK_WIDGET (binding->window)); state = gdk_window_get_state (window); if (state & GDK_WINDOW_STATE_MAXIMIZED) { key = g_strconcat (binding->key_prefix, "_maximized", NULL); gconf_client_set_bool (bridge->client, key, TRUE, NULL); g_free (key); } else { gtk_window_get_size (binding->window, &width, &height); key = g_strconcat (binding->key_prefix, "_width", NULL); gconf_client_set_int (bridge->client, key, width, NULL); g_free (key); key = g_strconcat (binding->key_prefix, "_height", NULL); gconf_client_set_int (bridge->client, key, height, NULL); g_free (key); key = g_strconcat (binding->key_prefix, "_maximized", NULL); gconf_client_set_bool (bridge->client, key, FALSE, NULL); g_free (key); } } if (binding->bind_pos) { gint x, y; gchar *key; gtk_window_get_position (binding->window, &x, &y); key = g_strconcat (binding->key_prefix, "_x", NULL); gconf_client_set_int (bridge->client, key, x, NULL); g_free (key); key = g_strconcat (binding->key_prefix, "_y", NULL); gconf_client_set_int (bridge->client, key, y, NULL); g_free (key); } binding->sync_timeout_id = 0; return FALSE; }
/* Preferences Callback : Save. */ void preferences_save_cb (gpointer data) { gint width = gtk_adjustment_get_value (stickynotes->w_prefs_width); gint height = gtk_adjustment_get_value (stickynotes->w_prefs_height); gboolean sys_color = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sys_color)); gboolean sys_font = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sys_font)); gboolean sticky = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sticky)); gboolean force_default = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (stickynotes->w_prefs_force)); gboolean desktop_hide = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (stickynotes->w_prefs_desktop)); if (gconf_client_key_is_writable (stickynotes->gconf, GCONF_PATH "/defaults/width", NULL)) gconf_client_set_int (stickynotes->gconf, GCONF_PATH "/defaults/width", width, NULL); if (gconf_client_key_is_writable (stickynotes->gconf, GCONF_PATH "/defaults/height", NULL)) gconf_client_set_int (stickynotes->gconf, GCONF_PATH "/defaults/height", height, NULL); if (gconf_client_key_is_writable (stickynotes->gconf, GCONF_PATH "/settings/use_system_color", NULL)) gconf_client_set_bool (stickynotes->gconf, GCONF_PATH "/settings/use_system_color", sys_color, NULL); if (gconf_client_key_is_writable (stickynotes->gconf, GCONF_PATH "/settings/use_system_font", NULL)) gconf_client_set_bool (stickynotes->gconf, GCONF_PATH "/settings/use_system_font", sys_font, NULL); if (gconf_client_key_is_writable (stickynotes->gconf, GCONF_PATH "/settings/sticky", NULL)) gconf_client_set_bool (stickynotes->gconf, GCONF_PATH "/settings/sticky", sticky, NULL); if (gconf_client_key_is_writable (stickynotes->gconf, GCONF_PATH "/settings/force_default", NULL)) gconf_client_set_bool (stickynotes->gconf, GCONF_PATH "/settings/force_default", force_default, NULL); if (gconf_client_key_is_writable (stickynotes->gconf, GCONF_PATH "/settings/desktop_hide", NULL)) gconf_client_set_bool (stickynotes->gconf, GCONF_PATH "/settings/desktop_hide", desktop_hide, NULL); }
static gboolean _toggle_show_seconds(GtkWidget *widget, GdkEventButton *event, Uptime_plug_data * plug_data) { toggle_boolean_menu(widget, event, &plug_data->show_seconds); gconf_client_set_bool(get_dashboard_gconf(), GCONF_UPTIME_SHOW_SECONDS , plug_data->show_seconds, NULL); plug_data->forceupdate = TRUE; return TRUE; }
void calendar_config_set_compress_weekend (gboolean compress) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_COMPRESS_WEEKEND, compress, NULL); }
void calendar_config_set_dnav_show_week_no (gboolean show_week_no) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, show_week_no, NULL); }
static gboolean _toggle_2_gradient(GtkWidget *widget, GdkEventButton *event, CPU_plug_data *p) { p->two_colour_gradient = !p->two_colour_gradient; gconf_client_set_bool(get_dashboard_gconf(), GCONF_CPU_METER_USE_2_COLOUR_GRADIENT, p->two_colour_gradient, NULL); _notify_color_change(p); return TRUE; }
void calendar_config_set_show_event_end (gboolean show_end) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_SHOW_EVENT_END, show_end, NULL); }
void calendar_config_set_24_hour_format (gboolean use_24_hour) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_24HOUR, use_24_hour, NULL); }
/** * calendar_config_set_use_default_reminder: * @value: Whether to create new appointments with a default reminder. * * Sets whether newly-created appointments should get a default reminder set * them. **/ void calendar_config_set_use_default_reminder (gboolean value) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_DEFAULT_REMINDER, value, NULL); }
void calendar_config_set_daylight_saving (gboolean daylight_saving) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_DAYLIGHT_SAVING, daylight_saving, NULL); }
/** * calendar_config_set_confirm_purge: * @confirm: Whether confirmation is required when purging items. * * Sets the configuration value for whether a confirmation dialog is presented * when purging calendar/tasks items. **/ void calendar_config_set_confirm_purge (gboolean confirm) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_PROMPT_PURGE, confirm, NULL); }
/** * calendar_config_set_confirm_delete: * @confirm: Whether confirmation is required when deleting items. * * Sets the configuration value for whether a confirmation dialog is presented * when deleting calendar/tasks items. **/ void calendar_config_set_confirm_delete (gboolean confirm) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_PROMPT_DELETE, confirm, NULL); }
void calendar_config_set_hide_completed_tasks (gboolean hide) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED, hide, NULL); }
void gam_toggle_set_visible (GamToggle *gam_toggle, gboolean visible) { GamTogglePrivate *priv; gchar *key; g_return_if_fail (GAM_IS_TOGGLE (gam_toggle)); priv = GAM_TOGGLE_GET_PRIVATE (gam_toggle); key = g_strdup_printf ("/apps/gnome-alsamixer/display_toggles/%s-%s", gam_mixer_get_config_name (GAM_MIXER (priv->mixer)), gam_toggle_get_config_name (gam_toggle)); gconf_client_set_bool (gam_app_get_gconf_client (GAM_APP (priv->app)), key, visible, NULL); gconf_client_suggest_sync (gam_app_get_gconf_client (GAM_APP (priv->app)), NULL); if (visible) gtk_widget_show (GTK_WIDGET (gam_toggle)); else gtk_widget_hide (GTK_WIDGET (gam_toggle)); }
void gconf_setup() { gchar *str; GConfClient *client = gconf_client_get_default(); if (client == NULL) return; /* we're not running under GConf */ /* * This is deliberately somewhat simple-minded, at least for now. * We care about one thing: Is anything set to handle "bible://"? * * Unfortunate consequence of changing xiphos2 => xiphos: * We must fix broken keys. */ if ((((str = gconf_client_get_string(client, gconf_keys[0][0], NULL)) == NULL) || (strncmp(str, "xiphos ", 7) == 0))) { /* * Mechanical as can be, one after another. */ int i; for (i = 0; i < GS_GCONF_MAX; ++i) { (((i % 3) == 0) /* contrived hack */ ? gconf_client_set_string(client, gconf_keys[i][0], gconf_keys[i][1], NULL) : gconf_client_set_bool(client, gconf_keys[i][0], (gconf_keys[i][1] ? TRUE : FALSE), NULL)); } } }
void calendar_config_set_show_type (gboolean state) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_SHOW_TYPE, state, NULL); }
void dasher_app_settings_set_bool(DasherAppSettings *pSelf, int iParameter, bool bValue) { DasherAppSettingsPrivate *pPrivate = (DasherAppSettingsPrivate *)(pSelf->private_data); if( iParameter < END_OF_BPS ) { if(pPrivate->bWidgetSet) { gtk_dasher_control_set_parameter_bool(GTK_DASHER_CONTROL(pDasherWidget), iParameter, bValue); } } else { if(dasher_app_settings_get_bool(pSelf, iParameter) == bValue) return; // Don't attempt to change to the existing value app_boolparamtable[ iParameter - FIRST_APP_BP ].value = bValue; #ifdef WITH_GCONF if(app_boolparamtable[ iParameter - FIRST_APP_BP ].persistent) { gchar szName[256]; strncpy(szName, "/apps/dasher4/", 256); strncat(szName, app_boolparamtable[ iParameter - FIRST_APP_BP ].regName, 255 - strlen( szName )); GError *pGConfError = NULL; gconf_client_set_bool(pPrivate->pGConfClient, szName, bValue, &pGConfError); if(pGConfError) g_message("Error"); } #endif // TODO: Use real signals to achieve this parameter_notification(0, iParameter, 0); } }
void calendar_config_set_show_status (gboolean state) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_SHOW_STATUS, state, NULL); }
void calendar_config_set_show_timezone (gboolean status) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_SHOW_TIMEZONE, status, NULL); }
/* Menu Callback: Lock/Unlock sticky notes */ void menu_toggle_lock_cb(GtkAction *action, StickyNotesApplet *applet) { gboolean locked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); if (gconf_client_key_is_writable(stickynotes->gconf, GCONF_PATH "/settings/locked", NULL)) gconf_client_set_bool(stickynotes->gconf, GCONF_PATH "/settings/locked", locked, NULL); }
void calendar_config_set_show_categories (gboolean status) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_SHOW_CATEGORIES, status, NULL); }
static void on_sidebar_toggled (GtkCheckMenuItem *item, ShellStatusMenu *status) { gconf_client_set_bool (status->priv->client, SIDEBAR_VISIBLE_KEY, gtk_check_menu_item_get_active (item), NULL); }
void calendar_config_set_preview_state (gboolean state) { calendar_config_init (); gconf_client_set_bool (config, CALENDAR_CONFIG_TASK_PREVIEW, state, NULL); }
static void gconf_dialog_onCheckButtonActivated (GConfDialog* self, GtkCheckButton* widget) { GError * _inner_error_; GConfEntry* _tmp0_; GConfEntry* entry; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); _inner_error_ = NULL; entry = (_tmp0_ = (GConfEntry*) g_object_get_data ((GObject*) widget, "gconf-entry"), (_tmp0_ == NULL) ? NULL : gconf_entry_ref (_tmp0_), _tmp0_); { gconf_client_set_bool (self->priv->_default_client, entry->key, gtk_toggle_button_get_active ((GtkToggleButton*) widget), &_inner_error_); if (_inner_error_ != NULL) { goto __catch22_g_error; } } goto __finally22; __catch22_g_error: { GError * e; e = _inner_error_; _inner_error_ = NULL; { g_warning ("gtkextra-gconfdialog.vala:135: %s", e->message); _g_error_free0 (e); } } __finally22: if (_inner_error_ != NULL) { _gconf_entry_unref0 (entry); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } _gconf_entry_unref0 (entry); }
static void panel_drawer_prepare (const char *drawer_id, const char *custom_icon, gboolean use_custom_icon, const char *tooltip, char **attached_toplevel_id) { GConfClient *client; const char *key; client = panel_gconf_get_client (); if (tooltip) { key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, drawer_id, "tooltip"); gconf_client_set_string (client, key, tooltip, NULL); } key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, drawer_id, "use_custom_icon"); gconf_client_set_bool (client, key, use_custom_icon, NULL); if (custom_icon) { key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, drawer_id, "custom_icon"); gconf_client_set_string (client, key, custom_icon, NULL); } if (attached_toplevel_id) { char *toplevel_id; char *toplevel_dir; toplevel_id = panel_profile_find_new_id (PANEL_GCONF_TOPLEVELS); toplevel_dir = g_strdup_printf (PANEL_CONFIG_DIR "/toplevels/%s", toplevel_id); panel_gconf_associate_schemas_in_dir (client, toplevel_dir, PANEL_SCHEMAS_DIR "/toplevels"); key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, drawer_id, "attached_toplevel_id"); gconf_client_set_string (client, key, toplevel_id, NULL); key = panel_gconf_full_key (PANEL_GCONF_TOPLEVELS, toplevel_id, "enable_buttons"); gconf_client_set_bool (client, key, TRUE, NULL); key = panel_gconf_full_key (PANEL_GCONF_TOPLEVELS, toplevel_id, "enable_arrows"); gconf_client_set_bool (client, key, TRUE, NULL); *attached_toplevel_id = toplevel_id; } }
void CGnomeSettingsStore::SaveSetting(const std::string &Key, bool Value) { std::string keypath(GCONF_KEY_ROOT); keypath += Key; GError *the_error = NULL; gconf_client_set_bool(the_gconf_client, keypath.c_str(), Value, &the_error); }
NS_IMETHODIMP nsGConfService::SetBool(const nsACString &aKey, PRBool aValue) { PRBool res = gconf_client_set_bool(mClient, PromiseFlatCString(aKey).get(), aValue, nsnull); return res ? NS_OK : NS_ERROR_FAILURE; }