diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-25 05:45:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-25 05:49:59 +0300 |
commit | 6cc5c28d15f45aee5c15d2560d9743d824d99ad3 (patch) | |
tree | c6e551e613a5f1c3c1efebf516529ee981bb4fd1 | |
parent | 3d8cbb534f8277840b51f0ec7003f77ee2391f16 (diff) |
Fix UI extension removal
App-templates & keymap names had their extensions removed twice.
Confusing for filenames containing dots.
-rw-r--r-- | release/scripts/modules/bpy/path.py | 5 | ||||
-rw-r--r-- | release/scripts/modules/rna_keymap_ui.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index d236af87052..845475b9180 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -201,7 +201,7 @@ _display_name_literals = { } -def display_name(name): +def display_name(name, *, has_ext=True): """ Creates a display string from name to be used menus and the user interface. Capitalize the first letter in all lowercase names, @@ -209,7 +209,8 @@ def display_name(name): filenames and module names. """ - name = _os.path.splitext(basename(name))[0] + if has_ext: + name = _os.path.splitext(basename(name))[0] # string replacements for disp_value, file_value in _display_name_literals.items(): diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py index 9d6020dc5ea..a6826c1d13c 100644 --- a/release/scripts/modules/rna_keymap_ui.py +++ b/release/scripts/modules/rna_keymap_ui.py @@ -369,7 +369,7 @@ def draw_keymaps(context, layout): spref = context.space_data # row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config") - text = bpy.path.display_name(kc_active.name) + text = bpy.path.display_name(kc_active.name, has_ext=False) if not text: text = "Blender (default)" diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index d27f8e303c9..937cec9eb29 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -588,7 +588,7 @@ class TOPBAR_MT_file(Menu): app_template = None if app_template: - layout.label(text=bpy.path.display_name(app_template)) + layout.label(text=bpy.path.display_name(app_template, has_ext=False)) layout.operator("wm.save_homefile") layout.operator( "wm.read_factory_settings", |