diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 57930ca2..17006e12 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -9,9 +9,18 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/properties b/properties
index ca1ec36a..9676afe2 100644
--- a/properties
+++ b/properties
@@ -2,9 +2,10 @@
"Email": "vmk-post@yandex.ru",
"Name": "M",
"ServerUserPassword": "mprit_2011",
- "OfferRegistrationOnStart": false,
+ "OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\BUG",
+ "DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
diff --git a/src/_VisualDVM/NormalProperties.java b/src/_VisualDVM/NormalProperties.java
index 34a7c90a..4b021769 100644
--- a/src/_VisualDVM/NormalProperties.java
+++ b/src/_VisualDVM/NormalProperties.java
@@ -19,11 +19,13 @@ public class NormalProperties extends VisualDVMProperties {
public boolean OfferRegistrationOnStart=true;
//--->
@Expose
- public String Workspace = "";
+ public String Workspace = ""; // место хранения проектов, и загруженных проектов
@Expose
- public String ProjectsSearchDirectory = "";
+ public String ProjectsSearchDirectory = ""; //место последнего открытия проектов
@Expose
- public String VisualiserPath = "";
+ public String DocumentsDirectory = ""; //место сохранения документов,например скрина графа функций или Excel
+ @Expose
+ public String VisualiserPath = ""; //места ручной установки компонентов. ( мб объединить с documents directory?)
@Expose
public String Sapfor_FPath = "";
@Expose
@@ -115,7 +117,7 @@ public class NormalProperties extends VisualDVMProperties {
public String getFieldDescription(String fieldName) {
switch (fieldName) {
case "OfferRegistrationOnStart":
- return "Предложение регистрации при запуске";
+ return "Проверка регистрации";
case "Email":
return "Адрес электронной почты";
case "Kernels":
diff --git a/src/_VisualDVM/Passes/All/CreateGroupFromDirectory.java b/src/_VisualDVM/Passes/All/CreateGroupFromDirectory.java
index 91f6b625..42a50bec 100644
--- a/src/_VisualDVM/Passes/All/CreateGroupFromDirectory.java
+++ b/src/_VisualDVM/Passes/All/CreateGroupFromDirectory.java
@@ -25,7 +25,7 @@ public class CreateGroupFromDirectory extends PublishTests {
}
@Override
protected boolean canStart(Object... args) throws Exception {
- Utils.RestoreSelectedDirectory(directoryChooser);
+ Utils.ChooserProjectsSearchDirectory(directoryChooser);
File dir = directoryChooser.ShowDialog();
if (dir == null) {
Log.Writeln_("Папка не выбрана");
diff --git a/src/_VisualDVM/Passes/All/CreateGroupFromFiles.java b/src/_VisualDVM/Passes/All/CreateGroupFromFiles.java
index 2e8256d6..b8538033 100644
--- a/src/_VisualDVM/Passes/All/CreateGroupFromFiles.java
+++ b/src/_VisualDVM/Passes/All/CreateGroupFromFiles.java
@@ -22,7 +22,7 @@ public class CreateGroupFromFiles extends PublishTests {
}
@Override
protected boolean canStart(Object... args) throws Exception {
- Utils.RestoreSelectedDirectory(fileChooser);
+ Utils.ChooserProjectsSearchDirectory(fileChooser);
Vector files = fileChooser.ShowMultiDialog();
if (files.isEmpty()) {
Log.Writeln_("Не выбрано ни одного файла.");
diff --git a/src/_VisualDVM/Passes/All/CreateTestFromDirectory.java b/src/_VisualDVM/Passes/All/CreateTestFromDirectory.java
index 280e6e34..8d4811e9 100644
--- a/src/_VisualDVM/Passes/All/CreateTestFromDirectory.java
+++ b/src/_VisualDVM/Passes/All/CreateTestFromDirectory.java
@@ -3,12 +3,10 @@ import Common.Passes.Pass;
import Common.Passes.PassException;
import Common.Utils.Utils_;
import Common.Visual.Windows.Dialog.VDirectoryChooser;
-import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.Files.ProjectFile;
-import _VisualDVM.ProjectData.LanguageName;
import _VisualDVM.TestingSystem.Common.Group.Group;
import _VisualDVM.TestingSystem.Common.Test.Test;
import _VisualDVM.Utils;
@@ -44,7 +42,7 @@ public class CreateTestFromDirectory extends Pass {
}
protected boolean selectFiles() {
VDirectoryChooser directoryChooser = new VDirectoryChooser("Выбор домашней папки теста");
- Utils.RestoreSelectedDirectory(directoryChooser);
+ Utils.ChooserProjectsSearchDirectory(directoryChooser);
dir = directoryChooser.ShowDialog();
if (dir == null) {
Log.Writeln_("Папка не выбрана.");
diff --git a/src/_VisualDVM/Passes/All/CreateTestFromSelectedFiles.java b/src/_VisualDVM/Passes/All/CreateTestFromSelectedFiles.java
index 5cf6afd7..3f5f1a49 100644
--- a/src/_VisualDVM/Passes/All/CreateTestFromSelectedFiles.java
+++ b/src/_VisualDVM/Passes/All/CreateTestFromSelectedFiles.java
@@ -12,7 +12,7 @@ public class CreateTestFromSelectedFiles extends CreateTestFromDirectory {
@Override
protected boolean selectFiles() {
VFileChooser files_chooser = new VFileChooser("Выбор файлов");
- Utils.RestoreSelectedDirectory(files_chooser);
+ Utils.ChooserProjectsSearchDirectory(files_chooser);
Vector res = files_chooser.ShowMultiDialog();
dir = files_chooser.getCurrentDirectory();
if (res.isEmpty()) {
diff --git a/src/_VisualDVM/Passes/All/CreateTestsFromFiles.java b/src/_VisualDVM/Passes/All/CreateTestsFromFiles.java
index 6d20b84f..bf69fc95 100644
--- a/src/_VisualDVM/Passes/All/CreateTestsFromFiles.java
+++ b/src/_VisualDVM/Passes/All/CreateTestsFromFiles.java
@@ -19,7 +19,7 @@ public class CreateTestsFromFiles extends PublishTests {
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.testingServer.db.groups.getUI().canModifyCurrent(Log)) {
- Utils.RestoreSelectedDirectory(fileChooser);
+ Utils.ChooserProjectsSearchDirectory(fileChooser);
Vector files = fileChooser.ShowMultiDialog();
if (files.isEmpty()) {
Log.Writeln_("Не выбрано ни одного файла.");
diff --git a/src/_VisualDVM/Passes/All/ExportDVMPackageToExcel.java b/src/_VisualDVM/Passes/All/ExportDVMPackageToExcel.java
index 5f42ee88..9a41deec 100644
--- a/src/_VisualDVM/Passes/All/ExportDVMPackageToExcel.java
+++ b/src/_VisualDVM/Passes/All/ExportDVMPackageToExcel.java
@@ -82,11 +82,13 @@ public class ExportDVMPackageToExcel extends Pass> {
}
if (!Log.isEmpty())
return false;
+ Utils.ChooseDocumentsDirectory(directoryChooser);
dir = directoryChooser.ShowDialog();
if (dir == null) {
Log.Writeln_("Папка не выбрана.");
return false;
}
+ Global.mainModule.getPass(PassCode.UpdateProperty).Do("DocumentsDirectory", dir.getAbsolutePath());
res = new File(dir, Utils_.getDateName("packages") + ".xls");
return true;
}
diff --git a/src/_VisualDVM/Passes/All/OpenCurrentProject.java b/src/_VisualDVM/Passes/All/OpenCurrentProject.java
index 8bacd099..c82306a3 100644
--- a/src/_VisualDVM/Passes/All/OpenCurrentProject.java
+++ b/src/_VisualDVM/Passes/All/OpenCurrentProject.java
@@ -40,7 +40,7 @@ public class OpenCurrentProject extends Pass {
dir = null;
target = null;
if (args.length == 0) {
- Utils.RestoreSelectedDirectory(directoryChooser);
+ Utils.ChooserProjectsSearchDirectory(directoryChooser);
dir = directoryChooser.ShowDialog();
} else {
Object arg = args[0];
diff --git a/src/_VisualDVM/Passes/All/ReplaceTestsFromFiles.java b/src/_VisualDVM/Passes/All/ReplaceTestsFromFiles.java
index 61e1ae03..8fa202d1 100644
--- a/src/_VisualDVM/Passes/All/ReplaceTestsFromFiles.java
+++ b/src/_VisualDVM/Passes/All/ReplaceTestsFromFiles.java
@@ -34,7 +34,7 @@ public class ReplaceTestsFromFiles extends TestingServerPass> {
return false;
group = Global.testingServer.db.groups.getUI().getCurrent();
//--->>>
- Utils.RestoreSelectedDirectory(fileChooser);
+ Utils.ChooserProjectsSearchDirectory(fileChooser);
Vector files = fileChooser.ShowMultiDialog();
//----------------ROLE is-----------------------------------------------
//--
diff --git a/src/_VisualDVM/Passes/All/SaveGraph.java b/src/_VisualDVM/Passes/All/SaveGraph.java
index e8274872..5f0f5cd2 100644
--- a/src/_VisualDVM/Passes/All/SaveGraph.java
+++ b/src/_VisualDVM/Passes/All/SaveGraph.java
@@ -3,8 +3,11 @@ import Common.Passes.Pass;
import Common.Passes.PassException;
import Common.Utils.Utils_;
import Common.Visual.UI;
+import Common.Visual.Windows.Dialog.VDirectoryChooser;
import _VisualDVM.Global;
+import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphForm;
+import _VisualDVM.Utils;
import com.mxgraph.io.mxCodec;
import com.mxgraph.util.mxCellRenderer;
import com.mxgraph.util.mxXmlUtils;
@@ -19,6 +22,7 @@ import java.io.FileOutputStream;
import java.net.URLEncoder;
import java.nio.file.Paths;
public class SaveGraph extends Pass {
+ VDirectoryChooser directoryChooser = new VDirectoryChooser("Выбор папки для сохранения скриншота графа функций");
FunctionsGraphForm graphForm = null;
@Override
protected boolean needsAnimation() {
@@ -35,14 +39,19 @@ public class SaveGraph extends Pass {
Log.Writeln_("Сначала отобразите граф");
if (Global.mainModule.getProject().functionsGraph.isEmpty())
Log.Writeln_("Граф процедур пуст");
- return Log.isEmpty();
+ Utils.ChooseDocumentsDirectory(directoryChooser);
+ File dir = directoryChooser.ShowDialog();
+ if (dir == null) {
+ Log.Writeln_("Папка не выбрана.");
+ }else {
+ Global.mainModule.getPass(PassCode.UpdateProperty).Do("DocumentsDirectory", dir.getAbsolutePath());
+ target = new File(dir, Utils_.getDateName("Graph")+".png");
+ return true;
+ }
+ return false;
}
@Override
protected void body() throws Exception {
- target = Paths.get(Global.visualiser.getWorkspace().getAbsolutePath(), "Graph.png").toFile();
- if (target.exists() && !target.delete())
- throw new PassException("Не удается удалить предыдущий файл " + Utils_.Brackets(target.getAbsolutePath()));
- //-
mxGraph graph = graphForm.getControl().getGraph();
BufferedImage image = mxCellRenderer.createBufferedImage(graph,
null, 1, Color.WHITE,
@@ -62,6 +71,16 @@ public class SaveGraph extends Pass {
}
@Override
protected void showDone() throws Exception {
- UI.Info("Граф успешно сохранен в файл: " + Utils_.Brackets(target.getAbsolutePath()));
+ if (UI.Question("Изображение графа процедур успешно сохранено\n"
+ + "в папке " + Utils_.Brackets(target.getParent())+"\n"
+ + "под именем "+Utils_.Brackets(target.getName())+"\n"
+ + "Открыть его"
+ )){
+ try {
+ Desktop.getDesktop().open(target);
+ } catch (Exception ex) {
+ Utils_.MainLog.PrintException(ex);
+ }
+ };
}
}
diff --git a/src/_VisualDVM/Passes/PassCode.java b/src/_VisualDVM/Passes/PassCode.java
index bc2303e5..3efd7ccf 100644
--- a/src/_VisualDVM/Passes/PassCode.java
+++ b/src/_VisualDVM/Passes/PassCode.java
@@ -82,7 +82,7 @@ public enum PassCode implements PassCode_ {
SPF_ExpressionSubstitution,
SPF_InsertDvmhRegions,
SPF_StatisticAnalyzer,
- //-
+ //- Проводнике
CombineFiles,
EraseBadSymbols,
CopyProject,
diff --git a/src/_VisualDVM/Utils.java b/src/_VisualDVM/Utils.java
index 6a220bf9..fa9fe003 100644
--- a/src/_VisualDVM/Utils.java
+++ b/src/_VisualDVM/Utils.java
@@ -600,11 +600,16 @@ public class Utils {
}
return res;
}
- public static void RestoreSelectedDirectory(VFileChooser_ directoryChooser) {
+ public static void ChooserProjectsSearchDirectory(VFileChooser_ directoryChooser) {
String last_dir_home = Global.normalProperties.ProjectsSearchDirectory;
if (!last_dir_home.isEmpty())
directoryChooser.SetCurrentDirectory(last_dir_home);
}
+ public static void ChooseDocumentsDirectory(VFileChooser_ directoryChooser) {
+ String last_dir_home = Global.normalProperties.DocumentsDirectory;
+ if (!last_dir_home.isEmpty())
+ directoryChooser.SetCurrentDirectory(last_dir_home);
+ }
public static void ClearProjectData(File project_home) throws Exception {
Utils.deleteFilesByExtensions(project_home, "dep", "proj");
File project_data = new File(project_home, Constants.data);
diff --git a/src/_VisualDVM/Visual/Windows/MainForm.java b/src/_VisualDVM/Visual/Windows/MainForm.java
index 16b96c80..ec0c6c30 100644
--- a/src/_VisualDVM/Visual/Windows/MainForm.java
+++ b/src/_VisualDVM/Visual/Windows/MainForm.java
@@ -265,7 +265,7 @@ public class MainForm extends Form implements MainWindow {
@Override
public void ShowUndefinedTabs()
{
- //ничего не делаем. лишних панелей и так нет.
+ //ничего не делаем. лишних панелей и так нет. экспорт
}
@Override
public void ShowUserTabs() {