Beispiel #1
0
static void
gtr_dict_panel_set_source_name (GtrDictPanel * panel,
                                const gchar * source_name)
{
  GtrDictPanelPrivate *priv = panel->priv;
  GdictContext *context;

  if (priv->source_name && source_name &&
      strcmp (priv->source_name, source_name) == 0)
    return;

  g_free (priv->source_name);

  if (source_name)
    priv->source_name = g_strdup (source_name);
  else
    priv->source_name = g_settings_get_string (priv->settings,
                                               DICTIONARY_SETTINGS_SOURCE_KEY);

  context = get_context_from_loader (panel);
  gtr_dict_panel_set_context (panel, context);

  if (priv->source_chooser)
    gdict_source_chooser_set_current_source (GDICT_SOURCE_CHOOSER
                                             (priv->source_chooser),
                                             priv->source_name);
}
Beispiel #2
0
static void
gdict_applet_set_source_name (GdictApplet *applet,
			      const gchar *source_name)
{
  GdictAppletPrivate *priv = applet->priv;
  GdictContext *context;

  g_free (priv->source_name);

  if (source_name != NULL && *source_name != '\0')
    priv->source_name = g_strdup (source_name);
  else
    priv->source_name = g_settings_get_string (priv->settings,
							     GDICT_SETTINGS_SOURCE_KEY);
  
  context = get_context_from_loader (applet);
  gdict_applet_set_context (applet, context);
}
Beispiel #3
0
static void
gedit_dict_panel_set_source_name (GeditDictPanel *panel,
					const gchar *source_name)
{
	GeditDictPanelPrivate *priv = panel->priv;
	GdictContext *context;
	
	g_free (priv->source_name);
	
	if (source_name)
		priv->source_name = g_strdup (source_name);
	else
		priv->source_name = gdict_gconf_get_string_with_default (priv->gconf_client,
									 GDICT_GCONF_SOURCE_KEY,
									 GDICT_DEFAULT_SOURCE_NAME);

	context = get_context_from_loader (panel);
	gedit_dict_panel_set_context (panel, context);
}