Fix RuntimeError: could not create signal for _closing
On Ubuntu 20.04 with GTK 3.24.13, importing sugar3.activity.activity fails with RuntimeError: could not create signal for _closing, preceeded by an assertion is_valid_signal_name failed. Cause is upstream 89f955d ("gsignal: Canonicalise signal names at installation time ") which requires application signal names to not start with a hyphen or underscore. Remove the prefix from our signal name. The signal remains reserved and private to the Activity class.
This commit is contained in:
parent
aca045bde2
commit
88adb38a42
@ -328,7 +328,7 @@ class Activity(Window, Gtk.Container):
|
|||||||
'joined': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
'joined': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
||||||
# For internal use only, use can_close() if you want to perform extra
|
# For internal use only, use can_close() if you want to perform extra
|
||||||
# checks before actually closing
|
# checks before actually closing
|
||||||
'_closing': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
'closing': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, handle, create_jobject=True):
|
def __init__(self, handle, create_jobject=True):
|
||||||
@ -1301,7 +1301,7 @@ class Activity(Window, Gtk.Container):
|
|||||||
|
|
||||||
def _do_close(self, skip_save):
|
def _do_close(self, skip_save):
|
||||||
self.busy()
|
self.busy()
|
||||||
self.emit('_closing')
|
self.emit('closing')
|
||||||
if not self._closing:
|
if not self._closing:
|
||||||
if not self._prepare_close(skip_save):
|
if not self._prepare_close(skip_save):
|
||||||
return
|
return
|
||||||
|
@ -189,7 +189,7 @@ class TitleEntry(Gtk.ToolItem):
|
|||||||
self.add(self.entry)
|
self.add(self.entry)
|
||||||
|
|
||||||
activity.metadata.connect('updated', self.__jobject_updated_cb)
|
activity.metadata.connect('updated', self.__jobject_updated_cb)
|
||||||
activity.connect('_closing', self.__closing_cb)
|
activity.connect('closing', self.__closing_cb)
|
||||||
|
|
||||||
def __activate_cb(self, entry, activity):
|
def __activate_cb(self, entry, activity):
|
||||||
self.save_title(activity)
|
self.save_title(activity)
|
||||||
|
Loading…
Reference in New Issue
Block a user