def displayCity(callingWidget, fileid, tabrow): global cities ctalts = [] ar = gtk.Label() warnme = False if cities.get(fileid, None): tab = cities[fileid].get("tab") if tab is not None: warnme = True if not config["duplicatetabs"]: status.push(0, "'%s' is Already open. Switching to existing tab instead of loading..." % fileid) tabrow.set_current_page(tab) for i in range(len(tabrow)): if fileid == tabrow.get_tab_label_text(tabrow.get_nth_page(i)): tabrow.set_current_page(i) return # No need to load again. If revert needed, use a different function else: cities[fileid] = {} cities[fileid]["info"] = loadCity(fileid) cities[fileid]["changed"] = False cities[fileid]["cat"] = "c" displayStage1( tabrow, fileid, "c", saveThisC, showCity, preClose, displayCity, ar, ctalts ) # creates tabrow.vbox and tabrow.vbox.ftabs, et al tabrow.vbox.connect("destroy", tabdestroyed, fileid) tabrow.labeli = gtk.Label("Information") tabrow.vbox.ftabs.infpage = displayStage2(tabrow.vbox.ftabs, tabrow.labeli) tabrow.labelm = gtk.Label("Milestones") tabrow.vbox.ftabs.milepage = displayStage2(tabrow.vbox.ftabs, tabrow.labelm) if config["debug"] > 2: print "Loading " + tabrow.get_tab_label_text(tabrow.vbox) ar.show() ar.set_alignment(0.5, 0.5) setRuletext(ar, len(ctalts)) tabrow.vbox.pack_end(ar, 0, 0, 2) initCinfo(tabrow.vbox.ftabs.infpage, fileid, tabrow, ar, ctalts) initCmile(tabrow.vbox.ftabs.milepage, fileid, tabrow, ar, ctalts) tabrow.set_current_page(tabrow.page_num(tabrow.vbox)) cities[fileid]["tab"] = tabrow.page_num(tabrow.vbox)
def displayPlace(callingWidget,fileid, tabrow): global places plalts = [] ar = gtk.Label() warnme = False if places.get(fileid,None): tab = places[fileid].get("tab") if tab is not None: warnme = True if not config['duplicatetabs']: status.push(0,"'" + fileid + "' is Already open. Switching to existing tab instead of loading...") tabrow.set_current_page(tab) for i in range(len(tabrow)): if fileid == tabrow.get_tab_label_text(tabrow.get_nth_page(i)): tabrow.set_current_page(i) return # No need to load again. If revert needed, use a different function else: L = loadPlace(fileid) places[fileid] = {} places[fileid]['info'] = L[0] places[fileid]['relat'] = L[1] places[fileid]['changed'] = False places[fileid]['cat'] = 'l' displayStage1(tabrow,fileid,'l',saveThisL,showPlace,preClose,displayPlace,ar,plalts) tabrow.vbox.connect("destroy",tabdestroyed,fileid) tabrow.labeli = gtk.Label("Information") tabrow.labelr = gtk.Label("Connections") tabrow.vbox.ftabs.infpage = displayStage2(tabrow.vbox.ftabs,tabrow.labeli) tabrow.vbox.ftabs.relpage = displayStage2(tabrow.vbox.ftabs,tabrow.labelr) if config['debug'] > 2: print "Loading " + tabrow.get_tab_label_text(tabrow.vbox) ar.show() ar.set_alignment(0.5,0.5) setRuletext(ar,len(plalts)) tabrow.vbox.pack_end(ar,0,0,2) initLinfo(tabrow.vbox.ftabs.infpage, fileid,ar,plalts) initLrels(tabrow.vbox.ftabs.relpage, fileid,tabrow,ar,plalts) tabrow.set_current_page(tabrow.page_num(tabrow.vbox)) places[fileid]["tab"] = tabrow.page_num(tabrow.vbox)
def displayState(callingWidget,fileid, tabrow): global states stalts = [] ar = gtk.Label() warnme = False if states.get(fileid,None): tab = states[fileid].get("tab") if tab is not None: warnme = True if not config['duplicatetabs']: status.push(0,"'" + fileid + "' is Already open. Switching to existing tab instead of loading...") tabrow.set_current_page(tab) for i in range(len(tabrow)): if fileid == tabrow.get_tab_label_text(tabrow.get_nth_page(i)): tabrow.set_current_page(i) return # No need to load again. If revert needed, use a different function else: states[fileid] = {} states[fileid]['info'] = loadState(fileid) states[fileid]['changed'] = False states[fileid]['cat'] = 's' displayStage1(tabrow,fileid,'s',saveThisS,showState,preClose,displayState,ar,stalts) # creates tabrow.vbox and tabrow.vbox.ftabs, et al tabrow.vbox.connect("destroy",tabdestroyed,fileid) tabrow.labeli = gtk.Label("Information") tabrow.vbox.ftabs.infpage = displayStage2(tabrow.vbox.ftabs,tabrow.labeli) tabrow.labelm = gtk.Label("Milestones") tabrow.vbox.ftabs.milepage = displayStage2(tabrow.vbox.ftabs,tabrow.labelm) if config['debug'] > 2: print "Loading " + tabrow.get_tab_label_text(tabrow.vbox) ar.show() ar.set_alignment(0.5,0.5) setRuletext(ar,len(stalts)) tabrow.vbox.pack_end(ar,0,0,2) initSinfo(tabrow.vbox.ftabs.infpage, fileid,tabrow,ar,stalts) initSmile(tabrow.vbox.ftabs.milepage, fileid,tabrow,ar,stalts) tabrow.set_current_page(tabrow.page_num(tabrow.vbox)) states[fileid]["tab"] = tabrow.page_num(tabrow.vbox)