added back space switching keys Shift+F2 to F12
authorCampbell Barton <ideasman42@gmail.com>
Tue, 13 Oct 2009 17:50:14 +0000 (17:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 13 Oct 2009 17:50:14 +0000 (17:50 +0000)
- Shift+F2 was Export DXF, made Logic Editor
- Shift+F4 was data browser, made console
- Shift+F11 was fullscreen in 2.5, changed fullscreen to Alt+F11

added Area.type so RNA can switch the type.

release/scripts/modules/bpy_ops.py
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/intern/rna_screen.c
source/blender/windowmanager/intern/wm_operators.c

index b1d782917b643454c3f4c7b074881a665e93e3ce..022c0581a81954ebe281e62db0f713ed5060ad33 100644 (file)
@@ -204,7 +204,7 @@ class WM_OT_context_toggle_values(bpy.types.Operator):
 class WM_OT_context_cycle_enum(bpy.types.Operator):
        '''Toggle a context value.'''
        __idname__ = "wm.context_cycle_enum"
-       __label__ = "Context Toggle Values"
+       __label__ = "Context Enum Cycle"
        __register__ = True
        __undo__ = True
        
index f102143f0ed14e6503b5181fde7b0ff7d79e3f06..af950c1148aef0235ee2559a34f72e519e14004c 100644 (file)
@@ -60,6 +60,8 @@ extern EnumPropertyItem unpack_method_items[];
 
 extern EnumPropertyItem object_type_items[];
 
+extern EnumPropertyItem space_type_items[];
+
 struct bContext;
 struct PointerRNA;
 EnumPropertyItem *rna_TransformOrientation_itemf(struct bContext *C, struct PointerRNA *ptr, int *free);
index 2a72845dd42cbf5a5a838c7eed577f6f9e0b52a9..004c57eedfc79f4b9c1e49c3910b7fc081be61ac 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "RNA_define.h"
 #include "RNA_types.h"
+#include "RNA_enum_types.h"
 
 #include "rna_internal.h"
 
@@ -77,6 +78,22 @@ static int rna_Screen_animation_playing_get(PointerRNA *ptr)
        return (sc->animtimer != NULL);
 }
 
+static void rna_Area_type_set(PointerRNA *ptr, int value)
+{
+       ScrArea *sa= (ScrArea*)ptr->data;
+       sa->butspacetype= value;
+}
+
+static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
+{
+       ScrArea *sa= (ScrArea*)ptr->data;
+
+       if(sa) {
+               ED_area_newspace(C, sa, sa->butspacetype); /* XXX - this uses the window */
+               ED_area_tag_redraw(sa);
+       }
+}
+
 #else
 
 static void rna_def_area(BlenderRNA *brna)
@@ -107,6 +124,14 @@ static void rna_def_area(BlenderRNA *brna)
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", HEADER_NO_PULLDOWN);
        RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header.");
        
+       prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "spacetype");
+       RNA_def_property_enum_items(prop, space_type_items);
+       RNA_def_property_enum_funcs(prop, NULL, "rna_Area_type_set", NULL);
+       RNA_def_property_ui_text(prop, "Type", "Space type.");
+       RNA_def_property_update(prop, 0, "rna_Area_type_update");
+
+
        RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
 }
 
index e3f23a488a283bf50dd61046fff0015f3d969f4b..2ed32808f4810acbd7607b3cf27fbd356ee8d545 100644 (file)
@@ -2186,6 +2186,7 @@ void wm_operatortype_init(void)
 void wm_window_keymap(wmKeyConfig *keyconf)
 {
        wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0);
+       wmKeyMapItem *km;
        
        /* items to make WM work */
        WM_keymap_verify_item(keymap, "WM_OT_jobs_timer", TIMERJOBS, KM_ANY, KM_ANY, 0);
@@ -2208,7 +2209,7 @@ void wm_window_keymap(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
 
-       WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
 
        /* debug/testing */
@@ -2216,5 +2217,55 @@ void wm_window_keymap(wmKeyConfig *keyconf)
        WM_keymap_verify_item(keymap, "WM_OT_debug_menu", DKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
        WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, 0, 0);
        
+       /* Space switching */
+
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F2KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was DXF export */
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'LOGIC_EDITOR'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F3KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'NODE_EDITOR'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F4KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was data browser */
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'CONSOLE'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F5KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'VIEW_3D'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F6KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'GRAPH_EDITOR'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F7KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'PROPERTIES'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F8KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'SEQUENCE_EDITOR'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F9KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'OUTLINER'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F9KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'OUTLINER'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F10KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'IMAGE_EDITOR'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F11KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'TEXT_EDITOR'");
+
+       km = WM_keymap_add_item(keymap, "WM_OT_context_set", F12KEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(km->ptr, "path", "area.type");
+       RNA_string_set(km->ptr, "value", "'DOPESHEET_EDITOR'");
 }