Skip to content

Commit

Permalink
renamed the bottom window mode enums
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Wicenec committed Dec 17, 2024
1 parent 3ac2aa8 commit 2bf7cb2
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/Eagle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4663,9 +4663,9 @@ export namespace Eagle

export enum BottomWindowMode {
None = "None",
ParameterTable = "ParameterTable",
NodeParameterTable = "NodeParameterTable",
GraphConfigsTable = "GraphConfigsTable",
GraphConfigAttributesTable = "GraphConfigAttributesTable",
ConfigParameterTable = "ConfigParameterTable",
GraphErrors = "GraphErrors"
}

Expand Down
2 changes: 1 addition & 1 deletion src/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ export class Field {
}

//check if the node name matches, but only if using the key parameter table modal
if(Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigAttributesTable){
if(Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ConfigParameterTable){
if(Eagle.getInstance().logicalGraph().findNodeById(that.nodeId()).getName().toLowerCase().indexOf(term) >= 0){
result = true
}
Expand Down
4 changes: 2 additions & 2 deletions src/KeyboardShortcut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ export class KeyboardShortcut {
new KeyboardShortcut("open_settings", "Open setting", [new Key("o")], "keydown", true, false, ['menu','options'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.smartToggleModal('settingsModal');}),
new KeyboardShortcut("open_help", "Open Online Documentation", [new Key("h")], "keydown", true, false, ['read me','guide','documentation'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.onlineDocs();}),
new KeyboardShortcut("open_keyboard_shortcut_modal", "Open Keyboard Shortcut Modal", [new Key("k")], "keydown", true, false, ['shortcuts'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.smartToggleModal('shortcutsModal')}),
new KeyboardShortcut("open_parameter_table", "Open Parameter Table Modal", [new Key("t")], "keydown", true, false, ['fields','field','node','table'], KeyboardShortcut.true, KeyboardShortcut.notInStudentMode, KeyboardShortcut.notInStudentMode, (eagle): void => {ParameterTable.toggleTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}),
new KeyboardShortcut("open_graph_attributes_configuration_table", "Open Graph Attributes Configuration Table Modal", [new Key("t", KeyboardShortcut.Modifier.Shift)], "keydown", true, false, ['fields','field','node','graph','table','favourites'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {ParameterTable.toggleTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);}),
new KeyboardShortcut("open_parameter_table", "Open Parameter Table Modal", [new Key("t")], "keydown", true, false, ['fields','field','node','table'], KeyboardShortcut.true, KeyboardShortcut.notInStudentMode, KeyboardShortcut.notInStudentMode, (eagle): void => {ParameterTable.toggleTable(Eagle.BottomWindowMode.NodeParameterTable, ParameterTable.SelectType.Normal);}),
new KeyboardShortcut("open_graph_attributes_configuration_table", "Open Graph Attributes Configuration Table Modal", [new Key("t", KeyboardShortcut.Modifier.Shift)], "keydown", true, false, ['fields','field','node','graph','table','favourites'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {ParameterTable.toggleTable(Eagle.BottomWindowMode.ConfigParameterTable, ParameterTable.SelectType.Normal);}),
new KeyboardShortcut("undo", "Undo", [new Key("z")], "keydown", true, false, ['back','history'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.undo().prevSnapshot(eagle)}),
new KeyboardShortcut("redo", "Redo", [new Key("z", KeyboardShortcut.Modifier.Shift)], "keydown", true, false, ['forward','history'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.undo().nextSnapshot(eagle)}),
new KeyboardShortcut("check_graph", "Check Graph", [new Key("!", KeyboardShortcut.Modifier.Shift)], "keydown", true, false, ['error','errors','fix'], KeyboardShortcut.true, KeyboardShortcut.allowGraphEditing, KeyboardShortcut.allowGraphEditing, (eagle): void => {eagle.showGraphErrors();}),
Expand Down
16 changes: 8 additions & 8 deletions src/ParameterTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class ParameterTable {
return "";
}

if (Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ParameterTable || Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigAttributesTable){
if (Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.NodeParameterTable || Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ConfigParameterTable){
return ParameterTable.selectionParent().getDisplayText() + " - " + ParameterTable.selectionName();
} else {
return "Unknown";
Expand All @@ -74,7 +74,7 @@ export class ParameterTable {
return "";
}

if (Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ParameterTable || Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigAttributesTable){
if (Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.NodeParameterTable || Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ConfigParameterTable){
return ParameterTable.selection();
} else {
return "Unknown";
Expand Down Expand Up @@ -158,10 +158,10 @@ export class ParameterTable {
const eagle: Eagle = Eagle.getInstance();

switch (Setting.findValue(Setting.BOTTOM_WINDOW_MODE)){
case Eagle.BottomWindowMode.ParameterTable:
case Eagle.BottomWindowMode.NodeParameterTable:
return eagle.selectedNode()?.getFields();

case Eagle.BottomWindowMode.GraphConfigAttributesTable:
case Eagle.BottomWindowMode.ConfigParameterTable:
const lg: LogicalGraph = eagle.logicalGraph();
const config: GraphConfig = lg.getActiveGraphConfig();
const displayedFields: Field[] = [];
Expand Down Expand Up @@ -206,7 +206,7 @@ export class ParameterTable {
static getNodeLockedState = (field:Field) : boolean => {
// this handles a special case where EAGLE is displaying the "Graph Configuration Attributes Table"
// all the field names shown in that table should be locked (readonly)
if (Setting.find(Setting.BOTTOM_WINDOW_MODE).value() === Eagle.BottomWindowMode.GraphConfigAttributesTable){
if (Setting.find(Setting.BOTTOM_WINDOW_MODE).value() === Eagle.BottomWindowMode.ConfigParameterTable){
return true;
}

Expand Down Expand Up @@ -381,7 +381,7 @@ export class ParameterTable {
} else {
graphConfig = new GraphConfig();
Utils.requestUserString("New Configuration", "Enter a name for the new configuration", Utils.generateGraphConfigName(graphConfig), false, (completed : boolean, userString : string) : void => {
ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);
ParameterTable.openTable(Eagle.BottomWindowMode.NodeParameterTable, ParameterTable.SelectType.Normal);

if (!completed){
return;
Expand Down Expand Up @@ -416,7 +416,7 @@ export class ParameterTable {

static requestEditConfig(config: GraphConfig): void {
GraphConfigurationsTable.closeModal();
ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);
ParameterTable.openTable(Eagle.BottomWindowMode.ConfigParameterTable, ParameterTable.SelectType.Normal);
}

static requestEditDescriptionInModal(field: Field) : void {
Expand Down Expand Up @@ -569,7 +569,7 @@ export class ParameterTable {

eagle.setSelection(node, Eagle.FileType.Graph)

ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);
ParameterTable.openTable(Eagle.BottomWindowMode.NodeParameterTable, ParameterTable.SelectType.Normal);

setTimeout(function(){
$('#tableRow_'+field.getId()).addClass('highlighted')
Expand Down
12 changes: 6 additions & 6 deletions src/RightClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ export class RightClick {

$('#customContextMenu').append('<h5 class="rightClickDropdownDividerTitle" tabindex="-1">Graph Options</h5>')
$('#customContextMenu').append(`<a class='rightClickPerpetual' onclick="Utils.showModelDataModal('Graph Info', eagle.logicalGraph().fileInfo());">Show Graph Info</a>`)
$('#customContextMenu').append(`<a class='rightClickPerpetual' onclick="ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);">Graph Attributes Table</a>`)
$('#customContextMenu').append(`<a class='rightClickPerpetual' onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ConfigParameterTable, ParameterTable.SelectType.Normal);">Graph Attributes Table</a>`)
$('#customContextMenu').append(`<a class='rightClickPerpetual' onclick="eagle.copyGraphUrl();">Copy Graph URL</a>`)
}else if(passedObjectClass === 'edgeDropCreate'){
if(Setting.findValue(Setting.ALLOW_GRAPH_EDITING)){
Expand Down Expand Up @@ -625,16 +625,16 @@ export class RightClick {

if(Setting.findValue(Setting.ALLOW_PALETTE_EDITING)){
$('#customContextMenu').append(RightClick.getNodeDescriptionDropdown())
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.NodeParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick=eagle.deleteSelection(true,false,false)>Delete</a>')
$('#customContextMenu').append('<a onclick=eagle.addSelectedNodesToPalette("contextMenuRequest")>Add to another palette</a>')
}
}else if(passedObjectClass === 'rightClick_hierarchyNode'){
Eagle.selectedRightClickLocation(Eagle.FileType.Graph)

$('#customContextMenu').append(RightClick.getNodeDescriptionDropdown())
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.RightClick)">Graph Attributes</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.NodeParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ConfigParameterTable, ParameterTable.SelectType.RightClick)">Graph Attributes</a>')
$('#customContextMenu').append('<a onclick=eagle.deleteSelection(true,false,false)>Delete</a>')
if(Setting.findValue(Setting.ALLOW_PALETTE_EDITING)){
$('#customContextMenu').append('<a onclick=eagle.addSelectedNodesToPalette("contextMenuRequest")>Add to palette</a>')
Expand All @@ -643,8 +643,8 @@ export class RightClick {

}else if(passedObjectClass === 'rightClick_graphNode'){
$('#customContextMenu').append(RightClick.getNodeDescriptionDropdown())
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.RightClick)">Graph Attributes</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.NodeParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ConfigParameterTable, ParameterTable.SelectType.RightClick)">Graph Attributes</a>')
$('#customContextMenu').append('<a onclick=eagle.deleteSelection(true,false,false)>Delete</a>')
if (data.isConstruct()){
$('#customContextMenu').append('<a onclick=eagle.deleteSelection(true,false,true)>Delete All</a>')
Expand Down
8 changes: 4 additions & 4 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@
<div class="dragHandle" draggable="true" data-bind="event: { dragstart: SideWindow.bottomWindowAdjustStart, dragend: SideWindow.sideWindowAdjustEnd }"></div>
<div class="tabs">
<div class="wrapper">
<button id="bottomTabParamsTableSwitcher" type="button" class="btn btn-secondary btn-sm" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ParameterTable},click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}, clickBubble: false, eagleTooltip: 'Open Node Parameter Table ' + KeyboardShortcut.idToText('open_parameter_table', true)" data-bs-placement="left">
<button id="bottomTabParamsTableSwitcher" type="button" class="btn btn-secondary btn-sm" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.NodeParameterTable},click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.NodeParameterTable, ParameterTable.SelectType.Normal);}, clickBubble: false, eagleTooltip: 'Open Node Parameter Table ' + KeyboardShortcut.idToText('open_parameter_table', true)" data-bs-placement="left">
<i class="material-icons md-20 clickable">table_chart</i>
</button>
<button id="bottomTabKeyParamsSwitcher" class="btn btn-secondary btn-sm" type="button" data-bs-placement="bottom" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigAttributesTable}, click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal)}, eagleTooltip: `Display Graph Attributes Configuration ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
<button id="bottomTabKeyParamsSwitcher" class="btn btn-secondary btn-sm" type="button" data-bs-placement="bottom" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ConfigParameterTable}, click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.ConfigParameterTable, ParameterTable.SelectType.Normal)}, eagleTooltip: `Display Graph Attributes Configuration ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
<i class="md-20 icon-key_attribute_table clickable"></i>
</button>
<button id="bottomTabGraphConfigurationsSwitcher" class="btn btn-secondary btn-sm" type="button" data-bs-placement="bottom" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigsTable}, click: function(){GraphConfigurationsTable.openTable()}, eagleTooltip: `Display all Graph Configurations ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
Expand All @@ -206,10 +206,10 @@
</div>
<div class="content">
<!-- ko if: $root.getEagleIsReady() -->
<!-- ko if: Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ParameterTable -->
<!-- ko if: Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.NodeParameterTable -->
{% include 'parameter_table.html' %}
<!-- /ko -->
<!-- ko if: Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigAttributesTable -->
<!-- ko if: Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ConfigParameterTable -->
{% include 'config_parameter_table.html' %}
<!-- /ko -->
<!-- ko if: Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigsTable -->
Expand Down
2 changes: 1 addition & 1 deletion templates/inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<div class="col-6 col text-right">
<!-- ko if: Eagle.selectedLocation() == Eagle.FileType.Graph || Setting.findValue(Setting.ALLOW_PALETTE_EDITING) -->
<button type="button" id="openNodeParamsTable" class="btn btn-secondary btn-sm" data-bind="click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}, clickBubble: false, eagleTooltip: 'Open Node Parameter Table ' + KeyboardShortcut.idToText('open_parameter_table', true)" data-bs-placement="left">
<button type="button" id="openNodeParamsTable" class="btn btn-secondary btn-sm" data-bind="click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.NodeParameterTable, ParameterTable.SelectType.Normal);}, clickBubble: false, eagleTooltip: 'Open Node Parameter Table ' + KeyboardShortcut.idToText('open_parameter_table', true)" data-bs-placement="left">
<i class="material-icons md-20 clickable">table_chart</i>
</button>
<!-- /ko -->
Expand Down
2 changes: 1 addition & 1 deletion templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<button id="openGraphModelDataModal" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: function(){Utils.showModelDataModal('Graph Info', $root.logicalGraph().fileInfo());}, eagleTooltip: 'Show Graph Info'">
<i class="material-icons md-18">info</i>
</button>
<button id="openGraphConfigurationTable" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal)}, eagleTooltip: `Display Graph Attributes Configuration ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
<button id="openGraphConfigurationTable" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.ConfigParameterTable, ParameterTable.SelectType.Normal)}, eagleTooltip: `Display Graph Attributes Configuration ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
<i class="md-18 icon-key_attribute_table"></i>
</button>
<button id="copyGraphUrl" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: copyGraphUrl, eagleTooltip: 'Copy Graph Url'" >
Expand Down

0 comments on commit 2bf7cb2

Please sign in to comment.