Commit: 3c82c0d6f8b873dbfc54b79df99354b8dff652f8
Author: Mateusz Grzeliński
Date:   Thu Aug 13 17:38:12 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB3c82c0d6f8b873dbfc54b79df99354b8dff652f8

Revert "Report filtering: use enum instead of separate bool properties"

This reverts commit 983bcc66 but preserves more error types

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

M       release/scripts/startup/bl_ui/space_info.py
M       source/blender/blenloader/intern/versioning_250.c
M       source/blender/blenloader/intern/versioning_defaults.c
M       source/blender/editors/space_info/info_report.c
M       source/blender/editors/space_info/space_info.c
M       source/blender/makesdna/DNA_windowmanager_types.h
M       source/blender/makesdna/intern/dna_rename_defs.h
M       source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_info.py 
b/release/scripts/startup/bl_ui/space_info.py
index 4de8adcab20..6a9dc984770 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -167,7 +167,15 @@ class INFO_PT_report_type_visibility(Panel):
         if sinfo.view == 'REPORTS':
             layout.label(text="Report Types Visibility")
             col = layout.column(align=True)
-            col.prop(sinfo, "report_mask")
+            col.prop(sinfo, "show_report_debug", text="Debug")
+            col.prop(sinfo, "show_report_info", text="Info")
+            col.prop(sinfo, "show_report_operator", text="Operator")
+            col.prop(sinfo, "show_report_property", text="Property")
+            col.prop(sinfo, "show_report_warning", text="Warning")
+            col.prop(sinfo, "show_report_error", text="Error")
+            col.prop(sinfo, "show_report_error_out_of_memory", text="Error")
+            col.prop(sinfo, "show_report_error_invalid_context", text="Error")
+            col.prop(sinfo, "show_report_error_invalid_input", text="Error")
             layout.separator()
         else:
             layout.label(text="Filter Log Severity")
diff --git a/source/blender/blenloader/intern/versioning_250.c 
b/source/blender/blenloader/intern/versioning_250.c
index 4da186d11a8..15e99b5ddb0 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -1860,7 +1860,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main 
*bmain)
             SpaceInfo *sinfo = (SpaceInfo *)sl;
             ARegion *region;
 
