From 3571133450c9184a2d8eb71dd6de887c89141008 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Fri, 7 Sep 2018 10:18:16 +0200 Subject: [PATCH] pour specifier le logiciel utilise selon l extension quand on clique sur la loupe --- InterfaceQT4/configuration.py | 1 + InterfaceQT4/gereIcones.py | 7 ++++++- MapIdentification/configuration_MapIdentification.py | 2 +- MapIdentification/prefs_MapIdentification.py | 12 +++--------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/InterfaceQT4/configuration.py b/InterfaceQT4/configuration.py index 8110fd46..52cc5f09 100644 --- a/InterfaceQT4/configuration.py +++ b/InterfaceQT4/configuration.py @@ -130,6 +130,7 @@ class configBase(object): self.withXSD=False self.afficheIhm=True self.closeParenthese=False + self.utilParExtensions=False diff --git a/InterfaceQT4/gereIcones.py b/InterfaceQT4/gereIcones.py index 3ba75228..13b31b09 100644 --- a/InterfaceQT4/gereIcones.py +++ b/InterfaceQT4/gereIcones.py @@ -236,7 +236,12 @@ class ContientIcones(object): if sys.platform[0:5]=="linux" : #cmd="xdg-open "+ str(fichier) #changer pour marcher dans l'EDC - cmd="gedit "+ str(fichier) + #cmd="gedit "+ str(fichier) + from os.path import splitext + fileName,extension = splitext(fichier) + if extension in self.parentQt.editor.appliEficas.maConfiguration.utilParExtensions: + cmd=self.parentQt.editor.appliEficas.maConfiguration.utilParExtensions[extension] + " " + str(fichier) + else: cmd="xdg-open "+ str(fichier) os.system(cmd) else : os.startfile(str(fichier)) diff --git a/MapIdentification/configuration_MapIdentification.py b/MapIdentification/configuration_MapIdentification.py index 6a8cc458..10269e71 100644 --- a/MapIdentification/configuration_MapIdentification.py +++ b/MapIdentification/configuration_MapIdentification.py @@ -33,7 +33,7 @@ class CONFIG(configuration.configBase): #----------------------------------- self.labels_user=['catalogues','lang'] - self.labels_eficas=['lang','rep_cata','catalogues'] + self.labels_eficas=['lang','rep_cata','catalogues','utilParExtensions'] self.afficheOptionnelVide=True configuration.configBase.__init__(self,appli,repIni) diff --git a/MapIdentification/prefs_MapIdentification.py b/MapIdentification/prefs_MapIdentification.py index 0eec5d7a..4014ee8e 100644 --- a/MapIdentification/prefs_MapIdentification.py +++ b/MapIdentification/prefs_MapIdentification.py @@ -30,8 +30,9 @@ sys.path[:0]=[INSTALLDIR] # lang indique la langue utilisee pour les chaines d'aide : fr ou ang lang='ang' -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -encoding='iso-8859-1' +# Pour specifier quels logiciels utiliser pour quels suffixes +utilParExtensions = { 'xml' : 'gedit' } + # #typeDeCata='XML' @@ -41,13 +42,6 @@ catalogues=( ('MapIdentification','Material parameters',os.path.join(repIni,'cata_map_cl0d_param.py'),'python','python'), ) -catalogues_exp=( - ('MapIdentification','Experiences plan',os.path.join(repIni,'cata_map_cl0d_exp.py'),'python','python'), -) -catalogues_param=( - ('MapIdentification','Material parameters',os.path.join(repIni,'cata_map_cl0d_param.py'),'python','python'), -) -#nombreDeBoutonParLigne=4 simpleClic=True closeFrameRechercheCommande=True boutonDsMenuBar=False -- 2.39.2