def remove_tab(self, tab): # Retire le tab du tablist # Retourne True si bonne fin # Retourne False sinon try: self.tablist.remove(tab) except: return False else: # Stockage du tablist iodata.manage_data((0, "./data/datafile.py", self.tablist)) return True
def remove_icon(self, tab_title, icon): # Return True si l'icon est effacé sinon return False icon_title = icon[0] retour = self.search_icon(tab_title, icon_title) if retour == False: return False else: retour = self.search_tab(tab_title) tab = retour[0] tab[2].remove(icon) # Stockage du tablist iodata.manage_data((0, "./data/datafile.py", self.tablist)) return True
def __init__(self): # Liste des Tabs # self.tablist = [[tab], [tab], ..., [tab]] # Avec: # [tab] = ["title", [fond d'écran], # [iconsList]] # [fond d'écran] = ["color", "pathname image"] # [iconsList] = [[icon], [icon], ... [icon]] # [icon] = ["title", [fond], (position), # [links]] # [fond] = ["bg color", "pathname_image"] # # (position) = Exemple (600, 300) # [links] = [link1, link2, ... link5] self.tablist = [] # Import du tablist stocké var = iodata.manage_data((1, "./data/datafile.py")) if var[0] == True: self.tablist = var[1] else: pass
def create_icon(self, tab_title, icon): # Return True si l'icon est créé, sinon return False icon_title = icon[0] retour = self.search_icon(tab_title, icon_title) if retour == False: retour = self.search_tab(tab_title) if retour == False: return False else: tab = retour[0] tab[2].append(icon) # Stockage du tablist iodata.manage_data((0, "./data/datafile.py", self.tablist)) return True else: return False
def create_tab(self, tab): # Creation de Tab # [tab] (Voir description dans __init__) # Retourne True si la création de Tab est effective # Retourne False si échec de création de Tab # Check si le nom de tab existe deja title_tab = tab[0] retour = self.search_tab(title_tab) if retour == False: self.tablist.append(tab) #self.tablist.sort() # Stockage du tablist iodata.manage_data((0, "./data/datafile.py", self.tablist)) return True else: return False
def modif_tab(self, tab): # Renvoyer True si modification effective d'un tab existant # Renvoyer False sinon # Check si le nom de tab existe deja title_tab = tab[0] retour = self.search_tab(title_tab) if retour == False: return False else: # Ancien tab old_tab = retour[0] # On efface l'ancien tab du tablist self.tablist.remove(old_tab) # On ajoute le nouveau Tab self.tablist.append(tab) #self.tablist.sort() # Stockage du tablist iodata.manage_data((0, "./data/datafile.py", self.tablist)) return True