Beispiel #1
0
 def on_button_media_rebuild_clicked(self, widget):
     '''Rebuild media cache requested.'''
     try:
         proxy = MessageBusProxy(client_name = "Manager GUI")
         proxy.connectToMessageBus()
         proxy.sendMessage(Message(MessageType.REBUILD_IMAGE_CACHE))
         proxy.sendMessage(Message(MessageType.REBUILD_MUSIC_CACHE))
         proxy.sendMessage(Message(MessageType.REBUILD_VIDEO_CACHE))
         proxy.disconnectFromMessageBus()
     except socket.error:
         error = gtk.MessageDialog(
             None, gtk.DIALOG_MODAL,
             gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _(
                 "Entertainer backend is not running. "
                 "Cache cannot be rebuilt."
             ))
         error.run()
         error.destroy()
Beispiel #2
0
    def on_dialog_closed(self, widget):
        """Callback function for dialog's close button"""
        try:
            proxy = MessageBusProxy(client_name = "Manager GUI")
            proxy.connectToMessageBus()
            proxy.sendMessage(Message(MessageType.CONTENT_CONF_UPDATED))
            proxy.disconnectFromMessageBus()
        except socket.error:
            error = gtk.MessageDialog(
                    None, gtk.DIALOG_MODAL,
                    gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _(
                        "Entertainer backend is not running. "
                        "Cache cannot be rebuilt."
                    ))
            error.run()
            error.destroy()

        if(self.stand_alone):
            self.dialog.hide()
            self.dialog.destroy()
            gtk.main_quit()
        else:
            self.dialog.hide()
            self.dialog.destroy()