From 47f3f266bf86e151baa5968e031205ca7fd99acc Mon Sep 17 00:00:00 2001 From: Jim Nelson Date: Mon, 3 Sep 2012 16:05:29 -0700 Subject: [PATCH] Add "Geary Mail" to messaging menu: Closes #5733 --- CMakeLists.txt | 4 ++++ desktop/CMakeLists.txt | 10 ++++------ desktop/geary | 1 + desktop/geary.desktop | 10 +++++----- src/CMakeLists.txt | 4 ---- src/client/geary-application.vala | 6 +++--- src/client/notification/libindicate.vala | 15 +++++++-------- 7 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 desktop/geary diff --git a/CMakeLists.txt b/CMakeLists.txt index 5dda9a96..44067938 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,10 @@ if (DESKTOP_UPDATE) message(STATUS "Desktop database will be updated") endif () +find_package(PkgConfig) +pkg_check_modules(LIBINDICATE QUIET indicate-0.7>=0.6.1) +pkg_check_modules(LIBUNITY QUIET unity>=5.12.0) + # intl include(Gettext) if (XGETTEXT_FOUND) diff --git a/desktop/CMakeLists.txt b/desktop/CMakeLists.txt index 9bb4376c..ba72af3c 100644 --- a/desktop/CMakeLists.txt +++ b/desktop/CMakeLists.txt @@ -1,12 +1,10 @@ # # Install geary.desktop # -install( - FILES - geary.desktop - DESTINATION - share/applications -) +install(FILES geary.desktop DESTINATION /usr/share/applications) +if (LIBINDICATE_FOUND) + install(FILES geary DESTINATION /usr/share/indicators/messages/applications) +endif () # Optional: run update-desktop-database at install time. # (This has to happen after the geary.desktop file is installed.) diff --git a/desktop/geary b/desktop/geary new file mode 100644 index 00000000..9cccfc6f --- /dev/null +++ b/desktop/geary @@ -0,0 +1 @@ +/usr/share/applications/geary.desktop diff --git a/desktop/geary.desktop b/desktop/geary.desktop index 5bf15210..9a5aab3e 100644 --- a/desktop/geary.desktop +++ b/desktop/geary.desktop @@ -1,13 +1,13 @@ -# See src/client/geary-application.vala for corresponding strings in the application [Desktop Entry] -Icon=geary -Name=Geary -GenericName=Email Client +Encoding=UTF-8 +Name=Geary Mail +GenericName=Mail Client Comment=Send and receive email +Icon=geary TryExec=geary Exec=geary %U Type=Application Terminal=false Categories=GNOME;GTK;Network;Office;Email; MimeType=x-scheme-handler/mailto; - +StartupNotify=true diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6a8fcf37..7a6765a5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -262,9 +262,6 @@ ensure_vala_version("0.17.4" MINIMUM) include(ValaPrecompile) # Packages -find_package(PkgConfig) - -pkg_check_modules(LIBINDICATE QUIET indicate-0.7>=0.6.1) if (LIBINDICATE_FOUND) message(STATUS "Unity messaging menu support: ON") set(EXTRA_CLIENT_PKG_CONFIG @@ -286,7 +283,6 @@ else () message(STATUS "Unity messaging menu support: OFF") endif () -pkg_check_modules(LIBUNITY QUIET unity>=5.12.0) if (LIBUNITY_FOUND) message(STATUS "Unity launcher support: ON") set(EXTRA_CLIENT_PKG_CONFIG diff --git a/src/client/geary-application.vala b/src/client/geary-application.vala index 60c8bf02..a4dffea3 100644 --- a/src/client/geary-application.vala +++ b/src/client/geary-application.vala @@ -21,8 +21,8 @@ public class GearyApplication : YorbaApplication { // These strings must match corresponding strings in desktop/geary.desktop *exactly* and be // internationalizable - public const string DESKTOP_NAME = _("Geary"); - public const string DESKTOP_GENERIC_NAME = _("Email Client"); + public const string DESKTOP_NAME = _("Geary Mail"); + public const string DESKTOP_GENERIC_NAME = _("Mail Client"); public const string DESKTOP_COMMENT = _("Send and receive email"); public const string VERSION = _VERSION; @@ -511,7 +511,7 @@ along with Geary; if not, write to the Free Software Foundation, Inc., public File? get_desktop_file() { File desktop_file = is_installed() - ? File.new_for_path(INSTALL_PREFIX).get_child("share/applications/geary.desktop") + ? File.new_for_path("/usr/share/applications/geary.desktop") : File.new_for_path(SOURCE_ROOT_DIR).get_child("desktop/geary.desktop"); return desktop_file.query_exists() ? desktop_file : null; diff --git a/src/client/notification/libindicate.vala b/src/client/notification/libindicate.vala index dae2b82c..ab909636 100644 --- a/src/client/notification/libindicate.vala +++ b/src/client/notification/libindicate.vala @@ -6,18 +6,13 @@ public class Libindicate : NewMessagesIndicator { #if HAVE_LIBINDICATE - private Indicate.Server indicator; - private Indicate.Indicator compose; - private Indicate.Indicator inbox; + private Indicate.Server? indicator = null; + private Indicate.Indicator? compose = null; + private Indicate.Indicator? inbox = null; public Libindicate(NewMessagesMonitor monitor) { base (monitor); - debug("Using libindicate for messaging menu support"); - - indicator = Indicate.Server.ref_default(); - indicator.set_type("message.email"); - // Find the desktop file this app instance is using (running from build dir vs. install dir) File? desktop_file = GearyApplication.instance.get_desktop_file(); if (desktop_file == null) { @@ -26,6 +21,10 @@ public class Libindicate : NewMessagesIndicator { return; } + debug("Using libindicate for messaging menu support w/ .desktop file %s", desktop_file.get_path()); + + indicator = Indicate.Server.ref_default(); + indicator.set_type("message.email"); indicator.set_desktop_file(desktop_file.get_path()); indicator.server_display.connect(on_display_server);