Lines 1583-1594
static int wm_open_mainfile_exec(bContex
Link Here
|
1583 |
G.fileflags &= ~G_FILE_NO_UI; |
1583 |
G.fileflags &= ~G_FILE_NO_UI; |
1584 |
else |
1584 |
else |
1585 |
G.fileflags |= G_FILE_NO_UI; |
1585 |
G.fileflags |= G_FILE_NO_UI; |
1586 |
|
1586 |
|
1587 |
if(RNA_boolean_get(op->ptr, "use_scripts")) |
1587 |
/* Restrict "Trusted Source" mode to Blender in --enable-autoexec mode */ |
|
|
1588 |
if(RNA_boolean_get(op->ptr, "use_scripts") && (!(G.f & G_SCRIPT_OVERRIDE_PREF))) |
1588 |
G.f |= G_SCRIPT_AUTOEXEC; |
1589 |
G.f |= G_SCRIPT_AUTOEXEC; |
1589 |
else |
1590 |
else |
1590 |
G.f &= ~G_SCRIPT_AUTOEXEC; |
1591 |
G.f &= ~G_SCRIPT_AUTOEXEC; |
1591 |
|
1592 |
|
1592 |
// XXX wm in context is not set correctly after WM_read_file -> crash |
1593 |
// XXX wm in context is not set correctly after WM_read_file -> crash |
1593 |
// do it before for now, but is this correct with multiple windows? |
1594 |
// do it before for now, but is this correct with multiple windows? |
1594 |
WM_event_add_notifier(C, NC_WINDOW, NULL); |
1595 |
WM_event_add_notifier(C, NC_WINDOW, NULL); |
Lines 1600-1605
static int wm_open_mainfile_exec(bContex
Link Here
|
1600 |
|
1601 |
|
1601 |
static void WM_OT_open_mainfile(wmOperatorType *ot) |
1602 |
static void WM_OT_open_mainfile(wmOperatorType *ot) |
1602 |
{ |
1603 |
{ |
|
|
1604 |
PropertyRNA * use_scripts_checkbox = NULL; |
1605 |
|
1603 |
ot->name= "Open Blender File"; |
1606 |
ot->name= "Open Blender File"; |
1604 |
ot->idname= "WM_OT_open_mainfile"; |
1607 |
ot->idname= "WM_OT_open_mainfile"; |
1605 |
ot->description="Open a Blender file"; |
1608 |
ot->description="Open a Blender file"; |
Lines 1611-1617
static void WM_OT_open_mainfile(wmOperat
Link Here
|
1611 |
WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH); |
1614 |
WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH); |
1612 |
|
1615 |
|
1613 |
RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file"); |
1616 |
RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file"); |
1614 |
RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source", "Allow blend file execute scripts automatically, default available from system preferences"); |
1617 |
use_scripts_checkbox = RNA_def_boolean(ot->srna, "use_scripts", |
|
|
1618 |
!!(G.f & G_SCRIPT_AUTOEXEC), "Trusted Source", |
1619 |
"Allow blend file execute scripts automatically, default available from system preferences"); |
1620 |
/* Disable "Trusted Source" checkbox unless Blender run with --enable-autoexec */ |
1621 |
if (use_scripts_checkbox && (G.f & G_SCRIPT_OVERRIDE_PREF)) |
1622 |
RNA_def_property_clear_flag(use_scripts_checkbox, PROP_EDITABLE); |
1615 |
} |
1623 |
} |
1616 |
|
1624 |
|
1617 |
/* **************** link/append *************** */ |
1625 |
/* **************** link/append *************** */ |