maintenance: cleanup of switching to editMode

This commit is contained in:
Chris Cochrun 2023-05-17 10:11:06 -05:00
parent a8eec1dee6
commit 3a3c4f9c5c
3 changed files with 7 additions and 9 deletions

View file

@ -47,8 +47,7 @@ Item {
libraryList.currentIndex = songProxyModel.songModel.rowCount() - 1;
if (!editMode)
editMode = true;
editType = "song";
editSwitch(libraryList.currentIndex);
editSwitch(libraryList.currentIndex, "song");
})
deleteItemFunction: (function(rows) {
songProxyModel.deleteSongs(rows)
@ -301,7 +300,7 @@ Item {
showPassiveNotification("newest video: " + video.title);
if (!editMode)
editMode = true;
editSwitch("video", video);
editSwitch(video, "video");
}
function addImg(url) {
@ -313,7 +312,7 @@ Item {
showPassiveNotification("newest image: " + image.title);
if (!editMode)
editMode = true;
editSwitch("image", image);
editSwitch(image, "image");
}
function addPres(url) {
@ -333,7 +332,7 @@ Item {
showPassiveNotification("newest image: " + presentation.title);
if (!editMode)
editMode = true;
editSwitch("presentation", presentation);
editSwitch(presentation, "presentation");
pdf.source = "";
}

View file

@ -349,8 +349,7 @@ ColumnLayout {
libraryList.currentIndex = index;
if (!editMode)
editMode = true;
editType = libraryType;
editSwitch(index);
editSwitch(index, libraryType);
}
}

View file

@ -201,9 +201,9 @@ Controls.Page {
pWindow.loopVideo();
}
function editSwitch(item) {
function editSwitch(item, mode) {
if (editMode) {
switch (editType) {
switch (mode) {
case "song" :
presentation.visible = false;
videoEditor.visible = false;