mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-04-05 21:44:17 +00:00
[GUI] Add specific error message for insufficient permissions on device opening in Windows.
This commit is contained in:
@@ -362,19 +362,38 @@ public partial class DeviceViewModel : ViewModelBase
|
|||||||
switch(dev)
|
switch(dev)
|
||||||
{
|
{
|
||||||
case null:
|
case null:
|
||||||
AaruLogging.Error(string.Format(UI.Could_not_open_device_error_0, devErrno));
|
if(OperatingSystem.IsWindows() && (int)devErrno == 5)
|
||||||
|
|
||||||
Dispatcher.UIThread.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
IMsBox<ButtonResult> msbox = MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
AaruLogging.Error(UI.Insufficient_permissions_trying_to_open_device);
|
||||||
string.Format(UI.Could_not_open_device_error_0, devErrno),
|
|
||||||
ButtonEnum.Ok,
|
|
||||||
Icon.Error);
|
|
||||||
|
|
||||||
_ = msbox.ShowAsync();
|
Dispatcher.UIThread.Invoke(() =>
|
||||||
|
{
|
||||||
|
IMsBox<ButtonResult> msbox = MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||||
|
UI.You_do_not_have_enough_privileges_to_access_the_device,
|
||||||
|
ButtonEnum.Ok,
|
||||||
|
Icon.Error);
|
||||||
|
|
||||||
_window.Close();
|
_ = msbox.ShowAsync();
|
||||||
});
|
|
||||||
|
_window.Close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AaruLogging.Error(string.Format(UI.Could_not_open_device_error_0, devErrno));
|
||||||
|
|
||||||
|
Dispatcher.UIThread.Invoke(() =>
|
||||||
|
{
|
||||||
|
IMsBox<ButtonResult> msbox = MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||||
|
string.Format(UI.Could_not_open_device_error_0, devErrno),
|
||||||
|
ButtonEnum.Ok,
|
||||||
|
Icon.Error);
|
||||||
|
|
||||||
|
_ = msbox.ShowAsync();
|
||||||
|
|
||||||
|
_window.Close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
case Devices.Remote.Device remoteDev:
|
case Devices.Remote.Device remoteDev:
|
||||||
|
|||||||
26737
Aaru.Localization/UI.Designer.cs
generated
26737
Aaru.Localization/UI.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -5554,4 +5554,10 @@ Probadores:
|
|||||||
<data name="Image_Write_Metadata_Command_Description" xml:space="preserve">
|
<data name="Image_Write_Metadata_Command_Description" xml:space="preserve">
|
||||||
<value>Escribe los metadatados a una imagen AaruFormat.</value>
|
<value>Escribe los metadatados a una imagen AaruFormat.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Insufficient_permissions_trying_to_open_device" xml:space="preserve">
|
||||||
|
<value>Permisos insuficientes al intentar abrir el dispositivo.</value>
|
||||||
|
</data>
|
||||||
|
<data name="You_do_not_have_enough_privileges_to_access_the_device" xml:space="preserve">
|
||||||
|
<value>No tiene los privilegios suficientes para acceder al dispositivo.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -5638,4 +5638,10 @@ Do you want to continue?</value>
|
|||||||
<data name="Image_Write_Metadata_Command_Description" xml:space="preserve">
|
<data name="Image_Write_Metadata_Command_Description" xml:space="preserve">
|
||||||
<value>Writes metadata to an AaruFormat image.</value>
|
<value>Writes metadata to an AaruFormat image.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Insufficient_permissions_trying_to_open_device" xml:space="preserve">
|
||||||
|
<value>Insufficient permissions trying to open device.</value>
|
||||||
|
</data>
|
||||||
|
<data name="You_do_not_have_enough_privileges_to_access_the_device" xml:space="preserve">
|
||||||
|
<value>You do not have enough privileges to access the device.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Reference in New Issue
Block a user