промежуточный. в процессе рефакторинга настроек.
This commit is contained in:
9
.idea/workspace.xml
generated
9
.idea/workspace.xml
generated
@@ -7,16 +7,15 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/VersionsComparisonMenu.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Settings/SettingName.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Settings/SettingName.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Settings/SettingsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Settings/SettingsDBTable.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalProperties.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Utils.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteDownloadedBugReports.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteDownloadedBugReports.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/GetOldBugReports.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/GetOldBugReports.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/UpdateSetting.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/UpdateSetting.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/VisualiserSettingsMenu/VisualiserSettingsMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/VisualiserSettingsMenu/VisualiserSettingsMenu.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/SapforVersionsComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/SapforVersionsComparisonForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/TasksComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/TasksComparisonForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/VersionsComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/VersionsComparisonForm.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
13
properties
13
properties
@@ -19,8 +19,8 @@
|
||||
"BackupMinute": 0,
|
||||
"EmailAdminsOnStart": false,
|
||||
"AutoUpdateSearch": true,
|
||||
"AutoBugReportsLoad": true,
|
||||
"AutoTestsLoad": true,
|
||||
"AutoBugReportsLoad": false,
|
||||
"AutoTestsLoad": false,
|
||||
"ConfirmPassesStart": true,
|
||||
"ShowPassesDone": true,
|
||||
"FocusPassesResult": true,
|
||||
@@ -39,13 +39,14 @@
|
||||
"CheckTestingIntervalSeconds": 10,
|
||||
"EmailOnTestingProgress": false,
|
||||
"eraseTestingWorkspaces": true,
|
||||
"lastMachineId": 1,
|
||||
"lastUserId": 17,
|
||||
"lastCompilerId": -1,
|
||||
"lastMachineId": 13,
|
||||
"lastUserId": 34,
|
||||
"lastCompilerId": 52,
|
||||
"RegisterOn": false,
|
||||
"SpacesOn": false,
|
||||
"EmptyLinesOn": false,
|
||||
"FortranWrapsOn": false,
|
||||
"ExtensionsOn": false,
|
||||
"ComparsionDiffMergeOn": true
|
||||
"ComparsionDiffMergeOn": true,
|
||||
"BugReportsAgeLimit": 3
|
||||
}
|
||||
@@ -19,7 +19,6 @@ public enum SettingName {
|
||||
DVMConvertationOptions,
|
||||
Kernels,
|
||||
Email, //для тестирования. потом.
|
||||
BugReportsAgeLimit,
|
||||
//--
|
||||
//<editor-fold desc="Настройки сапфора. должны быть подряд!">
|
||||
STATIC_SHADOW_ANALYSIS,
|
||||
@@ -48,8 +47,6 @@ public enum SettingName {
|
||||
}
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case BugReportsAgeLimit:
|
||||
return "Срок хранения отчетов об ошибках (месяцы)";
|
||||
case SaveModifications:
|
||||
return "Сохранять копию исходной версии при преобразованиях";
|
||||
case DVMConvertationOptions:
|
||||
|
||||
@@ -69,8 +69,6 @@ public class SettingsDBTable extends DBTable<SettingName, DBSetting> {
|
||||
AddSetting(new DBSetting(SettingName.DVMConvertationOptions, " ", SettingType.StringField, ComponentType.SapforOptions));
|
||||
AddSetting(new DBSetting(SettingName.SaveModifications, 1, SettingType.SapforFlag, ComponentType.SapforOptions));
|
||||
//</editor-fold>
|
||||
//-
|
||||
AddSetting(new DBSetting(SettingName.BugReportsAgeLimit, 2, SettingType.IntField, ComponentType.Visualiser));
|
||||
}
|
||||
public Vector<DBSetting> getSettingsByOwner(ComponentType owner) {
|
||||
return Data.values().stream().filter(setting -> setting.Owner.equals(owner)).collect(Collectors.toCollection(Vector::new));
|
||||
|
||||
@@ -2,6 +2,7 @@ package _VisualDVM;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.StableMenuItem;
|
||||
import Common.Visual.Windows.Dialog.SliderNumberForm;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
@@ -98,17 +99,19 @@ public class GlobalProperties {
|
||||
public int lastCompilerId = CommonConstants.Nan;
|
||||
//--
|
||||
@Expose
|
||||
public boolean RegisterOn=false;
|
||||
public boolean RegisterOn = false;
|
||||
@Expose
|
||||
public boolean SpacesOn=false;
|
||||
public boolean SpacesOn = false;
|
||||
@Expose
|
||||
public boolean EmptyLinesOn=false;
|
||||
public boolean EmptyLinesOn = false;
|
||||
@Expose
|
||||
public boolean FortranWrapsOn=false;
|
||||
public boolean FortranWrapsOn = false;
|
||||
@Expose
|
||||
public boolean ExtensionsOn=false;
|
||||
public boolean ExtensionsOn = false;
|
||||
@Expose
|
||||
public boolean ComparsionDiffMergeOn=false;
|
||||
public boolean ComparsionDiffMergeOn = false;
|
||||
@Expose
|
||||
public int BugReportsAgeLimit = 2;
|
||||
public GlobalProperties(GlobalProperties p) {
|
||||
super();
|
||||
Mode = p.Mode;
|
||||
@@ -160,6 +163,8 @@ public class GlobalProperties {
|
||||
//-----------------
|
||||
public String getFieldDescription(String fieldName) {
|
||||
switch (fieldName) {
|
||||
case "BugReportsAgeLimit":
|
||||
return "Срок хранения отчетов об ошибках (месяцы)";
|
||||
case "ExtensionsOn":
|
||||
return "Учитывать расширения файлов";
|
||||
case "FortranWrapsOn":
|
||||
@@ -197,16 +202,6 @@ public class GlobalProperties {
|
||||
}
|
||||
}
|
||||
//-----------------
|
||||
public void addFlagMenuItem(JMenu menu, String fieldName) {
|
||||
JMenuItem menu_item = new StableMenuItem(getFieldDescription(fieldName),
|
||||
getFlag(fieldName) ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png");
|
||||
//-
|
||||
menu_item.addActionListener(e -> {
|
||||
if (Global.mainModule.getPass(PassCode.UpdateProperty).Do(fieldName, !getFlag(fieldName)))
|
||||
menu_item.setIcon(Utils_.getIcon(getFlag(fieldName) ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
||||
});
|
||||
menu.add(menu_item);
|
||||
}
|
||||
public boolean getFlag(String fieldName) {
|
||||
boolean field = false;
|
||||
try {
|
||||
@@ -268,4 +263,35 @@ public class GlobalProperties {
|
||||
public File getFile() {
|
||||
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");
|
||||
//-
|
||||
menu_item.addActionListener(e -> {
|
||||
if (Global.mainModule.getPass(PassCode.UpdateProperty).Do(fieldName, !getFlag(fieldName)))
|
||||
menu_item.setIcon(Utils_.getIcon(getFlag(fieldName) ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
||||
});
|
||||
menu.add(menu_item);
|
||||
}
|
||||
public void addIntSliderMenuItem(JMenu menu, String fieldName, int min, int max) {
|
||||
try {
|
||||
String description = getFieldDescription(fieldName);
|
||||
Object oldValue = this.getClass().getField(fieldName).get(this);
|
||||
JMenuItem menu_item = new StableMenuItem(description + " : " + oldValue);
|
||||
//-
|
||||
menu_item.addActionListener(e -> {
|
||||
SliderNumberForm f = new SliderNumberForm();
|
||||
if (f.ShowDialog(description, oldValue, min, max)) {
|
||||
int newValue = f.Result;
|
||||
if (Global.mainModule.getPass(PassCode.UpdateProperty).Do(fieldName, newValue)) {
|
||||
menu_item.setText(description + " : " + newValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
menu.add(menu_item);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class DeleteDownloadedBugReports extends Pass<DirInfosDataSet> {
|
||||
target = (DirInfosDataSet) Global.mainModule.getPass(PassCode.GetOldBugReports).target;
|
||||
if (target.Data.isEmpty()) {
|
||||
Log.Writeln_("Не найдено отчетов, не использовавшихся " +
|
||||
(Global.mainModule.getDb()).settings.get(SettingName.BugReportsAgeLimit).toInt32() +
|
||||
Global.properties.BugReportsAgeLimit +
|
||||
" месяцев и более!");
|
||||
return false;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class DeleteDownloadedBugReports extends Pass<DirInfosDataSet> {
|
||||
}
|
||||
};
|
||||
if (dialog.ShowDialog("Найдено " + target.size() + " отчетов, не использовавшихся " +
|
||||
(Global.mainModule.getDb()).settings.get(SettingName.BugReportsAgeLimit).toInt32() +
|
||||
Global.properties.BugReportsAgeLimit +
|
||||
" месяцев и более. Удалить?")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class GetOldBugReports extends Pass<DirInfosDataSet> {
|
||||
//---
|
||||
Calendar c = new GregorianCalendar();
|
||||
c.setTimeInMillis(System.currentTimeMillis());
|
||||
c.add(Calendar.MONTH, -(Global.mainModule.getDb()).settings.get(SettingName.BugReportsAgeLimit).toInt32());
|
||||
c.add(Calendar.MONTH, -Global.properties.BugReportsAgeLimit);
|
||||
Date date = c.getTime();
|
||||
System.out.println(date);
|
||||
long border = date.getTime();
|
||||
|
||||
@@ -73,13 +73,6 @@ public class UpdateSetting extends Pass<DBSetting> {
|
||||
if (f_.ShowDialog(target.Name.getDescription()))
|
||||
NewValue = String.valueOf(f_.Result);
|
||||
break;
|
||||
case BugReportsAgeLimit:
|
||||
min = 1;
|
||||
max = 12;
|
||||
SliderNumberForm fffff = new SliderNumberForm();
|
||||
if (fffff.ShowDialog(target.Name.getDescription(), target.toInt32(), min, max))
|
||||
NewValue = String.valueOf(fffff.Result);
|
||||
break;
|
||||
case FastAccessPassesCount:
|
||||
min = 5;
|
||||
max = 15;
|
||||
|
||||
@@ -30,6 +30,6 @@ public class VisualiserSettingsMenu extends VisualiserMenu {
|
||||
add(new SynchronizationSettingsMenu());
|
||||
add(new VersionsComparisonMenu());
|
||||
add((Global.mainModule.getDb()).settings.get(SettingName.Workspace).getMenuItem());
|
||||
add((Global.mainModule.getDb()).settings.get(SettingName.BugReportsAgeLimit).getMenuItem());
|
||||
Global.properties.addIntSliderMenuItem(this, "BugReportsAgeLimit",1,12);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user