Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

Changeset 12 for trunk/lingosource


Ignore:
Timestamp:
09/03/07 08:40:14 (5 years ago)
Author:
alex
Message:

fixed ssome windows bugs in regards to svn functions

Location:
trunk/lingosource
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib1/OSCmenu_Utilities.ls

    r2 r12  
    172172  subli.add("mExportScriptsToFolder me, skipIcons, selectionOnly, convertLineBreaksToUnix") 
    173173  subli.add("mImportScriptWithThumbnail me, thePath, castlibNumber, dontWarn, infolist") 
     174  subli.add("") 
    174175  subli.add("mUpdateScriptsFromFolder me, thePath, selectionOnly") 
     176  subli.add("") 
     177  subli.add("mSVN_Delete_Selected_Scripts me, chooseNewPath") 
    175178  subli.add("") 
    176179  subli.add("mSVN_Update_Working_Copy me, chooseNewPath") 
    177180  subli.add("mSVN_Commit_CurrentScripts me, selected_Members_Only") 
     181  subli.add("") 
     182  subli.add("mSVN_Update_CurrentMovie me") 
     183  subli.add("mSVN_Commit_CurrentMovie me") 
    178184  ---------------------------------------------------- 
    179185   
  • trunk/lingosource/castlib1/alexUtilities.ls

    r6 r12  
    151151        startfolder = string(startfolder) 
    152152        if length(startfolder) > 0 then 
    153           pfad = baGetFilename("save", startfolder, theDefaultName, "", 524288+4, theTitle, false, -1, -1) 
     153          pfad = baGetFilename("save", startfolder, theDefaultName, "", 524288+4+2+4194304, theTitle, false, -1, -1) 
    154154        else 
    155           pfad = baGetFilename("save", "", theDefaultName, "", 524288+4, theTitle, false, -1, -1) 
     155          pfad = baGetFilename("save", "", theDefaultName, "", 524288+4+2+4194304, theTitle, false, -1, -1) 
    156156        end if 
    157157      else 
     
    331331   
    332332  if mCheckForXtra(me, "BudAPI") = 1 then -- if buddy is present... 
    333     retval = baGetFolder( "", "Select a folder", 0, "", 50, 50 ) 
     333    retval = baGetFolder( "", "Select a folder", 3, "", 50, 50 ) 
    334334  else if mCheckForXtra(me, "FileXtra4") = 1 then -- if not buddy then try filextra 
    335335    fx = (xtra "filextra4").new() 
     
    38303830   
    38313831  if the platform contains "mac" then 
    3832     theresult = shell_cmd_list(baUnixName(svnBinary) && "update" && QUOTE & baUnixName(workingFolder) & QUOTE) 
     3832    svnBinary = baUnixName(svnBinary) 
     3833    workingFolder = baUnixName(workingFolder) 
    38333834  else 
    3834     theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE) 
    3835   end if 
     3835    if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
     3836  end if 
     3837   
     3838  theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE) 
    38363839   
    38373840  if count(theresult) > 0 then 
    3838     alert "svn response:" && theresult[1] 
     3841    put theresult[1] 
     3842    alert "Done, see the results of the svn operation in the message window." 
    38393843  else 
    38403844    alert "svn application did not respond, something seems to have failed. :-(" 
     
    38463850 
    38473851 
    3848  
    3849 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    3850  
    3851 on mSVN_Commit_CurrentScripts me, selected_Members_Only, chooseNewPath 
     3852-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     3853 
     3854on mSVN_Delete_Selected_Scripts me, chooseNewPath 
     3855   
    38523856   
    38533857  workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
     
    38593863  workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies) 
    38603864  if length(workingFolder) < 1 then exit 
     3865   
     3866   
     3867  if the platform contains "mac" then 
     3868    isMac = 1 
     3869    svnBinary = baUnixName(svnBinary) 
     3870     
     3871  else 
     3872    isMac = 0 
     3873     
     3874  end if 
     3875   
     3876   
     3877  thePath = workingFolder 
     3878   
     3879  cl = the activecastlib 
     3880   
     3881  olddelim = the itemdelimiter 
     3882  the itemdelimiter = the last char of the applicationpath 
     3883  fname = thePath 
     3884  delete the last item of fname 
     3885  fname = the last item of fname 
     3886  the itemdelimiter = olddelim 
     3887   
     3888  infolist = 0 
     3889   
     3890  if fname <> "castlib" & the number of castlib cl then 
     3891     
     3892    newPath = thePath & "castlib" & the number of castlib cl 
     3893     
     3894    if baFolderExists(newPath) = 0 then 
     3895       
     3896      infolistPath = thePath & "memberInfo.xml" 
     3897       
     3898      infolist = mReadXML_2_List(me, infolistPath) 
     3899       
     3900      if ilk(infolist) <> #proplist then 
     3901         
     3902        alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
     3903        return 0 
     3904         
     3905      else 
     3906         
     3907        thePath = newPath 
     3908         
     3909      end if 
     3910       
     3911    else 
     3912       
     3913      thePath = newPath 
     3914       
     3915    end if 
     3916  end if 
     3917   
     3918   
     3919  if infolist = 0 then 
     3920     
     3921    infolistPath = thePath & "memberInfo.xml" 
     3922    infolist = mReadXML_2_List(me, infolistPath) 
     3923     
     3924    if ilk(infolist) <> #proplist then 
     3925       
     3926      alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
     3927      return 0 
     3928       
     3929    end if 
     3930     
     3931  end if 
     3932   
     3933  doCommit = 0 
     3934  saveRequired = 0 
     3935   
     3936  cl = the activecastlib 
     3937  sel = the selection of castlib cl 
     3938  anz = sel.count 
     3939  cnt = 1 
     3940  repeat with n = 1 to anz 
     3941    repeat with m = sel[n][1] to sel[n][2] 
     3942      memref = member(m, cl) 
     3943      dertyp = memref.type 
     3944      if dertyp = #script then 
     3945         
     3946        repeat with l = 1 to cnt 
     3947          li = infolist[l] 
     3948           
     3949          if li.getaprop(#memberName) = memref.name then 
     3950            fpath = thePath & infolist.getpropat(l) & ".ls" 
     3951             
     3952            if baFileExists(fpath) then 
     3953               
     3954              if isMac = 1 then 
     3955                ufpath =  baUnixName(fpath) 
     3956              else 
     3957                ufpath =  fpath 
     3958              end if 
     3959               
     3960              theresult = shell_cmd_list(svnBinary && "delete" && QUOTE & ufpath & QUOTE) 
     3961              if count(theresult) < 1 then 
     3962                put "failed to svn delete member " & memref & " no result from svn?!" 
     3963              else 
     3964                put theresult[1] 
     3965                doCommit = 1 
     3966              end if 
     3967               
     3968              li.deleteAt(l) 
     3969              memref.erase() 
     3970              saveRequired = 1 
     3971              put "Erase member:" && memref.name 
     3972               
     3973            end if 
     3974             
     3975          end if 
     3976        end repeat 
     3977         
     3978      end if 
     3979    end repeat 
     3980  end repeat 
     3981   
     3982   
     3983  if saveRequired = 1 then 
     3984     
     3985    if (baMsgBoxEx("The movie has been changed. Save changes to this movie?", "Save changes?", "Save", "Don't save", "", "Question", 1, "left", "Arial", 14, 4, -2, -2) = "Save") then 
     3986      saveMovie() 
     3987    end if 
     3988     
     3989  end if 
     3990   
     3991   
     3992  if doCommit = 1 then 
     3993     
     3994    msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
     3995     
     3996    if length(msg) < 1 then 
     3997      alert "You must enter a message for the commit action." 
     3998      exit 
     3999    end if 
     4000     
     4001    if isMac = 1 then 
     4002      workingFolder = baUnixName(workingFolder) 
     4003    else 
     4004      if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
     4005    end if 
     4006     
     4007    theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE && QUOTE & workingFolder & QUOTE) 
     4008     
     4009    if count(theresult) > 0 then 
     4010      put theresult[1] 
     4011      alert "Done, see the results of the svn operation in the message window." 
     4012    else 
     4013      alert "svn application did not respond, something seems to have failed. :-(" 
     4014    end if 
     4015     
     4016  else 
     4017     
     4018    alert "Nothing has been committed!" 
     4019     
     4020  end if 
     4021   
     4022  return 1 
     4023   
     4024end 
     4025 
     4026 
     4027-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     4028 
     4029on mSVN_Commit_CurrentMovie me, chooseNewPath 
     4030   
     4031  workingCopies = value(getPref("svn_wCopies_paths_Binary.txt")) 
     4032  if ilk(workingCopies) <> #proplist then workingCopies = [:] 
     4033   
     4034  svnBinary = mGetSVNBinaryPath(me, workingCopies) 
     4035  if length(svnBinary) < 1 then exit 
     4036   
     4037  workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies) 
     4038  if length(workingFolder) < 1 then exit 
     4039   
    38614040   
    38624041  msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
     
    38734052  end if 
    38744053   
    3875    
    38764054  saveMovie() 
    38774055   
    3878    
    3879   mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder 
    3880    
     4056  ------------ 
     4057  if workingFolder <> the moviepath then 
     4058    erg = baCopyFileProgress(the moviepath & the moviename, workingFolder & the moviename, "Always", "Copying movie to working folder", "", 33) 
     4059    if erg <> 0 then 
     4060      alert "An error occurred during copying the movie:" && erg 
     4061      exit 
     4062    end if 
     4063    clnum = the number of castlibs 
     4064    mp = the moviepath 
     4065    mplen = length(mp) 
     4066    olddelim = the itemdelimiter 
     4067    the itemdelimiter = mp 
     4068    repeat with n = 2 to clnum 
     4069      fname = castlib(n).filename 
     4070      if length(fname) > 0 then 
     4071         
     4072        offs = offset(mp, fname) 
     4073        if offs <> 1 then 
     4074          alert "Castlib" && castlib(n) && "is not within your current moviepath. This is not supported." 
     4075          exit 
     4076        end if 
     4077        relpath = fname 
     4078        delete char 1 to mplen of relpath 
     4079         
     4080        newpath = workingFolder & relpath 
     4081        newpathDir = newpath 
     4082        delete the last item of newpathDir 
     4083        if baFolderExists(newpathDir) <> 1 then baCreateFolder(newpathDir) 
     4084        baCopyFileProgress(fname, newpath, "Always", "Copying castlib " & n & " to working folder", "", 33) 
     4085         
     4086      end if 
     4087    end repeat 
     4088    the itemdelimiter = olddelim 
     4089  end if 
     4090  ------------ 
    38814091   
    38824092  if the platform contains "mac" then 
    38834093    svnBinary = baUnixName(svnBinary) 
    38844094    workingFolder = baUnixName(workingFolder) 
     4095  else 
     4096    if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
    38854097  end if 
    38864098   
     
    38984110    exit   
    38994111  end if 
     4112   
     4113   
     4114  ------- NOW, basically there are two options, one is only commiting the files, which we have copied (director movie and castlibs) 
     4115  ------- OR commit the whole folder (-> everything, which is changed or added to <workingFolder>) 
     4116  ------- The problem regarding option #1, is that it would be a new revision for each file -> ugly 
     4117  ------- #2 however "messes" with files, which the user may not expect... 
     4118  ------- I for one prefer #2 anyway, therefore I didn't even implement #1 
     4119  ------- in order to implement #1 you can use a repeat loop just like the above repeat, which goes thorugh each castlib 
    39004120   
    39014121  theresult = shell_cmd_list(svnBinary && "status" && QUOTE & workingFolder & QUOTE) 
     
    39404160     
    39414161    put theResult 
    3942     alert "svn response:" && theresult 
     4162    alert "Done, see the results of the svn operation in the message window." 
     4163     
     4164  else 
     4165    alert "svn application did not respond, something seems to have failed. :-(" 
     4166  end if 
     4167   
     4168   
     4169  setPref("svn_wCopies_paths_Binary.txt", string(workingCopies)) 
     4170   
     4171end 
     4172 
     4173-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     4174 
     4175on mSVN_Update_CurrentMovie me, chooseNewPath 
     4176   
     4177  workingCopies = value(getPref("svn_wCopies_paths_Binary.txt")) 
     4178  if ilk(workingCopies) <> #proplist then workingCopies = [:] 
     4179   
     4180  svnBinary = mGetSVNBinaryPath(me, workingCopies) 
     4181  if length(svnBinary) < 1 then exit 
     4182   
     4183  workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies) 
     4184  if length(workingFolder) < 1 then exit 
     4185   
     4186  if the platform contains "mac" then 
     4187    svnBinary = baUnixName(svnBinary) 
     4188    workingFolder = baUnixName(workingFolder) 
     4189  else 
     4190    if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
     4191  end if 
     4192   
     4193  theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE) 
     4194   
     4195  if count(theresult) > 0 then 
     4196    put theresult[1] 
     4197    alert "Done, see the results of the svn operation in the message window." 
     4198  else 
     4199    alert "svn application did not respond, something seems to have failed. :-(" 
     4200  end if 
     4201   
     4202  setPref("svn_wCopies_paths_Binary.txt", string(workingCopies)) 
     4203   
     4204end 
     4205 
     4206-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     4207 
     4208on mSVN_Commit_CurrentScripts me, selected_Members_Only, chooseNewPath 
     4209   
     4210  workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
     4211  if ilk(workingCopies) <> #proplist then workingCopies = [:] 
     4212   
     4213  svnBinary = mGetSVNBinaryPath(me, workingCopies) 
     4214  if length(svnBinary) < 1 then exit 
     4215   
     4216  workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies) 
     4217  if length(workingFolder) < 1 then exit 
     4218   
     4219  msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
     4220   
     4221  if length(msg) < 1 then 
     4222    alert "You must enter a message for the commit action." 
     4223    exit 
     4224  end if 
     4225   
     4226  if workingCopies.getaprop(#dontWarnWhenSaving) <> 1 then 
     4227    answer = baMsgBoxEx("The movie will be saved before committing.", "Save movie?", "Save", "Cancel", "Always save", "Question", 1, "left", "Arial", 14, 4, -2, -2) 
     4228    if answer = "Cancel" then exit 
     4229    if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1) 
     4230  end if 
     4231   
     4232   
     4233  saveMovie() 
     4234   
     4235   
     4236  mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder 
     4237   
     4238   
     4239  if the platform contains "mac" then 
     4240    svnBinary = baUnixName(svnBinary) 
     4241    workingFolder = baUnixName(workingFolder) 
     4242  else 
     4243    if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
     4244  end if 
     4245   
     4246   
     4247  theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE) 
     4248   
     4249  if count(theresult) < 1 then 
     4250    theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE && "2>&1") 
     4251    if count(theresult) < 1 then 
     4252      theError = theresult[1] 
     4253    else 
     4254      theError = "svn did not respond at all." 
     4255    end if 
     4256    alert "Can't proceed svn error while trying to update:" && theError 
     4257    exit   
     4258  end if 
     4259   
     4260  theresult = shell_cmd_list(svnBinary && "status" && QUOTE & workingFolder & QUOTE) 
     4261   
     4262  cnt = count(theresult) 
     4263  if cnt < 1 then 
     4264    alert "Apparently there are no changes to the most recent version in the svn repository: svn status is empty" 
     4265    exit 
     4266  end if 
     4267   
     4268  repeat with n = 1 to cnt 
     4269    answ = theresult[n] 
     4270    meth = word 1 of answ 
     4271    delete word 1 of answ 
     4272     
     4273    case meth of 
     4274      "!": -- deleted file (missing here, but in the repository present) 
     4275        -- I don't think, it is a good idea to delete the file in the repository in this case 
     4276        -- as it may also be the case, that we only have a subset of the castlibs/scripts 
     4277        -- therefore I just skip these files and leave it to the user what to do with them in his svn client application 
     4278        -- we only put a message, so the user is made aware of this fact 
     4279        put "Missing file!" && answ && "is missing here, but present in the repository" 
     4280         
     4281      "?": -- newly added file 
     4282        shell_cmd_list(svnBinary && "add" && QUOTE & answ & QUOTE) 
     4283         
     4284        put "Added file" && answ && "to the repository" 
     4285         
     4286      "m": 
     4287        -- just log the changes: 
     4288        put "Update file:" && answ 
     4289         
     4290    end case 
     4291     
     4292  end repeat 
     4293   
     4294  theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE && QUOTE & workingFolder & QUOTE) 
     4295   
     4296   
     4297  if count(theresult) > 0 then 
     4298    theResult = theresult[1] 
     4299     
     4300    put theResult 
     4301    alert "Done, see the results of the svn operation in the message window." 
    39434302     
    39444303  else 
     
    40464405   
    40474406  if chooseNewPath = 1 then 
    4048     workingFolder = baGetFolder(the moviepath, "Please select a working copy for SVN update", 0, "Select working copy", -2, -2) 
     4407    workingFolder = baGetFolder(the moviepath, "Please select a working copy for SVN update", 3, "Select working copy", -2, -2) 
    40494408  end if 
    40504409   
    40514410  if workingFolder = "" then 
    40524411    alert "No working copy is specified for this movie. Please select a working copy now." 
    4053     workingFolder = baGetFolder(the moviepath, "Please select a working copy for SVN update", 0, "Select working copy", -2, -2) 
     4412    workingFolder = baGetFolder(the moviepath, "Please select a working copy for SVN update", 3, "Select working copy", -2, -2) 
    40544413  end if 
    40554414   
  • trunk/lingosource/castlib1/thisMoviesScript.ls

    r1 r12  
    2121  theResult = prefsScript.mGetPrefValue(#windowrect) 
    2222  if ilk(theResult) <> #rect then theResult = rect(0,0,(the activewindow).rect.width, (the activewindow).rect.height).offset(50, 50) 
    23   (the activewindow).rect = theResult  
     23  (the activewindow).rect = theResult 
    2424end 
    2525 
     
    3737  -------------- the only benefit of doing so, was to save the window position, but maybe there was any other problem...? 
    3838   
    39   --  theResult = call(#mSetPrefValue, [mGetXscript(#GetSetPrefs)], #windowrect, (the activewindow).rect) 
    40   --  theResult = call(#mSavePrefs, [mGetXscript(#GetSetPrefs)], "handlerMenuToolPrefs", 1) 
     39  -------------- I've put it back in now, as I am having a problem on windows anyway, that I'll need to investigate further 
     40  theResult = call(#mSetPrefValue, [mGetXscript(#GetSetPrefs)], #windowrect, (the activewindow).rect) 
     41  theResult = call(#mSavePrefs, [mGetXscript(#GetSetPrefs)], "handlerMenuToolPrefs", 1) 
    4142   
    4243  forget the activewindow 
  • trunk/lingosource/castlib2/FileIOFunktionen.ls

    r1 r12  
    107107        startfolder = string(startfolder) 
    108108        if length(startfolder) > 0 then 
    109           pfad = baGetFilename("save", startfolder, theDefaultName, "", 524288+4, theTitle, false, -1, -1) 
     109          pfad = baGetFilename("save", startfolder, theDefaultName, "", 524288+2+4+4194304, theTitle, false, -1, -1) 
    110110        else 
    111         pfad = baGetFilename("save", "", theDefaultName, "", 524288+4, theTitle, false, -1, -1) 
     111        pfad = baGetFilename("save", "", theDefaultName, "", 524288+2+4+4194304, theTitle, false, -1, -1) 
    112112        end if 
    113113      else 
     
    281281    prompt = string(prompt) 
    282282     
    283     return baGetFilename("open", startDir, defaultName, filetypes, 524288+4, prompt, false, -2, -1) 
     283    return baGetFilename("open", startDir, defaultName, filetypes, 524288+4+2+4194304, prompt, false, -2, -1) 
    284284     
    285285  else 
  • trunk/lingosource/castlib2/memberInfo.xml

    r6 r12  
    6666                <memberName>commonMovieScript</memberName> 
    6767        </commonmoviescript> 
     68        <commonmoviescript> 
     69                <scriptType>#parent</scriptType> 
     70                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
     71                <memberName>commonMovieScript</memberName> 
     72        </commonmoviescript> 
     73        <commonmoviescript> 
     74                <scriptType>#parent</scriptType> 
     75                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
     76                <memberName>commonMovieScript</memberName> 
     77        </commonmoviescript> 
    6878        <commonMovieScript> 
    6979                <scriptType>#parent</scriptType> 
Note: See TracChangeset for help on using the changeset viewer.