User Defaults: Change user defaults based on decission by new UI team - T37518

Currently these changes are not saved in startup.blend to avoid bloating
our repo whenever we want to make minor changes.
This commit is contained in:
2013-11-25 11:45:12 +11:00
parent 9c262e5649
commit c5944812d6
5 changed files with 35 additions and 3 deletions

View File

@@ -687,6 +687,7 @@ void UI_remove_popup_handlers_all(struct bContext *C, struct ListBase *handlers)
void UI_init(void);
void UI_init_userdef(void);
void UI_init_userdef_factory(void);
void UI_reinit_font(void);
void UI_exit(void);

View File

@@ -4194,6 +4194,11 @@ void UI_init_userdef(void)
uiStyleInit();
}
void UI_init_userdef_factory(void)
{
init_userdef_factory();
}
void UI_reinit_font(void)
{
uiStyleInit();

View File

@@ -562,6 +562,7 @@ int ui_id_icon_get(struct bContext *C, struct ID *id, const bool big);
/* resources.c */
void init_userdef_do_versions(void);
void init_userdef_factory(void);
void ui_theme_init_default(void);
void ui_style_init_default(void);
void ui_resources_init(void);

View File

@@ -2246,3 +2246,23 @@ void init_userdef_do_versions(void)
// XXX reset_autosave();
}
/**
* Override values in in-memory startup.blend, avoids resaving for small changes.
*/
void init_userdef_factory(void)
{
/* defaults from T37518 */
U.uiflag2 |= USER_REGION_OVERLAP;
U.uiflag |= USER_AUTOPERSP;
U.uiflag |= USER_ORBIT_SELECTION;
U.uiflag |= USER_ZBUF_CURSOR;
U.uiflag |= USER_QUIT_PROMPT;
U.uiflag |= USER_CONTINUOUS_MOUSE;
U.ogl_multisamples = USER_MULTISAMPLE_4;
U.versions = 1;
U.savetime = 2;
}

View File

@@ -282,7 +282,7 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
}
/* in case UserDef was read, we re-initialize all, and do versioning */
static void wm_init_userdef(bContext *C)
static void wm_init_userdef(bContext *C, const bool from_memory)
{
/* versioning is here */
UI_init_userdef();
@@ -301,6 +301,11 @@ static void wm_init_userdef(bContext *C)
else G.f &= ~G_SCRIPT_AUTOEXEC;
}
/* avoid re-saving for every small change to our prefs, allow overrides */
if (from_memory) {
UI_init_userdef_factory();
}
/* update tempdir from user preferences */
BLI_init_temporary_dir(U.tempdir);
@@ -433,7 +438,7 @@ void WM_file_read(bContext *C, const char *filepath, ReportList *reports)
if (retval == BKE_READ_FILE_OK_USERPREFS) {
/* in case a userdef is read from regular .blend */
wm_init_userdef(C);
wm_init_userdef(C, false);
}
if (retval != BKE_READ_FILE_FAIL) {
@@ -576,7 +581,7 @@ int wm_homefile_read(bContext *C, ReportList *UNUSED(reports), short from_memory
G.fileflags &= ~G_FILE_RELATIVE_REMAP;
/* check userdef before open window, keymaps etc */
wm_init_userdef(C);
wm_init_userdef(C, from_memory);
/* match the read WM with current WM */
wm_window_match_do(C, &wmbase);