Fixed BUG with preset's deleting. Fixed about page

This commit is contained in:
2017-09-06 16:54:58 +02:00
parent e32b467048
commit 4083d09bc9
5 changed files with 24 additions and 12 deletions

View File

@@ -161,7 +161,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.<br><br>
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.<br><br><br>
along with this program. If not, see <a href=\"http://www.gnu.org/licenses\">http://www.gnu.org/licenses.<br><br><br>
All artworks are licensed under a <a href=\"https://creativecommons.org/licenses/by-sa/4.0/\">Creative Commons Attribution-ShareAlike 4.0 International</a>

View File

@@ -29,8 +29,23 @@ Page {
model: listModel
delegate: ListItem {
id: listItem
width: parent.width
ListView.onRemove: animateRemoval(listItem)
function remove() {
remorseAction(qsTr("Deleting"), function() {
settings.deletePreset(presetsList.model.get(index).name)
if (settings.presetsList().length < 1) {
pageStack.popAttached()
} else {
presetsList.model.remove(index)
}
})
}
onClicked: {
settings.preset = presetsList.model.get(index).name
@@ -41,13 +56,7 @@ Page {
MenuItem {
text: qsTr("Delete")
onClicked: {
settings.deletePreset(presetsList.model.get(index).name)
if (settings.presetsList().length < 1) {
pageStack.popAttached()
}
}
onClicked: remove()
}
}