//! //! @brief Returns an boolean from the preference backend //! @param preferences The LwPreferences to fetch the GSettings object matching the schema //! @param schema The key to use to look up the pref //! @param key The key to use to look up the pref //! gboolean lw_preferences_get_boolean_by_schema (LwPreferences* preferences, const char* schema, const char *key) { GSettings* settings; gboolean value; settings = lw_preferences_get_settings_object (preferences, schema); value = FALSE; if (settings != NULL) { value = lw_preferences_get_boolean (settings, key); } return value; }
void gw_application_sync_spellcheck_cb (GSettings *settings, gchar *key, gpointer data) { //Declarations GwApplication *application; gboolean state; GAction *action; //Initializations application = GW_APPLICATION (data); state = lw_preferences_get_boolean (settings, key); action = g_action_map_lookup_action (G_ACTION_MAP (application), "toggle-spellcheck"); if (action != NULL) g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (state)); }
G_MODULE_EXPORT void gw_settingswindow_sync_spellcheck_cb (GSettings *settings, gchar *KEY, gpointer data) { //Declarations GwSettingsWindow *window; GwSettingsWindowPrivate *priv; GtkWidget *toplevel; GtkToggleButton *togglebutton; gboolean request; //Initializations window = GW_SETTINGSWINDOW (data); g_return_if_fail (window != NULL); priv = window->priv; toplevel = gw_window_get_toplevel (GW_WINDOW (window)); togglebutton = GTK_TOGGLE_BUTTON (priv->spellcheck_checkbutton); request = lw_preferences_get_boolean (settings, KEY); G_GNUC_EXTENSION g_signal_handlers_block_by_func (togglebutton, gw_settingswindow_spellcheck_toggled_cb, toplevel); gtk_toggle_button_set_active (togglebutton, request); G_GNUC_EXTENSION g_signal_handlers_unblock_by_func (togglebutton, gw_settingswindow_spellcheck_toggled_cb, toplevel); }