mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[GUI] Send device to media dump view model instead of device path.
This commit is contained in:
@@ -81,8 +81,8 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
|||||||
string _destination;
|
string _destination;
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
bool _destinationEnabled;
|
bool _destinationEnabled;
|
||||||
Device _dev;
|
readonly Device _dev;
|
||||||
Dump _dumper;
|
Dump _dumper;
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
string _encodingEnabled;
|
string _encodingEnabled;
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
@@ -149,7 +149,7 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
|||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
bool _useSidecar;
|
bool _useSidecar;
|
||||||
|
|
||||||
public MediaDumpViewModel(string devicePath, DeviceInfo deviceInfo, Window view,
|
public MediaDumpViewModel(Device device, string devicePath, DeviceInfo deviceInfo, Window view,
|
||||||
[CanBeNull] ScsiInfo scsiInfo = null)
|
[CanBeNull] ScsiInfo scsiInfo = null)
|
||||||
{
|
{
|
||||||
_view = view;
|
_view = view;
|
||||||
@@ -283,6 +283,7 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
|||||||
_ => false
|
_ => false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_dev = device;
|
||||||
_devicePath = devicePath;
|
_devicePath = devicePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -603,32 +604,6 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
|||||||
|
|
||||||
UpdateStatus(UI.Opening_device);
|
UpdateStatus(UI.Opening_device);
|
||||||
|
|
||||||
_dev = Device.Create(_devicePath, out ErrorNumber devErrno);
|
|
||||||
|
|
||||||
switch(_dev)
|
|
||||||
{
|
|
||||||
case null:
|
|
||||||
StoppingErrorMessage(string.Format(UI.Error_0_opening_device, devErrno));
|
|
||||||
|
|
||||||
return;
|
|
||||||
case Devices.Remote.Device remoteDev:
|
|
||||||
Statistics.AddRemote(remoteDev.RemoteApplication,
|
|
||||||
remoteDev.RemoteVersion,
|
|
||||||
remoteDev.RemoteOperatingSystem,
|
|
||||||
remoteDev.RemoteOperatingSystemVersion,
|
|
||||||
remoteDev.RemoteArchitecture);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_dev.Error)
|
|
||||||
{
|
|
||||||
StoppingErrorMessage(string.Format(UI.Error_0_opening_device, _dev.LastError));
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Statistics.AddDevice(_dev);
|
|
||||||
Statistics.AddCommand("dump-media");
|
Statistics.AddCommand("dump-media");
|
||||||
|
|
||||||
if(SelectedPlugin is null)
|
if(SelectedPlugin is null)
|
||||||
|
|||||||
Reference in New Issue
Block a user