From 69dd2b81de3bcbb955669f7937f3844b86467849 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 28 Nov 2025 21:36:41 +0100 Subject: Port process spawning to g_spawn_*() --- UCore.pas | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'UCore.pas') diff --git a/UCore.pas b/UCore.pas index a41a7fd..b314eb4 100644 --- a/UCore.pas +++ b/UCore.pas @@ -1044,6 +1044,7 @@ end; function TMounterItem.Mount: boolean; var s: string; + Error: string; begin if Length(MountCommand) = 0 then begin if IsInFSTab then s := Format('mount "%s"', [MountPath]) @@ -1052,11 +1053,14 @@ begin s := ReplaceStr(MountCommand, '%dev', Device); s := ReplaceStr(s, '%dir', MountPath); end; - Result := HandleSystemCommand(s, Format(LANGErrorMount, [StrToUTF8(MountPath)])); + Result := HandleSystemCommand(s, Error); + if not Result then + Application.MessageBox(Format('%s%s', [Format(LANGErrorMount, [StrToUTF8(MountPath)]), StrToUTF8(Error)]), [mbOK], mbError, mbOK, mbOK); end; function TMounterItem.Umount: boolean; var s: string; + Error: string; begin if Length(UmountCommand) = 0 then begin if IsInFSTab then s := Format('umount "%s"', [MountPath]) @@ -1065,11 +1069,14 @@ begin s := ReplaceStr(UmountCommand, '%dev', Device); s := ReplaceStr(s, '%dir', MountPath); end; - Result := HandleSystemCommand(s, Format(LANGErrorUmount, [StrToUTF8(MountPath)])); + Result := HandleSystemCommand(s, Error); + if not Result then + Application.MessageBox(Format('%s%s', [Format(LANGErrorUmount, [StrToUTF8(MountPath)]), StrToUTF8(Error)]), [mbOK], mbError, mbOK, mbOK); end; function TMounterItem.Eject: boolean; var s: string; + Error: string; begin if Length(UmountCommand) = 0 then begin if IsInFSTab then s := Format('eject "%s"', [MountPath]) @@ -1078,7 +1085,9 @@ begin s := ReplaceStr(UmountCommand, '%dev', Device); s := ReplaceStr(s, '%dir', MountPath); end; - Result := HandleSystemCommand(s, Format(LANGErrorEject, [StrToUTF8(MountPath)])); + Result := HandleSystemCommand(s, Error); + if not Result then + Application.MessageBox(Format('%s%s', [Format(LANGErrorEject, [StrToUTF8(MountPath)]), StrToUTF8(Error)]), [mbOK], mbError, mbOK, mbOK); end; -- cgit v1.2.3