Skip to content

Commit

Permalink
app-office/gtg: bump to 0.5
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/788868
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Mart Raudsepp <[email protected]>
  • Loading branch information
leio committed Jun 19, 2021
1 parent 2b83700 commit c7803da
Show file tree
Hide file tree
Showing 5 changed files with 229 additions and 0 deletions.
1 change: 1 addition & 0 deletions app-office/gtg/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST gtg-0.4.0.tar.xz 3744752 BLAKE2B fdeabe32135dea24ac6113a486650b66b5143aa745117029b03e26e1bb3f2e8629623b26efdae0c8217741a2b4964b5dc060f0e450c05c950e21ea360f3f3823 SHA512 f2677f6bbc0b6cb21b7882a2bd0342b4919581c12e4aa43c13b5dbc48740418c512a41619584d0d75bfa63ebc4a5460abfbc27360e1817c8832cbecf3c34a60e
DIST gtg-0.5.tar.gz 2229259 BLAKE2B e724cbd015a6f0b6fee62c52283b56244490efb7df4e57b2e30745f58fbc41442b008f5c81b53cfd001f04a92ff53a14e2117d6c12d0d5a35fe49158b5f736fa SHA512 631f5343301d7d72211398152fa081c0fa15154babc7ec900f13a39a2677d0edaf4fea534a83284207e8019926c9108dc1d8f25bdbeae85ef0665dfe1c7b768a
69 changes: 69 additions & 0 deletions app-office/gtg/files/0.5-mouse-cursor-fixes1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
From ee709d2722a75f11b5f6c9d7cd9b4a925107e54f Mon Sep 17 00:00:00 2001
From: Neui <[email protected]>
Date: Wed, 21 Apr 2021 01:58:40 +0200
Subject: [PATCH] Remove Gdk.Cursor.new depredation warnings

Gdk.Cursor.new has been replaced by Gdk.Cursor.new_for_display, which
needs an additional display.
It was only used to set the cursor on windows, which has an display
associated with it, so now it is created when needed rather than being
cached.
---
GTG/gtk/editor/taskview.py | 12 ++++++------
GTG/plugins/unmaintained/tomboy/tomboy.py | 4 +++-
2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/GTG/gtk/editor/taskview.py b/GTG/gtk/editor/taskview.py
index 7f73fbb3..4b510499 100644
--- a/GTG/gtk/editor/taskview.py
+++ b/GTG/gtk/editor/taskview.py
@@ -74,10 +74,6 @@ class TaskView(Gtk.TextView):
# Timeout in milliseconds
PROCESSING_DELAY = 250

- # Mouse cursors
- CURSOR_HAND = Gdk.Cursor.new(Gdk.CursorType.HAND2)
- CURSOR_NORMAL = Gdk.Cursor.new(Gdk.CursorType.XTERM)
-

def __init__(self, req: Requester, clipboard) -> None:
super().__init__()
@@ -601,7 +597,9 @@ class TaskView(Gtk.TextView):
tags = view.get_iter_at_location(x, y)[1].get_tags()

# Reset cursor and hover states
- window.set_cursor(self.CURSOR_NORMAL)
+ cursor = Gdk.Cursor.new_for_display(window.get_display(),
+ Gdk.CursorType.XTERM)
+ window.set_cursor(cursor)

if self.hovered_tag:
try:
@@ -615,7 +613,9 @@ class TaskView(Gtk.TextView):
try:
tag = tags[0]
tag.set_hover()
- window.set_cursor(self.CURSOR_HAND)
+ cursor = Gdk.Cursor.new_for_display(window.get_display(),
+ Gdk.CursorType.HAND2)
+ window.set_cursor(cursor)
self.hovered_tag = tag

except (AttributeError, IndexError):
diff --git a/GTG/plugins/unmaintained/tomboy/tomboy.py b/GTG/plugins/unmaintained/tomboy/tomboy.py
index 33ec9264..28c4226a 100644
--- a/GTG/plugins/unmaintained/tomboy/tomboy.py
+++ b/GTG/plugins/unmaintained/tomboy/tomboy.py
@@ -337,6 +337,8 @@ class TomboyPlugin():
# cursor changes to a hand

def realize_callback(widget):
- eventbox.window.set_cursor(Gdk.Cursor.new(Gdk.HAND2))
+ cursor = Gdk.Cursor.new_for_display(eventbox.window.get_display(),
+ Gdk.CursorType.HAND2)
+ eventbox.window.set_cursor(cursor)
eventbox.connect("realize", realize_callback)
return eventbox
--
2.30.0

55 changes: 55 additions & 0 deletions app-office/gtg/files/0.5-mouse-cursor-fixes2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From 522f79e4ed58ea821dd939daa856a2d9dfd6f934 Mon Sep 17 00:00:00 2001
From: Neui <[email protected]>
Date: Sun, 2 May 2021 01:08:37 +0200
Subject: [PATCH] Use Gdk.Cursor.new_from_name()

Because GDK4 dropped new_for_display in favour of new_from_name.
---
GTG/gtk/editor/taskview.py | 8 ++++----
GTG/plugins/unmaintained/tomboy/tomboy.py | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/GTG/gtk/editor/taskview.py b/GTG/gtk/editor/taskview.py
index 4b510499..1313ead8 100644
--- a/GTG/gtk/editor/taskview.py
+++ b/GTG/gtk/editor/taskview.py
@@ -597,8 +597,8 @@ class TaskView(Gtk.TextView):
tags = view.get_iter_at_location(x, y)[1].get_tags()

