[Bf-blender-cvs] [bf54ed0] master: Fix T41704: 2.71.6 no longer reading user ui panel arrangement from earlier saved blend files.

Bastien Montagne noreply at git.blender.org
Thu Sep 4 15:21:55 CEST 2014


Commit: bf54ed0c7c097f1af3e73d07bb4bb32066f649ea
Author: Bastien Montagne
Date:   Thu Sep 4 14:38:29 2014 +0200
Branches: master
https://developer.blender.org/rBbf54ed0c7c097f1af3e73d07bb4bb32066f649ea

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...

===================================================================

M	source/blender/editors/interface/interface_panel.c

===================================================================

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 50a1900..9265ca0 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -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! */




More information about the Bf-blender-cvs mailing list