Beispiel #1
0
	def __init__( self, fitxer, gjlib, path="Gesjo", root="frmgesjo", domain=app_name, **kwargs ):
		path = os.path.join(glade_dir, path)
		
		AppBase.__init__(self, path, root, domain, **kwargs)
		
		self.gj = gjlib
		self.fitxer = fitxer
		self.widgets = gtk.glade.XML(fitxer)
		self.widgets.signal_autoconnect(self) 

		self.wid = self.widgets.get_widget

		#
		# Senyals pels botons de tancar finestres
		#
		self.wid('frmmarca').connect("delete_event",self.on_ma_delete_event)
		self.wid('frmtaller').connect("delete_event",self.on_ta_delete_event)
		self.wid('frmmecanic').connect("delete_event",self.on_ta_delete_event)
		self.wid('frmbrowse').connect("delete_event",self.on_sel_delete_event)
		self.wid('frmgesjo').connect("delete_event",gtk.main_quit)

		self.camps_cercar = []
		self.valors_cercar = []

		self.camps_editats = {}
		self.camps_editats["cl"] = []
		self.camps_editats["ma"] = []
		self.camps_editats["ta"] = []
		self.camps_editats["me"] = []
		self.camps_editats["ar"] = []

		self.edita = {}

		# eliminam les petanyes de la dreta
		self.wid("pestanya").set_show_tabs( False )
    def __init__(self, path="finestres.glade",
                 root="frmgesjo",
                 domain=app_name, **kwargs):
        path = os.path.join(glade_dir, path)
        AppBase.__init__(self, path, root, domain, **kwargs)

        for w in ["imatge_informes", "imatge_factures", "imatge_taller", "imatge_arreglos", "imatge_clients"]:
            wid = self.get_widget(w)
            print "W %s WID %s " % (w,wid.name)
            print "icon "+ str(wid.get_icon_name())
            wid.set_from_file("pixmaps/"+w.strip("imatge_")+".png")
	def __init__(self, pCamps, pDades, gjlib ):
		AppBase.__init__(self, gjlib, root="frm_cerca")
	
		self.res = []
		self.__dades = pDades
		# establim les columnes/camps del model i el cream  
		self.liststore = gtk.ListStore( *pCamps.obte_tipus() )
		self.treeview = self.get_widget("grid")
		self.treeview.set_model(self.liststore)

		# anem a crear les columnes, ;)
		self.camps_cercador = pCamps
		self.camps = self.camps_cercador.obte_camps()
		for camp in self.camps:
			self.cell = gtk.CellRendererText()
			self.tvcolumn = gtk.TreeViewColumn(sel<default>f.camps_cercador.obte_etiqueta(camp), self.cell, text=self.camps.index(camp))
			self.treeview.append_column(self.tvcolumn)
			self.tvcolumn.set_sort_column_id(self.camps.index(camp))  
			
		self.treeview.set_search_column(1)

		self.treeview.set_model(None) 
		for p in self.__dades: 
			if DEBUG: print "Insertant %s" % p
			
			# Tractam si hi ha camps buits....
			p2 = []
			for x in p:
				if x: p2.append(x)
				else: 
					if type(x) is str:
						p2.append("")
					else:
						p2.append(0)
			piter = self.liststore.append(p2)
		self.treeview.set_model(self.liststore)
Beispiel #4
0
	def __init__(self, gjlib ):
		AppBase.__init__(self, gjlib,  root="dlg_cerca")
	def run(self):
		AppBase.run(self)
		return self.res
 def __init__(self, path="finestres.glade",
              root="frmbrowse",
              domain=app_name, **kwargs):
     path = os.path.join(glade_dir, path)
     AppBase.__init__(self, path, root, domain, **kwargs)