Trees | Indices | Help |
|
---|
|
1 # -*- coding: iso-8859-1 -*- 2 # Copyright 20003 - 2008: Julien Bourdaillet (julien.bourdaillet@lip6.fr), Jean-Gabriel Ganascia (jean-gabriel.ganascia@lip6.fr) 3 # This file is part of MEDITE. 4 # 5 # MEDITE is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation; either version 2 of the License, or 8 # (at your option) any later version. 9 # 10 # MEDITE is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with Foobar; if not, write to the Free Software 17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 #---------------------------------------------------------------------------- 19 # Nom: Formulaires.py 20 # Objet: Ce fichier regroupe les differentes classes de formulaire 21 # concernant le menu Dossiers 22 #---------------------------------------------------------------------------- 23 24 #from wx.Python.wx. import * 25 import wx 26 from Utile.constantesGUI import * 27 from Utile.exceptionsDonnees import * 28 import Donnees.planTravail 29 import Controleurs.DGManager 30 #--------------------------------------------------------------------------------------------------# 31 32 #Classe qui cree un formulaire affichant le commentaire existant 33 #Si le bouton remplacer est enclenche, le nouveau commentaire remplacera l'ancien 34 #Si le bouton ajouter est enclenche, le nouveau commentaire s'ajoutera à l'ancien104 105 # Fenetre de dialogue de selection d'un element dans une liste 110 111 # Classe qui cree un formulaire de selection a partir de la selection de l'auteur, 112 # de l'oeuvre, de la version source, de l'état source, de la version cible, 113 # de l'état cible 114 # la classe appelle la methode supprimerInformations de cInformations37 wx.Frame.__init__(self, parent, -1, "Commentaire existant", pos = wx.Point(100,50) 38 ,size = (380,430), 39 style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE|wx.FRAME_FLOAT_ON_PARENT) 40 self.fenetreMedite=parent 41 self.param = pParametres 42 panel=wx.Panel(self,-1) 43 44 textCom=wx.StaticText(panel,-1,u"Un commentaire exite d\xe9ja !\n ",wx.Point(15,10)) 45 textComA=wx.StaticText(panel,-1,"L'ancien commentaire",wx.Point(15,40)) 46 textComOld=wx.TextCtrl(panel,-1,oldComment,wx.Point(40,60),size=(300,80), 47 style=wx.TE_READONLY|wx.TE_MULTILINE) 48 49 textComN=wx.StaticText(panel,-1,"Le nouveau commentaire",wx.Point(15,150)) 50 textComNew=wx.TextCtrl(panel,-1,self.fenetreMedite.getCompPanel().commentaire.GetValue(), 51 wx.Point(40,170),size=(300,80), 52 style=wx.TE_READONLY|wx.TE_MULTILINE) 53 54 msg = u"Vous avez 3 possibilit\xe9s :\n- remplacer l\'ancien commentaire par votre nouveau\n- ajouter le nouveau \xe0 l\'ancien\n- annuler la commande" 55 textMsg=wx.StaticText(panel,-1,msg,wx.Point(50,280)) 56 57 bValider = wx.Button(panel, ID_REMPLACER, "REMPLACER", wx.Point(50, 360)) 58 wx.EVT_BUTTON(self, ID_REMPLACER, self.onRemplacer) 59 60 bValider = wx.Button(panel, ID_AJOUTER, "AJOUTER", wx.Point(150, 360)) 61 wx.EVT_BUTTON(self, ID_AJOUTER, self.onAjouter) 62 63 bAnnuler = wx.Button(panel, ID_ANNULER, "ANNULER", wx.Point(250,360)) 64 wx.EVT_BUTTON(self, ID_ANNULER, self.onAnnuler)6567 try: 68 self.fenetreMedite.cinfos.remplacerCommentaire(self.fenetreMedite.getPlanTravail(), 69 self.fenetreMedite.getCompPanel().commentaire.GetValue()) 70 except AuteurNonTrouve, eANT: 71 dlg = wx.MessageDialog(self, u"L'auteur n'a pas \xe9t\xe9 trouv\xe9 !!", 'Attention !',wx.OK) 72 dlg.ShowModal() 73 dlg.Destroy() 74 except OeuvreNonTrouvee, eONT: 75 dlg = wx.MessageDialog(self, u"L'oeuvre n'a pas \xe9t\xe9 trouv\xe9e !!", 'Attention !',wx.OK) 76 dlg.ShowModal() 77 dlg.Destroy() 78 except InformationsNonTrouvees, eINT: 79 dlg = wx.MessageDialog(self, u"L'application Medite n'a pas \xe9t\xe9 appliqu\xe9 sur ce couple d'états !!", 'Attention !',wx.OK) 80 dlg.ShowModal() 81 dlg.Destroy() 82 self.Close()8385 try: 86 self.fenetreMedite.cinfos.ajouterCommentaire(self.fenetreMedite.getPlanTravail(), 87 self.fenetreMedite.getCompPanel().commentaire.GetValue()) 88 except AuteurNonTrouve, eANT: 89 dlg = wx.MessageDialog(self, u"L'auteur n'a pas \xe9t\xe9 trouv\xe9 !!", 'Attention !',wx.OK) 90 dlg.ShowModal() 91 dlg.Destroy() 92 except OeuvreNonTrouvee, eONT: 93 dlg = wx.MessageDialog(self, u"L'oeuvre n'a pas \xe9t\xe9 trouv\xe9e !!", 'Attention !',wx.OK) 94 dlg.ShowModal() 95 dlg.Destroy() 96 except InformationsNonTrouvees, eINT: 97 dlg = wx.MessageDialog(self, u"L'application Medite n'a pas \xe9t\xe9 appliqu\xe9 sur ce couple d'états !!", 'Attention !',wx.OK) 98 dlg.ShowModal() 99 dlg.Destroy() 100 self.Close()101334 335 # Classe qui cree un formulaire de selection 336 # A partir de la selection de l'auteur, de l'oeuvre, de la version source, de l'état source, 337 # de la version cible, de l'état cible la classe appelle la methode supprimerCommentaire 338 # de cInformations117 wx.Frame.__init__(self, parent, -1,title, pos = wx.Point(200,200) 118 ,size = ( 330,380), 119 style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE|wx.FRAME_FLOAT_ON_PARENT) 120 self.fenetreMedite=parent 121 self.dgm = Controleurs.DGManager.DGManager() 122 panel=wx.Panel(self,-1) 123 124 textAuteur=wx.StaticText(panel,-1,"Auteur : ",wx.Point(15,12)) 125 self.ctrlAuteur=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getAuteur(), 126 wx.Point(100,10),size=(125,-1),style=wx.TE_READONLY) 127 self.ctrlAuteur.SetInsertionPoint(0) 128 bAuteur = wx.Button(panel, ID_SELECT_AUTEUR, u"S\xe9lection",wx.Point(230,10)) 129 wx.EVT_BUTTON(self, ID_SELECT_AUTEUR, self.onSelectAuteur) 130 131 textOeuvre=wx.StaticText(panel,-1,"Oeuvre : ",wx.Point(15,52)) 132 self.ctrlOeuvre=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getOeuvre(), 133 wx.Point(100,50),size=(125,-1),style=wx.TE_READONLY) 134 self.ctrlOeuvre.SetInsertionPoint(0) 135 bOeuvre = wx.Button(panel, ID_SELECT_OEUVRE, u"S\xe9lection",wx.Point(230,50)) 136 wx.EVT_BUTTON(self, ID_SELECT_OEUVRE, self.onSelectOeuvre) 137 138 textVersionS=wx.StaticText(panel,-1,"Version Source: ",wx.Point(15,92)) 139 self.ctrlVersionS=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getVersionSource(), 140 wx.Point(100,90),size=(125,-1),style=wx.TE_READONLY) 141 self.ctrlVersionS.SetInsertionPoint(0) 142 bVersionS = wx.Button(panel, ID_SELECT_VERSION_S, u"S\xe9lection",wx.Point(230,90)) 143 wx.EVT_BUTTON(self, ID_SELECT_VERSION_S, self.onSelectVersionS) 144 145 textEtatS=wx.StaticText(panel,-1,"Etat Source: ",wx.Point(15,132)) 146 self.ctrlEtatS=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getEtatSource(), 147 wx.Point(100,130),size=(125,-1),style=wx.TE_READONLY) 148 self.ctrlEtatS.SetInsertionPoint(0) 149 bEtatS = wx.Button(panel, ID_SELECT_ETAT_S, u"S\xe9lection",wx.Point(230,130)) 150 wx.EVT_BUTTON(self, ID_SELECT_ETAT_S, self.onSelectEtatS) 151 152 textVersionC=wx.StaticText(panel,-1,"Version Cible: ",wx.Point(15,172)) 153 self.ctrlVersionC=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getVersionCible(), 154 wx.Point(100,170),size=(125,-1),style=wx.TE_READONLY) 155 self.ctrlVersionC.SetInsertionPoint(0) 156 bVersionC = wx.Button(panel, ID_SELECT_VERSION_C, u"S\xe9lection",wx.Point(230,170)) 157 wx.EVT_BUTTON(self, ID_SELECT_VERSION_C, self.onSelectVersionC) 158 159 textEtatC=wx.StaticText(panel,-1,"Etat Cible: ",wx.Point(15,212)) 160 self.ctrlEtatC=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getEtatCible(), 161 wx.Point(100,210),size=(125,-1),style=wx.TE_READONLY) 162 self.ctrlEtatC.SetInsertionPoint(0) 163 bEtatC = wx.Button(panel, ID_SELECT_ETAT_C, u"S\xe9lection",wx.Point(230,210)) 164 wx.EVT_BUTTON(self, ID_SELECT_ETAT_C, self.onSelectEtatC) 165 166 textParam=wx.StaticText(panel,-1,u"Param\xe8tres: ", 167 wx.Point(15,252)) 168 self.parametresChoix = self.fenetreMedite.getCompPanel().param.donnerParametres() 169 texte = '(%s,%s,%s)'%(self.parametresChoix.getp1(), 170 self.parametresChoix.getp2(), 171 self.parametresChoix.getp3()) 172 self.ctrlParam=wx.TextCtrl(panel,-1,texte,wx.Point(100,250), 173 size=(125,-1),style=wx.TE_READONLY) 174 self.ctrlParam.SetInsertionPoint(0) 175 bParam = wx.Button(panel, ID_SELECT_PARAM, u"S\xe9lection",wx.Point(230,250)) 176 wx.EVT_BUTTON(self, ID_SELECT_PARAM, self.onSelectParam) 177 178 bValider = wx.Button(panel, ID_OK, "VALIDER", wx.Point(70, 290)) 179 wx.EVT_BUTTON(self, ID_OK, self.onValider) 180 181 bAnnuler = wx.Button(panel, ID_ANNULER, "ANNULER", wx.Point(170, 290)) 182 wx.EVT_BUTTON(self, ID_ANNULER, self.onAnnuler)183185 #On recupere la liste des auteurs de la base 186 #listeAuteurs=self.fenetreMedite.cdon.getListeNomsAuteurs() 187 listeAuteurs = self.dgm.getListeAuteurs() 188 msg = "Choisissez l\'auteur" 189 titre = "Choix de l\'auteur" 190 self.auteurFormSelect = SelectionListe(self.fenetreMedite,msg,titre, listeAuteurs) 191 if self.auteurFormSelect.ShowModal() == wx.ID_OK: 192 self.ctrlAuteur.SetValue(self.auteurFormSelect.GetStringSelection())193195 if (self.ctrlAuteur.GetValue()!=""): 196 #on recupere la liste des oeuvres de l'auteur selectionne 197 #listeOeuvres=self.fenetreMedite.cdon.getListeTitresByAuteur(self.ctrlAuteur.GetValue()) 198 listeOeuvres=self.dgm.getListeOeuvresAuteur(self.ctrlAuteur.GetValue()) 199 msg = "Choisissez l\'oeuvre" 200 titre = "Choix de l\'oeuvre" 201 self.oeuvreFormSelect=SelectionListe(self.fenetreMedite, msg, titre, listeOeuvres) 202 if self.oeuvreFormSelect.ShowModal() == wx.ID_OK: 203 self.ctrlOeuvre.SetValue(self.oeuvreFormSelect.GetStringSelection()) 204 else: 205 text=u"Vous devez s\xe9lectionner un auteur" 206 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 207 dlg.ShowModal() 208 dlg.Destroy()209211 if (self.ctrlOeuvre.GetValue()!=""): 212 listeVersions=self.fenetreMedite.cdos.getListeDossiersVersions(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue()) 213 msg = 'Choisissez la version source' 214 titre = u"S\xe9lectionner une version" 215 self.versionFormSelectS=SelectionListe(self.fenetreMedite,msg,titre,listeVersions) 216 if self.versionFormSelectS.ShowModal() == wx.ID_OK: 217 self.ctrlVersionS.SetValue(self.versionFormSelectS.GetStringSelection()) 218 else: 219 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 220 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 221 dlg.ShowModal() 222 dlg.Destroy()223225 if (self.ctrlVersionS.GetValue()!=""): 226 #listeEtats=self.fenetreMedite.cdos.getListeEtats(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue(),self.ctrlVersionS.GetValue()) 227 listeEtats=self.dgm.getListeEtatsVersion(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue(),self.ctrlVersionS.GetValue()) 228 msg = u"Choisissez l\'état source \xe0" 229 titre = u"S\xe9lectionner un état" 230 self.etatFormSelectS=SelectionListe(self.fenetreMedite,msg,titre,listeEtats) 231 if self.etatFormSelectS.ShowModal() == wx.ID_OK: 232 self.ctrlEtatS.SetValue(self.etatFormSelectS.GetStringSelection()) 233 else: 234 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 235 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 236 dlg.ShowModal() 237 dlg.Destroy()238240 if (self.ctrlOeuvre.GetValue()!=""): 241 listeVersions=self.fenetreMedite.cdos.getListeDossiersVersions(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue()) 242 msg = 'Choisissez la version source' 243 titre = u"S\xe9lectionner une version" 244 self.versionFormSelectC=SelectionListe(self.fenetreMedite,msg,titre,listeVersions) 245 if self.versionFormSelectC.ShowModal() == wx.ID_OK: 246 self.ctrlVersionC.SetValue(self.versionFormSelectC.GetStringSelection()) 247 else: 248 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 249 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 250 dlg.ShowModal() 251 dlg.Destroy()252254 if (self.ctrlVersionC.GetValue()!=""): 255 #listeEtats=self.fenetreMedite.cdos.getListeEtats(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue(),self.ctrlVersionC.GetValue()) 256 listeEtats=self.dgm.getListeEtatsVersion(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue(),self.ctrlVersionC.GetValue()) 257 msg = u"Choisissez l\'état source \xe0" 258 titre = u"S\xe9lectionner un état" 259 self.etatFormSelectC=SelectionListe(self.fenetreMedite,msg,titre,listeEtats) 260 if self.etatFormSelectC.ShowModal() == wx.ID_OK: 261 self.ctrlEtatC.SetValue(self.etatFormSelectC.GetStringSelection()) 262 else: 263 text="Vous devez remplir les champs sup\xe9rieurs!!" 264 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 265 dlg.ShowModal() 266 dlg.Destroy()267269 if (self.ctrlEtatS.GetValue()!="") & (self.ctrlEtatC.GetValue()!=""): 270 # 1ere etape : rechercher toutes les infos existantes pour le couple de etats 271 # charge 272 liste=self.fenetreMedite.cinfos.rechercherToutesInformations(self.fenetreMedite.getPlanTravail()) 273 if len(liste) == 0: 274 dlg=wx.MessageDialog(self, u"Les informations n'ont pas \xe9t\xe9 trouv\xe9es !!","Attention",wx.OK) 275 dlg.ShowModal() 276 dlg.Destroy() 277 self.Close() 278 # 2eme etape : choix des parametres 279 else: 280 listeParam = [] 281 for i in liste : 282 param = i.getParametres() 283 lpara = '(%s,%s,%s)'%(param.getp1(),param.getp2(),param.getp3()) 284 listeParam.append(lpara) 285 msg = u"Il existe plusieurs informations concernant ces états.\n Choisissez les param\xe8tres\n (lg pivot, ratio, seuil)" 286 titre = u"S\xe9lectionner les param\xe8tres" 287 self.paramFormSelect=SelectionListe(self.fenetreMedite,msg,titre,listeParam) 288 if self.paramFormSelect.ShowModal() == wx.ID_OK: 289 choix = self.paramFormSelect.GetStringSelection() 290 self.ctrlParam.SetValue(choix) 291 n = 0 292 for p in listeParam : 293 if choix == p : 294 self.parametresChoix=liste[n].getParametres() 295 else : 296 n+=1 297 else: 298 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 299 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 300 dlg.ShowModal() 301 dlg.Destroy()302304 if (self.ctrlEtatS.GetValue()!="") & (self.ctrlEtatC.GetValue()!="") & (self.ctrlParam.GetValue()!=""): 305 try: 306 msg = 'Voulez-vous vraiment supprimer les informations' 307 dlg=wx.MessageDialog(self.fenetreMedite, msg,"Attention!",wx.YES_NO | wx.ICON_EXCLAMATION ) 308 if dlg.ShowModal() ==wx.ID_YES: 309 planTravail = Donnees.planTravail.PlanTravail(self.ctrlAuteur.GetValue(), 310 self.ctrlOeuvre.GetValue(),self.ctrlVersionS.GetValue(), 311 self.ctrlEtatS.GetValue(),self.ctrlVersionC.GetValue(), 312 self.ctrlEtatC.GetValue(),self.parametresChoix) 313 self.fenetreMedite.cinfos.supprimerInformations(planTravail) 314 except AuteurNonTrouve, eANT: 315 dlg = wx.MessageDialog(self, u"L'auteur n'a pas \xe9t\xe9 trouv\xe9 !!", 'Attention !',wx.OK) 316 dlg.ShowModal() 317 dlg.Destroy() 318 except OeuvreNonTrouvee, eONT: 319 dlg = wx.MessageDialog(self, u"L'oeuvre n'a pas \xe9t\xe9 trouv\xe9e !!", 'Attention !',wx.OK) 320 dlg.ShowModal() 321 dlg.Destroy() 322 except InformationsNonTrouvees, eINT: 323 dlg = wx.MessageDialog(self, u"L'application Medite n'a pas \xe9t\xe9 appliqu\xe9 sur ce couple d'états !!", 'Attention !',wx.OK) 324 dlg.ShowModal() 325 dlg.Destroy() 326 self.Close() 327 else: 328 dlg = wx.MessageDialog(self, "Vous devez remplir tous les champs !", 'Attention !',wx.OK) 329 dlg.ShowModal() 330 dlg.Destroy()331549341 wx.Frame.__init__(self, parent, -1,title,pos = wx.Point(200,200), 342 size = (330,380), 343 style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE|wx.FRAME_FLOAT_ON_PARENT) 344 self.fenetreMedite=parent 345 self.dgm = Controleurs.DGManager.DGManager() 346 panel=wx.Panel(self,-1) 347 348 textAuteur=wx.StaticText(panel,-1,"Auteur : ",wx.Point(15,12)) 349 self.ctrlAuteur=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getAuteur(), 350 wx.Point(100,10),size=(125,-1),style=wx.TE_READONLY) 351 self.ctrlAuteur.SetInsertionPoint(0) 352 bAuteur = wx.Button(panel, ID_SELECT_AUTEUR, u"S\xe9lection",wx.Point(230,10)) 353 wx.EVT_BUTTON(self, ID_SELECT_AUTEUR, self.onSelectAuteur) 354 355 textOeuvre=wx.StaticText(panel,-1,"Oeuvre : ",wx.Point(15,52)) 356 self.ctrlOeuvre=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getOeuvre(), 357 wx.Point(100,50),size=(125,-1),style=wx.TE_READONLY) 358 self.ctrlOeuvre.SetInsertionPoint(0) 359 bOeuvre = wx.Button(panel, ID_SELECT_OEUVRE, u"S\xe9lection",wx.Point(230,50)) 360 wx.EVT_BUTTON(self, ID_SELECT_OEUVRE, self.onSelectOeuvre) 361 362 textVersionS=wx.StaticText(panel,-1,"Version Source: ",wx.Point(15,92)) 363 self.ctrlVersionS=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getVersionSource() 364 ,wx.Point(100,90),size=(125,-1),style=wx.TE_READONLY) 365 self.ctrlVersionS.SetInsertionPoint(0) 366 bVersionS = wx.Button(panel, ID_SELECT_VERSION_S, u"S\xe9lection",wx.Point(230,90)) 367 wx.EVT_BUTTON(self, ID_SELECT_VERSION_S, self.onSelectVersionS) 368 369 textEtatS=wx.StaticText(panel,-1,"Etat Source: ",wx.Point(15,132)) 370 self.ctrlEtatS=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getEtatSource(), 371 wx.Point(100,130),size=(125,-1),style=wx.TE_READONLY) 372 self.ctrlEtatS.SetInsertionPoint(0) 373 bEtatS = wx.Button(panel, ID_SELECT_ETAT_S, u"S\xe9lection",wx.Point(230,130)) 374 wx.EVT_BUTTON(self, ID_SELECT_ETAT_S, self.onSelectEtatS) 375 376 textVersionC=wx.StaticText(panel,-1,"Version Cible: ",wx.Point(15,172)) 377 self.ctrlVersionC=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getVersionCible(), 378 wx.Point(100,170),size=(125,-1),style=wx.TE_READONLY) 379 self.ctrlVersionC.SetInsertionPoint(0) 380 bVersionC = wx.Button(panel, ID_SELECT_VERSION_C, u"S\xe9lection",wx.Point(230,170)) 381 wx.EVT_BUTTON(self, ID_SELECT_VERSION_C, self.onSelectVersionC) 382 383 textEtatC=wx.StaticText(panel,-1,"Etat Cible: ",wx.Point(15,212)) 384 self.ctrlEtatC=wx.TextCtrl(panel,-1,self.fenetreMedite.getPlanTravail().getEtatCible(), 385 wx.Point(100,210),size=(125,-1),style=wx.TE_READONLY) 386 self.ctrlEtatC.SetInsertionPoint(0) 387 bEtatC = wx.Button(panel, ID_SELECT_ETAT_C, u"S\xe9lection",wx.Point(230,210)) 388 wx.EVT_BUTTON(self, ID_SELECT_ETAT_C, self.onSelectEtatC) 389 390 textParam=wx.StaticText(panel,-1,u"Param\xe8tres: ", 391 wx.Point(15,252)) 392 self.parametresChoix = self.fenetreMedite.getCompPanel().param.donnerParametres() 393 texte = '(%s,%s,%s)'%(self.parametresChoix.getp1(), 394 self.parametresChoix.getp2(), 395 self.parametresChoix.getp3()) 396 self.ctrlParam=wx.TextCtrl(panel,-1,texte,wx.Point(100,250), 397 size=(125,-1),style=wx.TE_READONLY) 398 self.ctrlParam.SetInsertionPoint(0) 399 bParam = wx.Button(panel, ID_SELECT_PARAM, u"S\xe9lection",wx.Point(230,250)) 400 wx.EVT_BUTTON(self, ID_SELECT_PARAM, self.onSelectParam) 401 402 bValider = wx.Button(panel, ID_OK, "VALIDER", wx.Point(70, 290)) 403 wx.EVT_BUTTON(self, ID_OK, self.onValider) 404 405 bAnnuler = wx.Button(panel, ID_ANNULER, "ANNULER", wx.Point(160, 290)) 406 wx.EVT_BUTTON(self, ID_ANNULER, self.onAnnuler)407409 #On recupere la liste des auteurs de la base 410 #listeAuteurs=self.fenetreMedite.cdon.getListeNomsAuteurs() 411 listeAuteurs = self.dgm.getListeAuteurs() 412 self.auteurFormSelect=SelectionListe(-1,u"S\xe9lectionner un auteur",listeAuteurs,self.ctrlAuteur) 413 self.auteurFormSelect.Show(1)414416 if (self.ctrlAuteur.GetValue()!=""): 417 #on recupere la liste des oeuvres de l'auteur selectionne 418 #listeOeuvres=self.fenetreMedite.cdon.getListeTitresByAuteur(self.ctrlAuteur.GetValue()) 419 listeOeuvres=self.dgm.getListeOeuvresAuteur(self.ctrlAuteur.GetValue()) 420 self.oeuvreFormSelect=SelectionListe(-1,u"S\xe9lectionner une oeuvre",listeOeuvres,self.ctrlOeuvre) 421 self.oeuvreFormSelect.Show(1) 422 else: 423 text="Vous devez s\xe9lectionner un auteur" 424 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 425 dlg.ShowModal() 426 dlg.Destroy()427429 if (self.ctrlOeuvre.GetValue()!=""): 430 #listeVersions=self.fenetreMedite.cdos.getListeDossiersVersions(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue()) 431 listeVersions=self.dgm.getListeVersionsDG(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue()) 432 self.versionFormSelect=SelectionListe(-1,u"S\xe9lectionner une version",listeVersions,self.ctrlVersionS) 433 self.versionFormSelect.Show(1) 434 else: 435 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 436 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 437 dlg.ShowModal() 438 dlg.Destroy()439441 if (self.ctrlVersionS.GetValue()!=""): 442 #listeEtats=self.fenetreMedite.cdos.getListeEtats(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue(),self.ctrlVersionS.GetValue()) 443 listeEtats=self.dgm.getListeEtatsVersion(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue(),self.ctrlVersionS.GetValue()) 444 self.versionFormSelect=SelectionListe(-1,u"S\xe9lectionner un etat",listeEtats,self.ctrlEtatS) 445 self.versionFormSelect.Show(1) 446 else: 447 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 448 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 449 dlg.ShowModal() 450 dlg.Destroy()451453 if (self.ctrlOeuvre.GetValue()!=""): 454 #listeVersions=self.fenetreMedite.cdos.getListeDossiersVersions(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue()) 455 listeVersions=self.dgm.getListeVersionsDG(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue()) 456 self.versionFormSelect=SelectionListe(-1,u"S\xe9lectionner une version" 457 ,listeVersions,self.ctrlVersionC) 458 self.versionFormSelect.Show(1) 459 else: 460 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 461 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 462 dlg.ShowModal() 463 dlg.Destroy()464466 if (self.ctrlVersionC.GetValue()!=""): 467 #listeEtats=self.fenetreMedite.cdos.getListeEtats(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue(),self.ctrlVersionC.GetValue()) 468 listeEtats=self.dgm.getListeEtatsVersion(self.ctrlAuteur.GetValue(),self.ctrlOeuvre.GetValue(),self.ctrlVersionC.GetValue()) 469 self.versionFormSelect=SelectionListe(-1,u"S\xe9lectionner un etat", 470 listeEtats,self.ctrlEtatC) 471 self.versionFormSelect.Show(1) 472 else: 473 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 474 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 475 dlg.ShowModal() 476 dlg.Destroy()477479 if (self.ctrlEtatS.GetValue()!="") & (self.ctrlEtatC.GetValue()!=""): 480 # 1ere etape : rechercher toutes les infos existantes pour le couple de 481 # etats charge 482 liste=self.fenetreMedite.cinfos.rechercherToutesInformations(self.fenetreMedite.getPlanTravail()) 483 if len(liste) == 0: 484 dlg=wx.MessageDialog(self, u"Les informations n'ont pas \xe9t\xe9 trouv\xe9es !!","Attention",wx.OK) 485 dlg.ShowModal() 486 dlg.Destroy() 487 self.Close() 488 # 2eme etape : choix des parametres 489 else: 490 listeParam = [] 491 for i in liste : 492 param = i.getParametres() 493 lpara = '(%s,%s,%s)'%(param.getp1(),param.getp2(),param.getp3()) 494 listeParam.append(lpara) 495 msg = u"Il existe plusieurs informations concernant ces etats.\n Choisissez les param\xe8tres\n (lg pivot, ratio, seuil)" 496 titre = u"S\xe9lectionner les param\xe8tres" 497 self.paramFormSelect=SelectionListe(self.fenetreMedite,msg,titre,listeParam) 498 if self.paramFormSelect.ShowModal() == wx.ID_OK: 499 choix = self.paramFormSelect.GetStringSelection() 500 self.ctrlParam.SetValue(choix) 501 n = 0 502 for p in listeParam : 503 if choix == p : 504 self.parametresChoix=liste[n].getParametres() 505 else : 506 n+=1 507 else: 508 text=u"Vous devez remplir les champs sup\xe9rieurs!!" 509 dlg = wx.MessageDialog(self, text, 'Attention !',wx.OK) 510 dlg.ShowModal() 511 dlg.Destroy()512 513515 if (self.ctrlEtatS.GetValue()!="") & (self.ctrlEtatC.GetValue()!=""): 516 try: 517 msg = 'Voulez-vous vraiment supprimer le comentaire' 518 dlg=wx.MessageDialog(self.fenetreMedite, msg,"Attention!",wx.YES_NO | wx.ICON_EXCLAMATION ) 519 if dlg.ShowModal() ==wx.ID_YES: 520 planTravail = Donnees.planTravail.PlanTravail(self.ctrlAuteur.GetValue(), 521 self.ctrlOeuvre.GetValue(),self.ctrlVersionS.GetValue(), 522 self.ctrlEtatS.GetValue(),self.ctrlVersionC.GetValue(), 523 self.ctrlEtatC.GetValue(),self.parametresChoix) 524 self.fenetreMedite.cinfos.supprimerCommentaire(planTravail) 525 except AuteurNonTrouve, eANT: 526 dlg = wx.MessageDialog(self, u"L'auteur n'a pas \xe9t\xe9 trouv\xe9 !!", 'Attention !',wx.OK) 527 dlg.ShowModal() 528 dlg.Destroy() 529 except OeuvreNonTrouvee, eONT: 530 dlg = wx.MessageDialog(self, u"L'oeuvre n'a pas \xe9t\xe9 trouv\xe9e !!", 'Attention !',wx.OK) 531 dlg.ShowModal() 532 dlg.Destroy() 533 except CommentaireNonTrouve, eCNT: 534 dlg = wx.MessageDialog(self, u"Le commentaire n'a pas \xe9t\xe9 trouv\xe9 !!", 'Attention !',wx.OK) 535 dlg.ShowModal() 536 dlg.Destroy() 537 except InformationsNonTrouvees, eINT: 538 dlg = wx.MessageDialog(self, u"L'application Medite n'a pas \xe9t\xe9 appliqu\xe9 sur ce couple de etats !!", 'Attention !',wx.OK) 539 dlg.ShowModal() 540 dlg.Destroy() 541 self.Close() 542 else: 543 dlg = wx.MessageDialog(self, "Vous devez remplir tous les champs !", 'Attention !',wx.OK) 544 dlg.ShowModal() 545 dlg.Destroy()546
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed Aug 13 15:25:33 2008 | http://epydoc.sourceforge.net |