Commit 9c419859 authored by Alexandru Băluț's avatar Alexandru Băluț

editorperspective: Let signals disconnect automatically

The signals connected by self.builder are all for the main menu.
They are disconnected automatically when the objects are destroyed.
parent 25d2a313
...@@ -87,7 +87,6 @@ class EditorPerspective(Perspective, Loggable): ...@@ -87,7 +87,6 @@ class EditorPerspective(Perspective, Loggable):
self.app = app self.app = app
self.settings = app.settings self.settings = app.settings
self.builder_handler_ids = []
self.builder = Gtk.Builder() self.builder = Gtk.Builder()
pm = self.app.project_manager pm = self.app.project_manager
...@@ -318,9 +317,6 @@ class EditorPerspective(Perspective, Loggable): ...@@ -318,9 +317,6 @@ class EditorPerspective(Perspective, Loggable):
self.builder.add_from_file( self.builder.add_from_file(
os.path.join(get_ui_dir(), "mainmenubutton.ui")) os.path.join(get_ui_dir(), "mainmenubutton.ui"))
# FIXME : see https://bugzilla.gnome.org/show_bug.cgi?id=729263
self.builder.connect_signals_full(self._builderConnectCb, self)
self.menu_button = self.builder.get_object("menubutton") self.menu_button = self.builder.get_object("menubutton")
self._menubutton_items = {} self._menubutton_items = {}
...@@ -390,11 +386,6 @@ class EditorPerspective(Perspective, Loggable): ...@@ -390,11 +386,6 @@ class EditorPerspective(Perspective, Loggable):
self.save_action.set_enabled(True) self.save_action.set_enabled(True)
self.updateTitle() self.updateTitle()
def _builderConnectCb(self, builder, gobject, signal_name, handler_name,
connect_object, flags, user_data):
id_ = gobject.connect(signal_name, getattr(self, handler_name))
self.builder_handler_ids.append((gobject, id_))
# Toolbar/Menu actions callback # Toolbar/Menu actions callback
def __close_project_cb(self, unused_button): def __close_project_cb(self, unused_button):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment