浏览代码

Be more precise about which changes to a model mark it as unsaved.

SYSOUT messages which are used to print to the console were
marking the model as unsaved. This is used, for example,
for status messages from the transformation server.

Now, the list of changes which mark the model as unsaved is
explicitly recorded.

Note: The backdoor API is operated as a SYSOUT change, so this
is specially handled.
bentleyjoakes 4 年之前
父节点
当前提交
4f27073f16
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      client/query_response.js

+ 11 - 1
client/query_response.js

@@ -75,7 +75,6 @@ function __handleChangelog(changelog,seqNum,hitchhiker)
 		return;
 	}
 
-	WindowManagement.setWindowTitle(true);
 	changelog.forEach(
 		function(step)
 		{
@@ -90,6 +89,16 @@ function __handleChangelog(changelog,seqNum,hitchhiker)
 					' what has changed, click CANCEL');
 				__changed(step['id'],true);
 			}
+
+			// record the changes that mark the model as unsaved
+			// (as well, note that SYSOUT can change the model through
+			// the back-door API 'CLIENT_BDAPI')
+			let dirty_ops = ['MKEDGE', 'RMEDGE',
+				'MKNODE', 'RMNODE', 'CHATTR',
+				'LOADMM', 'LOADASMM', 'DUMPMM'];
+			if (dirty_ops.includes(step['op'])){
+				WindowManagement.setWindowTitle(true);
+			}
 				
 			if( step['op'] == 'MKEDGE' )
 				;
@@ -392,6 +401,7 @@ function __handleChangelog(changelog,seqNum,hitchhiker)
 				{
 					var op = utils.jsonp(step['text'].match(/^CLIENT_BDAPI :: (.*)/)[1]);
 					this[op['func']](op['args']);
+					WindowManagement.setWindowTitle(true);
 				}
 				else
 					console.log('MESSAGE :: '+step['text']);