Esempio n. 1
0
    def quit_gtk(m):
        # disable plugins
        import quodlibet.plugins
        quodlibet.plugins.quit()

        # stop all copools
        print_d("Quit GTK: Stop all copools")
        from quodlibet.util import copool
        copool.remove_all()

        # events that add new events to the main loop (like copool)
        # can block the shutdown, so force stop after some time.
        # gtk.main_iteration will return True if quit gets called here
        import gobject
        gobject.timeout_add(4 * 1000, gtk.main_quit,
                            priority=gobject.PRIORITY_HIGH)

        # destroy all open windows so they hide immediately on close:
        # destroying all top level windows doesn't work (weird errors),
        # so we hide them all and only destroy our tracked instances
        # (browser windows, tag editors, pref window etc.)
        from quodlibet.qltk import Window
        map(gtk.Window.hide, gtk.window_list_toplevels())
        map(gtk.Window.destroy, Window.instances)

        print_d("Quit GTK: Process pending events...")
        while gtk.events_pending():
            if gtk.main_iteration(False):
                print_d("Quit GTK: Timeout occurred, force quit.")
                break
        else:
            gtk.main_quit()

        print_d("Quit GTK: done.")
 def cleanup(self):
     from quodlibet import config, const
     if self.api_version == 1:
         ql.quit(self.instance)
         config.write(const.CONFIG)
     elif self.api_version == 2:
         from quodlibet.util import copool
         copool.remove_all()
         config.save(const.CONFIG)
     config.quit()
Esempio n. 3
0
 def cleanup(self):
     from quodlibet import config, const
     if self.api_version == 1:
         ql.quit(self.instance)
         config.write(const.CONFIG)
     elif self.api_version == 2:
         from quodlibet.util import copool
         copool.remove_all()
         config.save(const.CONFIG)
     config.quit()
Esempio n. 4
0
 def tearDown(self):
     copool.remove_all()
Esempio n. 5
0
 def tearDown(self):
     copool.remove_all()