summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac35
-rw-r--r--docs/Makefile.am2
-rw-r--r--polkitgtkmate/polkitlockbutton.c4
-rw-r--r--polkitgtkmate/polkitlockbutton.h8
-rw-r--r--src/Makefile.am1
-rw-r--r--src/polkitmateauthenticationdialog.c6
7 files changed, 46 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index a5ae081..718432e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,8 +1,6 @@
SUBDIRS = polkitgtkmate src po docs
EXTRA_DIST = \
- autogen.sh \
- TODO \
HACKING
clean-local :
diff --git a/configure.ac b/configure.ac
index 7ceb13a..1ab7753 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
-AC_INIT([polkit-mate],[1.6.0],[http://www.mate-desktop.org/],[polkit-mate])
+AC_INIT([polkit-mate],[1.7.0],[http://www.mate-desktop.org/],[mate-polkit])
-AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip])
+AM_INIT_AUTOMAKE([1.9 foreign dist-xz no-dist-gzip])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADERS([config.h])
@@ -121,14 +121,32 @@ MATE_MAINTAINER_MODE_DEFINES
# Check for required packages
# ***************************
-GTK_REQUIRED=2.17.1
-POLKIT_AGENT_REQUIRED=0.97
-POLKIT_GOBJECT_REQUIRED=0.97
-
-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
+AC_MSG_CHECKING([which gtk+ version to compile against])
+AC_ARG_WITH([gtk],
+ [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
+ [case "$with_gtk" in
+ 2.0|3.0) ;;
+ *) AC_MSG_ERROR([invalid gtk version specified]) ;;
+ esac],
+ [with_gtk=2.0])
+AC_MSG_RESULT([$with_gtk])
+
+case "$with_gtk" in
+ 2.0) GTK_API_VERSION=2.0
+ GTK_REQUIRED=2.17.1
+ ;;
+ 3.0) GTK_API_VERSION=3.0
+ GTK_REQUIRED=3.0.0
+ ;;
+esac
+
+PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
+POLKIT_AGENT_REQUIRED=0.97
+POLKIT_GOBJECT_REQUIRED=0.97
+
PKG_CHECK_MODULES(POLKIT_AGENT, polkit-agent-1 >= $POLKIT_AGENT_REQUIRED)
AC_SUBST(POLKIT_AGENT_CFLAGS)
AC_SUBST(POLKIT_AGENT_LIBS)
@@ -210,8 +228,9 @@ echo "
compiler: ${CC}
cflags: ${CFLAGS}
cppflags: ${CPPFLAGS}
- introspection: ${enable_introspection}
+ Gtk+ version: ${GTK_API_VERSION}
Maintainer mode: ${USE_MAINTAINER_MODE}
Building api docs: ${enable_gtk_doc}
+ GObject Introspection: ${enable_introspection}
"
diff --git a/docs/Makefile.am b/docs/Makefile.am
index c3b8217..45dd77f 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -25,7 +25,7 @@ IGNORE_HFILES= \
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
-INCLUDES = \
+AM_CPPFLAGS = \
$(POLKIT_GOBJECT_CFLAGS) \
$(GTK_CFLAGS) \
-I$(top_srcdir)/polkitgtkmate \
diff --git a/polkitgtkmate/polkitlockbutton.c b/polkitgtkmate/polkitlockbutton.c
index 079a94b..757c34c 100644
--- a/polkitgtkmate/polkitlockbutton.c
+++ b/polkitgtkmate/polkitlockbutton.c
@@ -209,7 +209,11 @@ static void on_authority_changed(PolkitAuthority* authority, gpointer user_data)
static void on_clicked(GtkButton* button, gpointer user_data);
+#if GTK_CHECK_VERSION (3, 0, 0)
+G_DEFINE_TYPE(PolkitLockButton, polkit_lock_button, GTK_TYPE_BOX);
+#else
G_DEFINE_TYPE(PolkitLockButton, polkit_lock_button, GTK_TYPE_HBOX);
+#endif
static void polkit_lock_button_finalize(GObject* object)
{
diff --git a/polkitgtkmate/polkitlockbutton.h b/polkitgtkmate/polkitlockbutton.h
index 519128b..ce3affe 100644
--- a/polkitgtkmate/polkitlockbutton.h
+++ b/polkitgtkmate/polkitlockbutton.h
@@ -57,7 +57,11 @@ typedef struct _PolkitLockButtonPrivate PolkitLockButtonPrivate;
* should be accessed using the provided API.
*/
struct _PolkitLockButton {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkBox parent;
+#else
GtkHBox parent;
+#endif
/*< private >*/
PolkitLockButtonPrivate* priv;
@@ -71,7 +75,11 @@ struct _PolkitLockButton {
* Class structure for #PolkitLockButton.
*/
struct _PolkitLockButtonClass {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkBoxClass parent_class;
+#else
GtkHBoxClass parent_class;
+#endif
/* Signals */
void (*changed)(PolkitLockButton* button);
diff --git a/src/Makefile.am b/src/Makefile.am
index 58f9507..0ee00b3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,7 +24,6 @@ polkit_mate_authentication_agent_1_CPPFLAGS = \
-DDATADIR=\""$(pkgdatadir)"\" \
-DMATELOCALEDIR=\""$(datadir)/locale"\" \
-DPOLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
- $(DISABLE_DEPRECATED) \
$(AM_CPPFLAGS)
polkit_mate_authentication_agent_1_CFLAGS = \
diff --git a/src/polkitmateauthenticationdialog.c b/src/polkitmateauthenticationdialog.c
index 3f02b19..22c8e51 100644
--- a/src/polkitmateauthenticationdialog.c
+++ b/src/polkitmateauthenticationdialog.c
@@ -536,7 +536,9 @@ polkit_mate_authentication_dialog_constructed (GObject *object)
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ #if !GTK_CHECK_VERSION(3, 0, 0)
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+ #endif
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
@@ -997,7 +999,11 @@ polkit_mate_authentication_dialog_run_until_response_for_prompt (PolkitMateAuthe
response = gtk_dialog_run (GTK_DIALOG (dialog));
+ #if GTK_CHECK_VERSION(3, 0, 0)
+ gtk_widget_hide (dialog->priv->table_alignment);
+ #else
gtk_widget_hide_all (dialog->priv->table_alignment);
+ #endif
gtk_widget_set_no_show_all (dialog->priv->table_alignment, TRUE);
dialog->priv->is_running = FALSE;