Add "Import" Tab

Add "Import" Tab
This commit is contained in:
Alezia Kurdis 2024-03-16 14:04:24 -04:00 committed by GitHub
parent 634dc64f8f
commit f50101db8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 39 additions and 1 deletions

View file

@ -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':
@ -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);
}

View file

@ -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':
@ -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);
@ -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);
}