Uploaded image for project: 'Snowstorm'
  1. Snowstorm
  2. STORM-1708

Save and load scripts from the script editor to local disk

    Details

    • Type: Story
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Active
    • Labels:
      None
    • Test Plan:
      Hide

      1) Open a script from inventory.
      2) Click the File menu in the open script's preview window.
      3) Both "Load from file..." and "Save to file..." entries should be present and not greyed out.
      4) Click "Save to file..." A file picker dialogue should open. In it, choose a location and name for the file which can be remembered, and click Save.
      5) Using an external editor (e.g. notepad on windows), find the file and verify that the contents were saved correctly.
      6) Close the external editor and the script preview.
      7) In inventory, create a new script and open it.
      8) On the File menu in the open script's preview window, select "Load from file...". In the following file picker window find the previously saved file and select it.
      9) Verify the script's new contents match the originally saved script.

      Show
      1) Open a script from inventory. 2) Click the File menu in the open script's preview window. 3) Both "Load from file..." and "Save to file..." entries should be present and not greyed out. 4) Click "Save to file..." A file picker dialogue should open. In it, choose a location and name for the file which can be remembered, and click Save. 5) Using an external editor (e.g. notepad on windows), find the file and verify that the contents were saved correctly. 6) Close the external editor and the script preview. 7) In inventory, create a new script and open it. 8) On the File menu in the open script's preview window, select "Load from file...". In the following file picker window find the previously saved file and select it. 9) Verify the script's new contents match the originally saved script.

      Description

      This is a patch to lltexteditor et. al. to allow saving and loading of local files to the script editor. I assume this makes sense as one can already cut/paste scripts. This patch simply allows direct access to the disk. Since opening a file from disk and creating an new asset for it was a more delicate operation, I opted to load as an over-write, as if a paste with all selected in the existing script window. I tried to make this sensible, given the SL model, in that if the existing has unsaved changes you cannot load and get a warning. This is more of a convenience effort then anything and simply bypasses the cut and paste nonsense. Patch is attached.

      Patch 2 adds a check on the loaded file size and aborts if it's too big. It is not clear to me what the correct constant to check against is wrt to capacity however.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jb.kraft JB Kraft
                Extended Group Visibility:
                jira-users
              • Watchers:
                26 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: