Exemplo n.º 1
0
def show(quote_pack):
    """Display the editing window."""
    global voice_item, config, config_mid
    voice_item = quote_pack

    win.title('BEE2 - Configure "' + voice_item.selitem_data.name + '"')
    notebook = UI['tabs']

    quote_data = quote_pack.config

    os.makedirs('config/voice', exist_ok=True)
    config = ConfigFile('voice/' + quote_pack.id + '.cfg')
    config_mid = ConfigFile('voice/MID_' + quote_pack.id + '.cfg')

    # Clear the transcript textbox
    text = UI['trans']
    text['state'] = 'normal'
    text.delete(1.0, END)
    text['state'] = 'disabled'

    # Destroy all the old tabs
    for tab in TABS.values():
        try:
            notebook.forget(tab)
        except TclError as e:
            pass
        tab.destroy()

    TABS.clear()

    for group in quote_data.find_all('quotes', 'group'):
        make_tab(
            group,
            config,
            is_mid=False,
            )

    mid_quotes = list(quote_data.find_all('quotes', 'midchamber'))
    if len(mid_quotes) > 0:
        frame = make_tab(
            mid_quotes[0],
            config_mid,
            is_mid=True,
            )
        frame.nb_text = ''

    config.save()
    config_mid.save()

    add_tabs()

    win.deiconify()
    win.lift(win.winfo_parent())
    utils.center_win(win)  # Center inside the parent
Exemplo n.º 2
0
def show(quote_pack):
    """Display the editing window."""
    global voice_item, config_sp, config_coop, config_mid_sp, config_mid_coop
    voice_item = quote_pack

    win.title('BEE2 - Configure "' + voice_item.name + '"')
    notebook = UI['tabs']

    quote_data = quote_pack.config

    os.makedirs('config/voice', exist_ok=True)
    config_sp = ConfigFile('voice/SP_' + quote_pack.id + '.cfg')
    config_coop = ConfigFile('voice/COOP_' + quote_pack.id + '.cfg')
    config_mid_sp = ConfigFile('voice/MID_SP_' + quote_pack.id + '.cfg')
    config_mid_coop = ConfigFile('voice/MID_COOP_' + quote_pack.id + '.cfg')

    # Clear the transcript textbox
    text = UI['trans']
    text['state'] = 'normal'
    text.delete(1.0, END)
    text['state'] = 'disabled'

    # Destroy all the old tabs
    for tab in itertools.chain(
            TABS_SP.values(),
            TABS_COOP.values(),
            ):
        try:
            notebook.forget(tab)
        except TclError:
            pass
        tab.destroy()

    TABS_SP.clear()
    TABS_COOP.clear()

    add_tabs(quote_data, 'quotes_sp', TABS_SP, config_sp)
    add_tabs(quote_data, 'quotes_coop', TABS_COOP, config_coop)

    config_sp.save()
    config_coop.save()
    config_mid_sp.save()
    config_mid_coop.save()

    refresh()
    win.deiconify()
    win.lift(win.winfo_parent())
    utils.center_win(win)  # Center inside the parent
Exemplo n.º 3
0
def show(quote_pack):
    """Display the editing window."""
    global voice_item, config, config_mid, config_resp
    voice_item = quote_pack

    win.title('BEE2 - Configure "' + voice_item.selitem_data.name + '"')
    notebook = UI['tabs']

    quote_data = quote_pack.config

    os.makedirs('config/voice', exist_ok=True)
    config = ConfigFile('voice/' + quote_pack.id + '.cfg')
    config_mid = ConfigFile('voice/MID_' + quote_pack.id + '.cfg')
    config_resp = ConfigFile('voice/RESP_' + quote_pack.id + '.cfg')

    # Clear the transcript textbox
    text = UI['trans']
    text['state'] = 'normal'
    text.delete(1.0, END)
    text['state'] = 'disabled'

    # Destroy all the old tabs
    for tab in TABS.values():
        try:
            notebook.forget(tab)
        except TclError:
            pass
        tab.destroy()

    TABS.clear()

    for group in quote_data.find_all('quotes', 'group'):
        make_tab(
            group,
            config,
            TabTypes.NORM
        )

    # Merge all blocks into one
    mid_quotes = Property(
        'midChamber',
        list(itertools.chain.from_iterable(
            quote_data.find_all('quotes', 'midChamber')
        ))
    )

    if len(mid_quotes):
        make_tab(
            mid_quotes,
            config_mid,
            TabTypes.MIDCHAMBER,
        )

    responses = Property(
        'CoopResponses',
        list(itertools.chain.from_iterable(
            quote_data.find_all('quotes', 'CoopResponses')
        )),
    )

    if len(responses):
        make_tab(
            responses,
            config_resp,
            TabTypes.RESPONSE,
        )

    config.save()
    config_mid.save()
    config_resp.save()

    add_tabs()

    win.deiconify()
    win.lift(win.winfo_parent())
    utils.center_win(win)  # Center inside the parent
Exemplo n.º 4
0
def show(quote_pack):
    """Display the editing window."""
    global voice_item, config, config_mid, config_resp
    if voice_item is not None:
        return

    voice_item = quote_pack

    win.title(_('BEE2 - Configure "{}"').format(voice_item.selitem_data.name))
    notebook = UI['tabs']

    quote_data = quote_pack.config

    os.makedirs('config/voice', exist_ok=True)
    config = ConfigFile('voice/' + quote_pack.id + '.cfg')
    config_mid = ConfigFile('voice/MID_' + quote_pack.id + '.cfg')
    config_resp = ConfigFile('voice/RESP_' + quote_pack.id + '.cfg')

    # Clear the transcript textbox
    text = UI['trans']
    text['state'] = 'normal'
    text.delete(1.0, END)
    text['state'] = 'disabled'

    # Destroy all the old tabs
    for tab in TABS.values():
        try:
            notebook.forget(tab)
        except TclError:
            pass
        tab.destroy()

    TABS.clear()

    for group in quote_data.find_all('quotes', 'group'):
        make_tab(group, config, TabTypes.NORM)

    # Merge all blocks into one
    mid_quotes = Property(
        'midChamber',
        list(
            itertools.chain.from_iterable(
                quote_data.find_all('quotes', 'midChamber'))))

    if len(mid_quotes):
        make_tab(
            mid_quotes,
            config_mid,
            TabTypes.MIDCHAMBER,
        )

    responses = Property(
        'CoopResponses',
        list(
            itertools.chain.from_iterable(
                quote_data.find_all('quotes', 'CoopResponses'))),
    )

    if len(responses):
        make_tab(
            responses,
            config_resp,
            TabTypes.RESPONSE,
        )

    config.save()
    config_mid.save()
    config_resp.save()

    add_tabs()

    win.deiconify()
    utils.center_win(win)  # Center inside the parent
    win.lift()