def show_dialog_rename_playlist(self, playlist_rowview):
        """
        Show a dialog to ask for the new name of the playlist.
        :param playlist_rowview:
        :return:
        """

        text = f"{str(playlist_rowview.playlist_obj.file_path.stem)}"

        content_obj = BoxLayout(orientation='vertical',
                                spacing="12dp",
                                size_hint_y=None)

        mdtf1 = MDTextField()
        mdtf1.text = text
        mdtf1.hint_text = f"Name of playlist"
        mdtf1.helper_text = f"{CU.tfs.dic['EXPLANATION_PLAYLIST_SONG_NAME'].value}"
        mdtf1.helper_text_mode = "on_focus"

        content_obj.add_widget(mdtf1)

        CU.show_input_dialog(title=f"Enter New Name for Playlist",
                             content_obj=content_obj,
                             size_hint=(.7, .4),
                             text_button_ok="Update",
                             text_button_cancel="Cancel",
                             ok_callback_set=lambda *args, **kwargs:
                             (self.rename_playlist(playlist_rowview, mdtf1.text
                                                   ), self.refresh_list()))
Exemple #2
0
    def show_dialog_add_lineup_entry(self):
        """
        Show a dialog to ask the name of the new lineup_entry.
        :return:
        """
        creation_time = datetime.now().strftime("%Y%m%d-%H%M%S")

        text = f"Concert_{creation_time}"

        content_obj = BoxLayout(orientation='vertical',
                                spacing="12dp",
                                size_hint_y=None)

        # mdlbl1 = MDLabel(text=str(CU.tfs.dic['EXPLANATION_WORKSPACE_PATH'].value))

        mdtf1 = MDTextField()

        mdtf1.text = text
        mdtf1.hint_text = f"Name of song"
        mdtf1.helper_text = f"{CU.tfs.dic['EXPLANATION_PLAYLIST_SONG_NAME'].value}"
        mdtf1.helper_text_mode = "on_focus"

        # content_obj.add_widget(mdlbl1)
        content_obj.add_widget(mdtf1)

        CU.show_input_dialog(
            title=f"Enter Name of New Songentry",
            content_obj=content_obj,
            size_hint=(.7, .4),
            text_button_ok="Add",
            ok_callback_set=lambda text_button, instance, *args, **kwargs: {
                self.add_lineup_entry(instance.text_field.text),
                self.refresh_list()
            })
    def show_dialog_add_playlist(self):
        """
        Show a dialog to ask the name of the new playlist.
        :return:
        """
        creation_time = datetime.now().strftime("%Y%m%d-%H%M%S")

        text = f"Concert_{creation_time}"

        content_obj = BoxLayout(orientation='vertical',
                                spacing="12dp",
                                size_hint_y=None)

        mdtf1 = MDTextField()
        mdtf1.text = text
        mdtf1.hint_text = f"Name of playlist"
        mdtf1.helper_text = f"{CU.tfs.dic['EXPLANATION_PLAYLIST_SONG_NAME'].value}"
        mdtf1.helper_text_mode = "on_focus"

        content_obj.add_widget(mdtf1)

        CU.show_input_dialog(
            title=f"Enter Name of New Playlist",
            content_obj=content_obj,
            size_hint=(.7, .4),
            text_button_ok="Add",
            text_button_cancel="Cancel",
            ok_callback_set=lambda *args, **kwargs:
            (self.add_playlist(mdtf1.text), self.refresh_list()))
Exemple #4
0
    def on_start(self):
        # As a proposal, the actual (default)value of the tf_workspace_path-param is copied to the clipboard:
        workspace_path_proposal = CU.tfs.dic['tf_workspace_path'].default_value
        pyperclip.copy(str(workspace_path_proposal))

        # In case the user did configure a customized path, that path will be filled in:
        text = "" if (CU.tfs.dic['tf_workspace_path'].default_value
                      == CU.tfs.dic['tf_workspace_path'].value
                      ) else f"{CU.tfs.dic['tf_workspace_path'].value}"

        content_obj = BoxLayout(orientation='vertical',
                                spacing="12dp",
                                size_hint_y=None)

        # mdlbl1 = MDLabel(text=str(CU.tfs.dic['EXPLANATION_WORKSPACE_PATH'].value))

        mdtf1 = MDTextField()

        mdtf1.text = text
        mdtf1.hint_text = f"{CU.tfs.dic['tf_workspace_path'].description}"
        mdtf1.helper_text = str(CU.tfs.dic['EXPLANATION_WORKSPACE_PATH'].value)
        mdtf1.helper_text_mode = "on_focus"

        # content_obj.add_widget(mdlbl1)
        content_obj.add_widget(mdtf1)

        CU.show_input_dialog(
            title=
            f"Enter Path to \"{CU.tfs.dic['WORKSPACE_NAME'].value}\"-Folder or to its Parent Folder",
            content_obj=content_obj,
            # hint_text=f"{CU.tfs.dic['tf_workspace_path'].description}",

            # size_hint=(.8, .4),
            text_button_ok="Load/Create",
            text_button_cancel="Cancel",
            ok_callback_set=lambda *args, **kwargs:
            (CU.tfs.dic['tf_workspace_path'].set_value(mdtf1.text),
             toast(str(CU.tfs.dic['tf_workspace_path'].value))),
            cancel_callback_set=lambda *args, **kwargs: toast(
                f"{CU.tfs.dic['WORKSPACE_NAME'].value} can still be changed anytime from the settings"
            ))