завершение обновления с настройками
This commit is contained in:
2025-01-17 01:35:43 +03:00
parent 01da3b3a70
commit 28fe6ee235
8 changed files with 135 additions and 18 deletions

View File

@@ -11,6 +11,8 @@ import _VisualDVM.Constants;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.DBLastProject.DBLastProject;
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.DBArray.DBArray;
import _VisualDVM.ProjectData.Files.DBProjectFile;
@@ -146,9 +148,28 @@ public class db_project_info extends DBObject {
public LinkedHashMap<String, DBProjectFile> allIncludes = new LinkedHashMap<>();
DBLastProject info = null; //обновляется при открытии проекта.
public SapforProperties sapforProperties=null;
public void SynchronizeSapforProperties() {
public void SynchronizeSapforProperties() throws Exception{
System.out.println("Syncronize Sapfor Properties...");
sapforProperties = Utils_.SynschronizeProperties(getPropertiesFile(), SapforProperties.class);
if (sapforProperties==null) {
File propertiesFile = getPropertiesFile();
System.out.println("propertiesFile="+propertiesFile.getAbsolutePath());
if (propertiesFile.exists()) {
System.out.println("properties file found.");
sapforProperties = Utils_.ReadProperties(propertiesFile,SapforProperties.class);
} else {
System.out.println("properties file not found. try get default profile..");
SapforProfile defaultProfile = Global.mainModule.getDb().getDefaultSapforProfile();
if (defaultProfile == null) {
System.out.println("Default profile not found!");
sapforProperties = Utils_.ReadProperties(propertiesFile,SapforProperties.class);
} else {
System.out.println("Default profile is " + defaultProfile.description);
sapforProperties = new SapforProperties(getPropertiesFile());
sapforProperties.applyProfile(Global.mainModule.getDb().getVectorByFK(defaultProfile, SapforProfileSetting.class));
sapforProperties.Update();
}
}
}else System.out.println("properties object found");
}
public File getPropertiesFile(){
return new File(getDataDirectory(), "properties");
@@ -228,7 +249,6 @@ public class db_project_info extends DBObject {
db.Connect();
db.prepareTablesStatements();
db.Synchronize();
SynchronizeSapforProperties();
}
public void Close() throws Exception {
db.Disconnect();