-            sinfo->rpt_mask = RPT_MASK_DEFAULT;
+            sinfo->report_mask_exclude = RPT_DEBUG_ALL;
 
             for (region = area->regionbase.first; region; region = 
region->next) {
               if (region->regiontype == RGN_TYPE_WINDOW) {
diff --git a/source/blender/blenloader/intern/versioning_defaults.c 
b/source/blender/blenloader/intern/versioning_defaults.c
index 1c6d068d3d1..5bbbf07cf78 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -178,7 +178,7 @@ static void blo_update_defaults_screen(bScreen *screen,
     }
     else if (area->spacetype == SPACE_INFO) {
       SpaceInfo *sinfo = area->spacedata.first;
-      sinfo->rpt_mask = RPT_MASK_DEFAULT;
+      sinfo->report_mask_exclude = RPT_DEBUG_ALL;
     }
     else if (area->spacetype == SPACE_TEXT) {
       /* Show syntax and line numbers in Script workspace text editor. */
diff --git a/source/blender/editors/space_info/info_report.c 
b/source/blender/editors/space_info/info_report.c
index 235210a0b56..509605a7d2c 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -106,7 +106,37 @@ static void reports_select_all(ReportList *reports,
 
 int info_report_mask(const SpaceInfo *sinfo)
 {
-  return sinfo->rpt_mask;
+  int report_mask = 0;
+
+  if (!(sinfo->report_mask_exclude & RPT_DEBUG)) {
+    report_mask |= RPT_DEBUG_ALL;
+  }
+  if (!(sinfo->report_mask_exclude & RPT_INFO)) {
+    report_mask |= RPT_INFO_ALL;
+  }
+  if (!(sinfo->report_mask_exclude & RPT_OPERATOR)) {
+    report_mask |= RPT_OPERATOR_ALL;
+  }
+  if (!(sinfo->report_mask_exclude & RPT_PROPERTY)) {
+    report_mask |= RPT_PROPERTY_ALL;
+  }
+  if (!(sinfo->report_mask_exclude & RPT_WARNING)) {
+    report_mask |= RPT_WARNING_ALL;
+  }
+  if (!(sinfo->report_mask_exclude & RPT_ERROR)) {
+    report_mask |= RPT_ERROR;
+  }
+  if (!(sinfo->report_mask_exclude & RPT_ERROR_INVALID_CONTEXT)) {
+    report_mask |= RPT_ERROR_INVALID_CONTEXT;
+  }
+  if (!(sinfo->report_mask_exclude & RPT_ERROR_OUT_OF_MEMORY)) {
+    report_mask |= RPT_ERROR_OUT_OF_MEMORY;
+  }
+  if (!(sinfo->report_mask_exclude & RPT_ERROR_INVALID_INPUT)) {
+    report_mask |= RPT_ERROR_INVALID_INPUT;
+  }
+
+  return report_mask;
 }
 
 // TODO, get this working again!
diff --git a/source/blender/editors/space_info/space_info.c 
b/source/blender/editors/space_info/space_info.c
index 387eb62a7a2..741459c7b1f 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -64,7 +64,7 @@ static SpaceLink *info_create(const ScrArea *UNUSED(area), 
const Scene *UNUSED(s
   sinfo = MEM_callocN(sizeof(SpaceInfo), "initinfo");
   sinfo->spacetype = SPACE_INFO;
 
-  sinfo->rpt_mask = RPT_MASK_DEFAULT;
+  sinfo->report_mask_exclude = RPT_DEBUG_ALL;
 
   /* header */
   region = MEM_callocN(sizeof(ARegion), "header for info");
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h 
b/source/blender/makesdna/DNA_windowmanager_types.h
index ccd73331237..41f11ce59ca 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -76,8 +76,6 @@ typedef enum ReportType {
 #define RPT_WARNING_ALL (RPT_WARNING)
 #define RPT_ERROR_ALL \
   (RPT_ERROR | RPT_ERROR_INVALID_INPUT | RPT_ERROR_INVALID_CONTEXT | 
RPT_ERROR_OUT_OF_MEMORY)
-#define RPT_MASK_DEFAULT \
-  RPT_ERROR_ALL | RPT_INFO_ALL | RPT_WARNING_ALL | RPT_PROPERTY_ALL | 
RPT_OPERATOR
 
 enum ReportListFlags {
   /* RPT_PRINT = (1 << 0), unused, replaced with logs */
diff --git a/source/blender/makesdna/intern/dna_rename_defs.h 
b/source/blender/makesdna/intern/dna_rename_defs.h
index a73fc747f84..87c73e7e112 100644
--- a/source/blender/makesdna/intern/dna_rename_defs.h
+++ b/source/blender/makesdna/intern/dna_rename_defs.h
@@ -88,6 +88,7 @@ DNA_STRUCT_RENAME_ELEM(Object, size, scale)
 DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_group, instance_collection)
 DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_ob, instance_object)
 DNA_STRUCT_RENAME_ELEM(ParticleSettings, dupliweights, instance_weights)
+DNA_STRUCT_RENAME_ELEM(SpaceInfo, rpt_mask, report_mask_exclude)
 DNA_STRUCT_RENAME_ELEM(Text, name, filepath)
 DNA_STRUCT_RENAME_ELEM(ThemeSpace, scrubbing_background, time_scrub_background)
 DNA_STRUCT_RENAME_ELEM(ThemeSpace, show_back_grad, background_type)
diff --git a/source/blender/makesrna/intern/rna_space.c 
b/source/blender/makesrna/intern/rna_space.c
index 6138b59095e..5926f21900b 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -6022,12 +6022,59 @@ static void rna_def_space_info(BlenderRNA *brna)
   RNA_def_struct_sdna(srna, "SpaceInfo");
   RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
 
-  prop = RNA_def_property(srna, "report_mask", PROP_ENUM, PROP_NONE);
-  RNA_def_property_enum_sdna(prop, NULL, "rpt_mask");
-  RNA_def_property_enum_items(prop, rna_enum_wm_report_items);
-  RNA_def_property_flag(prop, PROP_ENUM_FLAG);
-  RNA_def_property_enum_default(prop, RPT_MASK_DEFAULT);
-  RNA_def_property_ui_text(prop, "Filter Report Type", "");
+  /* reporting display */
+  prop = RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_DEBUG);
+  RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
+  RNA_def_property_ui_icon(prop, ICON_SYSTEM, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_INFO);
+  RNA_def_property_ui_text(prop, "Show Info", "Display general information");
+  RNA_def_property_ui_icon(prop, ICON_INFO, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_OPERATOR);
+  RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
+  RNA_def_property_ui_icon(prop, ICON_CHECKMARK, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "show_report_property", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_PROPERTY);
+  RNA_def_property_ui_text(prop, "Show Property", "Display property change");
+  RNA_def_property_ui_icon(prop, ICON_PROPERTIES, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, 
PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_WARNING);
+  RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
+  RNA_def_property_ui_icon(prop, ICON_ERROR, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_ERROR);
+  RNA_def_property_ui_text(prop, "Show Error", "Display error text");
+  RNA_def_property_ui_icon(prop, ICON_CANCEL, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "show_report_error_invalid_input", 
PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_ERROR_INVALID_INPUT);
+  RNA_def_property_ui_text(prop, "Show Error", "Display error text");
+  RNA_def_property_ui_icon(prop, ICON_CANCEL, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "show_report_error_invalid_context", 
PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_ERROR_INVALID_CONTEXT);
+  RNA_def_property_ui_text(prop, "Show Error", "Display error text");
+  RNA_def_property_ui_icon(prop, ICON_CANCEL, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
+  prop = RNA_def_property(srna, "show_report_error_out_of_memory", 
PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", 
RPT_ERROR_OUT_OF_MEMORY);
+  RNA_def_property_ui_text(prop, "Show Error", "Display error text");
+  RNA_def_property_ui_icon(prop, ICON_CANCEL,

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to