no message
This commit is contained in:
@@ -8,7 +8,6 @@ public enum SettingName {
|
||||
//--------------
|
||||
FastAccessPassesCount,
|
||||
LastOpenedProjectsCount,
|
||||
Workspace,
|
||||
ShowFullArraysDeclarations,
|
||||
ShowFullTabsNames,
|
||||
LocalMakePathWindows,
|
||||
@@ -65,8 +64,6 @@ public enum SettingName {
|
||||
return "Показывать полные имена вкладок";
|
||||
case ShowFullArraysDeclarations:
|
||||
return "Показывать развернутый список объявлений массивов";
|
||||
case Workspace:
|
||||
return "Рабочее пространство визуализатора";
|
||||
case STATIC_SHADOW_ANALYSIS:
|
||||
return "Оптимизация теневых обменов";
|
||||
case STATIC_PRIVATE_ANALYSIS:
|
||||
|
||||
@@ -36,7 +36,6 @@ public class SettingsDBTable extends DBTable<SettingName, DBSetting> {
|
||||
AddSetting(new DBSetting(SettingName.ShowFullTabsNames, 0, SettingType.SapforFlag, ComponentType.Visualiser));
|
||||
AddSetting(new DBSetting(SettingName.FastAccessPassesCount, 5, SettingType.IntField, ComponentType.Visualiser));
|
||||
AddSetting(new DBSetting(SettingName.LastOpenedProjectsCount, 5, SettingType.IntField, ComponentType.Visualiser));
|
||||
AddSetting(new DBSetting(SettingName.Workspace, "", SettingType.StringField, ComponentType.Visualiser));
|
||||
AddSetting(new DBSetting(SettingName.Kernels, Utils.getHalfKernels(), SettingType.IntField, ComponentType.Visualiser));
|
||||
if (Utils_.isWindows())
|
||||
AddSetting(new DBSetting(SettingName.LocalMakePathWindows, "C:\\MinGW\\msys\\1.0\\bin\\make.exe", SettingType.StringField, ComponentType.Visualiser));
|
||||
|
||||
@@ -48,6 +48,8 @@ public class GlobalProperties {
|
||||
@Expose
|
||||
public String BackupWorkspace = "_sapfor_x64_backups";
|
||||
@Expose
|
||||
public String Workspace ="";
|
||||
@Expose
|
||||
public int BackupHour = 5;
|
||||
@Expose
|
||||
public int BackupMinute = 0;
|
||||
@@ -167,6 +169,8 @@ public class GlobalProperties {
|
||||
//-----------------
|
||||
public String getFieldDescription(String fieldName) {
|
||||
switch (fieldName) {
|
||||
case "Workspace":
|
||||
return "Рабочее пространство визуализатора";
|
||||
case "BugReportsAgeLimit":
|
||||
return "Срок хранения отчетов об ошибках (месяцы)";
|
||||
case "ExtensionsOn":
|
||||
@@ -251,6 +255,7 @@ public class GlobalProperties {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//выкинуть(?)
|
||||
public void switchAndUpdateFlag(String name) {
|
||||
try {
|
||||
Field field = getClass().getField(name);
|
||||
@@ -268,6 +273,7 @@ public class GlobalProperties {
|
||||
return Paths.get(System.getProperty("user.dir"), "properties").toFile();
|
||||
}
|
||||
//-----------------
|
||||
//выкинуть.
|
||||
public void addFlagMenuItem(JMenu menu, String fieldName) {
|
||||
JMenuItem menu_item = new StableMenuItem(getFieldDescription(fieldName),
|
||||
getFlag(fieldName) ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png");
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.Windows.Dialog.SliderNumberForm;
|
||||
import Common.Visual.Windows.Dialog.VDirectoryChooser;
|
||||
import Common.Visual.Windows.Dialog.VFileChooser;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalProperties;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
public class UpdateProperty extends Pass<Object> {
|
||||
//todo в дальнейшем, все настройки перевести в properties, и перенести сюда функционал UpdateSetting (?)
|
||||
@@ -20,6 +23,8 @@ public class UpdateProperty extends Pass<Object> {
|
||||
oldValue = field.get(Global.properties);
|
||||
newValue = null;
|
||||
SliderNumberForm sliderNumberForm = new SliderNumberForm();
|
||||
VDirectoryChooser directoryChooser = new VDirectoryChooser("");
|
||||
VFileChooser fileChooser = new VFileChooser("", "exe");
|
||||
//-
|
||||
if (args.length==1){
|
||||
switch (name){
|
||||
@@ -27,6 +32,14 @@ public class UpdateProperty extends Pass<Object> {
|
||||
if (sliderNumberForm.ShowDialog(description, oldValue, 1, 12))
|
||||
newValue=sliderNumberForm.Result;
|
||||
break;
|
||||
case "Workspace":
|
||||
directoryChooser.setTitle(description);
|
||||
directoryChooser.SetCurrentDirectory(
|
||||
Global.properties.Workspace.isEmpty() ? Global.ProjectsDirectory : new File(Global.properties.Workspace));
|
||||
File dir = directoryChooser.ShowDialog();
|
||||
if (dir != null)
|
||||
newValue = dir.getAbsolutePath();
|
||||
break;
|
||||
}
|
||||
}else
|
||||
newValue = args[1];
|
||||
|
||||
@@ -31,14 +31,6 @@ public class UpdateSetting extends Pass<DBSetting> {
|
||||
break;
|
||||
case StringField:
|
||||
switch (target.Name) {
|
||||
case Workspace:
|
||||
directoryChooser.setTitle(target.Name.getDescription());
|
||||
directoryChooser.SetCurrentDirectory(
|
||||
target.Value.isEmpty() ? Global.ProjectsDirectory : new File(target.Value));
|
||||
File dir = directoryChooser.ShowDialog();
|
||||
if (dir != null)
|
||||
NewValue = dir.getAbsolutePath();
|
||||
break;
|
||||
case LocalMakePathWindows:
|
||||
fileChooser.setTitle(target.Name.getDescription());
|
||||
File file = fileChooser.ShowDialog();
|
||||
|
||||
@@ -36,7 +36,7 @@ public abstract class OpenSapforVersionPass extends Pass<SapforVersion_json> {
|
||||
protected void body() throws Exception {
|
||||
SapforTask task = target.task;
|
||||
ShowMessage1("Построение дерева версий и создание баз данных...");
|
||||
File rootHome = Paths.get((Global.mainModule.getDb()).settings.get(SettingName.Workspace).Value,
|
||||
File rootHome = Paths.get(Global.properties.Workspace,
|
||||
Utils_.getDateName(task.test_description)).toFile();
|
||||
for (SapforVersion_json version_json : task.versions) {
|
||||
ShowMessage2(version_json.version);
|
||||
|
||||
@@ -73,13 +73,12 @@ public class Visualiser extends Component {
|
||||
System.exit(0);
|
||||
}
|
||||
public File getWorkspace() {
|
||||
if (!(Global.mainModule.getDb()).settings.get(SettingName.Workspace).toString().isEmpty()) {
|
||||
File workspace = new File(Global.mainModule.getDb().settings.get(SettingName.Workspace).toString());
|
||||
if (!Global.properties.Workspace.isEmpty()) {
|
||||
File workspace = new File(Global.properties.Workspace);
|
||||
if (workspace.exists())
|
||||
return workspace;
|
||||
else
|
||||
Global.mainModule.getPass(PassCode.UpdateSetting).Do(
|
||||
SettingName.Workspace, "");
|
||||
Global.mainModule.getPass(PassCode.UpdateProperty).Do("Workspace", "");
|
||||
}
|
||||
return Global.ProjectsDirectory;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class VisualiserSettingsMenu extends VisualiserMenu {
|
||||
}
|
||||
add(new SynchronizationSettingsMenu());
|
||||
add(new VersionsComparisonMenu());
|
||||
add((Global.mainModule.getDb()).settings.get(SettingName.Workspace).getMenuItem());
|
||||
add(Global.properties.getMenuItem("Workspace"));
|
||||
add(Global.properties.getMenuItem("BugReportsAgeLimit"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user