Fix #24098: new file and load factory settings sharing same hotkey.

Made these separate operators now, less confusing.
This commit is contained in:
Brecht Van Lommel 2010-10-02 13:45:26 +00:00
parent 4c63215e38
commit 96565073d3
2 changed files with 12 additions and 2 deletions

@ -343,7 +343,7 @@ int WM_read_homefile(bContext *C, wmOperator *op)
{
ListBase wmbase;
char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR];
int from_memory= op?RNA_boolean_get(op->ptr, "factory"):0;
int from_memory= op && strcmp(op->type->idname, "WM_OT_read_factory_settings")==0;
int success;
free_ttfont(); /* still weird... what does it here? */

@ -1416,8 +1416,17 @@ static void WM_OT_read_homefile(wmOperatorType *ot)
ot->invoke= WM_operator_confirm;
ot->exec= WM_read_homefile;
ot->poll= WM_operator_winactive;
}
RNA_def_boolean(ot->srna, "factory", 0, "Factory Settings", "");
static void WM_OT_read_factory_settings(wmOperatorType *ot)
{
ot->name= "Load Factory Settings";
ot->idname= "WM_OT_read_factory_settings";
ot->description="Load default file and user preferences";
ot->invoke= WM_operator_confirm;
ot->exec= WM_read_homefile;
ot->poll= WM_operator_winactive;
}
/* *************** open file **************** */
@ -3059,6 +3068,7 @@ void wm_operatortype_init(void)
{
WM_operatortype_append(WM_OT_window_duplicate);
WM_operatortype_append(WM_OT_read_homefile);
WM_operatortype_append(WM_OT_read_factory_settings);
WM_operatortype_append(WM_OT_save_homefile);
WM_operatortype_append(WM_OT_window_fullscreen_toggle);
WM_operatortype_append(WM_OT_exit_blender);