[GME-commit] GMESRC/GME/Gme GMEApp.cpp, 1.143, 1.144 GMEApp.h, 1.37, 1.38 NewXmlbackendProjDlg.cpp, 1.1, 1.2

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Sat Jun 2 10:30:56 CDT 2007


Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv5597

Modified Files:
	GMEApp.cpp GMEApp.h NewXmlbackendProjDlg.cpp 
Log Message:
Fixing bug# GME-148 regarding VSS-based multiuser projects.
(http://escher.isis.vanderbilt.edu/JIRA/browse/GME-148)

Attempt for better error handling in case of OpenProject failure (multiuser case).


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: NewXmlbackendProjDlg.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/NewXmlbackendProjDlg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NewXmlbackendProjDlg.cpp	14 Sep 2004 14:12:52 -0000	1.1
--- NewXmlbackendProjDlg.cpp	2 Jun 2007 15:30:54 -0000	1.2
***************
*** 122,126 ****
      m_connectionString = "MGX=\"";
      m_connectionString += m_location;
!     m_connectionString += "\\";
      m_connectionString += m_projectName;
      m_connectionString += "\"";
--- 122,129 ----
      m_connectionString = "MGX=\"";
      m_connectionString += m_location;
!     // http://escher.isis.vanderbilt.edu/JIRA/browse/GME-148 : JIRA entry created
!     // if m_location contains a tailing '\' then no need for this
!     if( m_location.TrimRight().Right(1) != '\\')
!         m_connectionString += "\\";
      m_connectionString += m_projectName;
      m_connectionString += "\"";

Index: GMEApp.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEApp.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** GMEApp.h	7 Mar 2007 23:31:24 -0000	1.37
--- GMEApp.h	2 Jun 2007 15:30:54 -0000	1.38
***************
*** 141,144 ****
--- 141,145 ----
  	void RunComponent(const CString &progid);
  	void exit() { OnAppExit(); }
+ 	void consoleMessage( const CString& p_msg, short type);
  
  	void Autosave();

Index: GMEApp.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GMEApp.cpp,v
retrieving revision 1.143
retrieving revision 1.144
diff -C2 -d -r1.143 -r1.144
*** GMEApp.cpp	7 Mar 2007 23:31:24 -0000	1.143
--- GMEApp.cpp	2 Jun 2007 15:30:54 -0000	1.144
***************
*** 1035,1038 ****
--- 1035,1059 ----
  			CComVariant parg;
  			VARIANT_BOOL ro_mode;
+ 			if( E_FILEOPEN == hr && conn.Left(5) == "MGX=\"") // multi user project could not be open
+ 			{
+ 				// MGX="f:\temp\myproj" [VssDatabase = "..."] [VssPath = "..."] connection string implies that
+ 				// there must be a file named myproj.mgx in that directory
+ 				int pos = conn.Find( '"', 5);
+ 				if( pos != -1)
+ 				{
+ 					CString dname;
+ 					CString path = conn.Mid( 5, pos - 5);
+ 					pos = path.ReverseFind( '\\'); // the last dir name: 'myproj'
+ 					if( pos != -1)
+ 						dname = path.Mid( pos + 1) + ".mgx";
+ 	
+ 					CString msg;
+ 					msg.Format( "Could not open %s\\%s file!", path, dname );
+ 					consoleMessage( msg, MSG_ERROR);
+ 				}
+ 				
+ 				CString inf( "Please check if the .mgx file sits in a directory with the same name! (e.g. Helloworld.mgx has to be checked out into a directory called 'Helloworld') ");
+ 				consoleMessage( inf, MSG_INFO);
+ 			}
  			if(S_OK != mgaProject->QueryProjectInfo(PutInBstr(conn), &version, &parn, &parv, &parg, &ro_mode)) {
  				AfxMessageBox("Cannot query project information. Possible cause: missing/corrupt project file or database");
***************
*** 2767,2769 ****
--- 2788,2798 ----
  	HWND hwnd = CGMEObjectInspector::theInstance->GetSafeHwnd();
  	if( hwnd) ::SetFocus( hwnd);
+ }
+ 
+ void CGMEApp::consoleMessage( const CString& p_msg, short p_type)
+ {
+ 	if( CMainFrame::theInstance) // 99.99% of cases
+ 		CMainFrame::theInstance->m_console.Message( p_msg, p_type);
+ 	else
+ 		AfxMessageBox( p_msg);
  }



More information about the GME-commit mailing list