summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2015-04-02 11:26:24 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2015-04-02 11:26:24 +0900
commit35d035bfc48e20eecb3b3b3b14712d73c5fc027b (patch)
tree4fd8da0ce52c12e467f379c4f571252f56edd2da
parentcc88075ddae038f90039d58147bb3c9d7eb08364 (diff)
downloadibus-35d035bfc48e20eecb3b3b3b14712d73c5fc027b.tar.gz
ibus-ui-gtk3: Enable absolute path of engine icon in KDE5
plasma-workspace 5.2 supports the icon full path. Now the build checks if qtbase-devel is 5.4 or later since there is no way to check the version of plasma-workspace. BUG=https://github.com/ibus/ibus/pull/17 TEST=ui/gtk3/ibus-ui-gtk3 Review URL: https://codereview.appspot.com/217310044
-rw-r--r--configure.ac17
-rw-r--r--ui/gtk3/Makefile.am8
-rw-r--r--ui/gtk3/panel.vala10
3 files changed, 31 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 39c9cad7..8eb6168f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,9 +270,25 @@ else
enable_wayland="no (disabled, use --enable-wayland to enable)"
fi
+enable_appindicator_engine_icon="no"
if test x"$enable_appindicator" = x"yes"; then
enable_appindicator="yes (enabled, use --disable-appindicator to disable)"
+
+ # Need qt5-qtbase-devel package
+ # There is no way to check the version of KStatusNotifierItem and
+ # check the version of qtbase here.
+ AC_MSG_CHECKING([for KDE5 appindicator engine icon])
+ PKG_CHECK_EXISTS([Qt5Gui >= 5.4],
+ enable_appindicator_engine_icon="yes"
+ )
+ AC_MSG_RESULT([$enable_appindicator_engine_icon])
+
+fi
+if test x"$enable_appindicator_engine_icon" != x"yes" ; then
+ enable_appindicator_engine_icon="no (disabled, need qtbase-devel 5.4 or later)"
fi
+AM_CONDITIONAL([ENABLE_APPINDICATOR_ENGINE_ICON],
+ [test x"$enable_appindicator_engine_icon" = x"yes"])
# GObject introspection
GOBJECT_INTROSPECTION_CHECK([0.6.8])
@@ -639,6 +655,7 @@ Build options:
Build XIM agent server $enable_xim
Build wayland support $enable_wayland
Build appindicator support $enable_appindicator
+ Build appindicator engine icon $enable_appindicator_engine_icon
Build python library $enable_python_library
Build gconf modules $enable_gconf
Build memconf modules $enable_memconf
diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
index 40cce117..2de227d6 100644
--- a/ui/gtk3/Makefile.am
+++ b/ui/gtk3/Makefile.am
@@ -98,6 +98,10 @@ if ENABLE_APPINDICATOR
AM_VALAFLAGS += --define=INDICATOR
endif
+if ENABLE_APPINDICATOR_ENGINE_ICON
+AM_VALAFLAGS += --define=INDICATOR_ENGINE_ICON
+endif
+
libexec_PROGRAMS = ibus-ui-gtk3
ibus_ui_gtk3_SOURCES = \
@@ -136,8 +140,8 @@ CLEANFILES = \
# References:
# libappindicator/src/notification-item.xml
# libappindicator/src/notification-watcher.xml
-# knotifications/src/org.kde.StatusNotifierItem.xml
-# knotifications/src/org.kde.StatusNotifierWatcher.xml
+# kdelibs/kdeui/knotifications/src/org.kde.StatusNotifierItem.xml
+# kdelibs/kdeui/knotifications/src/org.kde.StatusNotifierWatcher.xml
EXTRA_DIST = \
gtkpanel.xml.in \
notification-item.xml \
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
index 13798608..c77bd2f7 100644
--- a/ui/gtk3/panel.vala
+++ b/ui/gtk3/panel.vala
@@ -1248,9 +1248,15 @@ class Panel : IBus.PanelService {
m_status_icon.set_from_file(icon_name);
}
else if (m_icon_type == IconType.INDICATOR) {
- warning("appindicator requires an icon name in a theme " +
- "path instead of the full path: %s", icon_name);
+#if INDICATOR_ENGINE_ICON
+ m_indicator.set_icon_full(icon_name, "");
+#else
+ warning("plasma-workspace 5.2 or later is required to " +
+ "show the absolute path icon %s. Currently check " +
+ "qtbase 5.4 since there is no way to check " +
+ "the version of plasma-workspace.", icon_name);
m_indicator.set_icon_full("ibus-engine", "");
+#endif
}
} else {
string language = null;