temp hack to make the popup show wider when running the edit description operator
authorCampbell Barton <ideasman42@gmail.com>
Mon, 23 Nov 2009 00:56:19 +0000 (00:56 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 23 Nov 2009 00:56:19 +0000 (00:56 +0000)
release/scripts/op/wm.py
source/blender/editors/interface/interface_handlers.c
source/blender/windowmanager/intern/wm_operators.c

index 7ec66220902281b647de2301ff2859b4dceb5900..92b1434b696bd6262a5712e408efc008d9567398 100644 (file)
@@ -248,9 +248,9 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
         return ('FINISHED',)
 
 doc_id = StringProperty(name="Doc ID",
-        description="ID for the documentation", maxlen=1024, default="")
+        description="", maxlen=1024, default="", hidden=True)
 
-doc_new = StringProperty(name="Doc New",
+doc_new = StringProperty(name="Edit Description",
         description="", maxlen=1024, default="")
 
 
index fb4438455bdcef7f3cae68e6e7662641e3301ba9..6ae5cab1a184f095d1f2791fa22b9f412ab0d16f 100644 (file)
@@ -3497,7 +3497,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
                        RNA_string_set(&ptr_props, "doc_id", buf);
                        RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop));
 
-                       uiItemFullO(layout, "Edit Docs (TODO)", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
+                       uiItemFullO(layout, "Submit Description", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
                }
                else if (but->optype) {
                        WM_operator_py_idname(buf, but->optype->idname);
@@ -3511,7 +3511,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
                        RNA_string_set(&ptr_props, "doc_id", buf);
                        RNA_string_set(&ptr_props, "doc_new", but->optype->description);
 
-                       uiItemFullO(layout, "Edit Docs (TODO)", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
+                       uiItemFullO(layout, "Submit Description", 0, "WM_OT_doc_edit", ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
                }
        }
 
index beece8c9226c62766156c4912e7c2c8c1ed92c44..1b334bc778fcb31eab0123a46f1931821ea8d6c5 100644 (file)
@@ -699,7 +699,9 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
        uiBlock *block;
        uiLayout *layout;
        uiStyle *style= U.uistyles.first;
+       int columns= 2, width= 300;
        
+
        block= uiBeginBlock(C, ar, "redo_popup", UI_EMBOSS);
        uiBlockClearFlag(block, UI_BLOCK_LOOP);
        uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1);
@@ -710,14 +712,20 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
                op->properties= IDP_New(IDP_GROUP, val, "wmOperatorProperties");
        }
 
+       // XXX - hack, only for editing docs
+       if(strcmp(op->type->idname, "WM_OT_doc_edit")==0) {
+               columns= 1;
+               width= 500;
+       }
+
        RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
-       layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 300, 20, style);
+       layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, 20, style);
        uiItemL(layout, op->type->name, 0);
 
        if(op->type->ui)
                op->type->ui((bContext*)C, &ptr, layout);
        else
-               uiDefAutoButsRNA(C, layout, &ptr, 2);
+               uiDefAutoButsRNA(C, layout, &ptr, columns);
 
        uiPopupBoundsBlock(block, 4.0f, 0, 0);
        uiEndBlock(C, block);