[GME-commit] GMESRC/GME/GMEActiveBrowser ActiveBrowserPropertyPage.cpp,1.59,1.60

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Jan 17 21:29:00 CST 2007


Update of /project/gme-repository/GMESRC/GME/GMEActiveBrowser
In directory escher:/tmp/cvs-serv20091

Modified Files:
	ActiveBrowserPropertyPage.cpp 
Log Message:
Minor changes.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: ActiveBrowserPropertyPage.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** ActiveBrowserPropertyPage.cpp	16 Jan 2007 17:48:06 -0000	1.59
--- ActiveBrowserPropertyPage.cpp	17 Jan 2007 21:28:57 -0000	1.60
***************
*** 1560,1565 ****
  					if( pMgaContext && pMgaContext->m_ccpConstMgr) COMTHROW( pMgaContext->m_ccpConstMgr->Enable( true));
  
  					Utils::put2Console( Utils::get_GME( pMgaContext->m_ccpProject)
! 						, CComBSTR("Library attached. (Note: Constraint Manager was turned off during attach to speed it up.)")
  						, MSG_INFO);
  				}
--- 1560,1567 ----
  					if( pMgaContext && pMgaContext->m_ccpConstMgr) COMTHROW( pMgaContext->m_ccpConstMgr->Enable( true));
  
+ 					CComBSTR msg( L"Library attached: ");
+ 					msg.Append( dlg.m_strConnString); msg.Append( L" (Note: Constraint Manager was turned off during attach to speed it up.)");
  					Utils::put2Console( Utils::get_GME( pMgaContext->m_ccpProject)
! 						, msg
  						, MSG_INFO);
  				}
***************
*** 1636,1639 ****
--- 1638,1694 ----
  }
  
