Fix T41704: 2.71.6 no longer reading user ui panel arrangement from earlier saved blend files.

This reverts rB52c06440d8e51c8661a679bcb33742666ce8dbf9 and rBe40d8258bb46926a1aecf51236822532397993f3
(tabname is old 2.4x tabed panels system, *not* new 2.7x tool tabs!).

Also disabled (#idef'ed) everything regarding tabname/tabed panels for now, we may even remove it completely,
would make things clearer imho.

Note files saved with 2.71.6 up till now would have two versions of some panels in store (with two different
values for their tabname), can give some order oddities in those cases, which have to be fixed by hand...
This commit is contained in:
Bastien Montagne 2014-09-04 14:38:29 +02:00
parent 15d39eaac1
commit bf54ed0c7c
Notes: blender-bot 2023-02-14 10:07:12 +01:00
Referenced by issue #41704, 2.71.6 no longer reading user ui panel arrangement from earlier saved blend files.
1 changed files with 27 additions and 6 deletions

View File

@ -201,13 +201,19 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar)
pa->ofsy = papar->ofsy + papar->sizey - pa->sizey;
}
/* XXX Disabled paneltab handling for now. Old 2.4x feature, *DO NOT* confuse it with new tool tabs in 2.70. ;)
* See also T41704.
*/
/* #define UI_USE_PANELTAB */
Panel *uiPanelFindByType(ARegion *ar, PanelType *pt)
{
Panel *pa;
const char *idname = pt->idname;
const char *tabname = pt->category;
#ifdef UI_USE_PANELTAB
const char *tabname = pt->idname;
for (pa = ar->panels.first; pa; pa = pa->next) {
if (STREQLEN(pa->panelname, idname, sizeof(pa->panelname))) {
if (STREQLEN(pa->tabname, tabname, sizeof(pa->tabname))) {
@ -215,6 +221,13 @@ Panel *uiPanelFindByType(ARegion *ar, PanelType *pt)
}
}
}
#else
for (pa = ar->panels.first; pa; pa = pa->next) {
if (STREQLEN(pa->panelname, idname, sizeof(pa->panelname))) {
return pa;
}
}
#endif
return NULL;
}
@ -224,11 +237,13 @@ Panel *uiPanelFindByType(ARegion *ar, PanelType *pt)
*/
Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Panel *pa, bool *r_open)
{
Panel *patab, *palast, *panext;
Panel *palast, *panext;
const char *drawname = CTX_IFACE_(pt->translation_context, pt->label);
const char *idname = pt->idname;
const char *tabname = pt->category;
#ifdef UI_USE_PANELTAB
const char *tabname = pt->idname;
const char *hookname = NULL;
#endif
const bool newpanel = (pa == NULL);
int align = panel_aligned(sa, ar);
@ -240,7 +255,6 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Pan
pa = MEM_callocN(sizeof(Panel), "new panel");
pa->type = pt;
BLI_strncpy(pa->panelname, idname, sizeof(pa->panelname));
BLI_strncpy(pa->tabname, tabname, sizeof(pa->tabname));
if (pt->flag & PNL_DEFAULT_CLOSED) {
if (align == BUT_VERTICAL)
@ -256,9 +270,13 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Pan
pa->runtime_flag |= PNL_NEW_ADDED;
BLI_addtail(&ar->panels, pa);
#ifdef UI_USE_PANELTAB
BLI_strncpy(pa->tabname, tabname, sizeof(pa->tabname));
/* make new Panel tabbed? */
if (hookname) {
Panel *patab;
for (patab = ar->panels.first; patab; patab = patab->next) {
if ((patab->runtime_flag & PNL_ACTIVE) && patab->paneltab == NULL) {
if (STREQLEN(hookname, patab->panelname, sizeof(patab->panelname))) {
@ -271,6 +289,9 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, Pan
}
}
}
#else
BLI_strncpy(pa->tabname, idname, sizeof(pa->tabname));
#endif
}
/* Do not allow closed panels without headers! Else user could get "disappeared" UI! */