summaryrefslogtreecommitdiff
path: root/src/gpm-prefs-core.c
diff options
context:
space:
mode:
authorMatt Spaulding <[email protected]>2016-07-25 17:52:31 -0700
committermonsta <[email protected]>2016-08-01 15:52:52 +0300
commit69be34ae5e905b2db1f44f84259133d8914f675f (patch)
treef7eb81f0899b6639a7f99353c078273798bcfdd2 /src/gpm-prefs-core.c
parent1d4c6cef6f3caf9e091625ce674c31019478dd22 (diff)
downloadmate-power-manager-69be34ae5e905b2db1f44f84259133d8914f675f.tar.bz2
mate-power-manager-69be34ae5e905b2db1f44f84259133d8914f675f.tar.xz
Port from libunique to GtkApplication
Diffstat (limited to 'src/gpm-prefs-core.c')
-rw-r--r--src/gpm-prefs-core.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 4bef861..2a2459f 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -110,10 +110,17 @@ gpm_prefs_class_init (GpmPrefsClass *klass)
* Activates (shows) the window.
**/
void
+#if GTK_CHECK_VERSION (3, 0, 0)
+gpm_prefs_activate_window (GtkApplication *app, GpmPrefs *prefs)
+#else
gpm_prefs_activate_window (GpmPrefs *prefs)
+#endif
{
GtkWindow *window;
window = GTK_WINDOW (gtk_builder_get_object (prefs->priv->builder, "dialog_preferences"));
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_application_add_window (GTK_APPLICATION (app), window);
+#endif
gtk_window_present (window);
}
@@ -865,7 +872,9 @@ gpm_prefs_init (GpmPrefs *prefs)
prefs_setup_general (prefs);
prefs_setup_notification (prefs);
+#if !GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_show (main_window);
+#endif
}
/**
@@ -901,3 +910,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"));
+}