[Scummvm-cvs-logs] SF.net SVN: scummvm: [27403] scummvm/branches/gsoc2007-fsnode/gui/options. cpp

david_corrales at users.sourceforge.net david_corrales at users.sourceforge.net
Thu Jun 14 20:40:28 CEST 2007


Revision: 27403
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27403&view=rev
Author:   david_corrales
Date:     2007-06-14 11:40:27 -0700 (Thu, 14 Jun 2007)

Log Message:
-----------
Fixed a TODO about checking that the savegames path is writable.

Modified Paths:
--------------
    scummvm/branches/gsoc2007-fsnode/gui/options.cpp

Modified: scummvm/branches/gsoc2007-fsnode/gui/options.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/gui/options.cpp	2007-06-14 17:11:09 UTC (rev 27402)
+++ scummvm/branches/gsoc2007-fsnode/gui/options.cpp	2007-06-14 18:40:27 UTC (rev 27403)
@@ -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 @@
 		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;
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list