+ void createMsg( CMgaContext* pMgaContext, CString p_msgText, const CString& p_val, CString& p_msg)
+ {
+ 	const CString& val = p_val;
+ 	CString&       msg = p_msg;
+ 
+ 	int i = 0;
+ 	CString lst;
+ 	CString token;
+ 	CString nfnd;
+ 	token = val.Tokenize( "\n", i);
+ 	while( token != "")
+ 	{
+ 		bool error = true;
+ 		try {
+ 			CComPtr<IMgaObject> obj;
+ 			if( SUCCEEDED( pMgaContext->m_ccpProject->GetObjectByID( CComBSTR( token), &obj)))
+ 			{
+ 				CComQIPtr<IMgaFolder> fld( obj);
+ 				long stat;
+ 				COMTHROW( obj->get_Status( &stat));
+ 				if( fld && stat == OBJECT_EXISTS)
+ 				{
+ 					CComBSTR connstr;
+ 					COMTHROW( fld->get_LibraryName( &connstr));
+ 					if( connstr && connstr.Length() > 0) 
+ 					{
+ 						CString cs; 
+ 						CopyTo( connstr, cs);
+ 						lst += cs + " [ " + token + " ]\n";
+ 						error = false;
+ 					}
+ 				}
+ 			}
+ 		} catch( hresult_exception&) {
+ 			ASSERT(0);
+ 		}
+ 
+ 		if( error)
+ 		{
+ 			nfnd += "Not found [ " + token + " ]\n";
+ 		}
+ 
+ 		token = val.Tokenize( "\n", i);
+ 	}
+ 
+ 	msg = p_msgText + (lst.IsEmpty()?"None":lst);
+ 
+ 	if( !nfnd.IsEmpty())
+ 	{
+ 		msg += CString("\nErrors:\n") + nfnd;
+ 	}
+ }
+ 
  void CAggregatePropertyPage::LibraryDependencies()
  {
***************
*** 1661,1771 ****
  			CComBSTR bszLibName;						
  			COMTHROW(ccpFolder->get_LibraryName(&bszLibName));
- 			//pMgaContext->CommitTransaction();
- 			pMgaContext->AbortTransaction();
  		
  			if(!bszLibName)
  			{
- 		
  				AfxMessageBox("Selected node is not a library");
- 				return;
  			}
! 			CString m1, m2;
! 			{
! 			CString val, nfnd; CComBSTR incby_value;
! 			CComBSTR incby_path( L"_includedBy");
! 
! 			pMgaContext->BeginTransaction(FALSE);
! 			ccpFolder->get_RegistryValue( incby_path, &incby_value);
! 
! 			CopyTo( incby_value, val);
! 			int i = 0;
! 			CString lst;
! 			CString token;
! 			token = val.Tokenize( "\n", i);
! 			while( token != "")
  			{
! 				bool error = true;
! 				CComPtr<IMgaObject> obj;
! 				if( SUCCEEDED( pMgaContext->m_ccpProject->GetObjectByID( CComBSTR( token), &obj)))
! 				{
! 					CComQIPtr<IMgaFolder> fld( obj);
! 					long stat;
! 					obj->get_Status( &stat);
! 					if( fld && stat == OBJECT_EXISTS)
! 					{
! 						CComBSTR connstr;
! 						fld->get_LibraryName( &connstr);
! 						if( connstr && connstr.Length() > 0) 
! 						{
! 							CString cs; 
! 							CopyTo( connstr, cs);
! 							lst += cs + " [ " + token + " ]\n";
! 							error = false;
! 						}
! 					}
! 				}
! 
! 				if( error)
! 				{
! 					nfnd += "Not found [ " + token + " ]\n";
! 				}
! 
! 				token = val.Tokenize( "\n", i);
! 			}
  
! 			m1 = CString( "Libraries depending on this:\n") + (lst.IsEmpty()?"None":lst);
  
! 			if( !nfnd.IsEmpty())
! 			{
! 				m1 += CString("\nErrors:\n") + nfnd;
! 			}
! 			}
  
! 			{
! 			CString val; CComBSTR incls_value;
! 			CComBSTR incls_path( L"_includes");
  
! 			ccpFolder->get_RegistryValue( incls_path, &incls_value);
  
! 			CopyTo( incls_value, val);
! 			int i = 0;
! 			CString lst;
! 			CString token;
! 			token = val.Tokenize( "\n", i);
! 			while( token != "")
! 			{
! 				CComPtr<IMgaObject> obj;
! 				if( SUCCEEDED( pMgaContext->m_ccpProject->GetObjectByID( CComBSTR( token), &obj)))
! 				{
! 					CComQIPtr<IMgaFolder> fld( obj);
! 					if( fld)
! 					{
! 						{
! 							CComBSTR connstr;
! 							fld->get_LibraryName( &connstr);
! 							if( connstr && connstr.Length() > 0) 
! 							{
! 								CString cs; 
! 								CopyTo( connstr, cs);
! 								lst += cs + " [ " + token + " ]\n";
! 							}
! 						}
! 						//else
! 						{
! 							// remove from the reg list
! 						}
! 					}
! 				}
! 				token = val.Tokenize( "\n", i);
  			}
  
  			//pMgaContext->CommitTransaction();
  			pMgaContext->AbortTransaction();
- 
- 			m2 = CString( "Libraries included are the following:\n") + (lst.IsEmpty()?"None":lst);
- 
- 			}
- 
- 			AfxMessageBox( m1 + "\n\n" + m2);
  
  		} MSGCATCH("Error while viewing library dependencies",pMgaContext->AbortTransaction();)	
--- 1716,1750 ----
  			CComBSTR bszLibName;						
  			COMTHROW(ccpFolder->get_LibraryName(&bszLibName));
  		
  			if(!bszLibName)
  			{
  				AfxMessageBox("Selected node is not a library");
  			}
! 			else
  			{
! 				CString msg0; CopyTo( bszLibName, msg0);
! 				msg0 = "Library [" + msg0 + "] dependencies";
  
! 				CComBSTR incby_value;
! 				CComBSTR incls_value;
! 				CComBSTR incby_path( L"_includedBy");
! 				CComBSTR incls_path( L"_includes");
  
! 				COMTHROW( ccpFolder->get_RegistryValue( incby_path, &incby_value));
! 				COMTHROW( ccpFolder->get_RegistryValue( incls_path, &incls_value));
  
! 				CString val1, val2;
! 				CopyTo( incby_value, val1);
! 				CopyTo( incls_value, val2);
  
! 				CString msg1, msg2;
! 				createMsg( pMgaContext, "Included virtually in:\n", val1, msg1);
! 				createMsg( pMgaContext, "Virtually includes:\n", val2, msg2);
  
! 				AfxMessageBox( msg0 + "\n\n" + msg1 + "\n\n" + msg2, MB_ICONINFORMATION);
  			}
  
  			//pMgaContext->CommitTransaction();
  			pMgaContext->AbortTransaction();
  
  		} MSGCATCH("Error while viewing library dependencies",pMgaContext->AbortTransaction();)	



More information about the GME-commit mailing list