diff options
| author | Tomas Bzatek <tbzatek@redhat.com> | 2025-11-28 21:36:41 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@redhat.com> | 2025-11-28 21:36:41 +0100 |
| commit | 69dd2b81de3bcbb955669f7937f3844b86467849 (patch) | |
| tree | 1fdca6cce755961766f7436e2c83041710dca2b4 /UCore.pas | |
| parent | 0ea64a41e1499d25296bdcc69fe207e20e545efd (diff) | |
| download | tuxcmd-69dd2b81de3bcbb955669f7937f3844b86467849.tar.xz | |
Port process spawning to g_spawn_*()
Diffstat (limited to 'UCore.pas')
| -rw-r--r-- | UCore.pas | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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; |
