Example #1
0
 def add_item(self, text, callback, icon=None):
     if icon:
         item = OneLineIconListItem(text=text, on_release=callback)
         item.add_widget(ListBSIconLeft(icon=icon))
     else:
         item = OneLineListItem(text=text, on_release=callback)
     item.bind(on_release=lambda x: self.dismiss())
     self.mlist.add_widget(item)
Example #2
0
    def add_item(self, text, callback, icon=None):
        if icon:
            item = OneLineIconListItem(text=text, on_release=callback)
            item.add_widget(ListBSIconLeft(icon=icon))
        else:
            item = OneLineListItem(text=text, on_release=callback)

        item.bind(on_release=lambda x: self.dismiss())
        self.mlist.add_widget(item)
Example #3
0
    def add_item(self, text, callback, icon=None):
        if icon:
            item = OneLineIconListItem(text=text, on_press=callback)
            item.add_widget(ListBSIconLeft(icon=icon))
        else:
            item = OneLineListItem(text=text, on_press=callback)

#apparently this breaks the function command
        item.bind(on_release=lambda x: self.dismiss())
        self.mlist.add_widget(item)
Example #4
0
    def one_shot_refresh(self):
        try:
            r = safe_get(self.scoreboard_address + '/status/sfxlist')
            status = r.data.json()
        except:
            print('error getting SFX List')
            return

        if status['status'] != 'ok':
            print('error getting SFX List')
            return

        self.sfx_list = status['sfx_list']

        self._sfx_widgets = []
        for k, v in self.sfx_list.items():
            if v is not None:
                name = v
            else:
                name = k

            widget = OneLineIconListItem(text=name)
            widget.add_widget(AvatarSampleWidget(icon='volume-high'))
            widget.bind(on_press=self.do_sfx_play)
            self._sfx_widgets.append(widget)
            self.ids['debugTabActions'].add_widget(widget)

        # create SFX reverse lookup dictionary
        self.sfx_reverse_list = {}
        for k, v in self.sfx_list.items():
            if v is not None:
                self.sfx_reverse_list[v] = k

        # get game persistance data
        try:
            r = safe_get(self.scoreboard_address + '/persist/game_list')
            status = r.data.json()
        except:
            print('error getting game persistance')
            return

        self.game_persist_list = status['game_list']
        # update spinner
        self.ids['gpersist'].values = sorted(self.game_persist_list)
        self.ids['gpersist'].disabled = False
Example #5
0
    def loadBranches(self):
        self.branches = self.helper.getBranchesToDelete()

        self.remove_widget(self.ids.spinner)

        for branch in self.branches:
            item = OneLineIconListItem(
                text=branch.getName(),
                disabled=True
            )
            item.add_widget(IconLeftSampleWidget(
                icon='source-branch'
            ))
            self.ids.list.add_widget(item)
            time.sleep(0.2)

        if len(self.branches) > 0:
            self.ids.buttonClean.disabled = False