From c118d9e0fa58fbe3ed1692d7367d96afc8938ccd Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Tue, 22 Mar 2016 19:53:55 +0100 Subject: [PATCH] up to 0.2.99.2 - mate screensaver plugin now included upstream - rel 1 --- synapse-mate.patch | 158 +-------------------------------------------- synapse.spec | 8 +-- 2 files changed, 6 insertions(+), 160 deletions(-) diff --git a/synapse-mate.patch b/synapse-mate.patch index 46f4eda..dd583e8 100644 --- a/synapse-mate.patch +++ b/synapse-mate.patch @@ -213,164 +213,10 @@ diff -urN synapse-0.2.10.orig/src/ui/synapse-main.vala synapse-0.2.10/src/ui/syn --- synapse-0.2.10.orig/src/ui/synapse-main.vala 2013-08-18 18:33:35.710536590 +0200 +++ synapse-0.2.10/src/ui/synapse-main.vala 2013-08-18 18:33:44.427203171 +0200 @@ -165,6 +165,7 @@ - typeof (DesktopFilePlugin), typeof (HybridSearchPlugin), + typeof (GnomeBookmarksPlugin), typeof (GnomeSessionPlugin), + typeof (MateSessionPlugin), - typeof (GnomeScreenSaverPlugin), + typeof (ScreenSaverPlugin), typeof (SystemManagementPlugin), typeof (CommandPlugin), -diff -urN synapse-0.2.99.orig/src/plugins/Makefile.am synapse-0.2.99/src/plugins/Makefile.am ---- synapse-0.2.99.orig/src/plugins/Makefile.am 2014-12-02 21:09:40.877899345 +0100 -+++ synapse-0.2.99/src/plugins/Makefile.am 2014-12-02 21:13:38.577901026 +0100 -@@ -44,6 +44,7 @@ - gnome-bookmarks-plugin.vala \ - gnome-session-plugin.vala \ - gnome-screensaver-plugin.vala \ -+ mate-screensaver-plugin.vala \ - hello-world-plugin.vala \ - hybrid-search-plugin.vala \ - launchpad-plugin.vala \ -diff -urN synapse-0.2.99.orig/src/plugins/mate-screensaver-plugin.vala synapse-0.2.99/src/plugins/mate-screensaver-plugin.vala ---- synapse-0.2.99.orig/src/plugins/mate-screensaver-plugin.vala 1970-01-01 01:00:00.000000000 +0100 -+++ synapse-0.2.99/src/plugins/mate-screensaver-plugin.vala 2014-12-02 21:12:56.697900730 +0100 -@@ -0,0 +1,128 @@ -+/* -+ * Copyright (C) 2010 Igor S. Mandrigin -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Based on plugins code by Michal Hruby -+ * -+ */ -+ -+namespace Synapse -+{ -+ [DBus (name = "org.mate.ScreenSaver")] -+ public interface MateScreenSaver : Object -+ { -+ public const string UNIQUE_NAME = "org.mate.ScreenSaver"; -+ public const string OBJECT_PATH = "/org/mate/ScreenSaver"; -+ -+ public abstract async void lock () throws IOError; -+ } -+ -+ public class MateScreenSaverPlugin : Object, Activatable, ItemProvider -+ { -+ public bool enabled { get; set; default = true; } -+ -+ public void activate () -+ { -+ -+ } -+ -+ public void deactivate () -+ { -+ -+ } -+ -+ private class LockScreenAction : ActionMatch -+ { -+ public LockScreenAction () -+ { -+ Object (title: _("Lock Screen"), -+ description: _("Locks screen and starts screensaver."), -+ icon_name: "system-lock-screen", has_thumbnail: false); -+ } -+ -+ public override void do_action () -+ { -+ MateScreenSaverPlugin.lock_screen (); -+ } -+ } -+ -+ public static void lock_screen () -+ { -+ try { -+ MateScreenSaver dbus_interface = Bus.get_proxy_sync (BusType.SESSION, -+ MateScreenSaver.UNIQUE_NAME, -+ MateScreenSaver.OBJECT_PATH); -+ // we need the async variant cause Screensaver doesn't send the reply -+ dbus_interface.lock.begin (); -+ } catch (IOError err) { -+ warning ("%s", err.message); -+ } -+ } -+ -+ static void register_plugin () -+ { -+ PluginRegistry.get_default ().register_plugin ( -+ typeof (MateScreenSaverPlugin), -+ "Mate screensaver plugin", -+ _("Lock screen of your computer."), -+ "system-lock-screen", -+ register_plugin, -+ DBusService.get_default ().name_is_activatable (MateScreenSaver.UNIQUE_NAME), -+ _("Mate Screen Saver wasn't found") -+ ); -+ } -+ -+ static construct -+ { -+ register_plugin (); -+ } -+ -+ private Gee.List actions; -+ -+ construct -+ { -+ actions = new Gee.LinkedList (); -+ actions.add (new LockScreenAction ()); -+ } -+ -+ public async ResultSet? search (Query q) throws SearchError -+ { -+ // we only search for actions -+ if (!(QueryFlags.ACTIONS in q.query_type)) return null; -+ -+ var result = new ResultSet (); -+ -+ var matchers = Query.get_matchers_for_query (q.query_string, 0, -+ RegexCompileFlags.OPTIMIZE | RegexCompileFlags.CASELESS); -+ -+ foreach (var action in actions) -+ { -+ foreach (var matcher in matchers) -+ { -+ if (matcher.key.match (action.title)) -+ { -+ result.add (action, matcher.value - MatchScore.INCREMENT_SMALL); -+ break; -+ } -+ } -+ } -+ -+ q.check_cancellable (); -+ -+ return result; -+ } -+ } -+} -diff -urN synapse-0.2.99.orig/src/ui/synapse-main.vala synapse-0.2.99/src/ui/synapse-main.vala ---- synapse-0.2.99.orig/src/ui/synapse-main.vala 2014-12-02 21:09:40.881232678 +0100 -+++ synapse-0.2.99/src/ui/synapse-main.vala 2014-12-02 21:13:26.064567604 +0100 -@@ -166,6 +166,7 @@ - typeof (GnomeSessionPlugin), - typeof (MateSessionPlugin), - typeof (GnomeScreenSaverPlugin), -+ typeof (MateScreenSaverPlugin), - typeof (SystemManagementPlugin), - typeof (CommandPlugin), - typeof (RhythmboxActions), diff --git a/synapse.spec b/synapse.spec index c3f9c87..defa3a8 100644 --- a/synapse.spec +++ b/synapse.spec @@ -1,11 +1,11 @@ Summary: Application launcher Name: synapse -Version: 0.2.99.1 -Release: 0.1 +Version: 0.2.99.2 +Release: 1 License: GPL v3+ Group: X11/Applications Source0: https://launchpad.net/synapse-project/0.3/%{version}/+download/%{name}-%{version}.tar.xz -# Source0-md5: 670ad81d3195cc29dc5bbc8726368776 +# Source0-md5: 0d5559793377cee3b292db95f7ebcc4c Patch0: %{name}-mate.patch URL: http://synapse.zeitgeist-project.com/ BuildRequires: autoconf >= 2.65 @@ -29,7 +29,7 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description Synapse is a semantic launcher written in Vala that you can use to start applications as well as find and access relevant documents and -files by making use of the Zeitgeist engine. +files by making use of the Zeitgeist engine. %prep %setup -q -- 2.43.0