From b8e11215fa027d947252db22b0d49d1bd0f9e1d9 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Wed, 9 Oct 2019 13:24:09 -0700 Subject: [PATCH] Add separate button for adding symbols+scripts from project The "add platform symbol file" and "add extension script" buttons create a file dialog with the initial directory set to the RuntimeData directory inside the SourceGen installation directory. This is great if you're trying to add a file from the platform definitions, but annoying if you're trying to add it from the project directory. It's really convenient to not have to hunt around though, so now there are two buttons: one for platform, one for project. The latter is disabled if the project is new and hasn't been saved yet. --- SourceGen/RuntimeData/Help/settings.html | 18 +++++++++++--- SourceGen/WpfGui/EditProjectProperties.xaml | 24 ++++++++++++++----- .../WpfGui/EditProjectProperties.xaml.cs | 21 ++++++++++++---- 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/SourceGen/RuntimeData/Help/settings.html b/SourceGen/RuntimeData/Help/settings.html index e9952fc..a0ef34d 100644 --- a/SourceGen/RuntimeData/Help/settings.html +++ b/SourceGen/RuntimeData/Help/settings.html @@ -294,6 +294,13 @@ with SourceGen, or in the directory where the project file lives. This is mostly to keep things manageable when projects are distributed to other people, but also acts as a minor security check, to prevent a wayward project from trying to open files it shouldn't.

+

Click one of the "Add Symbol Files" buttons to include one or more +symbol files in the project. +The "Add Symbol Files from Platform" button sets the directory +to the SourceGen RuntimeData directory, while "Add Symbol Files from Project" +starts in the project directory. If you haven't yet saved the project, +the latter button will be disabled. The only difference between the +buttons is the initial directory.

In the list, files loaded from the RuntimeData directory will be prefixed with RT:. Files loaded from the project directory will be prefixed with PROJ:.

@@ -303,15 +310,20 @@ you will receive a warning.

Extension Scripts

From here, you can add and remove extension script files. -See the extension scripts section for -details on how extension scripts work.

- +See the extension scripts +section for details on how extension scripts work.

Extension script files must live in the RuntimeData directory that comes with SourceGen, or in the directory where the project file lives. This is mostly to keep things manageable when projects are distributed to other people, but also acts as a minor security check, to prevent a wayward project from trying to open files it shouldn't.

+

Click one of the "Add Scripts" buttons to include one more scripts in +the project. The "Add Scripts from Platform" button sets the directory +to the SourceGen RuntimeData directory, while "Add Scripts from Project" +starts in the project directory. If you haven't yet saved the project, +the latter button will be disabled. The only difference between the +buttons is the initial directory.

In the list, files loaded from the RuntimeData directory will be prefixed with RT:. Files loaded from the project directory will be prefixed with PROJ:.

diff --git a/SourceGen/WpfGui/EditProjectProperties.xaml b/SourceGen/WpfGui/EditProjectProperties.xaml index 4ec0490..1bd65a6 100644 --- a/SourceGen/WpfGui/EditProjectProperties.xaml +++ b/SourceGen/WpfGui/EditProjectProperties.xaml @@ -211,9 +211,15 @@ limitations under the License. ItemsSource="{Binding PlatformSymbolIdentifiers}" SelectionChanged="List_SelectionChanged"/> -