Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/util/ed_util.c
| Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | |||||
| void unpack_menu(bContext *C, const char *opname, const char *id_name, const char *abs_name, const char *folder, struct PackedFile *pf) | void unpack_menu(bContext *C, const char *opname, const char *id_name, const char *abs_name, const char *folder, struct PackedFile *pf) | ||||
| { | { | ||||
| PointerRNA props_ptr; | PointerRNA props_ptr; | ||||
| uiPopupMenu *pup; | uiPopupMenu *pup; | ||||
| uiLayout *layout; | uiLayout *layout; | ||||
| char line[FILE_MAX + 100]; | char line[FILE_MAX + 100]; | ||||
| wmOperatorType *ot = WM_operatortype_find(opname, 1); | wmOperatorType *ot = WM_operatortype_find(opname, 1); | ||||
| pup = uiPupMenuBegin(C, IFACE_("Unpack File"), ICON_NONE); | pup = UI_popup_menu_begin(C, IFACE_("Unpack File"), ICON_NONE); | ||||
| layout = uiPupMenuLayout(pup); | layout = UI_popup_menu_layout(pup); | ||||
| props_ptr = uiItemFullO_ptr(layout, ot, IFACE_("Remove Pack"), ICON_NONE, | props_ptr = uiItemFullO_ptr(layout, ot, IFACE_("Remove Pack"), ICON_NONE, | ||||
| NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); | NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); | ||||
| RNA_enum_set(&props_ptr, "method", PF_REMOVE); | RNA_enum_set(&props_ptr, "method", PF_REMOVE); | ||||
| RNA_string_set(&props_ptr, "id", id_name); | RNA_string_set(&props_ptr, "id", id_name); | ||||
| if (G.relbase_valid) { | if (G.relbase_valid) { | ||||
| char local_name[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; | char local_name[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | case PF_DIFFERS: | ||||
| BLI_snprintf(line, sizeof(line), IFACE_("Overwrite %s"), abs_name); | BLI_snprintf(line, sizeof(line), IFACE_("Overwrite %s"), abs_name); | ||||
| //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL); | //uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL); | ||||
| props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); | props_ptr = uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); | ||||
| RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL); | RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL); | ||||
| RNA_string_set(&props_ptr, "id", id_name); | RNA_string_set(&props_ptr, "id", id_name); | ||||
| break; | break; | ||||
| } | } | ||||
| uiPupMenuEnd(C, pup); | UI_popup_menu_end(C, pup); | ||||
| } | } | ||||
| /* ********************* generic callbacks for drawcall api *********************** */ | /* ********************* generic callbacks for drawcall api *********************** */ | ||||
| /** | /** | ||||
| * Callback that draws a line between the mouse and a position given as the initial argument. | * Callback that draws a line between the mouse and a position given as the initial argument. | ||||
| */ | */ | ||||
| void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *ar, void *arg_info) | void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *ar, void *arg_info) | ||||
| Show All 14 Lines | |||||