Example #1
0
void
gam_toggle_set_visible (GamToggle *gam_toggle, gboolean visible)
{
    GamTogglePrivate *priv;
    gchar *key;

    g_return_if_fail (GAM_IS_TOGGLE (gam_toggle));

    priv = GAM_TOGGLE_GET_PRIVATE (gam_toggle);

    key = g_strdup_printf ("/apps/gnome-alsamixer/display_toggles/%s-%s",
                           gam_mixer_get_config_name (GAM_MIXER (priv->mixer)),
                           gam_toggle_get_config_name (gam_toggle));

    gconf_client_set_bool (gam_app_get_gconf_client (GAM_APP (priv->app)),
                           key,
                           visible,
                           NULL);

    gconf_client_suggest_sync (gam_app_get_gconf_client (GAM_APP (priv->app)), NULL);

    if (visible)
        gtk_widget_show (GTK_WIDGET (gam_toggle));
    else
        gtk_widget_hide (GTK_WIDGET (gam_toggle));
}
Example #2
0
void
gam_app_set_slider_toggle_style (GamApp *gam_app, gint style)
{
    const gchar *key = "/apps/gnome-alsamixer/geometry/mixer_slider_toggle_style";
    
    g_return_if_fail (GAM_IS_APP (gam_app));

    gconf_client_set_bool (gam_app_get_gconf_client (gam_app),
                           key,
                           style,
                           NULL);

    gconf_client_suggest_sync (gam_app_get_gconf_client (gam_app), NULL);
}
Example #3
0
gint
gam_app_get_slider_toggle_style (GamApp *gam_app)
{
    const gchar *key = "/apps/gnome-alsamixer/geometry/mixer_slider_toggle_style";
    gint style;

    g_return_if_fail (GAM_IS_APP (gam_app));

    style = gconf_client_get_bool (gam_app_get_gconf_client (gam_app),
                                      key,
                                      NULL);

    return style;
}
Example #4
0
void
gam_toggle_set_display_name (GamToggle *gam_toggle, const gchar *name)
{
    GamTogglePrivate *priv;
    gchar *key;

    g_return_if_fail (GAM_IS_TOGGLE (gam_toggle));

    priv = GAM_TOGGLE_GET_PRIVATE (gam_toggle);

    key = g_strdup_printf ("/apps/gnome-alsamixer/toggle_display_names/%s-%s",
                           gam_mixer_get_config_name (GAM_MIXER (priv->mixer)),
                           gam_toggle_get_config_name (gam_toggle));

    gconf_client_set_string (gam_app_get_gconf_client (GAM_APP (priv->app)),
                             key,
                             name,
                             NULL);

    gconf_client_suggest_sync (gam_app_get_gconf_client (GAM_APP (priv->app)), NULL);

    gtk_button_set_label (GTK_BUTTON (gam_toggle), name);
}
Example #5
0
gboolean
gam_toggle_get_visible (GamToggle *gam_toggle)
{
    GamTogglePrivate *priv;
    gchar *key;
    gboolean visible = TRUE;

    g_return_val_if_fail (GAM_IS_TOGGLE (gam_toggle), TRUE);

    priv = GAM_TOGGLE_GET_PRIVATE (gam_toggle);

    key = g_strdup_printf ("/apps/gnome-alsamixer/display_toggles/%s-%s",
                           gam_mixer_get_config_name (GAM_MIXER (priv->mixer)),
                           gam_toggle_get_config_name (gam_toggle));

    if (gconf_client_dir_exists (gam_app_get_gconf_client (GAM_APP (priv->app)), key, NULL))
        visible = gconf_client_get_bool (gam_app_get_gconf_client (GAM_APP (priv->app)),
                                         key,
                                         NULL);

    g_free (key);

    return visible;
}
Example #6
0
gchar *
gam_toggle_get_display_name (GamToggle *gam_toggle)
{
    GamTogglePrivate *priv;
    gchar *key, *name;

    g_return_val_if_fail (GAM_IS_TOGGLE (gam_toggle), NULL);

    priv = GAM_TOGGLE_GET_PRIVATE (gam_toggle);

    key = g_strdup_printf ("/apps/gnome-alsamixer/toggle_display_names/%s-%s",
                           gam_mixer_get_config_name (GAM_MIXER (priv->mixer)),
                           gam_toggle_get_config_name (gam_toggle));

    name = gconf_client_get_string (gam_app_get_gconf_client (GAM_APP (priv->app)),
                                    key,
                                    NULL);

    g_free (key);

    return name == NULL ? g_strdup (gam_toggle_get_name (gam_toggle)) : name;
}