Browse Source

Add lock and interrupt attributes to STARTUP tag

git-svn-id: https://klish.googlecode.com/svn/trunk@549 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 years ago
parent
commit
1d233ef351
2 changed files with 16 additions and 0 deletions
  1. 2 0
      clish.xsd
  2. 14 0
      clish/shell/shell_tinyxml.cpp

+ 2 - 0
clish.xsd

@@ -187,6 +187,8 @@
         <xs:attribute name="viewid" type="xs:string" use="optional"/>
         <xs:attribute name="default_shebang" type="xs:string" use="optional"/>
         <xs:attribute name="timeout" type="xs:string" use="optional"/>
+        <xs:attribute name="lock" type="bool_t" use="optional" default="true"/>
+        <xs:attribute name="interrupt" type="bool_t" use="optional" default="false"/>
     </xs:complexType>
     <!--
 *******************************************************

+ 14 - 0
clish/shell/shell_tinyxml.cpp

@@ -323,6 +323,8 @@ process_startup(clish_shell_t * shell, TiXmlElement * element, void *parent)
 	const char *viewid = element->Attribute("viewid");
 	const char *default_shebang = element->Attribute("default_shebang");
 	const char *timeout = element->Attribute("timeout");
+	const char *lock = element->Attribute("lock");
+	const char *interrupt = element->Attribute("interrupt");
 
 	assert(!shell->startup);
 	assert(view);
@@ -346,6 +348,18 @@ process_startup(clish_shell_t * shell, TiXmlElement * element, void *parent)
 	if (timeout)
 		clish_shell__set_timeout(shell, atoi(timeout));
 
+	/* lock field */
+	if (lock && (lub_string_nocasecmp(lock, "false") == 0))
+		clish_command__set_lock(cmd, BOOL_FALSE);
+	else
+		clish_command__set_lock(cmd, BOOL_TRUE);
+
+	/* interrupt field */
+	if (interrupt && (lub_string_nocasecmp(interrupt, "true") == 0))
+		clish_command__set_interrupt(cmd, BOOL_TRUE);
+	else
+		clish_command__set_interrupt(cmd, BOOL_FALSE);
+
 	// remember this command
 	shell->startup = cmd;