Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/file_ops.c
| Show All 39 Lines | |||||
| # include "BLI_winstuff.h" | # include "BLI_winstuff.h" | ||||
| #endif | #endif | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_fileselect.h" | #include "ED_fileselect.h" | ||||
| #include "ED_select_utils.h" | #include "ED_select_utils.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_interface_icons.h" | |||||
| #include "UI_resources.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| ▲ Show 20 Lines • Show All 891 Lines • ▼ Show 20 Lines | static int bookmark_add_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| SpaceFile *sfile = CTX_wm_space_file(C); | SpaceFile *sfile = CTX_wm_space_file(C); | ||||
| struct FSMenu *fsmenu = ED_fsmenu_get(); | struct FSMenu *fsmenu = ED_fsmenu_get(); | ||||
| struct FileSelectParams *params = ED_fileselect_get_params(sfile); | struct FileSelectParams *params = ED_fileselect_get_params(sfile); | ||||
| if (params->dir[0] != '\0') { | if (params->dir[0] != '\0') { | ||||
| char name[FILE_MAX]; | char name[FILE_MAX]; | ||||
| fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, params->dir, NULL, FS_INSERT_SAVE); | fsmenu_insert_entry( | ||||
| fsmenu, FS_CATEGORY_BOOKMARKS, params->dir, NULL, ICON_FILE_FOLDER, FS_INSERT_SAVE); | |||||
| BLI_make_file_string( | BLI_make_file_string( | ||||
| "/", name, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); | "/", name, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); | ||||
| fsmenu_write_file(fsmenu, name); | fsmenu_write_file(fsmenu, name); | ||||
| } | } | ||||
| ED_area_tag_refresh(sa); | ED_area_tag_refresh(sa); | ||||
| ED_area_tag_redraw(sa); | ED_area_tag_redraw(sa); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| ▲ Show 20 Lines • Show All 603 Lines • ▼ Show 20 Lines | else if (sfile->op) { | ||||
| file_sfile_to_operator_ex(C, op, sfile, filepath); | file_sfile_to_operator_ex(C, op, sfile, filepath); | ||||
| if (BLI_exists(sfile->params->dir)) { | if (BLI_exists(sfile->params->dir)) { | ||||
| fsmenu_insert_entry(ED_fsmenu_get(), | fsmenu_insert_entry(ED_fsmenu_get(), | ||||
| FS_CATEGORY_RECENT, | FS_CATEGORY_RECENT, | ||||
| sfile->params->dir, | sfile->params->dir, | ||||
| NULL, | NULL, | ||||
| ICON_FILE_FOLDER, | |||||
| FS_INSERT_SAVE | FS_INSERT_FIRST); | FS_INSERT_SAVE | FS_INSERT_FIRST); | ||||
| } | } | ||||
| BLI_make_file_string(BKE_main_blendfile_path(bmain), | BLI_make_file_string(BKE_main_blendfile_path(bmain), | ||||
| filepath, | filepath, | ||||
| BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), | BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), | ||||
| BLENDER_BOOKMARK_FILE); | BLENDER_BOOKMARK_FILE); | ||||
| fsmenu_write_file(ED_fsmenu_get(), filepath); | fsmenu_write_file(ED_fsmenu_get(), filepath); | ||||
| ▲ Show 20 Lines • Show All 965 Lines • Show Last 20 Lines | |||||