cifrado r106 - in trunk: . package/cifrado



Author: bersace
Date: Fri Apr 18 21:10:50 2008
New Revision: 106
URL: http://svn.gnome.org/viewvc/cifrado?rev=106&view=rev

Log:
Ajout d'un attribut COL_COD_POL et utilisation comme attribut 'font'
de GtkCellRendererText.


Modified:
   trunk/ChangeLog
   trunk/package/cifrado/cifrado.py
   trunk/package/cifrado/emission.py

Modified: trunk/package/cifrado/cifrado.py
==============================================================================
--- trunk/package/cifrado/cifrado.py	(original)
+++ trunk/package/cifrado/cifrado.py	Fri Apr 18 21:10:50 2008
@@ -195,10 +195,11 @@
         colonne.set_expand(True)
         liste.append_column(colonne)
 
-        # arg
+        # prop
         renderer = gtk.CellRendererText()
         colonne = gtk.TreeViewColumn('Configuration', renderer,
-                                     text=emission.COL_COD_PROP)
+                                     text=emission.COL_COD_PROP,
+                                     font=emission.COL_COD_POL)
         colonne.set_expand(True)
         liste.append_column(colonne)
 
@@ -745,6 +746,8 @@
         cod = self.get_cod_crt()
         model, iter = self.glade.get_widget('codeur_liste').get_selection().get_selected()
         model.set(iter, emission.COL_COD_PROP, cod.get_prop_desc())
+        if self.get_cod_crt().__class__ is codeurs.police.Codeur:
+            model.set(iter, emission.COL_COD_POL, cod.get_police())
         self.sync(False)
 
     def on_codeur_conv_btn_clicked(self, bouton):

Modified: trunk/package/cifrado/emission.py
==============================================================================
--- trunk/package/cifrado/emission.py	(original)
+++ trunk/package/cifrado/emission.py	Fri Apr 18 21:10:50 2008
@@ -10,7 +10,7 @@
 from    .       import codeur
 from    .       import codeurs
 
-COL_COD_NOM, COL_COD_PROP, COL_COD = range(3)
+COL_COD_NOM, COL_COD_PROP, COL_COD_POL, COL_COD = range(4)
 COL_SUB_VAR, COL_SUB_VAL = range(2)
 
 def charger(el, jeu):
@@ -39,6 +39,7 @@
         self.subs = subs
         self.codeurs = gtk.ListStore(gobject.TYPE_STRING,
                                      gobject.TYPE_STRING,
+                                     gobject.TYPE_STRING,
                                      gobject.TYPE_PYOBJECT)
 
         if cods is None:
@@ -50,15 +51,25 @@
                             
 
     def ajouter_codeur(self, codeur):
+        police = 'Sans 10'
+        if codeur.__class__ is codeurs.police.Codeur:
+            police = codeur.get_police()
+
         return self.codeurs.append([codeur.nom,
                                     codeur.get_prop_desc(),
+                                    police,
                                     codeur])
 
     def changer_codeur(self, iter, classe):
         codeur = classe()
+        police = 'Sans 10'
+        if classe is codeurs.police.Codeur:
+            police = codeur.get_police()
+
         self.codeurs.set(iter,
                          COL_COD, codeur,
                          COL_COD_PROP, codeur.get_prop_desc(),
+                         COL_COD_POL, police,
                          COL_COD_NOM, classe.nom)
 
     def get_codeur(self, iter):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]