diff options
Diffstat (limited to 'src/gpm-prefs-core.c')
-rw-r--r-- | src/gpm-prefs-core.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c index ddb1bd7..b33ff22 100644 --- a/src/gpm-prefs-core.c +++ b/src/gpm-prefs-core.c @@ -39,7 +39,7 @@ #include "gpm-tray-icon.h" #include "gpm-common.h" #include "gpm-prefs-core.h" -#include "gpm-stock-icons.h" +#include "gpm-icon-names.h" #include "gpm-brightness.h" static void gpm_prefs_finalize (GObject *object); @@ -110,10 +110,11 @@ gpm_prefs_class_init (GpmPrefsClass *klass) * Activates (shows) the window. **/ void -gpm_prefs_activate_window (GpmPrefs *prefs) +gpm_prefs_activate_window (GtkApplication *app, GpmPrefs *prefs) { GtkWindow *window; window = GTK_WINDOW (gtk_builder_get_object (prefs->priv->builder, "dialog_preferences")); + gtk_application_add_window (GTK_APPLICATION (app), window); gtk_window_present (window); } @@ -632,6 +633,7 @@ prefs_setup_general (GpmPrefs *prefs) GPM_ACTION_POLICY_SUSPEND, GPM_ACTION_POLICY_HIBERNATE, GPM_ACTION_POLICY_SHUTDOWN, + GPM_ACTION_POLICY_NOTHING, -1}; const GpmActionPolicy suspend_button_actions[] = {GPM_ACTION_POLICY_NOTHING, @@ -712,7 +714,7 @@ gpm_prefs_init (GpmPrefs *prefs) &error ); if (error == NULL && res != NULL) { - g_variant_get(res,"(s)", &r); + g_variant_get(res,"(&s)", &r); prefs->priv->can_shutdown = g_strcmp0(r,"yes")==0?TRUE:FALSE; g_variant_unref (res); } else if (error != NULL ) { @@ -728,7 +730,7 @@ gpm_prefs_init (GpmPrefs *prefs) &error ); if (error == NULL && res != NULL) { - g_variant_get(res,"(s)", &r); + g_variant_get(res,"(&s)", &r); prefs->priv->can_suspend = g_strcmp0(r,"yes")==0?TRUE:FALSE; g_variant_unref (res); } else if (error != NULL ) { @@ -744,7 +746,7 @@ gpm_prefs_init (GpmPrefs *prefs) &error ); if (error == NULL && res != NULL) { - g_variant_get(res,"(s)", &r); + g_variant_get(res,"(&s)", &r); prefs->priv->can_hibernate = g_strcmp0(r,"yes")==0?TRUE:FALSE; g_variant_unref (res); } else if (error != NULL ) { @@ -841,7 +843,7 @@ gpm_prefs_init (GpmPrefs *prefs) /* Hide window first so that the dialogue resizes itself without redrawing */ gtk_widget_hide (main_window); - gtk_window_set_default_icon_name (GPM_STOCK_APP_ICON); + gtk_window_set_default_icon_name (GPM_ICON_APP_ICON); /* Get the main window quit */ g_signal_connect (main_window, "delete_event", @@ -863,8 +865,6 @@ gpm_prefs_init (GpmPrefs *prefs) prefs_setup_ups (prefs); prefs_setup_general (prefs); prefs_setup_notification (prefs); - - gtk_widget_show (main_window); } /** @@ -884,6 +884,7 @@ gpm_prefs_finalize (GObject *object) g_object_unref (prefs->priv->settings); g_object_unref (prefs->priv->client); g_object_unref (prefs->priv->console); + g_object_unref (prefs->priv->builder); G_OBJECT_CLASS (gpm_prefs_parent_class)->finalize (object); } @@ -899,3 +900,13 @@ gpm_prefs_new (void) prefs = g_object_new (GPM_TYPE_PREFS, NULL); return GPM_PREFS (prefs); } + +/** + * gpm_window: + * Return value: Prefs window widget. + **/ +GtkWidget * +gpm_window (GpmPrefs *prefs) +{ + return GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "dialog_preferences")); +} |