Beispiel #1
0
 def ok_poet(self, *a):
     model, i = self.sel_poet.get_selected()
     if i:
         id_poet = model.get_value(i,0)
         list_poems, self.text_tarjama = self.parent.db.poems_of_poet(id_poet)
         if id_poet != 0:
             self.grid_poet.set_sensitive(True)
             self.view_tarjama_bfr.set_text(self.text_tarjama)
             self.lak_poet.set_text(self.parent.db.name_poet(id_poet)[1])
             self.nm_poet.set_text(self.parent.db.name_poet(id_poet)[0])
             self.ages.set_active(daw_tools.get_index(daw_tools.age_poet, self.parent.db.age_poet(id_poet)))
             self.lands.set_active(daw_tools.get_index(daw_tools.elbalad, self.parent.db.balad_poet(id_poet)))
             self.sexs.set_active(daw_tools.get_index(daw_tools.sex_poet, self.parent.db.sex_poet(id_poet)))
             self.dh_poet.set_value(float(self.parent.db.death_poet(id_poet)))
         else:
             self.grid_poet.set_sensitive(False)
             self.view_tarjama_bfr.set_text('')
             self.lak_poet.set_text('')
             self.nm_poet.set_text('')
             self.ages.set_active(-1)
             self.lands.set_active(-1)
             self.sexs.set_active(-1)
             self.dh_poet.set_value(0.0)
         self.store_poems.clear()
         self.load_data()
         if len(list_poems) != 0:
             self.names_list0 = []
             self.modelfilter0 = self.store_poems.filter_new()
             for a in list_poems:
                 self.store_poems.append([a[0], a[1]])
                 self.names_list0.append(a[1])
             self.theword0 = self.names_list0[:]
             self.modelfilter0.set_visible_func(self.visible_cb0, self.theword0) 
             self.tree_poems.set_model(self.modelfilter0)
         self.notebk.set_current_page(0)
Beispiel #2
0
 def change_takiir(self, *a):
     takiir= daw_customs.value_active(self.takiir)
     model = self.sabab.get_model()
     ls = []
     for a in model:
         ls.append(a)
     idx = daw_tools.get_index(ls, takiir)
     if idx == None: return
     self.sabab.set_active(idx) 
     self.zihaf_info_bfr.set_text(daw_scan.Zihafat_ta3rif[takiir][1]) 
Beispiel #3
0
 def ok_poem(self, *a):
     self.notebk.set_current_page(1)
     model, i = self.sel_poem.get_selected()
     if i:
         id_poem = model.get_value(i,0)
         text_poem, text_sabab, text_charh, text_ta3lik = self.parent.db.get_poem(id_poem)
         nm_poem = self.parent.db.name_poem(id_poem)
         baher = self.parent.db.get_id_baher(id_poem)-1
         rawi = daw_tools.get_index(daw_tools.elrawi, self.parent.db.rawi_poem(id_poem))
         gharadh = daw_tools.get_index(daw_tools.elgharadh, self.parent.db.gharadh_poem(id_poem))
         kafia = daw_tools.get_index(daw_tools.elkawafi, self.parent.db.kafia_poem(id_poem))
         naw3 = daw_tools.get_index(daw_tools.elnaw3, self.parent.db.naw3_poem(id_poem))
         if baher == -1:
             arodh = -1
         else:
             arodh = daw_tools.get_index_arodh(self.parent.db.get_id_baher(id_poem), 
                                               self.parent.db.arodh_poem(id_poem))
         self.load_data(text_poem, text_sabab, text_charh, nm_poem, baher, rawi, gharadh,
                         kafia, naw3, arodh)
         self.list_modifieds = []
         self.list_modifieds.append(text_poem)
         self.redo.set_sensitive(False)