Skip to content

Commit

Permalink
Add "Import" Tab
Browse files Browse the repository at this point in the history
Add "Import" Tab
  • Loading branch information
AleziaKurdis authored Mar 16, 2024
1 parent 634dc64 commit f50101d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
19 changes: 19 additions & 0 deletions scripts/system/create/qml/EditTabView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,22 @@ TabBar {
}
}

EditTabButton {
title: "IMPORT"
active: true
enabled: true
property string originalUrl: ""

property Component visualItem: Component {
WebView {
id: advancedImportWebView
url: Qt.resolvedUrl("../importEntities/html/importEntities.html")
enabled: true
blurOnCtrlShift: false
}
}
}

function fromScript(message) {
switch (message.method) {
case 'selectTab':
Expand Down Expand Up @@ -333,6 +349,9 @@ TabBar {
case 'grid':
editTabView.currentIndex = 3;
break;
case 'import':
editTabView.currentIndex = 4;
break;
default:
console.warn('Attempt to switch to invalid tab:', id);
}
Expand Down
21 changes: 20 additions & 1 deletion scripts/system/create/qml/EditToolsTabView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,22 @@ TabBar {
}
}

EditTabButton {
title: "IMPORT"
active: true
enabled: true
property string originalUrl: ""

property Component visualItem: Component {
WebView {
id: advancedImportWebView
url: Qt.resolvedUrl("../importEntities/html/importEntities.html")
enabled: true
blurOnCtrlShift: false
}
}
}

function fromScript(message) {
switch (message.method) {
case 'selectTab':
Expand All @@ -304,7 +320,7 @@ TabBar {
// Changes the current tab based on tab index or title as input
function selectTab(id) {
if (typeof id === 'number') {
if (id >= tabIndex.create && id <= tabIndex.grid) {
if (id >= tabIndex.create && id <= tabIndex.import) {
editTabView.currentIndex = id;
} else {
console.warn('Attempt to switch to invalid tab:', id);
Expand All @@ -320,6 +336,9 @@ TabBar {
case 'grid':
editTabView.currentIndex = tabIndex.grid;
break;
case 'import':
editTabView.currentIndex = tabIndex.import;
break;
default:
console.warn('Attempt to switch to invalid tab:', id);
}
Expand Down

0 comments on commit f50101d

Please sign in to comment.