Browse Source

fix package manager page

pull/55/head
JT 1 year ago
parent
commit
bfa969eb95
  1. 6
      StabilityMatrix.Avalonia/ViewModels/LaunchPageViewModel.cs
  2. 5
      StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs
  3. 6
      StabilityMatrix.Avalonia/Views/MainWindow.axaml
  4. 4
      StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml

6
StabilityMatrix.Avalonia/ViewModels/LaunchPageViewModel.cs

@ -46,8 +46,8 @@ public partial class LaunchPageViewModel : PageViewModelBase
{
var info = new ProcessStartInfo
{
FileName = "py",
WorkingDirectory = "py",
FileName = "python",
//WorkingDirectory = "py",
Arguments = "-uc \"import tqdm, time; print('start'); [time.sleep(0.1) for _ in tqdm.tqdm(range(25))]; print('end')\""
};
@ -61,7 +61,7 @@ public partial class LaunchPageViewModel : PageViewModelBase
private void OnProcessOutputReceived(ProcessOutput output)
{
var raw = output.RawText;
// Replace /n and /r with literals
// Replace \n and \r with literals
raw = raw.Replace("\n", "\\n").Replace("\r", "\\r");
Debug.WriteLine($"output raw: '{raw}', output: '{output.Text}', clear lines: {output.ClearLines}");
Debug.Flush();

5
StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs

@ -33,6 +33,11 @@ public partial class PackageManagerViewModel : PageViewModelBase
Packages = new ObservableCollection<InstalledPackage>(settingsManager.Settings.InstalledPackages);
}
public PackageManagerViewModel() : this(new SettingsManager(), null!)
{
}
[NotifyPropertyChangedFor(nameof(ProgressBarVisibility))]
[ObservableProperty]
private int progressValue;

6
StabilityMatrix.Avalonia/Views/MainWindow.axaml

@ -11,7 +11,9 @@
x:Class="StabilityMatrix.Avalonia.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
Icon="/Assets/Icon.ico"
Title="StabilityMatrix.Avalonia">
Width="900"
Height="650"
Title="Stability Matrix Avalonia">
<Design.DataContext>
<vm:MainWindowViewModel />
@ -56,6 +58,8 @@
Grid.RowSpan="2"
AlwaysShowHeader="False"
PaneDisplayMode="Left"
IsPaneOpen="False"
OpenPaneLength="200"
Content="{Binding CurrentPage}"
MenuItemsSource="{Binding Pages, Mode=OneWay}"
SelectedItem="{Binding SelectedCategory}"

4
StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml

@ -45,7 +45,6 @@
Command="{Binding ShowInstallWindowCommand}"
Height="40"
HorizontalAlignment="Stretch"
IsEnabled="{Binding InstallButtonEnabled, FallbackValue=True}"
Margin="0,0,0,16"
VerticalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
@ -59,8 +58,7 @@
<ListBox
ItemsSource="{Binding Packages}"
SelectedItem="{Binding SelectedPackage, Mode=TwoWay}"
IsVisible="{Binding InstallButtonVisibility, FallbackValue=True}">
SelectedItem="{Binding SelectedPackage, Mode=TwoWay}">
<ListBox.Template>
<ControlTemplate>

Loading…
Cancel
Save