mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 10:23:41 +00:00
system info copied when clicking in Bonsai Version (#6660)
This commit is contained in:
@@ -123,6 +123,7 @@ classes = [
|
|||||||
operator.SelectURIAttribute,
|
operator.SelectURIAttribute,
|
||||||
operator.SetTab,
|
operator.SetTab,
|
||||||
operator.SwitchTab,
|
operator.SwitchTab,
|
||||||
|
operator.Show_system_info,
|
||||||
prop.StrProperty,
|
prop.StrProperty,
|
||||||
operator.BIM_OT_enum_property_search, # /!\ Register AFTER prop.StrProperty
|
operator.BIM_OT_enum_property_search, # /!\ Register AFTER prop.StrProperty
|
||||||
prop.ObjProperty,
|
prop.ObjProperty,
|
||||||
|
|||||||
@@ -1286,3 +1286,33 @@ class CopyTextToClipboard(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
context.window_manager.clipboard = self.text
|
context.window_manager.clipboard = self.text
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
class Show_system_info(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.show_system_info"
|
||||||
|
bl_label = "System Info"
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
|
info_text: bpy.props.StringProperty()
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
context.window_manager.clipboard = self.info_text
|
||||||
|
self.report({"INFO"}, "System information copied to clipboard.")
|
||||||
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
def invoke(self, context, event):
|
||||||
|
# Invoke the bim.copy_debug_information operator to get the info to the clipboard
|
||||||
|
bpy.ops.bim.copy_debug_information()
|
||||||
|
self.info_text = context.window_manager.clipboard
|
||||||
|
|
||||||
|
return context.window_manager.invoke_popup(self, width=600)
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
col = layout.column()
|
||||||
|
|
||||||
|
for line in self.info_text.split("\n"):
|
||||||
|
col.label(text=line)
|
||||||
|
|
||||||
|
col.separator()
|
||||||
|
col.label(text="(The information has been copied to the clipboard.)")
|
||||||
|
|||||||
@@ -1182,8 +1182,10 @@ class UIData:
|
|||||||
def draw_statusbar(self, context):
|
def draw_statusbar(self, context):
|
||||||
if not UIData.is_loaded:
|
if not UIData.is_loaded:
|
||||||
UIData.load()
|
UIData.load()
|
||||||
text = f"Bonsai v{UIData.data['version']}"
|
bonsai_version = f"Bonsai v{UIData.data['version']}"
|
||||||
self.layout.label(text=text)
|
layout = self.layout
|
||||||
|
row = layout.row()
|
||||||
|
row.operator("bim.show_system_info", text=bonsai_version, emboss=False)
|
||||||
|
|
||||||
|
|
||||||
def draw_custom_context_menu(self: bpy.types.Menu, context: bpy.types.Context) -> None:
|
def draw_custom_context_menu(self: bpy.types.Menu, context: bpy.types.Context) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user