Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/file_panels.c
| Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | for (i = 0; i < nentries; ++i) { | ||||
| BLI_add_slash(temp); | BLI_add_slash(temp); | ||||
| BLI_getlastdir(temp, dir, FILE_MAX); | BLI_getlastdir(temp, dir, FILE_MAX); | ||||
| BLI_del_slash(dir); | BLI_del_slash(dir); | ||||
| if (dir[0] == 0) | if (dir[0] == 0) | ||||
| BLI_strncpy(dir, entry, FILE_MAX); | BLI_strncpy(dir, entry, FILE_MAX); | ||||
| /* create list item */ | /* create list item */ | ||||
| but = uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, nr, 0, i, 0, 0, entry); | but = uiDefIconTextButS(block, UI_BTYPE_LISTROW, 0, icon, dir, 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, nr, 0, i, 0, 0, entry); | ||||
| uiButSetFunc(but, file_panel_cb, entry, NULL); | UI_but_func_set(but, file_panel_cb, entry, NULL); | ||||
| uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ | UI_but_flag_disable(but, UI_BUT_UNDO); /* skip undo on screen buttons */ | ||||
| uiButSetDrawFlag(but, UI_BUT_ICON_LEFT | UI_BUT_TEXT_LEFT); | UI_but_drawflag_enable(but, UI_BUT_ICON_LEFT | UI_BUT_TEXT_LEFT); | ||||
| /* create delete button */ | /* create delete button */ | ||||
| if (allow_delete && fsmenu_can_save(fsmenu, category, i)) { | if (allow_delete && fsmenu_can_save(fsmenu, category, i)) { | ||||
| uiBlockSetEmboss(block, UI_EMBOSSN); | UI_block_emboss_set(block, UI_EMBOSS_NONE); | ||||
| uiItemIntO(layout, "", ICON_X, "FILE_OT_bookmark_delete", "index", i); | uiItemIntO(layout, "", ICON_X, "FILE_OT_bookmark_delete", "index", i); | ||||
| uiBlockSetEmboss(block, UI_EMBOSS); | UI_block_emboss_set(block, UI_EMBOSS); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void file_panel_system(const bContext *C, Panel *pa) | static void file_panel_system(const bContext *C, Panel *pa) | ||||
| { | { | ||||
| SpaceFile *sfile = CTX_wm_space_file(C); | SpaceFile *sfile = CTX_wm_space_file(C); | ||||
| ▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void file_panel_operator(const bContext *C, Panel *pa) | static void file_panel_operator(const bContext *C, Panel *pa) | ||||
| { | { | ||||
| SpaceFile *sfile = CTX_wm_space_file(C); | SpaceFile *sfile = CTX_wm_space_file(C); | ||||
| wmOperator *op = sfile->op; | wmOperator *op = sfile->op; | ||||
| // int empty = 1, flag; | // int empty = 1, flag; | ||||
| uiBlockSetFunc(uiLayoutGetBlock(pa->layout), file_draw_check_cb, NULL, NULL); | UI_block_func_set(uiLayoutGetBlock(pa->layout), file_draw_check_cb, NULL, NULL); | ||||
| uiLayoutOperatorButs(C, pa->layout, op, file_panel_check_prop, '\0', UI_LAYOUT_OP_SHOW_EMPTY); | uiLayoutOperatorButs(C, pa->layout, op, file_panel_check_prop, '\0', UI_LAYOUT_OP_SHOW_EMPTY); | ||||
| uiBlockSetFunc(uiLayoutGetBlock(pa->layout), NULL, NULL, NULL); | UI_block_func_set(uiLayoutGetBlock(pa->layout), NULL, NULL, NULL); | ||||
| } | } | ||||
| void file_panels_register(ARegionType *art) | void file_panels_register(ARegionType *art) | ||||
| { | { | ||||
| PanelType *pt; | PanelType *pt; | ||||
| pt = MEM_callocN(sizeof(PanelType), "spacetype file system directories"); | pt = MEM_callocN(sizeof(PanelType), "spacetype file system directories"); | ||||
| strcpy(pt->idname, "FILE_PT_system"); | strcpy(pt->idname, "FILE_PT_system"); | ||||
| Show All 38 Lines | |||||