This commit is contained in:
pablo rodriguez 2022-11-24 21:49:39 +01:00
parent 54a98099d4
commit e916ce2ebf
13 changed files with 24 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -68,6 +68,7 @@ public class commandes {
public static String pathDestination =""; //Pour le mode console uniquement
public static String nomDeLaBranch = "Origin"; //Branche de développement
public static String Command =""; //récupère le texte de la commande dans la console
public static String os = System.getProperty("os.name");
//** setting valeur par défaut
public static String culture = "FR";

View File

@ -50,7 +50,8 @@ public class actSave extends AbstractAction{
if(input==0) {
try {
verificationFichierAnalyse.MiseAJourHashNomFichierAnalyse(commandes.nameSujet);
Run.ecritureNodeEnXML(commandes.sujet, commandes.nameSujet ,commandes.PathFilenameAnalysis,"sujet");
Run.ecritureNodeEnXML(commandes.sujet, commandes.nameSujet,commandes.PathFilenameAnalysis,"sujet");
if(m.find()) {
fenetres.create.getTextNodeSelect().setText("Le fichier \"" + commandes.nameSujet + " a été réenregistré.\n\n"

View File

@ -36,6 +36,7 @@ public class actSaveAs extends AbstractAction{
if(!commandes.nameSujet.isEmpty()) {
file = new File(commandes.PathFilenameAnalysis ); //+ "\\" + utils.filename + ".xml"
System.out.println("commandes.PathFilenameAnalysis="+commandes.PathFilenameAnalysis);
}
@ -50,11 +51,22 @@ public class actSaveAs extends AbstractAction{
verificationFichierAnalyse.MiseAJourHashNomFichierAnalyse(fileToSave.getName());
Run.ecritureNodeEnXML(commandes.sujet, fileToSave.getName(), fileToSave.getPath().substring(0,fileToSave.getPath().lastIndexOf("\\")),"sujet" );
if(commandes.os.contains("Mac")||commandes.os.contains("Li")) {
Run.ecritureNodeEnXML(commandes.sujet, fileToSave.getName(), fileToSave.getPath().substring(0,fileToSave.getPath().lastIndexOf("/")),"sujet" );
}
if(commandes.os.contains("Win")) {
Run.ecritureNodeEnXML(commandes.sujet, fileToSave.getName(), fileToSave.getPath().substring(0,fileToSave.getPath().lastIndexOf("\\")),"sujet" );
}
commandes.nameSujet = fileToSave.getName();
commandes.PathFilenameAnalysis = fileToSave.getPath().substring(0,fileToSave.getPath().lastIndexOf("\\"));
if(commandes.os.contains("Win")) {
commandes.PathFilenameAnalysis = fileToSave.getPath().substring(0,fileToSave.getPath().lastIndexOf("\\"));
}
if(commandes.os.contains("Mac")||commandes.os.contains("Li")) {
commandes.PathFilenameAnalysis = fileToSave.getPath().substring(0,fileToSave.getPath().lastIndexOf("/"));
}
Pattern p = Pattern.compile("[.xml]\\b");
Matcher m = p.matcher(commandes.nameSujet);

View File

@ -60,10 +60,12 @@ public class filechooserXML extends JFileChooser {
private void openFileXML(File file) {
commandes.fichierAnalyseValide=true;
System.out.println("commandes.path="+file.getPath());
if(file.getPath().lastIndexOf("\\")>0) {
if(commandes.os.contains("Win")) {
commandes.path = file.getPath().substring(0,file.getPath().lastIndexOf("\\")); // Sur Windows
}else {
commandes.path = file.getPath(); // Sur mac
}
if(commandes.os.contains("Mac")||commandes.os.contains("Li")) {
commandes.path = file.getPath().substring(0,file.getPath().lastIndexOf("/")); // Sur mac
}
commandes.PathFilenameAnalysis = getCurrentDirectory().getPath();

View File

@ -33,6 +33,7 @@ public class mainApp extends JFrame implements ActionListener{
commandes.console=false;
try {
mainApp window = new mainApp();
System.out.println(commandes.os);
window.frmEvalwriter.setVisible(true);
} catch (Exception e) {
e.printStackTrace();