summaryrefslogtreecommitdiff
path: root/UCore.pas
diff options
context:
space:
mode:
Diffstat (limited to 'UCore.pas')
-rw-r--r--UCore.pas15
1 files changed, 12 insertions, 3 deletions
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;