diff options
Diffstat (limited to 'release/scripts/ui')
-rw-r--r-- | release/scripts/ui/space_userpref.py | 11 | ||||
-rw-r--r-- | release/scripts/ui/space_userpref_keymap.py | 8 |
2 files changed, 8 insertions, 11 deletions
diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 049d22a44ed..5f9514c5885 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -91,15 +91,12 @@ class USERPREF_HT_header(bpy.types.Header): layout.operator_context = 'INVOKE_DEFAULT' if userpref.active_section == 'INPUT': - op = layout.operator("wm.keyconfig_export") - op.filepath = "keymap.py" - op = layout.operator("wm.keyconfig_import") - op.filepath = "keymap.py" + layout.operator("wm.keyconfig_export") + layout.operator("wm.keyconfig_import") elif userpref.active_section == 'ADDONS': - op = layout.operator("wm.addon_install") - op.filepath = "*.py" + layout.operator("wm.addon_install") elif userpref.active_section == 'THEMES': - op = layout.operator("ui.reset_default_theme") + layout.operator("ui.reset_default_theme") class USERPREF_PT_tabs(bpy.types.Panel): diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py index c9bae47bd39..24d77dbed32 100644 --- a/release/scripts/ui/space_userpref_keymap.py +++ b/release/scripts/ui/space_userpref_keymap.py @@ -513,7 +513,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator): bl_idname = "wm.keyconfig_import" bl_label = "Import Key Configuration..." - filepath = StringProperty(name="File Path", description="Filepath to write file to") + filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py") filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'}) filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'}) @@ -522,7 +522,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator): def execute(self, context): import shutil - if not self.properties.filepath: + if not self.properties.is_property_set("filepath"): raise Exception("Filepath not set") f = open(self.properties.filepath, "r") @@ -582,14 +582,14 @@ class WM_OT_keyconfig_export(bpy.types.Operator): bl_idname = "wm.keyconfig_export" bl_label = "Export Key Configuration..." - filepath = StringProperty(name="File Path", description="Filepath to write file to") + filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py") filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'}) filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'}) kc_name = StringProperty(name="KeyConfig Name", description="Name to save the key config as") def execute(self, context): - if not self.properties.filepath: + if not self.properties.is_property_set("filepath"): raise Exception("Filepath not set") f = open(self.properties.filepath, "w") |