Rename File->New Project to Set up Project, open settings after
This commit is contained in:
parent
b2b00cb8ea
commit
c8daddf7db
|
@ -278,7 +278,8 @@ class TOPBAR_MT_file(Menu):
|
|||
layout.operator("wm.revert_mainfile")
|
||||
layout.menu("TOPBAR_MT_file_recover")
|
||||
|
||||
layout.operator("wm.new_project", text="New Project...")
|
||||
props = layout.operator("wm.new_project", text="Set up Project...")
|
||||
props.open_settings_after = True
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ struct Depsgraph;
|
|||
struct IDProperty;
|
||||
struct Main;
|
||||
struct MenuType;
|
||||
struct ReportList;
|
||||
struct Scene;
|
||||
struct SpaceLink;
|
||||
struct WorkSpace;
|
||||
|
@ -491,6 +492,9 @@ int ED_screen_animation_play(struct bContext *C, int sync, int mode);
|
|||
bScreen *ED_screen_animation_playing(const struct wmWindowManager *wm);
|
||||
bScreen *ED_screen_animation_no_scrub(const struct wmWindowManager *wm);
|
||||
|
||||
/** \return True on success. */
|
||||
bool ED_project_settings_window_show(struct bContext *C, struct ReportList *reports);
|
||||
|
||||
/* screen keymaps */
|
||||
/* called in spacetypes.c */
|
||||
void ED_operatortypes_screen(void);
|
||||
|
|
|
@ -5131,10 +5131,15 @@ static void SCREEN_OT_userpref_show(struct wmOperatorType *ot)
|
|||
/** \name Show Project Settings Operator
|
||||
* \{ */
|
||||
|
||||
bool ED_project_settings_window_show(bContext *C, ReportList *reports)
|
||||
{
|
||||
return settings_window_show(
|
||||
C, SPACE_PROJECT_SETTINGS, IFACE_("Blender Project Settings"), reports);
|
||||
}
|
||||
|
||||
static int project_settings_show_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
if (settings_window_show(
|
||||
C, SPACE_PROJECT_SETTINGS, IFACE_("Blender Project Settings"), op->reports)) {
|
||||
if (ED_project_settings_window_show(C, op->reports)) {
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
|
|
@ -2422,6 +2422,12 @@ static int wm_new_project_exec(bContext *C, wmOperator *op)
|
|||
"project is not active");
|
||||
}
|
||||
|
||||
PropertyRNA *prop_open_settings = RNA_struct_find_property(op->ptr, "open_settings_after");
|
||||
if (RNA_property_is_set(op->ptr, prop_open_settings) &&
|
||||
RNA_property_boolean_get(op->ptr, prop_open_settings)) {
|
||||
ED_project_settings_window_show(C, op->reports);
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
@ -2455,6 +2461,14 @@ void WM_OT_new_project(wmOperatorType *ot)
|
|||
WM_FILESEL_DIRECTORY,
|
||||
FILE_DEFAULTDISPLAY,
|
||||
FILE_SORT_DEFAULT);
|
||||
|
||||
PropertyRNA *prop;
|
||||
prop = RNA_def_boolean(ot->srna,
|
||||
"open_settings_after",
|
||||
false,
|
||||
"",
|
||||
"Open the project settings window after successfully creating a project");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
Loading…
Reference in New Issue