aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-25 22:59:59 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-25 22:59:59 +0200
commitc00d3d13b07ed6fa60ac975c2e633e2e5a3cbee3 (patch)
tree2983d9c84d009a388b2bac49a12cddcc4622c890
parent80a129dd5fcbaf0e8086a3c57f3ee0667c9ae0fc (diff)
downloadayatana-indicator-session-c00d3d13b07ed6fa60ac975c2e633e2e5a3cbee3.tar.gz
ayatana-indicator-session-c00d3d13b07ed6fa60ac975c2e633e2e5a3cbee3.tar.bz2
ayatana-indicator-session-c00d3d13b07ed6fa60ac975c2e633e2e5a3cbee3.zip
Reintroduce optional url-dispatcher support.
-rw-r--r--CMakeLists.txt7
-rw-r--r--debian/control1
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/backend-dbus/actions.c19
4 files changed, 32 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ec27033..7861e01 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,13 @@ pkg_check_modules (SERVICE REQUIRED
gio-unix-2.0>=2.36)
include_directories (${SERVICE_INCLUDE_DIRS})
+set(URL_DISPATCHER_1_REQUIRED_VERSION 1)
+pkg_check_modules(
+ URLDISPATCHER
+ url-dispatcher-1>=${URL_DISPATCHER_1_REQUIRED_VERSION}
+)
+include_directories(${URLDISPATCHER_INCLUDE_DIRS})
+
set (CC_WARNING_ARGS " -Wall -pedantic -Wextra -Wno-missing-field-initializers")
set (ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION})
diff --git a/debian/control b/debian/control
index 32005f8..af379c2 100644
--- a/debian/control
+++ b/debian/control
@@ -9,6 +9,7 @@ Build-Depends: cmake,
intltool,
libglib2.0-dev (>= 2.36),
libgtest-dev,
+ liburl-dispatcher1-dev | hello,
python,
systemd [linux-any],
Standards-Version: 4.1.1
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2a3acfd..7ee1692 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,13 +16,17 @@ add_library (libayatanaindicatorsessionservice STATIC
include_directories(${SERVICE_INCLUDE_DIRS})
link_directories(${SERVICE_LIBRARY_DIRS})
+if(URLDISPATCHER_FOUND)
+ add_definitions( -DHAS_URLDISPATCHER )
+endif()
+
set (SERVICE_EXEC "ayatana-indicator-session-service")
set_property (SOURCE main.c
APPEND PROPERTY COMPILE_DEFINITIONS
GETTEXT_PACKAGE="${GETTEXT_PACKAGE}"
LOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
add_executable (${SERVICE_EXEC} main.c)
-target_link_libraries (${SERVICE_EXEC} libayatanaindicatorsessionservice backenddbus ${SERVICE_LIBRARIES} ${GCOV_LIBS})
+target_link_libraries (${SERVICE_EXEC} libayatanaindicatorsessionservice backenddbus ${SERVICE_LIBRARIES} ${GCOV_LIBS} ${URLDISPATCHER_LIBRARIES})
install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR})
# common properties
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c
index e3991fb..db7d3d5 100644
--- a/src/backend-dbus/actions.c
+++ b/src/backend-dbus/actions.c
@@ -20,6 +20,10 @@
#include <glib.h>
#include <glib/gi18n.h>
+#ifdef HAS_URLDISPATCHER
+# include <url-dispatcher.h>
+#endif
+
#include "dbus-end-session-dialog.h"
#include "dbus-login1-manager.h"
#include "dbus-webcredentials.h"
@@ -1060,6 +1064,11 @@ have_gnome_control_center (void)
static void
my_settings (IndicatorSessionActions * self G_GNUC_UNUSED)
{
+#ifdef HAS_URLDISPATCHER
+ if (g_getenv ("MIR_SOCKET") != NULL)
+ url_dispatch_send("settings:///system", NULL, NULL);
+ else
+#endif
if (have_unity_control_center ())
run_outside_app ("unity-control-center");
else if (have_gnome_control_center())
@@ -1077,6 +1086,11 @@ my_settings (IndicatorSessionActions * self G_GNUC_UNUSED)
static void
my_online_accounts (IndicatorSessionActions * self G_GNUC_UNUSED)
{
+#ifdef HAS_URLDISPATCHER
+ if (g_getenv ("MIR_SOCKET") != NULL)
+ url_dispatch_send("settings:///system/online-accounts", NULL, NULL);
+ else
+#endif
if (have_unity_control_center ())
run_outside_app ("unity-control-center credentials");
else if (have_gnome_control_center())
@@ -1090,6 +1104,11 @@ my_online_accounts (IndicatorSessionActions * self G_GNUC_UNUSED)
static void
my_about (IndicatorSessionActions * self G_GNUC_UNUSED)
{
+#ifdef HAS_URLDISPATCHER
+ if (g_getenv ("MIR_SOCKET") != NULL)
+ url_dispatch_send("settings:///system/about", NULL, NULL);
+ else
+#endif
if (have_unity_control_center ())
run_outside_app ("unity-control-center info");
else if (have_gnome_control_center())