Skip to content

Commit

Permalink
[macos] ProgressIndicator workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
mnesarco committed Dec 14, 2022
1 parent 2d534d0 commit c8072ec
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion freecad/marz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# | along with Marz Workbench. If not, see <https://www.gnu.org/licenses/>. |
# +---------------------------------------------------------------------------+

__version__ = "0.0.26-alpha"
__version__ = "0.0.27-alpha"
__author__ = "Frank David Martinez M <mnesarco at gmail.com>"
__copyright__ = "Copyright 2020, Frank D. Martinez. M."
__license__ = "GPLv3"
Expand Down
15 changes: 14 additions & 1 deletion freecad/marz/extension/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
UIGroup_Tmp = ('Marz_Group_Tmp', 'tmp')
UIGroup_XLines = ('Marz_Group_Construction', 'Instrument Reference Constructions')

# Ugly workaround to FreeCAD bug on MacOS:
# forum: https://forum.freecadweb.org/viewtopic.php?f=10&t=53713
# issue: https://github.com/FreeCAD/FreeCAD_Conda/issues/26
class MacOSProgressIndicatorWorkaround:
def __init__(*args, **kwargs):
pass
def start(*args, **kwargs):
pass
def stop(*args, **kwargs):
pass

@RunInUIThread
def Msg(text):
Expand All @@ -49,7 +59,10 @@ def Log(text):


def StartProgress(msg, n = 0):
bar = App.Base.ProgressIndicator()
try:
bar = App.Base.ProgressIndicator()
except:
bar = MacOSProgressIndicatorWorkaround()
bar.start(msg,n)
return bar

Expand Down
2 changes: 1 addition & 1 deletion manifest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;* General identification metadata *
;***************************************************************************
[general]
version=0.1
version=0.27
name=Marz
title=Marz Guitar Design
description=Parametric Guitar Design
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package format="1">
<name>Marz Workbench</name>
<description>Parametric Guitar design workbench</description>
<version>0.0.26-alpha</version>
<version>0.0.27-alpha</version>
<maintainer email="twitter: @mnesarco">Frank Martinez</maintainer>
<license file="LICENSE">GPL-3.0</license>
<url type="repository" branch="master">https://github.com/mnesarco/MarzWorkbench</url>
Expand All @@ -13,7 +13,7 @@
<name>Marz Workbench</name>
<classname>MarzWorkbench</classname>
<description>Parametric Guitar design workbench.</description>
<version>0.0.26-alpha</version>
<version>0.0.27-alpha</version>
<subdirectory>./</subdirectory>
<icon>Resources/icons/Marz.svg</icon>
<freecadmin>0.19.0</freecadmin>
Expand Down

0 comments on commit c8072ec

Please sign in to comment.