Skip to content

Commit

Permalink
fix for Mac profile save bug, part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
swarfer committed Jan 6, 2017
1 parent cebef9c commit d9d6885
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Plugins/Phlatboyz/tools/ProfilesTool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ def select
Dir.mkdir(path)
end
trying = true
#deal with the pre 2014 dialog bug
#deal with the pre 2014 dialog bug, still present in Mac version Make2015 and later
#do not use wildcards in Mac, savepanel will never open
@vv = Sketchup.version.split(".")[0].to_i #primary version number
if (@vv >= 14)
wildcard = '.tpi Files|*.tpi|All tool files|*.t*||'
if ((@vv >= 14) && (!PhlatScript.isMac?))
wildcard = '.tpi Files|*.tpi|All tool files|*.t*||'
else
wildcard = "default.tpi"
wildcard = 'default.tpi' #Mac does not like wildcards for savepanel()
end

while trying do
result = UI.savepanel(PhlatScript.getString("Save Tool Profile"), path, wildcard)
while trying do
result = UI.savepanel(PhlatScript.getString('Save Tool Profile'), path, wildcard)
if (result != nil)
result = File.basename(result) # remove path because we force it later
result += '.tpi' if (File.extname(result).empty?)
Expand All @@ -105,7 +105,7 @@ def select
else
trying = false
end
else
else
trying = false
end
end # while
Expand Down

0 comments on commit d9d6885

Please sign in to comment.