Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_operator_props.c
| Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | void WM_operator_properties_filesel(wmOperatorType *ot, | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem file_display_items[] = { | static const EnumPropertyItem file_display_items[] = { | ||||
| {FILE_DEFAULTDISPLAY, | {FILE_DEFAULTDISPLAY, | ||||
| "DEFAULT", | "DEFAULT", | ||||
| 0, | 0, | ||||
| "Default", | "Default", | ||||
| "Automatically determine display type for files"}, | "Automatically determine display type for files"}, | ||||
| {FILE_SHORTDISPLAY, | {FILE_VERTICALDISPLAY, | ||||
| "LIST_SHORT", | "LIST_VERTICAL", | ||||
| ICON_SHORTDISPLAY, | ICON_SHORTDISPLAY, /* Name of deprecated short list */ | ||||
| "Short List", | "Short List", | ||||
| "Display files as short list"}, | "Display files as short list"}, | ||||
| {FILE_LONGDISPLAY, | {FILE_HORIZONTALDISPLAY, | ||||
| "LIST_LONG", | "LIST_HORIZONTAL", | ||||
| ICON_LONGDISPLAY, | ICON_LONGDISPLAY, /* Name of deprecated long list */ | ||||
| "Long List", | "Long List", | ||||
| "Display files as a detailed list"}, | "Display files as a detailed list"}, | ||||
| {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"}, | {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem file_action_types[] = { | |||||
| {FILE_OPENFILE, | |||||
| "OPENFILE", | |||||
| 0, | |||||
| "Open", | |||||
| "Use the file browser for opening files or a directory"}, | |||||
| {FILE_SAVE, "SAVE", 0, "Save", "Use the file browser for saving a file"}, | |||||
| }; | |||||
| if (flag & WM_FILESEL_FILEPATH) { | if (flag & WM_FILESEL_FILEPATH) { | ||||
| RNA_def_string_file_path(ot->srna, "filepath", NULL, FILE_MAX, "File Path", "Path to file"); | RNA_def_string_file_path(ot->srna, "filepath", NULL, FILE_MAX, "File Path", "Path to file"); | ||||
| } | } | ||||
| if (flag & WM_FILESEL_DIRECTORY) { | if (flag & WM_FILESEL_DIRECTORY) { | ||||
| RNA_def_string_dir_path( | RNA_def_string_dir_path( | ||||
| ot->srna, "directory", NULL, FILE_MAX, "Directory", "Directory of the file"); | ot->srna, "directory", NULL, FILE_MAX, "Directory", "Directory of the file"); | ||||
| } | } | ||||
| if (flag & WM_FILESEL_FILENAME) { | if (flag & WM_FILESEL_FILENAME) { | ||||
| RNA_def_string_file_name( | RNA_def_string_file_name( | ||||
| ot->srna, "filename", NULL, FILE_MAX, "File Name", "Name of the file"); | ot->srna, "filename", NULL, FILE_MAX, "File Name", "Name of the file"); | ||||
| } | } | ||||
| if (flag & WM_FILESEL_FILES) { | if (flag & WM_FILESEL_FILES) { | ||||
| prop = RNA_def_collection_runtime( | prop = RNA_def_collection_runtime( | ||||
| ot->srna, "files", &RNA_OperatorFileListElement, "Files", ""); | ot->srna, "files", &RNA_OperatorFileListElement, "Files", ""); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | ||||
| } | } | ||||
| if ((flag & WM_FILESEL_SHOW_PROPS) == 0) { | |||||
| prop = RNA_def_boolean(ot->srna, | |||||
| "hide_props_region", | |||||
| true, | |||||
| "Hide Operator Properties", | |||||
| "Collapse the region displaying the operator settings"); | |||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | |||||
| } | |||||
| if (action == FILE_SAVE) { | if (action == FILE_SAVE) { | ||||
| /* note, this is only used to check if we should highlight the filename area red when the | /* note, this is only used to check if we should highlight the filename area red when the | ||||
| * filepath is an existing file. */ | * filepath is an existing file. */ | ||||
| prop = RNA_def_boolean(ot->srna, | prop = RNA_def_boolean(ot->srna, | ||||
| "check_existing", | "check_existing", | ||||
| true, | true, | ||||
| "Check Existing", | "Check Existing", | ||||
| "Check and warn on overwriting existing files"); | "Check and warn on overwriting existing files"); | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | void WM_operator_properties_filesel(wmOperatorType *ot, | ||||
| } | } | ||||
| prop = RNA_def_enum(ot->srna, "display_type", file_display_items, display, "Display Type", ""); | prop = RNA_def_enum(ot->srna, "display_type", file_display_items, display, "Display Type", ""); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | ||||
| prop = RNA_def_enum( | prop = RNA_def_enum( | ||||
| ot->srna, "sort_method", rna_enum_file_sort_items, sort, "File sorting mode", ""); | ot->srna, "sort_method", rna_enum_file_sort_items, sort, "File sorting mode", ""); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | ||||
| prop = RNA_def_enum(ot->srna, "action_type", file_action_types, action, "Action Type", ""); | |||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | |||||
| } | } | ||||
| static void wm_operator_properties_select_action_ex(wmOperatorType *ot, | static void wm_operator_properties_select_action_ex(wmOperatorType *ot, | ||||
| int default_action, | int default_action, | ||||
| const EnumPropertyItem *select_actions, | const EnumPropertyItem *select_actions, | ||||
| bool hide_gui) | bool hide_gui) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines | |||||