console copy text was upside down.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 28 Jul 2009 08:50:11 +0000 (08:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 28 Jul 2009 08:50:11 +0000 (08:50 +0000)
made ctrl+space operator find and autocomplete in the console, need a bette way to make these key bindings co-exist.

source/blender/editors/screen/screen_ops.c
source/blender/editors/space_console/console_draw.c
source/blender/editors/space_console/console_intern.h
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_console/space_console.c
source/blender/windowmanager/intern/wm_operators.c

index 32f09f489a6fe17e5e5610f4f9d2ea0469d3b328..55668c5e9be5e6cf1dd58fb80164c279b1cc3941 100644 (file)
@@ -3111,7 +3111,6 @@ void ED_keymap_screen(wmWindowManager *wm)
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_screen_set", LEFTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "delta", -1);
        WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", UPARROWKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", DOWNARROWKEY, KM_PRESS, KM_CTRL, 0);
-       WM_keymap_add_item(keymap, "SCREEN_OT_screen_full_area", SPACEKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "SCREEN_OT_screenshot", F3KEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "SCREEN_OT_screencast", F3KEY, KM_PRESS, KM_ALT, 0);
 
index 68cb1cc4a01057e2aec42139f72e371aeae13f96..4f225bb8fcb1ee774f0b911751f6c4b6bae4fc35 100644 (file)
@@ -59,7 +59,7 @@
 #include "UI_interface.h"
 #include "UI_resources.h"
 
-//#include "console_intern.h"
+#include "console_intern.h"
 
 static void console_font_begin(SpaceConsole *sc)
 {
index 0a80059fc6589b1ff047504828e7efb512355ad9..62caad83144694610ce6dd1eb5ce271e071cb250 100644 (file)
@@ -33,6 +33,7 @@
 struct ConsoleLine;
 struct wmOperatorType;
 struct ReportList;
+struct bContext;
 
 /* console_draw.c */
 void console_text_main(struct SpaceConsole *sc, struct ARegion *ar, struct ReportList *reports);
@@ -42,10 +43,10 @@ void *console_text_pick(struct SpaceConsole *sc, struct ARegion *ar, struct Repo
 /* console_ops.c */
 void console_history_free(SpaceConsole *sc, ConsoleLine *cl);
 void console_scrollback_free(SpaceConsole *sc, ConsoleLine *cl);
-ConsoleLine *console_history_add_str(const bContext *C, char *str, int own);
-ConsoleLine *console_scrollback_add_str(const bContext *C, char *str, int own);
+ConsoleLine *console_history_add_str(const struct bContext *C, char *str, int own);
+ConsoleLine *console_scrollback_add_str(const struct bContext *C, char *str, int own);
 
-ConsoleLine *console_history_verify(const bContext *C);
+ConsoleLine *console_history_verify(const struct bContext *C);
 
 int console_report_mask(SpaceConsole *sc);
 
index 70570f6208a468082a3c78d352afc2c035112d84..37f16f3d88a25343812098c0e8c9ae3d7e21a8e6 100644 (file)
@@ -563,7 +563,7 @@ static int copy_exec(bContext *C, wmOperator *op)
        
        ConsoleLine *cl;
        
-       for(cl= sc->scrollback.last; cl; cl= cl->prev) {
+       for(cl= sc->scrollback.first; cl; cl= cl->next) {
                BLI_dynstr_append(buf_dyn, cl->line);
                BLI_dynstr_append(buf_dyn, "\n");
        }
index c50fef7faf657eb00d228f483e22052f970dc701..408d0410067952f63fb41436f7e07d7958028707 100644 (file)
@@ -171,7 +171,7 @@ static void console_main_area_draw(const bContext *C, ARegion *ar)
                console_scrollback_add_str(C, "Cursor:           Left/Right Home/End", 0);
                console_scrollback_add_str(C, "Remove:           Backspace/Delete", 0);
                console_scrollback_add_str(C, "Execute:          Enter", 0);
-               console_scrollback_add_str(C, "Autocomplete:     Ctrl+Enter", 0);
+               console_scrollback_add_str(C, "Autocomplete:     Ctrl+Space", 0);
                console_scrollback_add_str(C, "Ctrl +/-  Wheel:  Zoom", 0);
                console_scrollback_add_str(C, "Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.ui", 0);
        }
@@ -281,7 +281,7 @@ void console_keymap(struct wmWindowManager *wm)
        WM_keymap_add_item(keymap, "CONSOLE_OT_exec", PADENTER, KM_PRESS, 0, 0);
        
        //WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", TABKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */
-       WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", RETKEY, KM_PRESS, KM_CTRL, 0); /* python operator - space_text.py */
+       WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* python operator - space_text.py */
 #endif
 
        /* report selection */
index 1f1a34ee308ab2ab42ae1c2db84699ce8eac99b8..e048601a4d710d0ac1868cefa94b36d566b6ee41 100644 (file)
@@ -521,6 +521,14 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
        return OPERATOR_CANCELLED;
 }
 
+/* op->poll */
+int wm_search_menu_poll(bContext *C)
+{
+       if(CTX_wm_window(C)==NULL) return 0;
+       if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_CONSOLE) return 0;  // XXX - so we can use the shortcut in the console
+       return 1;
+}
+
 static void WM_OT_search_menu(wmOperatorType *ot)
 {
        ot->name= "Search Menu";
@@ -528,7 +536,7 @@ static void WM_OT_search_menu(wmOperatorType *ot)
        
        ot->invoke= wm_search_menu_invoke;
        ot->exec= wm_search_menu_exec;
-       ot->poll= WM_operator_winactive;
+       ot->poll= wm_search_menu_poll;
 }
 
 
@@ -1708,7 +1716,7 @@ void wm_window_keymap(wmWindowManager *wm)
        /* debug/testing */
        WM_keymap_verify_item(keymap, "WM_OT_ten_timer", TKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
        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", FKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
+       WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, KM_CTRL, 0);
        
 }