From e7aa6b996b54cec0a3dc2cb91feb4f1529cc27e5 Mon Sep 17 00:00:00 2001 From: David Corrales Date: Thu, 14 Jun 2007 18:40:27 +0000 Subject: Fixed a TODO about checking that the savegames path is writable. svn-id: r27403 --- gui/options.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index 4d6cadfdef..76bec036ad 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -27,6 +27,7 @@ #include "gui/themebrowser.h" #include "gui/chooser.h" #include "gui/eval.h" +#include "gui/message.h" #include "gui/newgui.h" #include "gui/options.h" #include "gui/PopUpWidget.h" @@ -821,9 +822,15 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 if (browser.runModal() > 0) { // User made his choice... FilesystemNode dir(browser.getResult()); - _savePath->setLabel(dir.getPath()); + if(dir.isWritable()) + { + _savePath->setLabel(dir.getPath()); + } else { + MessageDialog error("The chosen directory cannot be written to. Please select another one."); + error.runModal(); + return; + } draw(); - // TODO - we should check if the directory is writeable before accepting it } break; } -- cgit v1.2.3