[Scummvm-cvs-logs] SF.net SVN: scummvm:[44202] scummvm/trunk/backends

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Sun Sep 20 13:47:11 CEST 2009


Revision: 44202
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44202&view=rev
Author:   dhewg
Date:     2009-09-20 11:47:11 +0000 (Sun, 20 Sep 2009)

Log Message:
-----------
Mention mount errors on the status labels.

Modified Paths:
--------------
    scummvm/trunk/backends/fs/wii/wii-fs-factory.cpp
    scummvm/trunk/backends/fs/wii/wii-fs-factory.h
    scummvm/trunk/backends/platform/wii/options.cpp

Modified: scummvm/trunk/backends/fs/wii/wii-fs-factory.cpp
===================================================================
--- scummvm/trunk/backends/fs/wii/wii-fs-factory.cpp	2009-09-20 11:31:11 UTC (rev 44201)
+++ scummvm/trunk/backends/fs/wii/wii-fs-factory.cpp	2009-09-20 11:47:11 UTC (rev 44202)
@@ -40,7 +40,9 @@
 
 WiiFilesystemFactory::WiiFilesystemFactory() :
 	_dvdMounted(false),
-	_smbMounted(false) {
+	_smbMounted(false),
+	_dvdError(false),
+	_smbError(false) {
 }
 
 AbstractFSNode *WiiFilesystemFactory::makeRootFileNode() const {
@@ -104,6 +106,17 @@
 	return false;
 }
 
+bool WiiFilesystemFactory::failedToMount(FileSystemType type) {
+	switch (type) {
+	case kDVD:
+		return _dvdError;
+	case kSMB:
+		return _smbError;
+	}
+
+	return false;
+}
+
 void WiiFilesystemFactory::mount(FileSystemType type) {
 	switch (type) {
 	case kDVD:
@@ -126,9 +139,11 @@
 		printf("mount ISO9660\n");
 		if (ISO9660_Mount()) {
 			_dvdMounted = true;
+			_dvdError = false;
 			printf("ISO9660 mounted\n");
 		} else {
 			DI_StopMotor();
+			_dvdError = true;
 			printf("ISO9660 mount failed\n");
 		}
 #endif
@@ -149,8 +164,10 @@
 		if (smbInit(_smbUsername.c_str(), _smbPassword.c_str(),
 					_smbShare.c_str(), _smbServer.c_str())) {
 			_smbMounted = true;
+			_smbError = false;
 			printf("smb mounted\n");
 		} else {
+			_smbError = true;
 			printf("error mounting smb\n");
 		}
 #endif
@@ -171,6 +188,7 @@
 		DI_StopMotor();
 
 		_dvdMounted = false;
+		_dvdError = false;
 #endif
 		break;
 
@@ -187,6 +205,7 @@
 			printf("error umounting smb\n");
 
 		_smbMounted = false;
+		_smbError = false;
 #endif
 		break;
 	}

Modified: scummvm/trunk/backends/fs/wii/wii-fs-factory.h
===================================================================
--- scummvm/trunk/backends/fs/wii/wii-fs-factory.h	2009-09-20 11:31:11 UTC (rev 44201)
+++ scummvm/trunk/backends/fs/wii/wii-fs-factory.h	2009-09-20 11:47:11 UTC (rev 44202)
@@ -57,6 +57,7 @@
 #endif
 
 	bool isMounted(FileSystemType type);
+	bool failedToMount(FileSystemType type);
 
 	void mount(FileSystemType type);
 	void umount(FileSystemType type);
@@ -72,6 +73,8 @@
 
 	bool _dvdMounted;
 	bool _smbMounted;
+	bool _dvdError;
+	bool _smbError;
 
 #ifdef USE_WII_SMB
 	String _smbServer;

Modified: scummvm/trunk/backends/platform/wii/options.cpp
===================================================================
--- scummvm/trunk/backends/platform/wii/options.cpp	2009-09-20 11:31:11 UTC (rev 44201)
+++ scummvm/trunk/backends/platform/wii/options.cpp	2009-09-20 11:47:11 UTC (rev 44202)
@@ -72,7 +72,7 @@
 
 	new StaticTextWidget(_tab, 16, 16, 64, 16,
 							"Status:", Graphics::kTextAlignRight);
-	_textDVDStatus = new StaticTextWidget(_tab, 96, 16, 192, 16, "Unknown",
+	_textDVDStatus = new StaticTextWidget(_tab, 96, 16, 272, 16, "Unknown",
 											Graphics::kTextAlignLeft);
 
 	new ButtonWidget(_tab, 16, 48, 108, 24, "Mount DVD", 'mdvd');
@@ -84,7 +84,7 @@
 
 	new StaticTextWidget(_tab, 16, 16, 64, 16,
 							"Status:", Graphics::kTextAlignRight);
-	_textSMBStatus = new StaticTextWidget(_tab, 96, 16, 192, 16, "Unknown",
+	_textSMBStatus = new StaticTextWidget(_tab, 96, 16, 272, 16, "Unknown",
 											Graphics::kTextAlignLeft);
 
 	new StaticTextWidget(_tab, 16, 52, 64, 16,
@@ -124,10 +124,14 @@
 
 #ifdef USE_WII_DI
 	if (tab == _tabDVD) {
-		if (fsf.isMounted(WiiFilesystemFactory::kDVD))
-			_textDVDStatus->setLabel("Mounted");
-		else
-			_textDVDStatus->setLabel("Not mounted");
+		if (fsf.isMounted(WiiFilesystemFactory::kDVD)) {
+			_textDVDStatus->setLabel("DVD Mounted successfully");
+		} else {
+			if (fsf.failedToMount(kDVD))
+				_textDVDStatus->setLabel("Error while mounting the DVD");
+			else
+				_textDVDStatus->setLabel("DVD not mounted");
+		}
 	}
 #endif
 
@@ -138,11 +142,17 @@
 
 		switch (status) {
 		case 0:
-			if (fsf.isMounted(WiiFilesystemFactory::kSMB))
+			if (fsf.isMounted(WiiFilesystemFactory::kSMB)) {
 				label = "Network up, share mounted";
-			else
-				label = "Network up, share not mounted";
+			} else {
+				label = "Network up";
 
+				if (fsf.failedToMount(WiiFilesystemFactory::kSMB))
+					label += ", error while mounting the share";
+				else
+					label += ", share not mounted";
+			}
+
 			break;
 
 		case -ENETDOWN:


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