[commit] r1681 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Fri Nov 11 16:29:04 CST 2011


Author: ksmyth
Date: Fri Nov 11 16:29:04 2011
New Revision: 1681

Log:
Fix AskConnectionString: sometimes it should be a Save As dialog instead of an Open dialog

Modified:
   trunk/GME/Gme/GMEApp.cpp
   trunk/GME/Gme/MgaOpenDlg.cpp
   trunk/GME/Gme/MgaOpenDlg.h

Modified: trunk/GME/Gme/GMEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEApp.cpp	Fri Nov 11 16:28:52 2011	(r1680)
+++ trunk/GME/Gme/GMEApp.cpp	Fri Nov 11 16:29:04 2011	(r1681)
@@ -1720,7 +1720,7 @@
 void CGMEApp::OnFileOpen() 
 {
 	CMgaOpenDlg dlg(CMgaOpenDlg::OpenDialog);
-	CString conn = dlg.AskConnectionString(true);
+	CString conn = dlg.AskConnectionString(true, true);
 
 	CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileOpen ")+conn+_T("\r\n"));
 
@@ -1819,7 +1819,7 @@
 		metaname.Empty();
 		COMTHROW( launcher->get_ParadigmName(PutOut(metaname)) );
 
-		dataconn = dlg.AskConnectionString(false);
+		dataconn = dlg.AskConnectionString(false, false);
 
 		if( dlg.pressed_back )
 			goto meta_label;
@@ -2037,7 +2037,7 @@
 				else
 					opdlg.SetFileNameHint(ftitle);
 				opdlg.SetFolderPathHint(folderPath);
-				dataconn = opdlg.AskConnectionString(false);
+				dataconn = opdlg.AskConnectionString(false, false);
 				if (dataconn.IsEmpty()) {
 				   CGMEEventLogger::LogGMEEvent(_T("CGMEApp::OnFileImportxml exited because empty connection string has been given"));
 				   return;
@@ -2345,7 +2345,7 @@
 	MSGTRY
 	{
 		CMgaOpenDlg dlg(CMgaOpenDlg::ClearLocksDialog);
-		CString conn = dlg.AskConnectionString(false);
+		CString conn = dlg.AskConnectionString(false, true);
 
 		if( conn.IsEmpty() )
 			return;
@@ -2747,7 +2747,7 @@
 				else
 					opdlg.SetFileNameHint(ftitle);
 				opdlg.SetFolderPathHint(fpath);
-				dataconn = opdlg.AskConnectionString(false);
+				dataconn = opdlg.AskConnectionString(false, false);
 				if (dataconn.IsEmpty()) {
 				   return;
 				}

Modified: trunk/GME/Gme/MgaOpenDlg.cpp
==============================================================================
--- trunk/GME/Gme/MgaOpenDlg.cpp	Fri Nov 11 16:28:52 2011	(r1680)
+++ trunk/GME/Gme/MgaOpenDlg.cpp	Fri Nov 11 16:29:04 2011	(r1681)
@@ -120,7 +120,7 @@
 	return conn;
 }
 
-CString CMgaOpenDlg::AskConnectionString(bool allowXme)
+CString CMgaOpenDlg::AskConnectionString(bool allowXme, bool openFileDialog)
 {
 	CString conn;
 
@@ -130,7 +130,7 @@
 		{
 			if( m_radio == 0 )
 			{
-				CFileDialog dlg(true, NULL, fileNameHint.IsEmpty() ? NULL : (LPCTSTR)fileNameHint,
+				CFileDialog dlg(openFileDialog, NULL, fileNameHint.IsEmpty() ? NULL : (LPCTSTR)fileNameHint,
 					OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |
 					(flag_create ? 0 : OFN_FILEMUSTEXIST), allowXme ? xmemgafilter : mgafilter);
 				if (!folderPathHint.IsEmpty())

Modified: trunk/GME/Gme/MgaOpenDlg.h
==============================================================================
--- trunk/GME/Gme/MgaOpenDlg.h	Fri Nov 11 16:28:52 2011	(r1680)
+++ trunk/GME/Gme/MgaOpenDlg.h	Fri Nov 11 16:29:04 2011	(r1681)
@@ -31,7 +31,7 @@
 
 	bool pressed_back;
 
-	CString AskConnectionString(bool allowXme);
+	CString AskConnectionString(bool allowXme, bool openFileDialog);
 	CString AskMGAConnectionString();
 private:
 	CString PruneConnectionString(const CString& conn);


More information about the gme-commit mailing list