Exemplo n.º 1
0
	def validar_entero(self,widget,event,entry):
		
		if entry == "aumento marca":
			texto = self.entry_aumento_marca.get_text()
			if es_int(texto) or texto == "":
				self.entry_aumento_marca.set_icon_from_stock(1,gtk.STOCK_APPLY)
				self.entry_aumento_marca.set_property("secondary-icon-tooltip-text",None)
				self.pagina1[0] = True
				texto2 = self.entry_ganancia.get_text()
				if not False in self.pagina1 and (texto2 != "" or texto != ""):
					print self.pagina1
					self.btn_aceptar.set_sensitive(True)
				else:
					self.btn_aceptar.set_sensitive(False)
			else:
				self.entry_aumento_marca.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
				self.entry_aumento_marca.set_property("secondary-icon-tooltip-text","Solo numeros enteros.")
				self.pagina1[0] = False
				self.btn_aceptar.set_sensitive(False)
		elif entry == "aumento":
			texto = self.entry_aumento.get_text()
			if es_int(texto) or texto == "":
				self.entry_aumento.set_icon_from_stock(1,gtk.STOCK_APPLY)
				self.entry_aumento.set_property("secondary-icon-tooltip-text",None)
				self.pagina2[0] = True
				if not False in self.pagina2:
					print self.pagina2
					self.btn_aceptar.set_sensitive(True)
			else:
				self.entry_aumento.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
				self.entry_aumento.set_property("secondary-icon-tooltip-text","Solo numeros enteros.")
				self.pagina2[0] = False
				self.btn_aceptar.set_sensitive(False)
		else:
			texto = self.entry_ganancia.get_text()
			if es_int(texto) or texto == "":
				self.entry_ganancia.set_icon_from_stock(1,gtk.STOCK_APPLY)
				self.entry_ganancia.set_property("secondary-icon-tooltip-text",None)
				self.pagina1[1] = True
				texto2 = self.entry_ganancia.get_text()
				if not False in self.pagina1 and (texto2 != "" or texto != ""): 
					print self.pagina1
					self.btn_aceptar.set_sensitive(True)
				else:
					self.btn_aceptar.set_sensitive(False)
			else:
				self.entry_ganancia.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
				self.entry_ganancia.set_property("secondary-icon-tooltip-text","Solo numeros enteros.")
				self.pagina1[1] = False
				self.btn_aceptar.set_sensitive(False)
Exemplo n.º 2
0
	def validar_codigo(self,widget):
		self.codigo_ok=False
		codigo=self.entry_codigo.get_text()
		if es_int(codigo) and not codigo_no_repetido_modificado(self.liststore_elejido,self.entry_codigo,self.id_codigo):
			self.entry_codigo.set_icon_from_stock(1,gtk.STOCK_APPLY)
			self.codigo_ok=True
		else:
			self.entry_codigo.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
		if codigo == "":
			self.codigo_ok=False
Exemplo n.º 3
0
	def validar_codigo(self,widget,liststore):
		self.codigo_ok=False
		codigo=self.entry_codigo.get_text()
		if es_int(codigo):
			if not codigo_no_repetido(liststore,codigo):
				self.entry_codigo.set_icon_from_stock(1,gtk.STOCK_APPLY)
				self.entry_codigo.set_property("secondary-icon-tooltip-text","")
				self.codigo_ok=True
			else:
				self.entry_codigo.set_property("secondary-icon-tooltip-text","Codigo Repetido")
				self.entry_codigo.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
		else:
			self.entry_codigo.set_property("secondary-icon-tooltip-text","Incorrecto")
			self.entry_codigo.set_icon_from_stock(1,gtk.STOCK_DIALOG_ERROR)
		if codigo == "":
			self.entry_codigo.set_property("secondary-icon-stock",None)