From 58bda9983cfc6cdced6bd56c04da11626d29084a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 14 Feb 2009 00:58:01 +0000 Subject: [PATCH] * alert when the destination volume is read only. Fixes bug #3422. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29195 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/expander/ExpanderWindow.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/apps/expander/ExpanderWindow.cpp b/src/apps/expander/ExpanderWindow.cpp index 674dcf0bb9..0f8f55ceb9 100644 --- a/src/apps/expander/ExpanderWindow.cpp +++ b/src/apps/expander/ExpanderWindow.cpp @@ -183,6 +183,7 @@ bool ExpanderWindow::ValidateDest() { BEntry entry(fDestText->Text(), true); + BVolume volume; if (!entry.Exists()) { BAlert *alert = new BAlert("destAlert", "The destination" " directory does not exist.", "Cancel", NULL, NULL, @@ -190,10 +191,14 @@ ExpanderWindow::ValidateDest() alert->Go(); return false; } else if (!entry.IsDirectory()) { - BAlert *alert = new BAlert("destAlert", "The destination" + (new BAlert("destAlert", "The destination" " is not a directory.", "Cancel", NULL, NULL, - B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); - alert->Go(); + B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT))->Go(); + return false; + } else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) { + (new BAlert("destAlert", "The destination is read only.", + "Cancel", NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, + B_WARNING_ALERT))->Go(); return false; } else { entry.GetRef(&fDestRef);