[commit] r1095 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Nov 24 11:49:47 CST 2010


Author: ksmyth
Date: Wed Nov 24 11:49:47 2010
New Revision: 1095

Log:
Fix GME-316: autofill current filename in File>SaveAs

Modified:
   trunk/GME/Gme/MgaOpenDlg.cpp

Modified: trunk/GME/Gme/MgaOpenDlg.cpp
==============================================================================
--- trunk/GME/Gme/MgaOpenDlg.cpp	Mon Nov 22 17:26:42 2010	(r1094)
+++ trunk/GME/Gme/MgaOpenDlg.cpp	Wed Nov 24 11:49:47 2010	(r1095)
@@ -112,8 +112,21 @@
 		filters.Insert( 0, spec_filter);
 	}
 
+	const char* initialFile = NULL; // NULL or points into currentMgaPath
+	char currentMgaPath[MAX_PATH];
+	if (theApp.isMgaProj()) {
+		CString conn = theApp.connString();
+		const char* zsConn = conn;
+		zsConn += 4; // skip MGA=
+		char* filename;
+		if (!GetFullPathName(zsConn, MAX_PATH, currentMgaPath, &filename) || filename == 0) {
+		} else {
+			initialFile = filename;
+		}
+	}
+
 	CString conn;
-	CFileDialog dlg(flag_isopen ? TRUE : FALSE, NULL, NULL, 
+	CFileDialog dlg(flag_isopen ? TRUE : FALSE, NULL, initialFile, 
 			OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | 
 			0, filters);
 


More information about the gme-commit mailing list