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; }
static void get_gconf_options (MTClosure *mt) { gdouble val; mt->threshold = gconf_client_get_int (mt->client, OPT_THRESHOLD, NULL); mt->delay_enabled = gconf_client_get_bool (mt->client, OPT_DELAY, NULL); mt->dwell_enabled = gconf_client_get_bool (mt->client, OPT_DWELL, NULL); mt->dwell_show_ctw = gconf_client_get_bool (mt->client, OPT_CTW, NULL); mt->dwell_mode = gconf_client_get_int (mt->client, OPT_MODE, NULL); mt->style = gconf_client_get_int (mt->client, OPT_STYLE, NULL); mt->animate_cursor = gconf_client_get_bool (mt->client, OPT_ANIMATE, NULL); val = gconf_client_get_float (mt->client, OPT_DELAY_T, NULL); mt_timer_set_target (mt->delay_timer, val); val = gconf_client_get_float (mt->client, OPT_DWELL_T, NULL); mt_timer_set_target (mt->dwell_timer, val); mt->dwell_dirs[DWELL_CLICK_TYPE_SINGLE] = gconf_client_get_int (mt->client, OPT_G_SINGLE, NULL); mt->dwell_dirs[DWELL_CLICK_TYPE_DOUBLE] = gconf_client_get_int (mt->client, OPT_G_DOUBLE, NULL); mt->dwell_dirs[DWELL_CLICK_TYPE_DRAG] = gconf_client_get_int (mt->client, OPT_G_DRAG, NULL); mt->dwell_dirs[DWELL_CLICK_TYPE_RIGHT] = gconf_client_get_int (mt->client, OPT_G_RIGHT, NULL); }
static void config_load (GConfClient *gconf) { GSList *paths, *it; main_set_loop_at_end (gconf_client_get_bool (gconf, LOOP_PLAYLIST, NULL)); main_set_random_order (gconf_client_get_bool (gconf, RANDOM_ORDER, NULL)); paths = gconf_client_get_list (gconf, PLAYLIST, GCONF_VALUE_STRING, NULL); for (it = paths; it; it = g_slist_next (it)) { GError *e = NULL; gchar *p = g_filename_from_utf8 (it->data, -1, NULL, NULL, &e); if (p) { playlist_append_single (p); g_free(p); } if (e) { g_warning ("Error loading playlist: %s", e->message); g_error_free(e); } g_free(it->data); } g_slist_free(paths); /* don't need another copy of the playlist in memory, and gconf_client_clear_cache makes a nice segfault when I try save stuff later. This value can't be edited while quark is running anyways. */ gconf_client_unset (gconf, PLAYLIST, NULL); playlist_seek (gconf_client_get_int (gconf, PLAYLIST_POSITION, NULL)); }
static void em_junk_sa_init (void) { pthread_mutex_lock (&em_junk_sa_init_lock); if (!em_junk_sa_gconf) { em_junk_sa_gconf = gconf_client_get_default(); gconf_client_add_dir (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); em_junk_sa_local_only = gconf_client_get_bool (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/local_only", NULL); em_junk_sa_use_daemon = gconf_client_get_bool (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/use_daemon", NULL); pthread_mutex_lock (&em_junk_sa_preferred_socket_path_lock); g_free (em_junk_sa_preferred_socket_path); em_junk_sa_preferred_socket_path = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/socket_path", NULL); pthread_mutex_unlock (&em_junk_sa_preferred_socket_path_lock); gconf_client_notify_add(em_junk_sa_gconf, "/apps/evolution/mail/junk/sa", (GConfClientNotifyFunc)em_junk_sa_setting_notify, NULL, NULL, NULL); em_junk_sa_spamc_gconf_binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamc_binary", NULL); em_junk_sa_spamd_gconf_binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamd_binary", NULL); } pthread_mutex_unlock (&em_junk_sa_init_lock); atexit (em_junk_sa_finalize); }
static CORBA_boolean impl_quit(PortableServer_Servant servant, CORBA_Environment *ev) { MailComponent *mc = MAIL_COMPONENT(bonobo_object_from_servant(servant)); if (mc->priv->quit_state == -1) mc->priv->quit_state = MC_QUIT_START; mail_config_prune_proxies (); switch (mc->priv->quit_state) { case MC_QUIT_START: { extern int camel_application_is_exiting; int now = time(NULL)/60/60/24, days; gboolean empty_junk; GConfClient *gconf = mail_config_get_gconf_client(); camel_application_is_exiting = TRUE; mail_vfolder_shutdown(); mc->priv->quit_expunge = gconf_client_get_bool(gconf, "/apps/evolution/mail/trash/empty_on_exit", NULL) && ((days = gconf_client_get_int(gconf, "/apps/evolution/mail/trash/empty_on_exit_days", NULL)) == 0 || (days + gconf_client_get_int(gconf, "/apps/evolution/mail/trash/empty_date", NULL)) <= now); empty_junk = gconf_client_get_bool(gconf, "/apps/evolution/mail/junk/empty_on_exit", NULL) && ((days = gconf_client_get_int(gconf, "/apps/evolution/mail/junk/empty_on_exit_days", NULL)) == 0 || (days + gconf_client_get_int(gconf, "/apps/evolution/mail/junk/empty_date", NULL)) <= now); if (empty_junk) { g_hash_table_foreach(mc->priv->store_hash, (GHFunc)mc_quit_delete, mc); gconf_client_set_int(gconf, "/apps/evolution/mail/junk/empty_date", now, NULL); } g_hash_table_foreach(mc->priv->store_hash, (GHFunc)mc_quit_sync, mc); if (mc->priv->quit_expunge) gconf_client_set_int(gconf, "/apps/evolution/mail/trash/empty_date", now, NULL); mc->priv->quit_state = MC_QUIT_SYNC; } /* Falls through */ case MC_QUIT_SYNC: if (mc->priv->quit_count > 0) return FALSE; mail_cancel_all(); mc->priv->quit_state = MC_QUIT_THREADS; /* Falls through */ case MC_QUIT_THREADS: /* should we keep cancelling? */ return !mail_msg_active((unsigned int)-1); } return TRUE; }
void ui_init (AppearanceData *data) { GObject *peditor; char *toolbar_style; gconf_client_add_dir (data->client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); peditor = gconf_peditor_new_boolean (NULL, "/desktop/gnome/interface/can_change_accels", glade_xml_get_widget (data->xml, "menu_accel_toggle"), NULL); peditor = gconf_peditor_new_boolean (NULL, "/desktop/gnome/interface/menus_have_icons", glade_xml_get_widget (data->xml, "menu_icons_toggle"), NULL); g_signal_connect (peditor, "value_changed", (GCallback) menus_have_icons_cb, data); set_have_icons (data, gconf_client_get_bool (data->client, "/desktop/gnome/interface/menus_have_icons", NULL)); peditor = gconf_peditor_new_combo_box (NULL, "/desktop/gnome/interface/toolbar_style", glade_xml_get_widget (data->xml, "toolbar_style_select"), "conv-to-widget-cb", toolbar_to_widget, "conv-from-widget-cb", toolbar_from_widget, NULL); g_signal_connect (peditor, "value_changed", (GCallback) toolbar_style_cb, data); g_signal_connect (glade_xml_get_widget (data->xml, "toolbar_handlebox"), "button_press_event", (GCallback) button_press_block_cb, NULL); show_handlebar (data, gconf_client_get_bool (data->client, "/desktop/gnome/interface/toolbar_detachable", NULL)); toolbar_style = gconf_client_get_string (data->client, "/desktop/gnome/interface/toolbar_style", NULL); set_toolbar_style (data, toolbar_style); g_free (toolbar_style); /* no ui for detachable toolbars */ gconf_client_notify_add (data->client, "/desktop/gnome/interface/toolbar_detachable", (GConfClientNotifyFunc) toolbar_detachable_cb, data, NULL, NULL); }
void proxy_init(void) { GError *gconf_error = NULL; gboolean use_proxy; gboolean use_proxy_auth; gl_client = gconf_client_get_default(); gl_mutex = g_mutex_new(); gconf_client_add_dir(gl_client, PATH_GCONF_GNOME_VFS, GCONF_CLIENT_PRELOAD_ONELEVEL, &gconf_error); if (gconf_error) { DEBUG_HTTP(("GConf error during client_add_dir '%s'", gconf_error->message)); g_error_free(gconf_error); gconf_error = NULL; } gconf_client_notify_add(gl_client, PATH_GCONF_GNOME_VFS, notify_gconf_value_changed, NULL, NULL, &gconf_error); if (gconf_error) { DEBUG_HTTP(("GConf error during notify_error '%s'", gconf_error->message)); g_error_free(gconf_error); gconf_error = NULL; } /* Load the http proxy setting */ use_proxy = gconf_client_get_bool(gl_client, KEY_GCONF_USE_HTTP_PROXY, &gconf_error); if (gconf_error != NULL) { DEBUG_HTTP(("GConf error during client_get_bool '%s'", gconf_error->message)); g_error_free(gconf_error); gconf_error = NULL; } else { construct_gl_http_proxy(use_proxy); } use_proxy_auth = gconf_client_get_bool(gl_client, KEY_GCONF_HTTP_USE_AUTH, &gconf_error); if (gconf_error != NULL) { DEBUG_HTTP(("GConf error during client_get_bool '%s'", gconf_error->message)); g_error_free(gconf_error); gconf_error = NULL; } else { set_proxy_auth(use_proxy_auth); } }
//Sets initial state of widgets static void setWidgets() { gtk_spin_button_set_value((GtkSpinButton*)historyLength, gconf_client_get_int(global_conf, MAX_ELEMENTS_KEY, NULL)); gtk_spin_button_set_value((GtkSpinButton*)itemLength, gconf_client_get_int(global_conf, MAX_ITEM_LENGTH_KEY, NULL)); gtk_toggle_button_set_active((GtkToggleButton*)primaryCheck, gconf_client_get_bool(global_conf, USE_PRIMARY_CLIPBOARD_KEY, NULL)); gtk_toggle_button_set_active((GtkToggleButton*)defaultCheck, gconf_client_get_bool(global_conf, USE_DEFAULT_CLIPBOARD_KEY, NULL)); gtk_toggle_button_set_active((GtkToggleButton*)markDefaultCheck, gconf_client_get_bool(global_conf, MARK_DEFAULT_ENTRY_KEY, NULL)); gtk_toggle_button_set_active((GtkToggleButton*)saveHistCheck, gconf_client_get_bool(global_conf, SAVE_HISTORY_KEY, NULL)); gtk_entry_set_text((GtkEntry*)keyCombEntry, gconf_client_get_string(global_conf, KEY_COMBINATION_KEY, NULL)); updateMarkDefaultCheck(); }
void switcher_button_update_icon(SwitcherButton *self) { if (self->priv->model == N800 || self->priv->model == N810) self->priv->current = gconf_client_get_int(self->priv->gconfClient, GCONF_CURRENT_2008, 0); else if (self->priv->model == N770) self->priv->current = gconf_client_get_bool(self->priv->gconfClient, GCONF_CURRENT_2006, 0) ? 0 : 1; self->priv->locked = gconf_client_get_bool(self->priv->gconfClient, GCONF_LOCK_ENTRY, 0) ? 1 : 0; gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(self->priv->menuItemBlock), self->priv->locked != 0); gtk_widget_queue_draw(GTK_WIDGET(self)); }
static void search_preferences_read_setting(gchar *name) { GConfClient *client; client = gconf_client_get_default(); sr->search.expr.regex = gconf_client_get_bool(client, gconf_concat_dir_and_key(name, "regex"), NULL); sr->search.expr.greedy = gconf_client_get_bool(client, gconf_concat_dir_and_key(name, "greedy"), NULL); sr->search.expr.match_case = gconf_client_get_bool(client, gconf_concat_dir_and_key(name, "match_case"), NULL); sr->search.expr.whole_word = gconf_client_get_bool(client, gconf_concat_dir_and_key(name, "whole_word"), NULL); sr->search.expr.whole_line = gconf_client_get_bool(client, gconf_concat_dir_and_key(name, "whole_line"), NULL); sr->search.expr.word_start = gconf_client_get_bool(client, gconf_concat_dir_and_key(name, "word_start"), NULL); sr->search.expr.no_limit = gconf_client_get_bool(client, gconf_concat_dir_and_key(name, "no_limit"), NULL); sr->search.expr.actions_max = gconf_client_get_int(client, gconf_concat_dir_and_key(name, "actions_max"), NULL); sr->search.range.type = gconf_client_get_int(client, gconf_concat_dir_and_key(name, "type"), NULL); sr->search.range.direction = gconf_client_get_int(client, gconf_concat_dir_and_key(name, "direction"), NULL); sr->search.action = gconf_client_get_int(client, gconf_concat_dir_and_key(name, "action"), NULL); sr->search.basic_search = gconf_client_get_bool(client, gconf_concat_dir_and_key(name, "basic_search"), NULL); search_update_dialog(); }
static void sj_metadata_musicbrainz5_init (SjMetadataMusicbrainz5 *self) { GConfClient *gconf_client; gchar *server_name; SjMetadataMusicbrainz5Private *priv; priv = GET_PRIVATE (self); gconf_client = gconf_client_get_default (); server_name = gconf_client_get_string (gconf_client, GCONF_MUSICBRAINZ_SERVER, NULL); if (server_name && (*server_name == '\0')) { g_free (server_name); server_name = NULL; } priv->mb = mb5_query_new (SJ_MUSICBRAINZ_USER_AGENT, server_name, 0); g_free (server_name); /* Set the HTTP proxy */ if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_PROXY, NULL)) { char *proxy_host; int port; proxy_host = gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL); mb5_query_set_proxyhost (priv->mb, proxy_host); g_free (proxy_host); port = gconf_client_get_int (gconf_client, GCONF_PROXY_PORT, NULL); mb5_query_set_proxyport (priv->mb, port); if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_AUTHENTICATION, NULL)) { char *username, *password; username = gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL); mb5_query_set_proxyusername (priv->mb, username); g_free (username); password = gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL); mb5_query_set_proxypassword (priv->mb, password); g_free (password); } } g_object_unref (gconf_client); }
static void sj_metadata_musicbrainz3_init (SjMetadataMusicbrainz3 *self) { GConfClient *gconf_client; gchar *server_name; SjMetadataMusicbrainz3Private *priv; priv = GET_PRIVATE (self); priv->mb = mb_webservice_new (); gconf_client = gconf_client_get_default (); server_name = gconf_client_get_string (gconf_client, GCONF_MUSICBRAINZ_SERVER, NULL); if (server_name && strcmp (server_name, "") != 0) { mb_webservice_set_host (priv->mb, server_name); } g_free (server_name); /* Set the HTTP proxy */ if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_PROXY, NULL)) { char *proxy_host; int port; proxy_host = gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL); mb_webservice_set_proxy_host (priv->mb, proxy_host); g_free (proxy_host); port = gconf_client_get_int (gconf_client, GCONF_PROXY_PORT, NULL); mb_webservice_set_proxy_port (priv->mb, port); if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_AUTHENTICATION, NULL)) { char *username, *password; username = gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL); mb_webservice_set_proxy_username (priv->mb, username); g_free (username); password = gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL); mb_webservice_set_proxy_password (priv->mb, password); g_free (password); } } g_object_unref (gconf_client); }
void update_from_gconf () { disable_grab = gconf_client_get_bool (gconf_client, BASE_PATH "disable-grab", NULL); force_grab = gconf_client_get_bool (gconf_client, BASE_PATH "force-grab", NULL); prompt = gconf_client_get_bool (gconf_client, BASE_PATH "prompt", NULL); sudo_mode = gconf_client_get_bool (gconf_client, BASE_PATH "sudo-mode", NULL); }
gboolean sb_settings_get_ignore_whitespaces (void) { return gconf_client_get_bool (get_client (), "/apps/source-browser/ignore-whitespaces", NULL); }
gboolean sb_settings_get_follow_moves (void) { return gconf_client_get_bool (get_client (), "/apps/source-browser/follow-moves", NULL); }
void gfloppy_config_load (GFloppyConfig *config, GConfClient *client) { GError *error = NULL; g_return_if_fail (config != NULL); g_return_if_fail (client != NULL); /* We'll default the value when analyzing it, after loading the config */ config->default_fs = g_strdup (gconf_client_get_string (client, "/apps/gfloppy/default_fs", &error)); check_gconf_error (&error); /* Check to make sure that it's a valid string */ if (config->default_fs == NULL) config->default_fs = g_strdup (GFLOPPY_CONFIG_FS_FAT); else if (config->default_fs && strcmp (config->default_fs, GFLOPPY_CONFIG_FS_EXT2) && strcmp (config->default_fs, GFLOPPY_CONFIG_FS_FAT)) { g_free (config->default_fs); config->default_fs = g_strdup (GFLOPPY_CONFIG_FS_FAT); } config->default_formatting_mode = gconf_client_get_int (client, "/apps/gfloppy/default_formatting_mode", &error); /* We need to care about users sillyness ;) */ if (!check_gconf_error (&error) || config->default_formatting_mode < GFLOPPY_FORMAT_QUICK || config->default_formatting_mode > GFLOPPY_FORMAT_THOROUGH) config->default_formatting_mode = GFLOPPY_FORMAT_STANDARD; config->prefer_mkdosfs_backend = gconf_client_get_bool (client, "/apps/gfloppy/prefer_mkdosfs_backend", &error); if (!check_gconf_error (&error)) config->prefer_mkdosfs_backend = TRUE; }
/* Show Role*/ gboolean calendar_config_get_show_role (void) { calendar_config_init (); return gconf_client_get_bool (config, CALENDAR_CONFIG_SHOW_ROLE, NULL); }
NS_IMETHODIMP nsGConfService::GetAppForProtocol(const nsACString &aScheme, PRBool *aEnabled, nsACString &aHandler) { nsCAutoString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); key.Append("/command"); GError *err = nsnull; gchar *command = gconf_client_get_string(mClient, key.get(), &err); if (!err && command) { key.Replace(key.Length() - 7, 7, NS_LITERAL_CSTRING("enabled")); *aEnabled = gconf_client_get_bool(mClient, key.get(), &err); } else { *aEnabled = PR_FALSE; } aHandler.Assign(command); if (command) g_free(command); if (err) { g_error_free(err); return NS_ERROR_FAILURE; } return NS_OK; }
/* Show status */ gboolean calendar_config_get_show_status (void) { calendar_config_init (); return gconf_client_get_bool (config, CALENDAR_CONFIG_SHOW_STATUS, NULL); }
MnpClockArea * mnp_clock_area_new (void) { MnpClockArea *area = g_object_new(MNP_TYPE_CLOCK_AREA, NULL); int clk_sec = 60 - (time(NULL)%60); GConfClient *client = gconf_client_get_default (); area->priv = g_new0(MnpClockAreaPriv, 1); area->priv->is_enabled = 1; area->priv->prop_sec_zero = FALSE; area->priv->clock_tiles = g_ptr_array_new (); area->priv->position = 0.05; mx_box_layout_set_orientation ((MxBoxLayout *)area, MX_ORIENTATION_VERTICAL); mx_box_layout_set_enable_animations ((MxBoxLayout *)area, TRUE); area->priv->time_now = time(NULL); area->priv->last_time = area->priv->time_now - 60 + clk_sec; mx_box_layout_set_spacing ((MxBoxLayout *)area, 4); if (clk_sec) { area->priv->source = g_timeout_add (clk_sec * 1000, (GSourceFunc)clock_ticks, area); } else { area->priv->prop_sec_zero = TRUE; area->priv->source = g_timeout_add (60 * 1000, (GSourceFunc)clock_ticks, area); } gconf_client_add_dir (client, "/apps/date-time-panel", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); gconf_client_notify_add (client, "/apps/date-time-panel/24_h_clock", clock_fmt_changed, area, NULL, NULL); area->priv->tfh = gconf_client_get_bool (client, "/apps/date-time-panel/24_h_clock", NULL); g_object_unref(client); return area; }
/* Show timezone */ gboolean calendar_config_get_show_timezone (void) { calendar_config_init (); return gconf_client_get_bool (config, CALENDAR_CONFIG_SHOW_TIMEZONE, NULL); }
/* Whether we show week numbers in the Date Navigator. */ gboolean calendar_config_get_dnav_show_week_no (void) { calendar_config_init (); return gconf_client_get_bool (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, NULL); }
gboolean calendar_config_get_show_categories (void) { calendar_config_init (); return gconf_client_get_bool (config, CALENDAR_CONFIG_SHOW_CATEGORIES, NULL); }
gboolean gm_conf_get_bool (const gchar *key) { g_return_val_if_fail (key != NULL, FALSE); return gconf_client_get_bool (client, key, NULL); }
gboolean calendar_config_get_preview_state (void) { calendar_config_init (); return gconf_client_get_bool (config, CALENDAR_CONFIG_TASK_PREVIEW, NULL); }
static GList *nautilus_makepkg_get_file_items (NautilusMenuProvider *provider, GtkWidget *window, GList *files) { GFile *parent; gchar *name, *path; GList *list = NULL; NautilusFileInfo *info; NautilusMakepkg *self = NAUTILUS_MAKEPKG (provider); if (!gconf_client_get_bool (self->priv->conf, NAUTILUS_MAKEPKG_CONF_ENABLED, NULL)) { return list; } if (g_list_length (files) != 1) { return list; } info = NAUTILUS_FILE_INFO (files->data); name = nautilus_file_info_get_name (info); parent = nautilus_file_info_get_parent_location (info); path = g_file_get_path (parent); if (g_strcmp0 (name, "PKGBUILD") == 0 && path != NULL) { NautilusMenuItem *item = nautilus_makepkg_menu_item_new (self, window, path); list = g_list_append (list, item); } g_free (name); g_free (path); g_object_unref (parent); return list; }
static gboolean panel_lockdown_load_bool (PanelLockdown *lockdown, GConfClient *client, const char *key, GConfClientNotifyFunc notify_func, int listener) { GError *error = NULL; gboolean retval; retval = gconf_client_get_bool (client, key, &error); if (error) { g_warning ("Error getting value of '%s': %s\n", key, error->message); retval = FALSE; } lockdown->listeners [listener] = gconf_client_notify_add (client, key, notify_func, lockdown, NULL, NULL); return retval; }
void aoview_voice_init(GladeXML *xml) { gboolean enabled; GConfClient *gconf_client; voice_enable = GTK_CHECK_MENU_ITEM(glade_xml_get_widget(xml, "voice_enable")); assert(voice_enable); gconf_client = gconf_client_get_default(); enabled = TRUE; if (gconf_client) { GError *error; error = NULL; enabled = gconf_client_get_bool(gconf_client, ALTOS_VOICE_PATH, &error); if (error) enabled = TRUE; } gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(voice_enable), enabled); if (enabled) aoview_voice_open(); g_signal_connect(G_OBJECT(voice_enable), "toggled", G_CALLBACK(aoview_voice_enable), voice_enable); }
static void mnb_statusbar_update_datetime (MnbStatusbar *self) { MnbStatusbarPrivate *priv = self->priv; GDateTime *datetime = g_date_time_new_now_local (); gchar *time_str; GConfClient *client = gconf_client_get_default (); gboolean c24h = gconf_client_get_bool (client, MNB_24H_KEY, NULL); if (c24h) { /* translators: translate this to a suitable 24 hourt time * format for your locale showing only hours and minutes. For * available format specifiers see * http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html */ time_str = g_date_time_format (datetime, _("%A %B %e, %Y - %H:%M")); } else { /* translators: translate this to a suitable default time format for * your locale showing only hours and minutes. For available format * specifiers see * http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html */ time_str = g_date_time_format (datetime, _("%A %B %e, %Y - %l:%M %P")); } mx_button_set_label (MX_BUTTON (priv->datetime), time_str); g_date_time_unref (datetime); g_free (time_str); }
/* Whether we compress the weekend in the week/month views. */ gboolean calendar_config_get_compress_weekend (void) { calendar_config_init (); return gconf_client_get_bool (config, CALENDAR_CONFIG_COMPRESS_WEEKEND, NULL); }