from sysactions import action, show_messagebox
from application.interactor import TabsInteractor


@action
def show_open_tabs(
        pos_id  # type: int
):
    # type: (...) -> bool

    tabs_interactor = TabsInteractor(int(pos_id))
    opened_tabs = tabs_interactor.get_opened_tabs()
    if not opened_tabs:
        show_messagebox(pos_id, "$EMPTY_OPENED_TABS")
        return True

    tabs_interactor.show_opened_tabs(opened_tabs)

    return True
