Beispiel #1
0
 def inner(*args, **kwargs):
     w = BusyWindow.create()
     try:
         return func(*args, **kwargs)
     finally:
         w.doClose()
         del w
         util.garbageCollect()
Beispiel #2
0
def showOptionsDialog(heading, options, non_playback=False, selected_idx=None):
    w = SelectDialog.open(heading=heading,
                          options=options,
                          non_playback=non_playback,
                          selected_idx=selected_idx)
    choice = w.choice
    del w
    util.garbageCollect()
    return choice
Beispiel #3
0
def show(header, info, button0=None, button1=None, button2=None):
    w = OptionsDialog.open(header=header,
                           info=info,
                           button0=button0,
                           button1=button1,
                           button2=button2)
    choice = w.buttonChoice
    del w
    util.garbageCollect()
    return choice
Beispiel #4
0
def play(video=None, play_queue=None, resume=False):
    w = VideoPlayerWindow.open(video=video,
                               play_queue=play_queue,
                               resume=resume)
    player.PLAYER.off('session.ended', w.sessionEnded)
    player.PLAYER.off('post.play', w.postPlay)
    player.PLAYER.off('change.background', w.changeBackground)
    command = w.exitCommand
    del w
    util.garbageCollect()
    return command
Beispiel #5
0
def handleOpen(winclass, **kwargs):
    w = None
    try:
        w = winclass.open(**kwargs)
        return w.exitCommand or ''
    except AttributeError:
        pass
    finally:
        del w
        util.garbageCollect()

    return ''
Beispiel #6
0
    def doClose(self, delete=False):
        if self.handler.playlist:
            self.handler.playlist.off('change', self.updateProperties)

        try:
            if self.playlistDialog:
                self.playlistDialog.doClose()
                if delete:
                    del self.playlistDialog
                    self.playlistDialog = None
                    util.garbageCollect()
        finally:
            kodigui.BaseDialog.doClose(self)
Beispiel #7
0
 def infoButtonClicked(self):
     fallback = 'script.plex/thumb_fallbacks/{0}.png'.format(self.mediaItem.type == 'show' and 'show' or 'music')
     genres = u' / '.join([g.tag for g in util.removeDups(self.mediaItem.genres())][:6])
     w = info.InfoWindow.open(
         title=self.mediaItem.title,
         sub_title=genres,
         thumb=self.mediaItem.defaultThumb,
         thumb_fallback=fallback,
         info=self.mediaItem.summary,
         background=self.getProperty('background'),
         is_square=bool(isinstance(self, ArtistWindow))
     )
     del w
     util.garbageCollect()
Beispiel #8
0
def handleOpen(winclass, **kwargs):
    w = None
    try:
        autoPlay = kwargs.pop("auto_play", False)
        if autoPlay and hasattr(winclass, "doAutoPlay"):
            w = winclass.create(show=False, **kwargs)
            if w.doAutoPlay():
                w.modal()
        else:
            w = winclass.open(**kwargs)
        return w.exitCommand or ''
    except AttributeError:
        pass
    finally:
        del w
        util.garbageCollect()

    return ''
Beispiel #9
0
def showDropdown(options,
                 pos=None,
                 pos_is_bottom=False,
                 close_direction='top',
                 set_dropdown_prop=True,
                 with_indicator=False,
                 suboption_callback=None,
                 close_on_playback_ended=False,
                 header=None):

    if header:
        pos = pos or (660, 400)
        w = DropdownHeaderDialog.open(
            options=options,
            pos=pos,
            pos_is_bottom=pos_is_bottom,
            close_direction=close_direction,
            set_dropdown_prop=set_dropdown_prop,
            with_indicator=with_indicator,
            suboption_callback=suboption_callback,
            close_on_playback_ended=close_on_playback_ended,
            header=header)
    else:
        pos = pos or (810, 400)
        w = DropdownDialog.open(
            options=options,
            pos=pos,
            pos_is_bottom=pos_is_bottom,
            close_direction=close_direction,
            set_dropdown_prop=set_dropdown_prop,
            with_indicator=with_indicator,
            suboption_callback=suboption_callback,
            close_on_playback_ended=close_on_playback_ended,
            header=header)
    choice = w.choice
    del w
    util.garbageCollect()
    return choice
Beispiel #10
0
def showDialog(video, non_playback=False, via_osd=False):
    w = VideoSettingsDialog.open(video=video,
                                 non_playback=non_playback,
                                 via_osd=via_osd)
    del w
    util.garbageCollect()