|
5 | 5 |
|
6 | 6 | def dialog_window(title,method,lang_data):
|
7 | 7 | # method = lang_data[util.remove_special_characters_from_text(get_first_word(method),case='capitalize')]
|
8 |
| - method = lang_data[util.remove_special_characters_from_text(method,case='capitalize')] |
| 8 | + method_lang = lang_data[util.remove_special_characters_from_text(method,case='capitalize')] |
9 | 9 | event, values = sg.Window('',
|
10 | 10 | [
|
11 | 11 | [
|
12 | 12 | sg.Frame('',[
|
13 | 13 | [
|
14 |
| - sg.Button(f'{method} ?',expand_x=True,expand_y=True,font=FONT_H1_BOLD,disabled_button_color=(color.LIGHT_BLUE, color.DARK_GRAY),disabled=True,border_width=0), |
| 14 | + sg.Button(f'{method_lang} ?',expand_x=True,expand_y=True,font=FONT_H1_BOLD,disabled_button_color=(color.LIGHT_BLUE, color.DARK_GRAY),disabled=True,border_width=0), |
15 | 15 | ],
|
16 | 16 | [
|
17 | 17 | sg.Button(lang_data[LOCAL_YES],k='-yes_key-',expand_x=True,expand_y=True,s=(5,2),font=FONT_H2_BOLD,button_color=(color.DIM_GREEN,color.DARK_GRAY),border_width=0),
|
18 | 18 | sg.Button(lang_data[LOCAL_NO],k='-no_key-',expand_x=True,expand_y=True,s=(5,2),font=FONT_H2_BOLD,button_color=(color.RED_ORANGE, color.DARK_GRAY),border_width=0)
|
19 | 19 | ],
|
20 | 20 | ],expand_x=True,expand_y=True,border_width=0,relief=sg.RELIEF_FLAT,element_justification="c",background_color=color.LIGHT_GRAY)
|
21 | 21 | ]
|
| 22 | +# if method == 'Install webui extension' else |
| 23 | +# [ |
| 24 | +# sg.Frame('',[ |
| 25 | +# [ |
| 26 | +# sg.Button(f'Install {title} ?',expand_x=True,expand_y=True,font=FONT_H1_BOLD,disabled_button_color=(color.DIM_GREEN, color.GRAY),disabled=True,border_width=0, |
| 27 | +# button_color=(color.DARK_GRAY, color.DARK_GRAY)), |
| 28 | +# ], |
| 29 | +# [ |
| 30 | +# # Do you wish to install ControlNet WebUI extension? it will also download about 19GB of controlnet adpters models |
| 31 | +# sg.ML(f""" |
| 32 | +# Please select the desired installation option: |
| 33 | + |
| 34 | +# Option 1 (Default): Install ControlNet and download adapter models (approximately 19GB). |
| 35 | + |
| 36 | +# Option 2: Install ControlNet only. (Choose if you already have the adapter models) |
| 37 | + |
| 38 | +# """, |
| 39 | +# font=FONT_H1,text_color=color.DIM_BLUE,background_color=color.DARK_GRAY,size=(80,8),expand_x=True,expand_y=True,visible=True,no_scrollbar=True,disabled=True,justification='l'), |
| 40 | +# ], |
| 41 | +# [ |
| 42 | +# sg.Button("Option 1",k='-yes_key-',expand_x=True,expand_y=True,s=(25,2),font=FONT_H2_BOLD,button_color=(color.DIM_GREEN,color.DARK_GRAY),border_width=0), |
| 43 | +# sg.Button("Option 2",k='-yes_key-',expand_x=True,expand_y=True,s=(25,2),font=FONT_H2_BOLD,button_color=(color.DIM_GREEN,color.DARK_GRAY),border_width=0), |
| 44 | + |
| 45 | +# sg.Button(lang_data[LOCAL_NO],k='-no_key-',expand_x=True,expand_y=True,s=(5,2),font=FONT_H2_BOLD,button_color=(color.RED_ORANGE, color.DARK_GRAY),border_width=0) |
| 46 | +# ], |
| 47 | +# ],expand_x=True,expand_y=True,border_width=0,relief=sg.RELIEF_FLAT,element_justification="c",background_color=color.LIGHT_GRAY) |
| 48 | + |
| 49 | +# ] |
| 50 | + if method != 'uninstall' else [ |
| 51 | + sg.Frame('',[ |
| 52 | + [ |
| 53 | + sg.Button(f'{method_lang} ?',expand_x=True,expand_y=True,font=FONT_H1_BOLD,disabled_button_color=(color.RED_ORANGE, color.GRAY),disabled=True,border_width=0, |
| 54 | + button_color=(color.DARK_GRAY, color.DARK_GRAY)), |
| 55 | + ], |
| 56 | + [ |
| 57 | + sg.ML(f""" |
| 58 | +{lang_data[LOCAL_WARN_PERM_DEL]} |
| 59 | +{title} {lang_data[LOCAL_WARN_CANNOT_BE_RECOVERED]} {lang_data[LOCAL_SURE_WANT_TO_CONTINUE]} |
| 60 | +""", |
| 61 | + font=FONT_H1,text_color=color.RED_ORANGE,background_color=color.DARK_GRAY,size=(80,5),expand_x=True,expand_y=True,visible=True,no_scrollbar=True,disabled=True,justification='c'), |
| 62 | + ], |
| 63 | + [ |
| 64 | + sg.Button(lang_data[LOCAL_YES],k='-yes_key-',expand_x=True,expand_y=True,s=(5,2),font=FONT_H2_BOLD,button_color=(color.DIM_GREEN,color.DARK_GRAY),border_width=0), |
| 65 | + sg.Button(lang_data[LOCAL_NO],k='-no_key-',expand_x=True,expand_y=True,s=(5,2),font=FONT_H2_BOLD,button_color=(color.RED_ORANGE, color.DARK_GRAY),border_width=0) |
| 66 | + ], |
| 67 | + ],expand_x=True,expand_y=True,border_width=0,relief=sg.RELIEF_FLAT,element_justification="c",background_color=color.LIGHT_GRAY) |
| 68 | + ] |
| 69 | + |
22 | 70 | ],modal=True, element_justification='c',no_titlebar=True,background_color=color.DARK_GRAY,auto_size_text=True,).read(close=True)
|
| 71 | + |
23 | 72 | if event == '-yes_key-':
|
24 | 73 | return True
|
25 | 74 | if event == '-no_key-':
|
|
0 commit comments