message_on_start.py
1 ''' 2 QuickSave allows you to download videos from YotuTube 3 Copyright (C) 2025 Andrés Chaparro 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <https://www.gnu.org/licenses/>. 17 ''' 18 19 # Importing MDButton from kivyMD 20 from kivymd.uix.button import ( 21 MDButton, 22 MDButtonText 23 ) 24 25 # Importing the MDialog 26 from kivymd.uix.dialog import ( 27 MDDialog, 28 MDDialogIcon, 29 MDDialogHeadlineText, 30 MDDialogSupportingText, 31 MDDialogButtonContainer, 32 MDDialogContentContainer, 33 ) 34 35 from kivy.uix.widget import Widget 36 37 ''' 38 This class displays the 39 message when the application 40 starts 41 ''' 42 43 class MessageOnStart(): 44 def start(self, dt): 45 self.first_message() 46 47 def first_message(self): 48 ''' 49 This is the first message, 50 it shows a welcome. 51 52 When you press the next 53 button it opens the next 54 message and closes this one 55 ''' 56 message_start = MDDialog( 57 # ----------------------------Icon----------------------------- 58 MDDialogIcon( 59 icon="tools", 60 ), 61 # -----------------------Headline text------------------------- 62 MDDialogHeadlineText( 63 text="¡Bienvenido!", 64 ), 65 # -----------------------Supporting text----------------------- 66 MDDialogSupportingText( 67 text="Esta aplicación permite descargar videos de youtube rapidamente. " 68 "Es software libre, no recopila información personal y no tiene anuncios. ", 69 halign="left", 70 ), 71 # ---------------------Button container------------------------ 72 73 MDDialogButtonContainer( 74 Widget(), 75 MDButton( 76 MDButtonText(text="Siguiente"), 77 style="text", 78 on_press=lambda *args: ( 79 self.second_message(), 80 message_start.dismiss() 81 ) 82 ), 83 spacing="8dp", 84 pos_hint={"center_x": 1} 85 ), 86 # ------------------------------------------------------------- 87 ) 88 message_start.open() 89 90 def second_message(self): 91 message_start = MDDialog( 92 # ----------------------------Icon----------------------------- 93 MDDialogIcon( 94 icon="tools", 95 ), 96 # -----------------------Headline text------------------------- 97 MDDialogHeadlineText( 98 text="¿Cómo empezar?", 99 ), 100 # -----------------------Supporting text----------------------- 101 MDDialogSupportingText( 102 text= 103 "1. Pegue la url del video en el espacio en blanco y oprima el boton Obtener. \n" 104 "2. Elija el formato que desee escribiendo el id en el espacio y oprima en Descargar. \n" 105 "3. ¡Y listo!, su descarga comenzará y su telefono vibrará cuando termine.", 106 halign="left", 107 ), 108 # ---------------------Button container------------------------ 109 MDDialogButtonContainer( 110 Widget(), 111 MDButton( 112 MDButtonText(text="Siguiente"), 113 style="text", 114 on_press=lambda *args: ( 115 self.third_message(), 116 message_start.dismiss() 117 ) 118 ), 119 spacing="8dp", 120 pos_hint={"center_x": 1} 121 ), 122 # ------------------------------------------------------------- 123 ) 124 125 message_start.open() 126 127 def third_message(self): 128 message_start = MDDialog( 129 # ----------------------------Icon----------------------------- 130 MDDialogIcon( 131 icon="tools", 132 ), 133 # -----------------------Headline text------------------------- 134 MDDialogHeadlineText( 135 text="Otras consideraciones", 136 ), 137 # -----------------------Supporting text----------------------- 138 MDDialogSupportingText( 139 text="" 140 " 1. Podrá cambiar la ubicación de guardado en configuraciones. " 141 "Por defecto esta en 'descargas'.\n" 142 " 2. Podrá cambiar el tema y el esquema de color en configuraciones.\n", 143 halign="left", 144 ), 145 # ---------------------Button container------------------------ 146 MDDialogButtonContainer( 147 Widget(), 148 MDButton( 149 MDButtonText(text="Aceptar"), 150 style="text", 151 on_press=lambda *args: ( 152 message_start.dismiss() 153 ) 154 ), 155 spacing="8dp", 156 pos_hint={"center_x": 1} 157 ), 158 # ------------------------------------------------------------- 159 ) 160 161 message_start.open() 162 163 164