|
10 | 10 | import warnings |
11 | 11 | import PySimpleGUI as sg |
12 | 12 |
|
13 | | -version = '6.0' |
| 13 | +version = '6.0.1' |
14 | 14 | __version__ = version.split()[0] |
15 | 15 |
|
16 | 16 |
|
|
52 | 52 | 5.2.0 14-Aug-2024 Fixed erronous import error (when import line started with "from") |
53 | 53 | Added a new "Path" input so that an arbitrary file can be executed easily (or edited) |
54 | 54 | 5.3.0 15-Aug-2024 One last change for the new path input... clear other fields if chars are entered |
| 55 | + 6.0 8-Apr-2026 Major version bump to match the commercial to LGPL3 license change |
| 56 | + 6.0.1 9-Apr-2026 Set the likely location of the demo programs as the initial path in the settings window |
| 57 | + |
55 | 58 | Copyright 2018-2026 PySinpleGUI. All rights reserved. |
56 | 59 | """ |
57 | 60 |
|
@@ -230,7 +233,7 @@ def get_line_number(file_path, string, dupe_lines): |
230 | 233 | if string.strip() == line.strip() and num not in dupe_lines: |
231 | 234 | lmn = num |
232 | 235 | return lmn |
233 | | - |
| 236 | + |
234 | 237 | def kill_ascii(s): |
235 | 238 | return "".join([x if ord(x) < 128 else '?' for x in s]) |
236 | 239 |
|
@@ -502,7 +505,7 @@ def find_in_file(string, demo_files_dict, regex=False, verbose=False, window=Non |
502 | 505 | list_of_matches.append(_match.strip()) |
503 | 506 | file_array_old.append(file_array_new) |
504 | 507 | file_array_old.append(file_match_list) |
505 | | - |
| 508 | + |
506 | 509 | if tail in file_lines_dict: |
507 | 510 | for i in range(1, 100): |
508 | 511 | new_tail = f'{tail}_{i}' |
@@ -589,10 +592,13 @@ def settings_window(): |
589 | 592 | except: |
590 | 593 | global_theme = '' |
591 | 594 |
|
| 595 | + # normally the demo programs are located in a folder in the same folder as the demo browser |
| 596 | + default_demo_programs_path = os.path.join(os.path.dirname(__file__), 'demo_programs') |
| 597 | + |
592 | 598 | layout = [[sg.T('Program Settings', font='DEFAULT 25')], |
593 | 599 | [sg.T('Path to Tree', font='_ 16')], |
594 | | - [sg.Combo(sorted(sg.user_settings_get_entry('-folder names-', [])), default_value=sg.user_settings_get_entry('-demos folder-', get_demo_path()), size=(50, 1), key='-FOLDERNAME-'), |
595 | | - sg.FolderBrowse('Folder Browse', target='-FOLDERNAME-'), sg.B('Clear History')], |
| 600 | + [sg.Combo(sorted(sg.user_settings_get_entry('-folder names-', [])), default_value=sg.user_settings_get_entry('-demos folder-', get_demo_path()), size=(50, 1), auto_size_text=False, key='-FOLDERNAME-'), |
| 601 | + sg.FolderBrowse('Folder Browse', target='-FOLDERNAME-', initial_folder=default_demo_programs_path), sg.B('Clear History')], |
596 | 602 | [sg.T('Editor Program', font='_ 16')], |
597 | 603 | [sg.T('Leave blank to use global default'), sg.T(global_editor)], |
598 | 604 | [ sg.In(sg.user_settings_get_entry('-editor program-', ''),k='-EDITOR PROGRAM-'), sg.FileBrowse()], |
|
0 commit comments