Exemple #1
0
static void
gedit_dict_panel_set_word (GeditDictPanel *panel,
				 const gchar *word,
				 const gchar *database)
{
	GeditDictPanelPrivate *priv = panel->priv;
	gchar *title;
	
	g_free (priv->word);
	priv->word = NULL;
	
	if (word && word[0] != '\0')
		priv->word = g_strdup (word);
	else
		return;
	
	if (!database || database[0] == '\0')
		database = priv->database;
	
	if (priv->defbox)
	{
		gdict_defbox_set_database (GDICT_DEFBOX (priv->defbox), database);
		gdict_defbox_lookup (GDICT_DEFBOX (priv->defbox), word);
	}
}
static void
gtr_dict_panel_set_database (GtrDictPanel * panel, const gchar * database)
{
  GtrDictPanelPrivate *priv = panel->priv;

  g_free (priv->database);

  if (database)
    priv->database = g_strdup (database);
  else
    priv->database = g_settings_get_string (priv->settings,
                                            DICTIONARY_SETTINGS_DATABASE_KEY);

  if (priv->defbox)
    gdict_defbox_set_database (GDICT_DEFBOX (priv->defbox), priv->database);
}
Exemple #3
0
static void
gdict_applet_set_database (GdictApplet *applet,
			   const gchar *database)
{
  GdictAppletPrivate *priv = applet->priv;
  
  g_free (priv->database);

  if (database != NULL && *database != '\0')
    priv->database = g_strdup (database);
  else
    priv->database = g_settings_get_string (priv->settings,
							  GDICT_SETTINGS_DATABASE_KEY);
  if (priv->defbox)
    gdict_defbox_set_database (GDICT_DEFBOX (priv->defbox),
			       priv->database);
}
Exemple #4
0
static void
gedit_dict_panel_set_database (GeditDictPanel *panel,
				     const gchar *database)
{
	GeditDictPanelPrivate *priv = panel->priv;
  
	g_free (priv->database);

	if (database)
		priv->database = g_strdup (database);
	else
		priv->database = gdict_gconf_get_string_with_default (priv->gconf_client,
								      GDICT_GCONF_DATABASE_KEY,
								      GDICT_DEFAULT_DATABASE);
	if (priv->defbox)
		gdict_defbox_set_database (GDICT_DEFBOX (priv->defbox),
					   priv->database);
}