Skip to content

Commit

Permalink
Added Save New button for Notes Counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Niccori250k committed Aug 1, 2020
1 parent ce8ee5b commit 5c65ad6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Black-Midi-Render/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Zenith_MIDI
class Settings
{
public string PreviousVersion = "";
public string VersionName = "2.1.4";
public string VersionName = "2.1.5";
public string LanguagesVersion = "";
public bool AutoUpdate = false;
public bool Installed = false;
Expand Down
1 change: 1 addition & 0 deletions NoteCountRender/Languages/en/notecounter.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

<system:String x:Key="reload">Reload</system:String>
<system:String x:Key="openFolder">Open Folder</system:String>
<system:String x:Key="saveNew">Save New</system:String>

<system:String x:Key="thousandsSeparator">Thousands separator</system:String>
<system:String x:Key="commas">Commas</system:String>
Expand Down
5 changes: 4 additions & 1 deletion NoteCountRender/SettingsCtrl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<TabItem Header="{DynamicResource Render}">
<DockPanel Margin="10">
<DockPanel DockPanel.Dock="Top">
<StackPanel>
<StackPanel Width="530">
<DockPanel HorizontalAlignment="Left" LastChildFill="False" Margin="0,0,0,0" VerticalAlignment="Top">
<Label DockPanel.Dock="Left" Content="{DynamicResource fontSize}" VerticalAlignment="Top"/>
<ui:NumberSelect x:Name="fontSize" Value="1" Maximum="15360" Minimum="1" HorizontalAlignment="Left" Width="99" IsEnabled="{Binding IsEnabled, ElementName=notPreviewingOrRendering}" DockPanel.Dock="Left" Margin="5,0,0,0" ValueChanged="FontSize_ValueChanged" />
Expand All @@ -50,6 +50,9 @@
<ComboBox x:Name="templates" DockPanel.Dock="Left" Width="120" SelectionChanged="Templates_SelectionChanged"/>
<Button x:Name="reload" Content="{DynamicResource reload}" HorizontalAlignment="Left" Padding="10,0,10,0" DockPanel.Dock="Left" Margin="5,0,0,0" Click="Reload_Click"/>
<Button x:Name="openFolder" Content="{DynamicResource openFolder}" HorizontalAlignment="Left" Padding="10,0,10,0" DockPanel.Dock="Left" Margin="5,0,0,0" Click="openFolder_Click"/>
<Button x:Name="newProfile" Content="{DynamicResource saveNew}" HorizontalAlignment="Left" Margin="15,0,0,0" Padding="10,0,10,0" Click="NewProfile_Click" DockPanel.Dock="Left"/>
<TextBox DockPanel.Dock="Left" x:Name="profileName" HorizontalAlignment="Left" Margin="5,0,0,0" TextWrapping="Wrap" Text="" Width="110"/>
<Label DockPanel.Dock="Right" HorizontalAlignment="Right" Content=".txt" />
</DockPanel>
</StackPanel>
<StackPanel Margin="30,0,0,0">
Expand Down
31 changes: 31 additions & 0 deletions NoteCountRender/SettingsCtrl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,5 +282,36 @@ private void SetDefault_Click(object sender, RoutedEventArgs e)
settings.BarCountPad = 3;
settings.FrCountPad = 5;
}

private void NewProfile_Click(object sender, RoutedEventArgs e)
{
if (profileName.Text == "")
{
MessageBox.Show("Please write a name for the profile");
return;
}
profileName.Text = profileName.Text.Replace(".txt", "");
if (String.Compare(profileName.Text, "default", true) == 0 ||
String.Compare(profileName.Text, "full", true) == 0 ||
String.Compare(profileName.Text, "miditrail", true) == 0)
{
MessageBox.Show("You can't override default profiles.");
return;
}
if (File.Exists(templateFolder + "\\" + profileName.Text + ".txt"))
{
if (MessageBox.Show("Are you sure you want to override the profile \"" + profileName.Text + "\"?", "Override Profile", MessageBoxButton.YesNo) == MessageBoxResult.No)
{
return;
}
}
try
{
File.WriteAllText(Path.Combine(templateFolder, profileName.Text + ".txt"), textTemplate.Text);
}
catch { }
Reloading = true;
Reload();
}
}
}

1 comment on commit 5c65ad6

@MatthewToaster64
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add pre-render on zenith

Please sign in to comment.