plugin destroy



I have written a small plugin with the following activate function. Unfortunately it seems that sending "window" as parameter to the action confuses something and eog never quits Is there a close function called when the plugin is deleted, so that I can delete the reference to the window object ? looking at the plugin code it does not look so ..

or maybe there is another way to get the path to the current image ...


    def activate(self, window):
        ui_manager = window.get_ui_manager()
        self.group = gtk.ActionGroup('CopyImage')
self.group.add_actions([('CopyImage', None, '_Web Image', "w", "Create a sized down copy of an image", self.createCopy)], window)
        ui_manager.insert_action_group(self.group, 0)
        self.ui_id = ui_manager.add_ui_from_string(self._ui_str)


    def createCopy(self, action, window):
        image = window.get_image()
        if  image == None:
            print "No image available"
        else:
           path = image.get_uri_for_display()
           RATECOMMAND.append(path)
           subprocess.call(RATECOMMAND)






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]