Esempio n. 1
0
/**
 * gtk_app_chooser_widget_get_default_text:
 * @self: a #GtkAppChooserWidget
 *
 * Returns the text that is shown if there are not applications
 * that can handle the content type.
 *
 * Returns: the value of #GtkAppChooserWidget:default-text
 */
const gchar *
gtk_app_chooser_widget_get_default_text (GtkAppChooserWidget *self)
{
  g_return_val_if_fail (GTK_IS_APP_CHOOSER_WIDGET (self), NULL);

  return self->priv->default_text;
}
Esempio n. 2
0
/**
 * gtk_app_chooser_widget_get_show_all:
 * @self: a #GtkAppChooserWidget
 *
 * Returns the current value of the #GtkAppChooserWidget:show-all
 * property.
 *
 * Returns: the value of #GtkAppChooserWidget:show-all
 */
gboolean
gtk_app_chooser_widget_get_show_all (GtkAppChooserWidget *self)
{
  g_return_val_if_fail (GTK_IS_APP_CHOOSER_WIDGET (self), FALSE);

  return self->priv->show_all;
}
Esempio n. 3
0
static void
test_app_chooser_widget_basic (void)
{
  GtkWidget *widget;

  widget = gtk_app_chooser_widget_new (NULL);
  g_assert (GTK_IS_APP_CHOOSER_WIDGET (widget));
  gtk_widget_destroy (widget);
}
Esempio n. 4
0
/**
 * gtk_app_chooser_widget_set_show_all:
 * @self: a #GtkAppChooserWidget
 * @setting: the new value for #GtkAppChooserWidget:show-all
 *
 * Sets whether the app chooser should show all applications
 * in a flat list.
 */
void
gtk_app_chooser_widget_set_show_all (GtkAppChooserWidget *self,
                                     gboolean             setting)
{
  g_return_if_fail (GTK_IS_APP_CHOOSER_WIDGET (self));

  if (self->priv->show_all != setting)
    {
      self->priv->show_all = setting;

      g_object_notify (G_OBJECT (self), "show-all");

      gtk_app_chooser_refresh (GTK_APP_CHOOSER (self));
    }
}
Esempio n. 5
0
/**
 * gtk_app_chooser_widget_set_default_text:
 * @self: a #GtkAppChooserWidget
 * @text: the new value for #GtkAppChooserWidget:default-text
 *
 * Sets the text that is shown if there are not applications
 * that can handle the content type.
 */
void
gtk_app_chooser_widget_set_default_text (GtkAppChooserWidget *self,
                                         const gchar         *text)
{
  g_return_if_fail (GTK_IS_APP_CHOOSER_WIDGET (self));

  if (g_strcmp0 (text, self->priv->default_text) != 0)
    {
      g_free (self->priv->default_text);
      self->priv->default_text = g_strdup (text);

      g_object_notify (G_OBJECT (self), "default-text");

      gtk_app_chooser_refresh (GTK_APP_CHOOSER (self));
    }
}