# Reset cursor and hover states
- cursor = Gdk.Cursor.new_for_display(window.get_display(),
- Gdk.CursorType.XTERM)
+ cursor = Gdk.Cursor.new_from_name(window.get_display(),
+ 'text')
window.set_cursor(cursor)

if self.hovered_tag:
@@ -613,8 +613,8 @@ class TaskView(Gtk.TextView):
try:
tag = tags[0]
tag.set_hover()
- cursor = Gdk.Cursor.new_for_display(window.get_display(),
- Gdk.CursorType.HAND2)
+ cursor = Gdk.Cursor.new_from_name(window.get_display(),
+ 'pointer')
window.set_cursor(cursor)
self.hovered_tag = tag

diff --git a/GTG/plugins/unmaintained/tomboy/tomboy.py b/GTG/plugins/unmaintained/tomboy/tomboy.py
index 28c4226a..d81cd58c 100644
--- a/GTG/plugins/unmaintained/tomboy/tomboy.py
+++ b/GTG/plugins/unmaintained/tomboy/tomboy.py
@@ -337,8 +337,8 @@ class TomboyPlugin():
# cursor changes to a hand

def realize_callback(widget):
- cursor = Gdk.Cursor.new_for_display(eventbox.window.get_display(),
- Gdk.CursorType.HAND2)
+ cursor = Gdk.Cursor.new_from_name(eventbox.window.get_display(),
+ 'pointer')
eventbox.window.set_cursor(cursor)
eventbox.connect("realize", realize_callback)
return eventbox
--
2.30.0

41 changes: 41 additions & 0 deletions app-office/gtg/files/0.5-mouse-cursor-fixes3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From c6fa415ed7b71197f27e946b8a854d74a8e92f84 Mon Sep 17 00:00:00 2001
From: Neui <[email protected]>
Date: Sun, 2 May 2021 01:12:08 +0200
Subject: [PATCH] Prevent flicker cursor when moving over a tag

When hovering over a tag in the task editor, it'll "flicker" between a
normal text cursor and the pointer cursor. This fixes this by simply
calling set_cursor just once.
---
GTG/gtk/editor/taskview.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/GTG/gtk/editor/taskview.py b/GTG/gtk/editor/taskview.py
index 1313ead8..9358b98f 100644
--- a/GTG/gtk/editor/taskview.py
+++ b/GTG/gtk/editor/taskview.py
@@ -599,7 +599,6 @@ class TaskView(Gtk.TextView):
# Reset cursor and hover states
cursor = Gdk.Cursor.new_from_name(window.get_display(),
'text')
- window.set_cursor(cursor)

if self.hovered_tag:
try:
@@ -615,12 +614,12 @@ class TaskView(Gtk.TextView):
tag.set_hover()
cursor = Gdk.Cursor.new_from_name(window.get_display(),
'pointer')
- window.set_cursor(cursor)
self.hovered_tag = tag

except (AttributeError, IndexError):
# Not an interactive tag, or no tag at all
pass
+ window.set_cursor(cursor)


def do_populate_popup(self, popup) -> None:
--
2.30.0

63 changes: 63 additions & 0 deletions app-office/gtg/gtg-0.5.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"
PYTHON_COMPAT=( python3_8 )
PYTHON_REQ_USE="xml(+)"

inherit meson python-single-r1 xdg

DESCRIPTION="Personal organizer for the GNOME desktop environment"
HOMEPAGE="https://wiki.gnome.org/Apps/GTG/"
SRC_URI="https://github.com/getting-things-gnome/gtg/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="!test? ( test )"

RDEPEND="
${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/dbus-python[${PYTHON_USEDEP}]
dev-python/pygobject:3[${PYTHON_USEDEP}]
>=dev-python/liblarch-3.1.0[${PYTHON_USEDEP}]
dev-python/pycairo[${PYTHON_USEDEP}]
dev-python/lxml[${PYTHON_USEDEP}]
')
x11-libs/pango[introspection]
x11-libs/gdk-pixbuf[introspection]
x11-libs/gtk+:3[introspection]
"
DEPEND="${RDEPEND}"
BDEPEND="
dev-util/itstool
>=sys-devel/gettext-0.19.8
test? ( $(python_gen_cond_dep '
dev-python/nose[${PYTHON_USEDEP}]
dev-python/cheetah3[${PYTHON_USEDEP}]
dev-python/mock[${PYTHON_USEDEP}]
')
app-text/pdfjam
app-text/pdftk
dev-texlive/texlive-latex
)
"

PATCHES=(
# Fixes tests, and mouse cursor with some themes
"${FILESDIR}"/${PV}-mouse-cursor-fixes{1,2,3}.patch
)

src_install() {
meson_src_install
python_fix_shebang "${ED}"/usr/bin/gtg
python_optimize
}

src_test() {
sed -e "s|@VCS_TAG@|${PV}|" GTG/core/info.py.in > GTG/core/info.py || die
nosetests -v || die
}

0 comments on commit c7803da

Please sign in to comment.