[commit] r1468 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Fri Aug 5 15:34:23 CDT 2011


Author: ksmyth
Date: Fri Aug  5 15:34:23 2011
New Revision: 1468

Log:
Dont Synchronize Aspects for an instance model. Synchronize aspects from the current aspect to other aspects. OnExecutePendingRequests gets called from pumping messages; if an interpreter has a transaction open and pumps messages, dont trash the transaction

Modified:
   trunk/GME/Gme/GMEView.cpp

Modified: trunk/GME/Gme/GMEView.cpp
==============================================================================
--- trunk/GME/Gme/GMEView.cpp	Thu Aug  4 16:24:05 2011	(r1467)
+++ trunk/GME/Gme/GMEView.cpp	Fri Aug  5 15:34:23 2011	(r1468)
@@ -118,7 +118,7 @@
 		}
 		viewsToKill.RemoveAll();
 		if(view->alive && view->needsReset) {
-			view->Reset(true);
+			view->Reset(true); // FIXME KMS: maybe post a message instead?
 			view->needsReset = false;
 		}
 		if(attrNeedsRefresh) {
@@ -8567,9 +8567,17 @@
 {
 	CGMEEventLogger::LogGMEEvent(_T("CGMEView::OnEditSync in ")+path+name+_T("\r\n"));
 	CAspectSyncDlg dlg;
-
+	VARIANT_BOOL isInstance = VARIANT_TRUE;
+	BeginTransaction();
+	HRESULT hr = currentModel->get_IsInstance(&isInstance);
+	AbortTransaction(E_FAIL);
+	ASSERT(SUCCEEDED(hr));
+	if (isInstance != VARIANT_FALSE) {
+		AfxMessageBox(L"Cannot synchronize aspects for instances", MB_ICONEXCLAMATION);
+		return;
+	}
+	dlg.m_srcAspect = currentAspect;
 	POSITION apos = guiMeta->aspects.GetHeadPosition();
-	dlg.m_srcAspect = (apos ? guiMeta->aspects.GetAt(apos) : NULL);
 	while (apos) {
 		CGuiMetaAspect *metaAspect = guiMeta->aspects.GetNext(apos);
 		dlg.m_allAspects.AddTail(metaAspect);
@@ -9777,9 +9785,13 @@
 	
 	executingPendingRequests = true;
 	try {
-		BeginTransaction();
+		CComPtr<IMgaTerritory> terr;
+		COMTHROW(theApp.mgaProject->get_ActiveTerritory(&terr));
+		if (!terr)
+			BeginTransaction();
 		TryToExecutePendingRequests();
-		CommitTransaction();
+		if (!terr)
+			CommitTransaction();
 	}
 	catch(hresult_exception &e) {
 		// silent failure (not critical)


More information about the gme-commit mailing list