-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from TQLApp/edit-dialogs
Reworked the configuration controls
- Loading branch information
Showing
69 changed files
with
1,915 additions
and
1,772 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/Tql.App/Themes/**/* | ||
/Tql.App/QuickStart/*.md | ||
/Tql.App/QuickStart/Playbook*.md | ||
/.github/ISSUE_TEMPLATE/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
################################################################################ | ||
# SUPPORT | ||
################################################################################ | ||
|
||
Function Split-Playbook | ||
{ | ||
foreach ($Child in Get-ChildItem "Tql.App\QuickStart\Playbook*.md") | ||
{ | ||
$Index = 0 | ||
$Content = Get-Content $Child.FullName | ||
$Part = @() | ||
$First = $true | ||
|
||
foreach ($Line in $Content) | ||
{ | ||
if ($Line -eq "---") | ||
{ | ||
if ($First) | ||
{ | ||
Write-Playbook-Part -Name $Child.Name -Index $Index -Part $Part | ||
|
||
$First = $false | ||
$Part = @() | ||
$Index += 1 | ||
} | ||
else | ||
{ | ||
$First = $true | ||
} | ||
} | ||
|
||
$Part += $Line | ||
} | ||
|
||
Write-Playbook-Part -Name $Child.Name -Index $Index -Part $Part | ||
} | ||
} | ||
|
||
Function Write-Playbook-Part([string]$Name, [int]$Index, [array]$Part) | ||
{ | ||
if ($Part.Count -gt 0) | ||
{ | ||
Set-Content (Get-Playbook-Part-FileName -Name $Name -Index $Index) $Part | ||
} | ||
} | ||
|
||
Function Merge-Playbook | ||
{ | ||
foreach ($Child in Get-ChildItem "Tql.App\QuickStart\Playbook*.md") | ||
{ | ||
$Content = @() | ||
|
||
for ($Index = 1; ; $Index += 1) | ||
{ | ||
$Part = Read-Playbook-Part -Name $Child.Name -Index $Index | ||
|
||
if ($Part -eq $null) | ||
{ | ||
break | ||
} | ||
|
||
if ($Content.Count -gt 0) | ||
{ | ||
$Content += "" | ||
} | ||
|
||
$Content += $Part | ||
} | ||
|
||
Set-Content $Child.FullName $Content | ||
} | ||
} | ||
|
||
Function Read-Playbook-Part([string]$Name, [int]$Index) | ||
{ | ||
$FileName = Get-Playbook-Part-FileName -Name $Name -Index $Index | ||
|
||
if (-not (Test-Path $FileName)) | ||
{ | ||
return $null | ||
} | ||
|
||
return Get-Content $FileName | ||
} | ||
|
||
Function Get-Playbook-Part-FileName([string]$Name, [int]$Index) | ||
{ | ||
$Name = $Name.Substring(0, $Name.Length - 3) | ||
|
||
return "Tql.App\QuickStart\Split$Name-$Index.md" | ||
} | ||
|
||
################################################################################ | ||
# ENTRY POINT | ||
################################################################################ | ||
|
||
npm install --save-dev prettier @prettier/plugin-xml | ||
|
||
rm "Tql.App\QuickStart\SplitPlaybook*.md" | ||
|
||
Split-Playbook | ||
|
||
npx prettier ` | ||
--plugin=@prettier/plugin-xml ` | ||
--write "**/*.xaml" "**/*.md" ` | ||
--end-of-line crlf ` | ||
--bracket-same-line true ` | ||
--single-attribute-per-line true ` | ||
--xml-quote-attributes double ` | ||
--xml-self-closing-space true ` | ||
--xml-whitespace-sensitivity ignore ` | ||
--prose-wrap always | ||
|
||
Merge-Playbook | ||
|
||
rm "Tql.App\QuickStart\SplitPlaybook*.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<utilities:BaseWindow | ||
x:Class="Tql.App.ConfigurationUI.PackageSourceEditWindow" | ||
x:ClassModifier="internal" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:utilities="clr-namespace:Tql.Utilities;assembly=Tql.Utilities" | ||
xmlns:app="clr-namespace:Tql.App" | ||
xmlns:configurationUi="clr-namespace:Tql.App.ConfigurationUI" | ||
ResizeMode="NoResize" | ||
SizeToContent="Height" | ||
WindowStartupLocation="CenterOwner" | ||
mc:Ignorable="d" | ||
Title="{x:Static app:Labels.PackageSourceEditWindow_Title}" | ||
Width="500" | ||
d:DataContext="{d:DesignInstance configurationUi:PackageSourceDto}"> | ||
<Window.Resources> | ||
<utilities:InverseBooleanConverter x:Key="IBConverter" /> | ||
</Window.Resources> | ||
|
||
<Grid Margin="9"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Label | ||
Content="{x:Static app:Labels.PackageSourceEditWindow_URLLabel}" /> | ||
<TextBox | ||
Text="{Binding Url}" | ||
Grid.Column="1" | ||
Margin="3" /> | ||
|
||
<Label | ||
Content="{x:Static app:Labels.PackageSourceEditWindow_UserNameLabel}" | ||
Grid.Row="1" /> | ||
<TextBox | ||
Text="{Binding UserName}" | ||
Grid.Row="1" | ||
Grid.Column="1" | ||
Margin="3" /> | ||
|
||
<Label | ||
Content="{x:Static app:Labels.PackageSourceEditWindow_PasswordLabel}" | ||
Grid.Row="2" /> | ||
<PasswordBox | ||
utilities:PasswordBoxHelper.BoundPassword="{Binding Password, Mode=TwoWay}" | ||
Grid.Row="2" | ||
Grid.Column="1" | ||
Margin="3" /> | ||
|
||
<TextBlock | ||
Margin="4" | ||
Grid.Row="3" | ||
Grid.Column="1" | ||
TextWrapping="Wrap" | ||
Text="{x:Static app:Labels.PackageSourceEditWindow_PasswordHelpText}" /> | ||
|
||
<StackPanel | ||
Orientation="Horizontal" | ||
HorizontalAlignment="Right" | ||
Margin="0,3,0,0" | ||
Grid.Row="4" | ||
Grid.ColumnSpan="2"> | ||
<Button | ||
x:Name="_acceptButton" | ||
IsEnabled="{Binding HasErrors, Converter={StaticResource IBConverter}}" | ||
Content="{x:Static app:Labels.Button_Save}" | ||
Margin="3" | ||
IsDefault="true" | ||
Click="_acceptButton_Click" /> | ||
<Button | ||
Content="{x:Static app:Labels.Button_Cancel}" | ||
Margin="3" | ||
IsCancel="true" /> | ||
</StackPanel> | ||
</Grid> | ||
</utilities:BaseWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Tql.Abstractions; | ||
|
||
namespace Tql.App.ConfigurationUI; | ||
|
||
internal partial class PackageSourceEditWindow | ||
{ | ||
public PackageSourceEditWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void _acceptButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
DialogResult = true; | ||
} | ||
} |
Oops, something went wrong.