SHA256
1
0
forked from pool/polari

Accepting request 481588 from GNOME:Factory

Update to 3.24.0 (forwarded request 481573 from dimstar)

OBS-URL: https://build.opensuse.org/request/show/481588
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/polari?expand=0&rev=22
This commit is contained in:
Dominique Leuenberger 2017-03-22 22:09:21 +00:00 committed by Git OBS Bridge
commit 71114a0695
5 changed files with 72 additions and 198 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c7b4c382a9bae8094a576dbd9d022de0a90e186a36529a2eab914fe9d9b0045f
size 617316

3
polari-3.24.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4aa83b309b9d16c4a9c1fff7e374fc745eaaeac40def7daaeebf54e8e01b19ae
size 771144

View File

@ -1,186 +0,0 @@
a5244483d205d69774c7adbb4f620ae49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Fri, 24 Jun 2016 13:15:03 +0200
Subject: app: Add option to run in background
Like other messaging applications, IRC clients don't require constant
attention from the user, but can sit in the background and notify the
user when an important message was received. We currently don't have
any explicit support for this mode, so users need to ignore the window
the best they can (by moving it to another workspace or keeping it at
the bottom of the window stack). This is obviously not great, but neither
are status icons that have traditionally been used by applications to
offer this mode.
Instead, implement a pattern for background applications that was agreed
upon with the GNOME design team:
When set up to run in the background, the application:
- sets itself up to start in the background on login
- keeps running after the last window has been closed
- can be stopped via the 'quit' action in the application menu
https://bugzilla.gnome.org/show_bug.cgi?id=770750
---
data/Makefile.am | 4 +++
data/org.gnome.Polari.Autostart.desktop | 4 +++
data/org.gnome.Polari.gschema.xml | 5 ++++
data/resources/menus.ui | 6 +++++
src/application.js | 48 +++++++++++++++++++++++++++++++--
5 files changed, 65 insertions(+), 2 deletions(-)
create mode 100644 data/org.gnome.Polari.Autostart.desktop
diff --git a/data/Makefile.am b/data/Makefile.am
index 3f9866c..4756d21 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -4,6 +4,9 @@ desktopdir = $(datadir)/applications
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
desktop_in_files = $(APP_ID).desktop.in
+autostartdir = $(pkgdatadir)
+autostart_DATA = $(APP_ID).Autostart.desktop
+
%.desktop: %.desktop.in Makefile
$(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
@@ -25,6 +28,7 @@ clientdir=$(datadir)/telepathy/clients
dist_client_DATA = Polari.client
EXTRA_DIST = \
+ $(autostart_DATA) \
$(desktop_in_files) \
$(service_in_files) \
$(APP_ID).data.gresource.xml \
diff --git a/data/org.gnome.Polari.Autostart.desktop b/data/org.gnome.Polari.Autostart.desktop
new file mode 100644
index 0000000..d0cc77d
--- /dev/null
+++ b/data/org.gnome.Polari.Autostart.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Type=Application
+Exec=gapplication action org.gnome.Polari start-client
+NoDisplay=True
diff --git a/data/org.gnome.Polari.gschema.xml b/data/org.gnome.Polari.gschema.xml
index 839983c..d6a16b9 100644
--- a/data/org.gnome.Polari.gschema.xml
+++ b/data/org.gnome.Polari.gschema.xml
@@ -6,6 +6,11 @@
<summary>Saved channel list</summary>
<description>List of channels to restore on startup</description>
</key>
+ <key type="b" name="run-in-background">
+ <default>false</default>
+ <summary>Run in Background</summary>
+ <description>Keep running in background when closed.</description>
+ </key>
<key type="ai" name="window-size">
<default>[800,500]</default>
<summary>Window size</summary>
diff --git a/data/resources/menus.ui b/data/resources/menus.ui
index 22f20e5..eff8d78 100644
--- a/data/resources/menus.ui
+++ b/data/resources/menus.ui
@@ -2,6 +2,12 @@
<menu id="app-menu">
<section>
<item>
+ <attribute name="action">app.run-in-background</attribute>
+ <attribute name="label" translatable="yes">Run in Background</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
<attribute name="action">win.show-help-overlay</attribute>
<attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
</item>
diff --git a/src/application.js b/src/application.js
index 6e2f40d..7818776 100644
--- a/src/application.js
+++ b/src/application.js
@@ -21,6 +21,9 @@ const MAX_RETRIES = 3;
const IRC_SCHEMA_REGEX = /^(irc?:\/\/)([\da-z\.-]+):?(\d+)?\/(?:%23)?([\w\.\+-]+)/i;
+const AUTOSTART_DIR = GLib.get_user_config_dir() + '/autostart';
+const AUTOSTART_FILE = '/org.gnome.Polari.Autostart.desktop';
+
const Application = new Lang.Class({
Name: 'Application',
Extends: Gtk.Application,
@@ -149,6 +152,14 @@ const Application = new Lang.Class({
this.add_action(action);
}));
+ this._settings = new Gio.Settings({ schema_id: 'org.gnome.Polari' });
+ let action = this._settings.create_action('run-in-background');
+ this.add_action(action);
+
+ this._settings.connect('changed::run-in-background',
+ Lang.bind(this, this._onRunInBackgroundChanged));
+ this._onRunInBackgroundChanged();
+
for (let i = 1; i < 10; i++)
this.set_accels_for_action('app.nth-room(%d)'.format(i), ['<Alt>' + i]);
@@ -184,8 +195,11 @@ const Application = new Lang.Class({
if (!this.active_window) {
let window = new MainWindow.MainWindow({ application: this });
- window.connect('destroy',
- () => { this.emit('prepare-shutdown'); });
+ window.connect('destroy', () => {
+ if (this._settings.get_boolean('run-in-background'))
+ return;
+ this.emit('prepare-shutdown');
+ });
window.connect('notify::active-room',
() => { this.emit('room-focus-changed'); });
window.connect('notify::is-active',
@@ -500,6 +514,35 @@ const Application = new Lang.Class({
dialog.show();
},
+ _createLink: function(file, target) {
+ try {
+ file.get_parent().make_directory_with_parents(null);
+ } catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.EXISTS)) {
+ // not an error, carry on
+ }
+
+ file.make_symbolic_link(target, null);
+ },
+
+ _onRunInBackgroundChanged: function() {
+ let file = Gio.File.new_for_path(AUTOSTART_DIR + AUTOSTART_FILE);
+
+ if (this._settings.get_boolean('run-in-background'))
+ try {
+ this._createLink(file, pkg.pkgdatadir + AUTOSTART_FILE);
+ } catch(e) {
+ if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.EXISTS))
+ log('Failed to create autostart link: ' + e.message);
+ }
+ else
+ try {
+ file.delete(null);
+ } catch(e) {
+ if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND))
+ log('Failed to remove autostart link: ' + e.message);
+ }
+ },
+
_onStartClient: function() {
if (this._telepathyClient)
return;
@@ -564,5 +607,6 @@ const Application = new Lang.Class({
_onQuit: function() {
this.get_windows().reverse().forEach(w => { w.destroy(); });
+ this.emit('prepare-shutdown');
}
});
--
cgit v0.12

View File

@ -1,3 +1,67 @@
-------------------------------------------------------------------
Mon Mar 20 20:25:06 UTC 2017 - dimstar@opensuse.org
- Update to version 3.24.0:
+ Add user documentation (bgo#722498).
+ Misc. bug fixes: bgo#780166, bgo#779946, bgo#780298.
+ Updated translations.
-------------------------------------------------------------------
Tue Mar 14 17:52:28 UTC 2017 - dimstar@opensuse.org
- Update to version 3.23.92:
+ Support the meson build system (bgo#779599).
+ Implement room list filtering (bgo#779960).
+ Misc. bug fixes and cleanups: bgo#779906, bgo#779921,
bgo#779940.
+ Updated translations.
-------------------------------------------------------------------
Mon Mar 6 10:17:08 UTC 2017 - zaitor@opensuse.org
- Update to version 3.23.91:
+ Bundle required Telepathy services in flatpak (bgo#777705).
+ Support auth bots that use "login" instead of "identify"
(bgo#778841).
+ Misc. bug fixes: bgo#778793, bgo#778797, bgo#778850,
bgo#779449, bgo#771888.
+ Updated translations.
- Drop polari-fast-forward-to-9d0fcf3.patch: No longer needed.
-------------------------------------------------------------------
Mon Feb 20 12:54:45 UTC 2017 - dimstar@opensuse.org
- Add polari-fast-forward-to-9d0fcf3.patch: Move to git HEAD of
today, which fixes a lot of issues in combination with gjs
1.47.90 (issues that rendered polari unusable).
-------------------------------------------------------------------
Thu Feb 16 08:24:46 UTC 2017 - luke.nukem.jones@gmail.com
- Update to version 3.23.90:
+ Add spell check support to entry (bgo#709956).
+ Add room list to join dialog (bgo#763200).
- Add pkgconfig(gspell-1) BuildRequires: New dependency.
-------------------------------------------------------------------
Wed Nov 23 20:23:58 UTC 2016 - dimstar@opensuse.org
- Update to version 3.23.2:
+ Allow to run polari in the background (bgo#770750).
+ Misc. bug fixes: bgo#774283.
+ Updated translations.
- Drop polari-allow-run-in-background.patch, libtool BuildRequires
and stop passing autoreconf, fixed upstream.
-------------------------------------------------------------------
Wed Nov 23 20:22:58 UTC 2016 - dimstar@opensuse.org
- Update to version 3.23.1:
+ Mask identify passwords in private chats (bgo#771888).
+ Add a contextual popover to nicks in chat log (bgo#760853).
+ Misc. bug fixes: bgo#771557, bgo#770749, bgo#773293.
- Add pkgconfig(gjs-1.0) BuildRequires: new dependency.
-------------------------------------------------------------------
Wed Nov 23 20:21:58 UTC 2016 - zaitor@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package polari
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2013 Dominique Leuenberger, Amsterdam, The Netherlands
#
# All modifications and additions to the file contributed by third parties
@ -18,25 +18,23 @@
Name: polari
Version: 3.22.2
Version: 3.24.0
Release: 0
Summary: An IRC Client for GNOME
License: GPL-2.0+ and LGPL-2.1+
Group: Productivity/Networking/IRC
Url: http://wiki.gnome.org/Apps/Polari
Source0: http://download.gnome.org/sources/polari/3.22/%{name}-%{version}.tar.xz
Source0: http://download.gnome.org/sources/polari/3.24/%{name}-%{version}.tar.xz
Source99: polari-rpmlintrc
# PATCH-FEATURE-UPSTREAM polari-allow-run-in-background.patch bgo#770750 zaitor@opensuse.org -- Allow app to run in background.
Patch0: polari-allow-run-in-background.patch
BuildRequires: gjs >= 1.45.0
BuildRequires: hicolor-icon-theme
BuildRequires: intltool >= 0.50.0
# Needed for patch0
BuildRequires: libtool
BuildRequires: update-desktop-files
BuildRequires: yelp-tools
BuildRequires: pkgconfig(gio-2.0) >= 2.41.0
BuildRequires: pkgconfig(gjs-1.0)
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 0.9.6
BuildRequires: pkgconfig(gspell-1)
BuildRequires: pkgconfig(gtk+-3.0) >= 3.21.6
BuildRequires: pkgconfig(libsecret-1)
BuildRequires: pkgconfig(libsoup-2.4)
@ -64,10 +62,8 @@ with GNOME 3.
%lang_package
%prep
%setup -q
%patch0 -p1
%build
autoreconf -fiv
%configure
make %{?_smp_mflags}