Skip to content

Commit

Permalink
ADD: error if commands.txt file is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
filip2cz committed Jan 28, 2024
1 parent 436c4d0 commit 275c8cf
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions ssh-buttons_desktop/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public MainWindow()

commands = configLoader.LoadCommands();

bool commandsLoaded = true;
if (commands[1] == "error")
{
commandsLoaded = false;
}

Debug.WriteLine("Loaded commands:");

Debug.WriteLine("Loaded config:");
Expand All @@ -70,13 +76,20 @@ public MainWindow()
Debug.WriteLine(thing);
}

Button1.Content = commands[0];
Button2.Content = commands[2];
Button3.Content = commands[4];
Button4.Content = commands[6];
Button5.Content = commands[8];
Button6.Content = commands[10];
Button7.Content = commands[12];
if (commandsLoaded == true)
{
Button1.Content = commands[0];
Button2.Content = commands[2];
Button3.Content = commands[4];
Button4.Content = commands[6];
Button5.Content = commands[8];
Button6.Content = commands[10];
Button7.Content = commands[12];
}
else
{
output.Text = $"{commands[0]}\r\n{commands[2]}";
}
}
public void Button_Click1(object sender, RoutedEventArgs e)
{
Expand Down

0 comments on commit 275c8cf

Please sign in to comment.