support for readonly variable
add 'version' as a readonly variable
This commit is contained in:
		
							parent
							
								
									b6d32de0ea
								
							
						
					
					
						commit
						4534b2bbbc
					
				
					 2 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -63,7 +63,10 @@ class Advanced_window:
 | 
			
		|||
		if not val:
 | 
			
		||||
			model.append(iter, [name, '', ''])
 | 
			
		||||
			return
 | 
			
		||||
		model.append(iter, [name, val[OPT_VAL], val[OPT_TYPE][0]])
 | 
			
		||||
		type = ''
 | 
			
		||||
		if val[OPT_TYPE]:
 | 
			
		||||
			type = val[OPT_TYPE][0]
 | 
			
		||||
		model.append(iter, [name, val[OPT_VAL], type])
 | 
			
		||||
 | 
			
		||||
	def visible_func(self, model, iter, str):
 | 
			
		||||
		if str is None or str == '':
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -93,6 +93,7 @@ class Config:
 | 
			
		|||
		'log_notif_in_user_file': [ opt_bool, True ],
 | 
			
		||||
		'log_notif_in_sep_file': [ opt_bool, True ],
 | 
			
		||||
		'change_title': [ opt_bool, True ],
 | 
			
		||||
		'version': [ None, '0.7' ],
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	__options_per_key = {
 | 
			
		||||
| 
						 | 
				
			
			@ -237,6 +238,8 @@ class Config:
 | 
			
		|||
		return val
 | 
			
		||||
		
 | 
			
		||||
	def is_valid(self, type, val):
 | 
			
		||||
		if not type:
 | 
			
		||||
			return None
 | 
			
		||||
		if type[0] == 'boolean':
 | 
			
		||||
			return self.is_valid_bool(val)
 | 
			
		||||
		elif type[0] == 'integer':
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue