From 257c6de9ace4c66d6054d10712204b62aa8ace2f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 19 Aug 2012 21:32:18 +0000 Subject: copy as script operator for the console, so you can copy input from a console for use in a textblock. --- source/blender/editors/space_console/space_console.c | 1 + source/blender/makesrna/intern/rna_space.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 460b31d69bd..490a3b45990 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -326,6 +326,7 @@ static void console_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* python operator - space_text.py */ #endif + WM_keymap_add_item(keymap, "CONSOLE_OT_copy_as_script", CKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0); WM_keymap_add_item(keymap, "CONSOLE_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "CONSOLE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0); #ifdef __APPLE__ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 456df187fff..ad14c60e532 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2656,6 +2656,14 @@ static void rna_def_space_time(BlenderRNA *brna) static void rna_def_console_line(BlenderRNA *brna) { + static EnumPropertyItem console_line_type_items[] = { + {CONSOLE_LINE_OUTPUT, "OUTPUT", 0, "Output", ""}, + {CONSOLE_LINE_INPUT, "INPUT", 0, "Input", ""}, + {CONSOLE_LINE_INFO, "INFO", 0, "Info", ""}, + {CONSOLE_LINE_ERROR, "ERROR", 0, "Error", ""}, + {0, NULL, 0, NULL, NULL} + }; + StructRNA *srna; PropertyRNA *prop; @@ -2673,6 +2681,11 @@ static void rna_def_console_line(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "cursor"); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CONSOLE, NULL); + + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, console_line_type_items); + RNA_def_property_ui_text(prop, "Type", "Console line type when used in scrollback"); } static void rna_def_space_console(BlenderRNA *brna) -- cgit v1.2.3