Пример #1
0
	def save(self):
		
		title = self.strvar_title.get()
		new_color = self.strvar_color.get()
		new_image = self.strvar_image.get()
		
		if new_color == "":
			new_color = None
		if new_image == "":
			new_image = None
		
		
		# Edit
		if self.update == True:
			
			retour = popup.confirm("Are you sure to save new settings for this tab ?")
			
			
			if retour == True:
				icon_list = self.main.cache["CurrentTab"][2]
		
				modif_tab = [title, [new_color, new_image], icon_list] 
		
				retour = self.main.core.modif_tab(modif_tab)
				if retour == True:
					popup.info("Tab successfully modified")
					self.main.this_tab(title)
				else:
					popup.info("Error. Tab not modified")
				
			else:
				self.toplevel.focus_force()
				pass
		# Making new tab
		else:
				
			new_tab = [title, [new_color, new_image], []] 
			
			retour = self.main.core.create_tab(new_tab)
			
			if retour == True:
				popup.info("Tab successfully created")
				self.main.this_tab(title)
			else:
				popup.info("Error. Tab not created. Title already used")

		
		self.toplevel.destroy()
Пример #2
0
	def save(self):
		
		tab_title = self.main.cache["CurrentTab"][0]
		
		title = self.strvar_title.get()
		new_color = self.strvar_color.get()
		new_image = self.strvar_image.get()
		
		new_link1 = self.strvar_link1.get()
		new_link2 = self.strvar_link2.get()
		new_link3 = self.strvar_link3.get()
		new_link4 = self.strvar_link4.get()
		new_link5 = self.strvar_link5.get()
		
		
		if new_color == "":
			new_color = None
		if new_image == "":
			new_image = None
		if new_link1 == "":
			new_link1 = None
		if new_link2 == "":
			new_link2 = None
		if new_link3 == "":
			new_link3 = None
		if new_link4 == "":
			new_link4 = None
		if new_link5 == "":
			new_link5 = None
		
		
		
		# Edit
		if self.update == True:
			retour = popup.confirm("Are you sure to save new settings for this tab ?")
			
			
			if retour == True:
		
				position = self.main.cache["CurrentIcon"][2]
				modif_icon = [title, [new_color, new_image], position, 
						[new_link1, new_link2, new_link3, new_link4,
						new_link5]] 
		
				retour = self.main.core.modif_icon(tab_title, modif_icon)
				if retour == True:
					popup.info("Tab successfully modified")
					self.main.this_tab(tab_title)
				else:
					popup.info("Error. Tab not modified")
				
			else:
				self.toplevel.focus_force()
				pass
		# Making new Icon
		else:
				
			new_icon = [title, [new_color, new_image], (200, 200), 
						[new_link1, new_link2, new_link3, new_link4,
						new_link5]] 		
			retour = self.main.core.create_icon(tab_title, new_icon)
			
			if retour == True:
				popup.info("Icon successfully created")
				self.main.this_tab(tab_title)
			else:
				popup.info("Error. Icon not created. Title already used")

		
		self.toplevel.destroy()