Changeset 774


Ignore:
Timestamp:
Dec 4, 2009 5:11:48 PM (13 years ago)
Author:
toby
Message:

# on 2004/01/30 00:48:57, toby did:
Add code to set app/icon in OS X, remove applescript generation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 2003/12/16 18:02:53 to 2004/01/30 00:48:57
    • Property rcs:lines changed from +14 -9 to +33 -5
    • Property rcs:rev changed from 1.68 to 1.69
    r763 r774  
    100100set expgui(needpowpref) 0
    101101set expgui(needpowpref_why) ""
     102# on Mac associate a app with .EXP file (on by default)
     103set expgui(MacAssignApp) 1
    102104#=============================================================================
    103105#----------------------------------------------------------------
     
    332334    }
    333335    set expgui(expfile) $expfile
     336
     337    # change the icon and assign an app to this .EXP file
     338    global tcl_platform
     339    if {$tcl_platform(os) == "Darwin" && $expgui(MacAssignApp)} {
     340        MacSetResourceFork $expfile
     341    }
     342
     343    # read in the .EXP file
    334344    set fmt [expload $expfile]
    335345    # if the file was not in the correct format, force a rewrite before use
     
    451461    set expgui(expfile) $newexpfile
    452462    catch {cd [string trim [file dirname $expgui(expfile)]]}
     463    # change the icon and assign an app to this .EXP file
     464    global tcl_platform
     465    if {$tcl_platform(os) == "Darwin" && $expgui(MacAssignApp)} {
     466        MacSetResourceFork $expgui(expfile)
     467    }
    453468    set expgui(changed) 0
    454469    set expgui(expModifiedLast) [file mtime $expgui(expfile)]
     
    559574
    560575    puts $fp "# EXPGUI saved options from [clock format [clock ticks]]"
    561     foreach item {archive asorttype hsorttype filesort disaglSeparateBox \
    562             font autoexpload autoiconify autotick autoGRWND} {
     576    set itemlist {archive asorttype hsorttype filesort disaglSeparateBox \
     577        font autoexpload autoiconify autotick}
     578    if {$tcl_platform(os) == "Darwin"} {
     579        lappend itemlist MacAssignApp
     580    }
     581    if {$tcl_platform(platform) == "windows" && \
     582            $tcl_platform(os) == "Windows 95"} {
     583        lappend itemlist autoGRWND
     584    }
     585    foreach item $itemlist {
    563586        puts $fp "set expgui($item) [list $expgui($item)]"
    564587    }
     
    608631}
    609632
     633# this proc is no longer called, but I am leaving it here as it may
     634# be of use in the future
    610635proc MakeAppleScript {} {
    611636    global wishshell expgui
     
    660685    }
    661686}
     687
    662688# this proc gets called when the export coordinate button is pressed
    663689# it loads export
     
    42754301
    42764302if {$tcl_platform(os) == "Darwin"} {
    4277     $expgui(fm).file.menu add command -label "Create AppleScript" -command MakeAppleScript
     4303#    $expgui(fm).file.menu add command -label "Create AppleScript" -command MakeAppleScript
     4304    $expgui(fm).option.menu add checkbutton -label "Assign app to .EXP files" \
     4305        -variable expgui(MacAssignApp)
    42784306}
    42794307$expgui(fm).file.menu add command -label "Exit"  -underline 1 -command catchQuit
Note: See TracChangeset for help on using the changeset viewer.