Package: gnome-shell-timer / 0.3.20+20190726-1

Fix-multiple-warnings.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
From: =?utf-8?q?Rapha=C3=ABl_Hertzog?= <hertzog@debian.org>
Date: Sat, 31 Aug 2019 16:51:39 +0200
Subject: Fix multiple warnings

* Specify Gtk version to import
* Use keyword instead of positional parameters when creating GObjects
* Drop deprecated calls to set_rules_hint/set_use_alpha.
---
 gnome-shell-timer-config.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/gnome-shell-timer-config.py b/gnome-shell-timer-config.py
index 8ae298c..c067a99 100755
--- a/gnome-shell-timer-config.py
+++ b/gnome-shell-timer-config.py
@@ -26,6 +26,9 @@ an alternative of dconf-editor
 
 """
 
+import gi
+gi.require_version('Gtk', '3.0')
+
 from gi.repository import Gtk, Gio, Gdk, GLib
 
 import os.path
@@ -56,12 +59,11 @@ def hex_to_color(hexstr):
 
 class ColorSelect:
     def __init__(self, name):
-        self.label = Gtk.Label(_('{} Chart Color: '.format(name)))
+        self.label = Gtk.Label(label=_('{} Chart Color: '.format(name)))
         self.picker = Gtk.ColorButton()
         self.actor = Gtk.HBox()
         self.actor.add(self.label)
         self.actor.add(self.picker)
-        self.picker.set_use_alpha(True)
 
     def set_value(self, value):
         self.picker.set_rgba(hex_to_color(value))
@@ -69,7 +71,7 @@ class ColorSelect:
 
 class IntSelect:
     def __init__(self, name):
-        self.label = Gtk.Label(name + ": ")
+        self.label = Gtk.Label(label=name + ": ")
         self.spin = Gtk.SpinButton()
         self.actor = Gtk.HBox()
         self.actor.add(self.label)
@@ -125,7 +127,7 @@ def edited_duration(cell, path, new_text, treeview, store, schema):
 class SettingFrame:
     def __init__(self, name, schema):
         self.schema = schema
-        self.label = Gtk.Label(name)
+        self.label = Gtk.Label(label=name)
         self.frame = Gtk.Frame()
         self.frame.set_border_width(10)
         self.vbox = Gtk.VBox(spacing=20)
@@ -146,8 +148,7 @@ class SettingFrame:
             presets = self.schema.get_value(key)
             for key in presets.keys():
                 store.append([key, presets[key]])
-            treeView = Gtk.TreeView(store)
-            treeView.set_rules_hint(True)
+            treeView = Gtk.TreeView(model=store)
             cellrenderer = Gtk.CellRendererText()
             cellrenderer.set_property('editable', True)
             column = Gtk.TreeViewColumn(_("Name"), cellrenderer, text=0)
@@ -171,7 +172,7 @@ class SettingFrame:
             item.connect('clicked', delete_row, treeView, store, self.schema)
 
         elif sections[1] == 'hours':
-            self.hbox0.add(Gtk.Label(_('Set default timer values:')))
+            self.hbox0.add(Gtk.Label(label=_('Set default timer values:')))
             item = IntSelect(_('Hours'))
             item.set_args(0, 23, 1, 10)
             item.set_value(self.schema.get_int(key))
@@ -265,7 +266,7 @@ class App:
     setting_items = ('manual', 'ui', 'presets', 'sound')
 
     def __init__(self):
-        self.schema = Gio.Settings('org.gnome.shell.extensions.timer')
+        self.schema = Gio.Settings(schema='org.gnome.shell.extensions.timer')
         keys = self.schema.keys()
         self.window = Gtk.Window(title=_('Timer Applet Configurator'))
         self.window.connect('destroy', Gtk.main_quit)