Sculpt:
[blender.git] / release / scripts / ui / space_userpref.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21
22
23 class USERPREF_HT_header(bpy.types.Header):
24     bl_space_type = 'USER_PREFERENCES'
25
26     def draw(self, context):
27         layout = self.layout
28         layout.template_header(menus=False)
29
30         userpref = context.user_preferences
31
32         layout.operator_context = 'EXEC_AREA'
33         layout.operator("wm.save_homefile", text="Save As Default")
34
35         if userpref.active_section == 'INPUT':
36             layout.operator_context = 'INVOKE_DEFAULT'
37             layout.operator("wm.keyconfig_export", "Export Key Configuration...").path = "keymap.py"
38
39
40 class USERPREF_MT_view(bpy.types.Menu):
41     bl_label = "View"
42
43     def draw(self, context):
44         pass # layout = self.layout
45
46
47 class USERPREF_PT_tabs(bpy.types.Panel):
48     bl_label = ""
49     bl_space_type = 'USER_PREFERENCES'
50     bl_region_type = 'WINDOW'
51     bl_show_header = False
52
53     def draw(self, context):
54         layout = self.layout
55
56         userpref = context.user_preferences
57
58         layout.prop(userpref, "active_section", expand=True)
59
60
61 class USERPREF_PT_interface(bpy.types.Panel):
62     bl_space_type = 'USER_PREFERENCES'
63     bl_label = "Interface"
64     bl_region_type = 'WINDOW'
65     bl_show_header = False
66
67     def poll(self, context):
68         userpref = context.user_preferences
69         return (userpref.active_section == 'INTERFACE')
70
71     def draw(self, context):
72         layout = self.layout
73
74         userpref = context.user_preferences
75         view = userpref.view
76
77         split = layout.split()
78
79         col = split.column()
80         sub = col.split(percentage=0.85)
81
82         sub1 = sub.column()
83         sub1.label(text="Display:")
84         sub1.prop(view, "tooltips")
85         sub1.prop(view, "display_object_info", text="Object Info")
86         sub1.prop(view, "use_large_cursors")
87         sub1.prop(view, "show_view_name", text="View Name")
88         sub1.prop(view, "show_playback_fps", text="Playback FPS")
89         sub1.prop(view, "global_scene")
90         sub1.prop(view, "pin_floating_panels")
91         sub1.prop(view, "object_center_size")
92         sub1.separator()
93         sub1.separator()
94         sub1.separator()
95         sub1.prop(view, "show_mini_axis", text="Display Mini Axis")
96         sub2 = sub1.column()
97         sub2.enabled = view.show_mini_axis
98         sub2.prop(view, "mini_axis_size", text="Size")
99         sub2.prop(view, "mini_axis_brightness", text="Brightness")
100
101         col = split.column()
102         sub = col.split(percentage=0.85)
103
104         sub1 = sub.column()
105         sub1.label(text="View Manipulation:")
106         sub1.prop(view, "auto_depth")
107         sub1.prop(view, "global_pivot")
108         sub1.prop(view, "zoom_to_mouse")
109         sub1.prop(view, "rotate_around_selection")
110         sub1.separator()
111
112
113         sub1.prop(view, "auto_perspective")
114         sub1.prop(view, "smooth_view")
115         sub1.prop(view, "rotation_angle")
116
117         col = split.column()
118         sub = col.split(percentage=0.85)
119         sub1 = sub.column()
120
121 #Toolbox doesn't exist yet
122 #               sub1.label(text="Toolbox:")
123 #               sub1.prop(view, "use_column_layout")
124 #               sub1.label(text="Open Toolbox Delay:")
125 #               sub1.prop(view, "open_left_mouse_delay", text="Hold LMB")
126 #               sub1.prop(view, "open_right_mouse_delay", text="Hold RMB")
127
128         #manipulator
129         sub1.prop(view, "use_manipulator")
130         sub2 = sub1.column()
131         sub2.enabled = view.use_manipulator
132         sub2.prop(view, "manipulator_size", text="Size")
133         sub2.prop(view, "manipulator_handle_size", text="Handle Size")
134         sub2.prop(view, "manipulator_hotspot", text="Hotspot")
135
136         sub1.separator()
137         sub1.separator()
138         sub1.separator()
139
140         sub1.label(text="Menus:")
141         sub1.prop(view, "open_mouse_over")
142         sub1.label(text="Menu Open Delay:")
143         sub1.prop(view, "open_toplevel_delay", text="Top Level")
144         sub1.prop(view, "open_sublevel_delay", text="Sub Level")
145
146
147 class USERPREF_PT_edit(bpy.types.Panel):
148     bl_space_type = 'USER_PREFERENCES'
149     bl_label = "Edit"
150     bl_region_type = 'WINDOW'
151     bl_show_header = False
152
153     def poll(self, context):
154         userpref = context.user_preferences
155         return (userpref.active_section == 'EDITING')
156
157     def draw(self, context):
158         layout = self.layout
159
160         userpref = context.user_preferences
161         edit = userpref.edit
162
163         split = layout.split()
164
165         col = split.column()
166         sub = col.split(percentage=0.85)
167
168         sub1 = sub.column()
169         sub1.label(text="Link Materials To:")
170         sub1.row().prop(edit, "material_link", expand=True)
171         sub1.separator()
172         sub1.separator()
173         sub1.separator()
174         sub1.label(text="New Objects:")
175         sub1.prop(edit, "enter_edit_mode")
176         sub1.label(text="Align To:")
177         sub1.row().prop(edit, "object_align", expand=True)
178         sub1.separator()
179         sub1.separator()
180         sub1.separator()
181
182         sub1.label(text="Undo:")
183         sub1.prop(edit, "global_undo")
184         sub1.prop(edit, "undo_steps", text="Steps")
185         sub1.prop(edit, "undo_memory_limit", text="Memory Limit")
186
187         col = split.column()
188         sub = col.split(percentage=0.85)
189
190         sub1 = sub.column()
191         sub1.label(text="Snap:")
192         sub1.prop(edit, "snap_translate", text="Translate")
193         sub1.prop(edit, "snap_rotate", text="Rotate")
194         sub1.prop(edit, "snap_scale", text="Scale")
195         sub1.separator()
196         sub1.separator()
197         sub1.separator()
198         sub1.label(text="Grease Pencil:")
199         sub1.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
200         sub1.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
201         # sub1.prop(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
202         sub1.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
203         sub1.prop(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
204
205         col = split.column()
206         sub = col.split(percentage=0.85)
207
208         sub1 = sub.column()
209         sub1.label(text="Keyframing:")
210         sub1.prop(edit, "use_visual_keying")
211         sub1.prop(edit, "keyframe_insert_needed", text="Only Insert Needed")
212         sub1.separator()
213         sub1.label(text="New F-Curve Defaults:")
214         sub1.prop(edit, "new_interpolation_type", text="Interpolation")
215         sub1.separator()
216         sub1.prop(edit, "auto_keying_enable", text="Auto Keyframing:")
217         sub2 = sub1.column()
218         sub2.active = edit.auto_keying_enable
219         sub2.prop(edit, "auto_keyframe_insert_keyingset", text="Only Insert for Keying Set")
220         sub2.prop(edit, "auto_keyframe_insert_available", text="Only Insert Available")
221
222         sub1.separator()
223         sub1.separator()
224         sub1.separator()
225
226         sub1.label(text="Transform:")
227         sub1.prop(edit, "drag_immediately")
228
229         sub1.separator()
230         sub1.separator()
231         sub1.separator()
232
233         col = split.column()
234         sub = col.split(percentage=0.85)
235
236         sub1 = sub.column()
237         sub1.label(text="Duplicate Data:")
238         sub1.prop(edit, "duplicate_mesh", text="Mesh")
239         sub1.prop(edit, "duplicate_surface", text="Surface")
240         sub1.prop(edit, "duplicate_curve", text="Curve")
241         sub1.prop(edit, "duplicate_text", text="Text")
242         sub1.prop(edit, "duplicate_metaball", text="Metaball")
243         sub1.prop(edit, "duplicate_armature", text="Armature")
244         sub1.prop(edit, "duplicate_lamp", text="Lamp")
245         sub1.prop(edit, "duplicate_material", text="Material")
246         sub1.prop(edit, "duplicate_texture", text="Texture")
247         sub1.prop(edit, "duplicate_ipo", text="F-Curve")
248         sub1.prop(edit, "duplicate_action", text="Action")
249         sub1.prop(edit, "duplicate_particle", text="Particle")
250
251
252 class USERPREF_PT_system(bpy.types.Panel):
253     bl_space_type = 'USER_PREFERENCES'
254     bl_label = "System"
255     bl_region_type = 'WINDOW'
256     bl_show_header = False
257
258     def poll(self, context):
259         userpref = context.user_preferences
260         return (userpref.active_section == 'SYSTEM')
261
262     def draw(self, context):
263         layout = self.layout
264
265         userpref = context.user_preferences
266         system = userpref.system
267
268         split = layout.split()
269
270         col = split.column()
271         sub = col.split(percentage=0.9)
272
273         sub1 = sub.column()
274         sub1.label(text="General:")
275         sub1.prop(system, "dpi")
276         sub1.prop(system, "frame_server_port")
277         sub1.prop(system, "scrollback", text="Console Scrollback")
278         sub1.prop(system, "auto_run_python_scripts")
279
280         sub1.separator()
281         sub1.separator()
282         sub1.separator()
283
284         sub1.label(text="Sound:")
285         sub1.row().prop(system, "audio_device", expand=True)
286         sub2 = sub1.column()
287         sub2.active = system.audio_device != 'NONE'
288         sub2.prop(system, "enable_all_codecs")
289         sub2.prop(system, "game_sound")
290         sub2.prop(system, "audio_channels", text="Channels")
291         sub2.prop(system, "audio_mixing_buffer", text="Mixing Buffer")
292         sub2.prop(system, "audio_sample_rate", text="Sample Rate")
293         sub2.prop(system, "audio_sample_format", text="Sample Format")
294
295         col = split.column()
296         sub = col.split(percentage=0.9)
297
298         sub1 = sub .column()
299         sub1.label(text="Weight Colors:")
300         sub1.prop(system, "use_weight_color_range", text="Use Custom Range")
301         sub2 = sub1.column()
302         sub2.active = system.use_weight_color_range
303         sub2.template_color_ramp(system, "weight_color_range", expand=True)
304
305         sub1.separator()
306         sub1.separator()
307         sub1.separator()
308
309         sub1.prop(system, "language")
310         sub1.label(text="Translate:")
311         sub1.prop(system, "translate_tooltips", text="Tooltips")
312         sub1.prop(system, "translate_buttons", text="Labels")
313         sub1.prop(system, "translate_toolbox", text="Toolbox")
314
315         sub1.separator()
316
317         sub1.prop(system, "use_textured_fonts")
318
319         col = split.column()
320         sub = col.split(percentage=0.9)
321
322         sub1 = sub.column()
323
324         sub1.label(text="OpenGL:")
325         sub1.prop(system, "clip_alpha", slider=True)
326         sub1.prop(system, "use_mipmaps")
327         sub1.prop(system, "use_vbos")
328         sub1.label(text="Window Draw Method:")
329         sub1.row().prop(system, "window_draw_method", expand=True)
330         sub1.label(text="Textures:")
331         sub1.prop(system, "gl_texture_limit", text="Limit Size")
332         sub1.prop(system, "texture_time_out", text="Time Out")
333         sub1.prop(system, "texture_collection_rate", text="Collection Rate")
334
335         sub1.separator()
336         sub1.separator()
337         sub1.separator()
338
339         sub1.label(text="Sequencer:")
340         sub1.prop(system, "prefetch_frames")
341         sub1.prop(system, "memory_cache_limit")
342
343
344 class USERPREF_PT_theme(bpy.types.Panel):
345     bl_space_type = 'USER_PREFERENCES'
346     bl_label = "Themes"
347     bl_region_type = 'WINDOW'
348     bl_show_header = False
349
350     def poll(self, context):
351         userpref = context.user_preferences
352
353         return (userpref.active_section == 'THEMES')
354
355     def draw(self, context):
356         layout = self.layout
357
358         theme = context.user_preferences.themes[0]
359
360
361         split = layout.split(percentage=0.33)
362         split.prop(theme, "active_theme", text="")
363
364         layout.separator()
365
366         split = layout.split()
367
368         if theme.active_theme == 'VIEW_3D':
369             v3d = theme.view_3d
370
371             col = split.column()
372             col.prop(v3d, "back")
373             col.prop(v3d, "button")
374             col.prop(v3d, "button_title")
375             col.prop(v3d, "button_text")
376             col.prop(v3d, "header")
377
378             col = split.column()
379             col.prop(v3d, "grid")
380             col.prop(v3d, "wire")
381             col.prop(v3d, "lamp", slider=True)
382             col.prop(v3d, "editmesh_active", slider=True)
383
384             col = split.column()
385
386             col.prop(v3d, "object_selected")
387             col.prop(v3d, "object_active")
388             col.prop(v3d, "object_grouped")
389             col.prop(v3d, "object_grouped_active")
390             col.prop(v3d, "transform")
391
392             col = split.column()
393             col.prop(v3d, "vertex")
394             col.prop(v3d, "face", slider=True)
395             col.prop(v3d, "normal")
396             col.prop(v3d, "bone_solid")
397             col.prop(v3d, "bone_pose")
398
399 #           col.prop(v3d, "edge") Doesn't seem to work
400         elif theme.active_theme == 'USER_INTERFACE':
401
402             ui = theme.user_interface.wcol_regular
403
404             layout.label(text="Regular:")
405
406             sub = layout.row()
407             sub1 = sub.column()
408             sub1.prop(ui, "outline")
409             sub1.prop(ui, "item", slider=True)
410             sub1 = sub.column()
411             sub1.prop(ui, "inner", slider=True)
412             sub1.prop(ui, "inner_sel", slider=True)
413             sub1 = sub.column()
414             sub1.prop(ui, "text")
415             sub1.prop(ui, "text_sel")
416             sub1 = sub.column()
417             sub1.prop(ui, "shaded")
418             sub2 = sub1.column(align=True)
419             sub2.active = ui.shaded
420             sub2.prop(ui, "shadetop")
421             sub2.prop(ui, "shadedown")
422             layout.separator()
423
424             ui = theme.user_interface.wcol_tool
425             layout.label(text="Tool:")
426
427             sub = layout.row()
428             sub1 = sub.column()
429             sub1.prop(ui, "outline")
430             sub1.prop(ui, "item", slider=True)
431             sub1 = sub.column()
432             sub1.prop(ui, "inner", slider=True)
433             sub1.prop(ui, "inner_sel", slider=True)
434             sub1 = sub.column()
435             sub1.prop(ui, "text")
436             sub1.prop(ui, "text_sel")
437             sub1 = sub.column()
438             sub1.prop(ui, "shaded")
439             sub2 = sub1.column(align=True)
440             sub2.active = ui.shaded
441             sub2.prop(ui, "shadetop")
442             sub2.prop(ui, "shadedown")
443
444             ui = theme.user_interface.wcol_radio
445             layout.label(text="Radio Buttons:")
446
447             sub = layout.row()
448             sub1 = sub.column()
449             sub1.prop(ui, "outline")
450             sub1.prop(ui, "item", slider=True)
451             sub1 = sub.column()
452             sub1.prop(ui, "inner", slider=True)
453             sub1.prop(ui, "inner_sel", slider=True)
454             sub1 = sub.column()
455             sub1.prop(ui, "text")
456             sub1.prop(ui, "text_sel")
457             sub1 = sub.column()
458             sub1.prop(ui, "shaded")
459             sub2 = sub1.column(align=True)
460             sub2.active = ui.shaded
461             sub2.prop(ui, "shadetop")
462             sub2.prop(ui, "shadedown")
463
464             ui = theme.user_interface.wcol_text
465             layout.label(text="Text:")
466
467             sub = layout.row()
468             sub1 = sub.column()
469             sub1.prop(ui, "outline")
470             sub1.prop(ui, "item", slider=True)
471             sub1 = sub.column()
472             sub1.prop(ui, "inner", slider=True)
473             sub1.prop(ui, "inner_sel", slider=True)
474             sub1 = sub.column()
475             sub1.prop(ui, "text")
476             sub1.prop(ui, "text_sel")
477             sub1 = sub.column()
478             sub1.prop(ui, "shaded")
479             sub2 = sub1.column(align=True)
480             sub2.active = ui.shaded
481             sub2.prop(ui, "shadetop")
482             sub2.prop(ui, "shadedown")
483
484             ui = theme.user_interface.wcol_option
485             layout.label(text="Option:")
486
487             sub = layout.row()
488             sub1 = sub.column()
489             sub1.prop(ui, "outline")
490             sub1.prop(ui, "item", slider=True)
491             sub1 = sub.column()
492             sub1.prop(ui, "inner", slider=True)
493             sub1.prop(ui, "inner_sel", slider=True)
494             sub1 = sub.column()
495             sub1.prop(ui, "text")
496             sub1.prop(ui, "text_sel")
497             sub1 = sub.column()
498             sub1.prop(ui, "shaded")
499             sub2 = sub1.column(align=True)
500             sub2.active = ui.shaded
501             sub2.prop(ui, "shadetop")
502             sub2.prop(ui, "shadedown")
503
504             ui = theme.user_interface.wcol_toggle
505             layout.label(text="Toggle:")
506
507             sub = layout.row()
508             sub1 = sub.column()
509             sub1.prop(ui, "outline")
510             sub1.prop(ui, "item", slider=True)
511             sub1 = sub.column()
512             sub1.prop(ui, "inner", slider=True)
513             sub1.prop(ui, "inner_sel", slider=True)
514             sub1 = sub.column()
515             sub1.prop(ui, "text")
516             sub1.prop(ui, "text_sel")
517             sub1 = sub.column()
518             sub1.prop(ui, "shaded")
519             sub2 = sub1.column(align=True)
520             sub2.active = ui.shaded
521             sub2.prop(ui, "shadetop")
522             sub2.prop(ui, "shadedown")
523
524             ui = theme.user_interface.wcol_num
525             layout.label(text="Number Field:")
526
527             sub = layout.row()
528             sub1 = sub.column()
529             sub1.prop(ui, "outline")
530             sub1.prop(ui, "item", slider=True)
531             sub1 = sub.column()
532             sub1.prop(ui, "inner", slider=True)
533             sub1.prop(ui, "inner_sel", slider=True)
534             sub1 = sub.column()
535             sub1.prop(ui, "text")
536             sub1.prop(ui, "text_sel")
537             sub1 = sub.column()
538             sub1.prop(ui, "shaded")
539             sub2 = sub1.column(align=True)
540             sub2.active = ui.shaded
541             sub2.prop(ui, "shadetop")
542             sub2.prop(ui, "shadedown")
543
544             ui = theme.user_interface.wcol_numslider
545             layout.label(text="Value Slider:")
546
547             sub = layout.row()
548             sub1 = sub.column()
549             sub1.prop(ui, "outline")
550             sub1.prop(ui, "item", slider=True)
551             sub1 = sub.column()
552             sub1.prop(ui, "inner", slider=True)
553             sub1.prop(ui, "inner_sel", slider=True)
554             sub1 = sub.column()
555             sub1.prop(ui, "text")
556             sub1.prop(ui, "text_sel")
557             sub1 = sub.column()
558             sub1.prop(ui, "shaded")
559             sub2 = sub1.column(align=True)
560             sub2.active = ui.shaded
561             sub2.prop(ui, "shadetop")
562             sub2.prop(ui, "shadedown")
563
564             ui = theme.user_interface.wcol_box
565             layout.label(text="Box:")
566
567             sub = layout.row()
568             sub1 = sub.column()
569             sub1.prop(ui, "outline")
570             sub1.prop(ui, "item", slider=True)
571             sub1 = sub.column()
572             sub1.prop(ui, "inner", slider=True)
573             sub1.prop(ui, "inner_sel", slider=True)
574             sub1 = sub.column()
575             sub1.prop(ui, "text")
576             sub1.prop(ui, "text_sel")
577             sub1 = sub.column()
578             sub1.prop(ui, "shaded")
579             sub2 = sub1.column(align=True)
580             sub2.active = ui.shaded
581             sub2.prop(ui, "shadetop")
582             sub2.prop(ui, "shadedown")
583
584             ui = theme.user_interface.wcol_menu
585             layout.label(text="Menu:")
586
587             sub = layout.row()
588             sub1 = sub.column()
589             sub1.prop(ui, "outline")
590             sub1.prop(ui, "item", slider=True)
591             sub1 = sub.column()
592             sub1.prop(ui, "inner", slider=True)
593             sub1.prop(ui, "inner_sel", slider=True)
594             sub1 = sub.column()
595             sub1.prop(ui, "text")
596             sub1.prop(ui, "text_sel")
597             sub1 = sub.column()
598             sub1.prop(ui, "shaded")
599             sub2 = sub1.column(align=True)
600             sub2.active = ui.shaded
601             sub2.prop(ui, "shadetop")
602             sub2.prop(ui, "shadedown")
603
604             ui = theme.user_interface.wcol_pulldown
605             layout.label(text="Pulldown:")
606
607             sub = layout.row()
608             sub1 = sub.column()
609             sub1.prop(ui, "outline")
610             sub1.prop(ui, "item", slider=True)
611             sub1 = sub.column()
612             sub1.prop(ui, "inner", slider=True)
613             sub1.prop(ui, "inner_sel", slider=True)
614             sub1 = sub.column()
615             sub1.prop(ui, "text")
616             sub1.prop(ui, "text_sel")
617             sub1 = sub.column()
618             sub1.prop(ui, "shaded")
619             sub2 = sub1.column(align=True)
620             sub2.active = ui.shaded
621             sub2.prop(ui, "shadetop")
622             sub2.prop(ui, "shadedown")
623
624             ui = theme.user_interface.wcol_menu_back
625             layout.label(text="Menu Back:")
626
627             sub = layout.row()
628             sub1 = sub.column()
629             sub1.prop(ui, "outline")
630             sub1.prop(ui, "item", slider=True)
631             sub1 = sub.column()
632             sub1.prop(ui, "inner", slider=True)
633             sub1.prop(ui, "inner_sel", slider=True)
634             sub1 = sub.column()
635             sub1.prop(ui, "text")
636             sub1.prop(ui, "text_sel")
637             sub1 = sub.column()
638             sub1.prop(ui, "shaded")
639             sub2 = sub1.column(align=True)
640             sub2.active = ui.shaded
641             sub2.prop(ui, "shadetop")
642             sub2.prop(ui, "shadedown")
643
644             ui = theme.user_interface.wcol_menu_item
645             layout.label(text="Menu Item:")
646
647             sub = layout.row()
648             sub1 = sub.column()
649             sub1.prop(ui, "outline")
650             sub1.prop(ui, "item", slider=True)
651             sub1 = sub.column()
652             sub1.prop(ui, "inner", slider=True)
653             sub1.prop(ui, "inner_sel", slider=True)
654             sub1 = sub.column()
655             sub1.prop(ui, "text")
656             sub1.prop(ui, "text_sel")
657             sub1 = sub.column()
658             sub1.prop(ui, "shaded")
659             sub2 = sub1.column(align=True)
660             sub2.active = ui.shaded
661             sub2.prop(ui, "shadetop")
662             sub2.prop(ui, "shadedown")
663
664             ui = theme.user_interface.wcol_scroll
665             layout.label(text="Scroll Bar:")
666
667             sub = layout.row()
668             sub1 = sub.column()
669             sub1.prop(ui, "outline")
670             sub1.prop(ui, "item", slider=True)
671             sub1 = sub.column()
672             sub1.prop(ui, "inner", slider=True)
673             sub1.prop(ui, "inner_sel", slider=True)
674             sub1 = sub.column()
675             sub1.prop(ui, "text")
676             sub1.prop(ui, "text_sel")
677             sub1 = sub.column()
678             sub1.prop(ui, "shaded")
679             sub2 = sub1.column(align=True)
680             sub2.active = ui.shaded
681             sub2.prop(ui, "shadetop")
682             sub2.prop(ui, "shadedown")
683
684             ui = theme.user_interface.wcol_list_item
685             layout.label(text="List Item:")
686
687             sub = layout.row()
688             sub1 = sub.column()
689             sub1.prop(ui, "outline")
690             sub1.prop(ui, "item", slider=True)
691             sub1 = sub.column()
692             sub1.prop(ui, "inner", slider=True)
693             sub1.prop(ui, "inner_sel", slider=True)
694             sub1 = sub.column()
695             sub1.prop(ui, "text")
696             sub1.prop(ui, "text_sel")
697             sub1 = sub.column()
698             sub1.prop(ui, "shaded")
699             sub2 = sub1.column(align=True)
700             sub2.active = ui.shaded
701             sub2.prop(ui, "shadetop")
702             sub2.prop(ui, "shadedown")
703
704             ui = theme.user_interface.wcol_state
705             layout.label(text="State:")
706
707             sub = layout.row()
708             sub1 = sub.column()
709             sub1.prop(ui, "inner_anim")
710             sub1.prop(ui, "inner_anim_sel")
711             sub1 = sub.column()
712             sub1.prop(ui, "inner_driven")
713             sub1.prop(ui, "inner_driven_sel")
714             sub1 = sub.column()
715             sub1.prop(ui, "inner_key")
716             sub1.prop(ui, "inner_key_sel")
717             sub1 = sub.column()
718             sub1.prop(ui, "blend")
719
720             ui = theme.user_interface
721             layout.separator()
722
723             sub = layout.row()
724             sub.prop(ui, "icon_file")
725
726             layout.separator()
727             layout.separator()
728
729
730         elif theme.active_theme == 'GRAPH_EDITOR':
731             graph = theme.graph_editor
732
733             col = split.column()
734             col.prop(graph, "back")
735             col.prop(graph, "button")
736             col.prop(graph, "button_title")
737             col.prop(graph, "button_text")
738
739             col = split.column()
740             col.prop(graph, "header")
741             col.prop(graph, "grid")
742             col.prop(graph, "list")
743             col.prop(graph, "channel_group")
744
745             col = split.column()
746             col.prop(graph, "active_channels_group")
747             col.prop(graph, "dopesheet_channel")
748             col.prop(graph, "dopesheet_subchannel")
749             col.prop(graph, "vertex")
750
751             col = split.column()
752             col.prop(graph, "current_frame")
753             col.prop(graph, "handle_vertex")
754             col.prop(graph, "handle_vertex_select")
755             col.separator()
756             col.prop(graph, "handle_vertex_size")
757
758         elif theme.active_theme == 'FILE_BROWSER':
759             file_browse = theme.file_browser
760
761             col = split.column()
762             col.prop(file_browse, "back")
763             col.prop(file_browse, "text")
764             col.prop(file_browse, "text_hi")
765
766             col = split.column()
767             col.prop(file_browse, "header")
768             col.prop(file_browse, "list")
769
770             col = split.column()
771             col.prop(file_browse, "selected_file")
772             col.prop(file_browse, "tiles")
773
774             col = split.column()
775             col.prop(file_browse, "active_file")
776             col.prop(file_browse, "active_file_text")
777
778         elif theme.active_theme == 'NLA_EDITOR':
779             nla = theme.nla_editor
780
781             col = split.column()
782             col.prop(nla, "back")
783             col.prop(nla, "button")
784             col.prop(nla, "button_title")
785
786             col = split.column()
787             col.prop(nla, "button_text")
788             col.prop(nla, "text")
789             col.prop(nla, "header")
790
791             col = split.column()
792             col.prop(nla, "grid")
793             col.prop(nla, "bars")
794             col.prop(nla, "bars_selected")
795
796             col = split.column()
797             col.prop(nla, "strips")
798             col.prop(nla, "strips_selected")
799             col.prop(nla, "current_frame")
800
801         elif theme.active_theme == 'DOPESHEET_EDITOR':
802             dope = theme.dopesheet_editor
803
804             col = split.column()
805             col.prop(dope, "back")
806             col.prop(dope, "list")
807             col.prop(dope, "text")
808             col.prop(dope, "header")
809
810             col = split.column()
811             col.prop(dope, "grid")
812             col.prop(dope, "channels")
813             col.prop(dope, "channels_selected")
814             col.prop(dope, "channel_group")
815
816             col = split.column()
817             col.prop(dope, "active_channels_group")
818             col.prop(dope, "long_key")
819             col.prop(dope, "long_key_selected")
820
821             col = split.column()
822             col.prop(dope, "current_frame")
823             col.prop(dope, "dopesheet_channel")
824             col.prop(dope, "dopesheet_subchannel")
825
826         elif theme.active_theme == 'IMAGE_EDITOR':
827             image = theme.image_editor
828
829             col = split.column()
830             col.prop(image, "back")
831             col.prop(image, "button")
832
833             col = split.column()
834             col.prop(image, "button_title")
835             col.prop(image, "button_text")
836
837             col = split.column()
838             col.prop(image, "header")
839
840             col = split.column()
841             col.prop(image, "editmesh_active", slider=True)
842
843         elif theme.active_theme == 'SEQUENCE_EDITOR':
844             seq = theme.sequence_editor
845
846             col = split.column()
847             col.prop(seq, "back")
848             col.prop(seq, "button")
849             col.prop(seq, "button_title")
850             col.prop(seq, "button_text")
851             col.prop(seq, "text")
852
853             col = split.column()
854             col.prop(seq, "header")
855             col.prop(seq, "grid")
856             col.prop(seq, "movie_strip")
857             col.prop(seq, "image_strip")
858             col.prop(seq, "scene_strip")
859
860             col = split.column()
861             col.prop(seq, "audio_strip")
862             col.prop(seq, "effect_strip")
863             col.prop(seq, "plugin_strip")
864             col.prop(seq, "transition_strip")
865
866             col = split.column()
867             col.prop(seq, "meta_strip")
868             col.prop(seq, "current_frame")
869             col.prop(seq, "keyframe")
870             col.prop(seq, "draw_action")
871
872         elif theme.active_theme == 'PROPERTIES':
873             prop = theme.properties
874
875             col = split.column()
876             col.prop(prop, "back")
877
878             col = split.column()
879             col.prop(prop, "title")
880
881             col = split.column()
882             col.prop(prop, "text")
883
884             col = split.column()
885             col.prop(prop, "header")
886
887         elif theme.active_theme == 'TEXT_EDITOR':
888             text = theme.text_editor
889
890             col = split.column()
891             col.prop(text, "back")
892             col.prop(text, "button")
893             col.prop(text, "button_title")
894             col.prop(text, "button_text")
895
896             col = split.column()
897             col.prop(text, "text")
898             col.prop(text, "text_hi")
899             col.prop(text, "header")
900             col.prop(text, "line_numbers_background")
901
902             col = split.column()
903             col.prop(text, "selected_text")
904             col.prop(text, "cursor")
905             col.prop(text, "syntax_builtin")
906             col.prop(text, "syntax_special")
907
908             col = split.column()
909             col.prop(text, "syntax_comment")
910             col.prop(text, "syntax_string")
911             col.prop(text, "syntax_numbers")
912
913         elif theme.active_theme == 'TIMELINE':
914             time = theme.timeline
915
916             col = split.column()
917             col.prop(time, "back")
918             col.prop(time, "text")
919
920             col = split.column()
921             col.prop(time, "header")
922
923             col = split.column()
924             col.prop(time, "grid")
925
926             col = split.column()
927             col.prop(time, "current_frame")
928
929         elif theme.active_theme == 'NODE_EDITOR':
930             node = theme.node_editor
931
932             col = split.column()
933             col.prop(node, "back")
934             col.prop(node, "button")
935             col.prop(node, "button_title")
936             col.prop(node, "button_text")
937
938
939             col = split.column()
940             col.prop(node, "text")
941             col.prop(node, "text_hi")
942             col.prop(node, "header")
943             col.prop(node, "wires")
944
945             col = split.column()
946             col.prop(node, "wire_select")
947             col.prop(node, "selected_text")
948             col.prop(node, "node_backdrop", slider=True)
949             col.prop(node, "in_out_node")
950
951             col = split.column()
952             col.prop(node, "converter_node")
953             col.prop(node, "operator_node")
954             col.prop(node, "group_node")
955
956         elif theme.active_theme == 'LOGIC_EDITOR':
957             logic = theme.logic_editor
958
959             col = split.column()
960             col.prop(logic, "back")
961             col.prop(logic, "button")
962
963             col = split.column()
964             col.prop(logic, "button_title")
965             col.prop(logic, "button_text")
966
967             col = split.column()
968             col.prop(logic, "text")
969             col.prop(logic, "header")
970
971             col = split.column()
972             col.prop(logic, "panel")
973
974         elif theme.active_theme == 'OUTLINER':
975             out = theme.outliner
976
977             col = split.column()
978             col.prop(out, "back")
979
980             col = split.column()
981             col.prop(out, "text")
982
983             col = split.column()
984             col.prop(out, "text_hi")
985
986             col = split.column()
987             col.prop(out, "header")
988
989         elif theme.active_theme == 'INFO':
990             info = theme.info
991
992             col = split.column()
993             col.prop(info, "back")
994
995             col = split.column()
996             col.prop(info, "header")
997
998             col = split.column()
999             col.prop(info, "header_text")
1000
1001             col = split.column()
1002
1003         elif theme.active_theme == 'USER_PREFERENCES':
1004             prefs = theme.user_preferences
1005
1006             col = split.column()
1007             col.prop(prefs, "back")
1008
1009             col = split.column()
1010             col.prop(prefs, "text")
1011
1012             col = split.column()
1013             col.prop(prefs, "header")
1014
1015             col = split.column()
1016             col.prop(prefs, "header_text")
1017
1018
1019 class USERPREF_PT_file(bpy.types.Panel):
1020     bl_space_type = 'USER_PREFERENCES'
1021     bl_label = "Files"
1022     bl_region_type = 'WINDOW'
1023     bl_show_header = False
1024
1025     def poll(self, context):
1026         userpref = context.user_preferences
1027         return (userpref.active_section == 'FILES')
1028
1029     def draw(self, context):
1030         layout = self.layout
1031
1032         userpref = context.user_preferences
1033         paths = userpref.filepaths
1034
1035         split = layout.split(percentage=0.6)
1036
1037         col = split.column()
1038         col.label(text="File Paths:")
1039         sub = col.split(percentage=0.3)
1040
1041         sub.label(text="Fonts:")
1042         sub.prop(paths, "fonts_directory", text="")
1043         sub = col.split(percentage=0.3)
1044         sub.label(text="Textures:")
1045         sub.prop(paths, "textures_directory", text="")
1046         sub = col.split(percentage=0.3)
1047         sub.label(text="Texture Plugins:")
1048         sub.prop(paths, "texture_plugin_directory", text="")
1049         sub = col.split(percentage=0.3)
1050         sub.label(text="Sequence Plugins:")
1051         sub.prop(paths, "sequence_plugin_directory", text="")
1052         sub = col.split(percentage=0.3)
1053         sub.label(text="Render Output:")
1054         sub.prop(paths, "render_output_directory", text="")
1055         sub = col.split(percentage=0.3)
1056         sub.label(text="Scripts:")
1057         sub.prop(paths, "python_scripts_directory", text="")
1058         sub = col.split(percentage=0.3)
1059         sub.label(text="Sounds:")
1060         sub.prop(paths, "sounds_directory", text="")
1061         sub = col.split(percentage=0.3)
1062         sub.label(text="Temp:")
1063         sub.prop(paths, "temporary_directory", text="")
1064
1065         col = split.column()
1066         sub = col.split(percentage=0.2)
1067         sub.column() # sub1, unused
1068         sub2 = sub.column()
1069         sub2.label(text="Save & Load:")
1070         sub2.prop(paths, "use_relative_paths")
1071         sub2.prop(paths, "compress_file")
1072         sub2.prop(paths, "load_ui")
1073         sub2.prop(paths, "filter_file_extensions")
1074         sub2.prop(paths, "hide_dot_files_datablocks")
1075         sub2.separator()
1076         sub2.separator()
1077         sub2.label(text="Auto Save:")
1078         sub2.prop(paths, "save_version")
1079         sub2.prop(paths, "recent_files")
1080         sub2.prop(paths, "save_preview_images")
1081         sub2.prop(paths, "auto_save_temporary_files")
1082         sub3 = sub2.column()
1083         sub3.enabled = paths.auto_save_temporary_files
1084         sub3.prop(paths, "auto_save_time", text="Timer (mins)")
1085
1086
1087 class USERPREF_PT_input(bpy.types.Panel):
1088     bl_space_type = 'USER_PREFERENCES'
1089     bl_label = "Input"
1090     bl_region_type = 'WINDOW'
1091     bl_show_header = False
1092
1093     def poll(self, context):
1094         userpref = context.user_preferences
1095         return (userpref.active_section == 'INPUT')
1096
1097     def draw(self, context):
1098         layout = self.layout
1099
1100         userpref = context.user_preferences
1101         wm = context.manager
1102         #input = userpref.input
1103         #input = userpref
1104         inputs = userpref.inputs
1105
1106         split = layout.split(percentage=0.25)
1107
1108         # General settings
1109         row = split.row()
1110         col = row.column()
1111
1112         sub = col.column()
1113         sub.label(text="Configuration:")
1114         sub.prop_object(wm, "active_keyconfig", wm, "keyconfigs", text="")
1115
1116         col.separator()
1117
1118         sub = col.column()
1119         sub.label(text="Mouse:")
1120         sub1 = sub.column()
1121         sub1.enabled = (inputs.select_mouse == 'RIGHT')
1122         sub1.prop(inputs, "emulate_3_button_mouse")
1123         sub.prop(inputs, "continuous_mouse")
1124
1125         sub.label(text="Select With:")
1126         sub.row().prop(inputs, "select_mouse", expand=True)
1127
1128         sub.separator()
1129
1130         sub.prop(inputs, "emulate_numpad")
1131
1132         sub.separator()
1133
1134         sub.label(text="Orbit Style:")
1135         sub.row().prop(inputs, "view_rotation", expand=True)
1136
1137         sub.label(text="Zoom Style:")
1138         sub.row().prop(inputs, "viewport_zoom_style", expand=True)
1139
1140         #sub.prop(inputs, "use_middle_mouse_paste")
1141
1142         #col.separator()
1143
1144         #sub = col.column()
1145         #sub.label(text="Mouse Wheel:")
1146         #sub.prop(view, "wheel_invert_zoom", text="Invert Zoom")
1147         #sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
1148
1149         col.separator()
1150
1151         sub = col.column()
1152         sub.label(text="NDOF Device:")
1153         sub.prop(inputs, "ndof_pan_speed", text="Pan Speed")
1154         sub.prop(inputs, "ndof_rotate_speed", text="Orbit Speed")
1155
1156         row.separator()
1157
1158         # Keymap Settings
1159         col = split.column()
1160
1161         # kc = wm.active_keyconfig
1162         defkc = wm.default_keyconfig
1163         km = wm.active_keymap
1164
1165         subsplit = col.split()
1166         subsplit.prop_object(wm, "active_keymap", defkc, "keymaps", text="Map:")
1167         if km.user_defined:
1168             row = subsplit.row()
1169             row.operator("WM_OT_keymap_restore", text="Restore")
1170             row.operator("WM_OT_keymap_restore", text="Restore All").all = True
1171         else:
1172             row = subsplit.row()
1173             row.operator("WM_OT_keymap_edit", text="Edit")
1174             row.label()
1175
1176         col.separator()
1177
1178         for kmi in km.items:
1179             subcol = col.column()
1180             subcol.set_context_pointer("keyitem", kmi)
1181
1182             row = subcol.row()
1183
1184             if kmi.expanded:
1185                 row.prop(kmi, "expanded", text="", icon='ICON_TRIA_DOWN')
1186             else:
1187                 row.prop(kmi, "expanded", text="", icon='ICON_TRIA_RIGHT')
1188
1189             itemrow = row.row()
1190             itemrow.enabled = km.user_defined
1191             if kmi.active:
1192                 itemrow.prop(kmi, "active", text="", icon='ICON_CHECKBOX_HLT')
1193             else:
1194                 itemrow.prop(kmi, "active", text="", icon='ICON_CHECKBOX_DEHLT')
1195
1196             itemcol = itemrow.column()
1197             itemcol.active = kmi.active
1198             row = itemcol.row()
1199
1200             if km.modal:
1201                 row.prop(kmi, "propvalue", text="")
1202             else:
1203                 row.prop(kmi, "idname", text="")
1204
1205             sub = row.row()
1206             sub.scale_x = 0.6
1207             sub.prop(kmi, "map_type", text="")
1208
1209             sub = row.row(align=True)
1210             if kmi.map_type == 'KEYBOARD':
1211                 sub.prop(kmi, "type", text="", full_event=True)
1212             elif kmi.map_type == 'MOUSE':
1213                 sub.prop(kmi, "type", text="", full_event=True)
1214             elif kmi.map_type == 'TWEAK':
1215                 sub.scale_x = 0.5
1216                 sub.prop(kmi, "type", text="")
1217                 sub.prop(kmi, "value", text="")
1218             elif kmi.map_type == 'TIMER':
1219                 sub.prop(kmi, "type", text="")
1220             else:
1221                 sub.label()
1222
1223             if kmi.expanded:
1224                 if kmi.map_type not in ('TEXTINPUT', 'TIMER'):
1225                     sub = itemcol.row(align=True)
1226
1227                     if kmi.map_type == 'KEYBOARD':
1228                         sub.prop(kmi, "type", text="", event=True)
1229                         sub.prop(kmi, "value", text="")
1230                     elif kmi.map_type == 'MOUSE':
1231                         sub.prop(kmi, "type", text="")
1232                         sub.prop(kmi, "value", text="")
1233                     else:
1234                         sub.label()
1235                         sub.label()
1236
1237                     subrow = sub.row()
1238                     subrow.scale_x = 0.75
1239                     subrow.prop(kmi, "any")
1240                     subrow.prop(kmi, "shift")
1241                     subrow.prop(kmi, "ctrl")
1242                     subrow.prop(kmi, "alt")
1243                     subrow.prop(kmi, "oskey", text="Cmd")
1244                     sub.prop(kmi, "key_modifier", text="", event=True)
1245
1246                 flow = itemcol.column_flow(columns=2)
1247                 props = kmi.properties
1248
1249                 if props is not None:
1250                     for pname in dir(props):
1251                         if not props.is_property_hidden(pname):
1252                             flow.prop(props, pname)
1253
1254                 itemcol.separator()
1255
1256             itemrow.operator("wm.keyitem_remove", text="", icon='ICON_ZOOMOUT')
1257
1258         itemrow = col.row()
1259         itemrow.label()
1260         itemrow.operator("wm.keyitem_add", text="", icon='ICON_ZOOMIN')
1261         itemrow.enabled = km.user_defined
1262
1263 bpy.types.register(USERPREF_HT_header)
1264 bpy.types.register(USERPREF_MT_view)
1265 bpy.types.register(USERPREF_PT_tabs)
1266 bpy.types.register(USERPREF_PT_interface)
1267 bpy.types.register(USERPREF_PT_theme)
1268 bpy.types.register(USERPREF_PT_edit)
1269 bpy.types.register(USERPREF_PT_system)
1270 bpy.types.register(USERPREF_PT_file)
1271 bpy.types.register(USERPREF_PT_input)
1272
1273 from bpy.props import *
1274
1275
1276 class WM_OT_keyconfig_export(bpy.types.Operator):
1277     "Export key configuration to a python script."
1278     bl_idname = "wm.keyconfig_export"
1279     bl_label = "Export Key Configuration..."
1280
1281     path = bpy.props.StringProperty(name="File Path", description="File path to write file to.")
1282
1283     def _string_value(self, value):
1284         result = ""
1285         if isinstance(value, str):
1286             if value != "":
1287                 result = "\'%s\'" % value
1288         elif isinstance(value, bool):
1289             if value:
1290                 result = "True"
1291             else:
1292                 result = "False"
1293         elif isinstance(value, float):
1294             result = "%.10f" % value
1295         elif isinstance(value, int):
1296             result = "%d" % value
1297         elif getattr(value, '__len__', False):
1298             if len(value):
1299                 result = "["
1300                 for i in range(0, len(value)):
1301                     result += self._string_value(value[i])
1302                     if i != len(value)-1:
1303                         result += ", "
1304                 result += "]"
1305         else:
1306             print("Export key configuration: can't write ", value)
1307
1308         return result
1309
1310     def execute(self, context):
1311         if not self.properties.path:
1312             raise Exception("File path not set.")
1313
1314         f = open(self.properties.path, "w")
1315         if not f:
1316             raise Exception("Could not open file.")
1317
1318         wm = context.manager
1319         kc = wm.active_keyconfig
1320
1321         f.write('# Configuration %s\n' % kc.name)
1322
1323         f.write("wm = bpy.data.windowmanagers[0]\n")
1324         f.write("kc = wm.add_keyconfig(\'%s\')\n\n" % kc.name)
1325
1326         for km in kc.keymaps:
1327             km = km.active()
1328             f.write("# Map %s\n" % km.name)
1329             f.write("km = kc.add_keymap(\'%s\', space_type=\'%s\', region_type=\'%s\', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.modal))
1330             for kmi in km.items:
1331                 if km.modal:
1332                     f.write("kmi = km.add_modal_item(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value))
1333                 else:
1334                     f.write("kmi = km.add_item(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value))
1335                 if kmi.any:
1336                     f.write(", any=True")
1337                 else:
1338                     if kmi.shift:
1339                         f.write(", shift=True")
1340                     if kmi.ctrl:
1341                         f.write(", ctrl=True")
1342                     if kmi.alt:
1343                         f.write(", alt=True")
1344                     if kmi.oskey:
1345                         f.write(", oskey=True")
1346                 if kmi.key_modifier and kmi.key_modifier != 'NONE':
1347                     f.write(", key_modifier=\'%s\'" % kmi.key_modifier)
1348                 f.write(")\n")
1349
1350                 props = kmi.properties
1351
1352                 if props is not None:
1353                     for pname in dir(props):
1354                         if props.is_property_set(pname) and not props.is_property_hidden(pname):
1355                             value = eval("props.%s" % pname)
1356                             value = self._string_value(value)
1357                             if value != "":
1358                                 f.write("kmi.properties.%s = %s\n" % (pname, value))
1359
1360             f.write("\n")
1361
1362         f.close()
1363
1364         return ('FINISHED',)
1365
1366     def invoke(self, context, event):
1367         wm = context.manager
1368         wm.add_fileselect(self)
1369         return ('RUNNING_MODAL',)
1370
1371
1372 class WM_OT_keymap_edit(bpy.types.Operator):
1373     "Edit key map."
1374     bl_idname = "wm.keymap_edit"
1375     bl_label = "Edit Key Map"
1376
1377     def execute(self, context):
1378         wm = context.manager
1379         km = wm.active_keymap
1380         km.copy_to_user()
1381         return ('FINISHED',)
1382
1383
1384 class WM_OT_keymap_restore(bpy.types.Operator):
1385     "Restore key map"
1386     bl_idname = "wm.keymap_restore"
1387     bl_label = "Restore Key Map"
1388
1389     all = BoolProperty(attr="all", name="All Keymaps", description="Restore all keymaps to default.")
1390
1391     def execute(self, context):
1392         wm = context.manager
1393
1394         if self.properties.all:
1395             for km in wm.default_keyconfig.keymaps:
1396                 km.restore_to_default()
1397         else:
1398             km = wm.active_keymap
1399             km.restore_to_default()
1400
1401         return ('FINISHED',)
1402
1403
1404 class WM_OT_keyitem_add(bpy.types.Operator):
1405     "Add key map item."
1406     bl_idname = "wm.keyitem_add"
1407     bl_label = "Add Key Map Item"
1408
1409     def execute(self, context):
1410         wm = context.manager
1411         km = wm.active_keymap
1412         if km.modal:
1413             km.add_modal_item("", 'A', 'PRESS') # kmi
1414         else:
1415             km.add_item("", 'A', 'PRESS') # kmi
1416         return ('FINISHED',)
1417
1418
1419 class WM_OT_keyitem_remove(bpy.types.Operator):
1420     "Remove key map item."
1421     bl_idname = "wm.keyitem_remove"
1422     bl_label = "Remove Key Map Item"
1423
1424     def execute(self, context):
1425         wm = context.manager
1426         kmi = context.keyitem
1427         km = wm.active_keymap
1428         km.remove_item(kmi)
1429         return ('FINISHED',)
1430
1431 bpy.ops.add(WM_OT_keyconfig_export)
1432 bpy.ops.add(WM_OT_keymap_edit)
1433 bpy.ops.add(WM_OT_keymap_restore)
1434 bpy.ops.add(WM_OT_keyitem_add)
1435 bpy.ops.add(WM_OT_keyitem_remove)