~ahayzen/music-app/remix-add-card-view

« back to all changes in this revision

Viewing changes to common/ExpanderItems/DeletePlaylist.qml

* Remove expander, reorder, swipedelete code
* Use ListItemWithActions from other apps
* Implement actions for add to playlist, add to queue, edit playlist, delete playlist
* Implement reordering. Fixes: https://bugs.launchpad.net/bugs/1311800, https://bugs.launchpad.net/bugs/1338042.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2014 Andrew Hayzen <ahayzen@gmail.com>
3
 
 *                    Daniel Holm <d.holmen@gmail.com>
4
 
 *                    Victor Thompson <victor.thompson@gmail.com>
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; version 3.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 */
18
 
 
19
 
import QtQuick 2.0
20
 
import Ubuntu.Components 0.1
21
 
import Ubuntu.Components.Popups 0.1
22
 
 
23
 
Rectangle {
24
 
    id: deleteColumn
25
 
    color: "transparent"
26
 
    height: styleMusic.common.expandHeight
27
 
    width: units.gu(15)
28
 
    Icon {
29
 
        id: deletePlaylistIcon
30
 
        anchors {
31
 
            left: parent.left
32
 
            verticalCenter: parent.verticalCenter
33
 
        }
34
 
        color: styleMusic.common.white
35
 
        name: "delete"
36
 
        height: styleMusic.common.expandedItem
37
 
        width: styleMusic.common.expandedItem
38
 
    }
39
 
    Label {
40
 
        anchors {
41
 
            left: deletePlaylistIcon.right
42
 
            leftMargin: units.gu(0.5)
43
 
            verticalCenter: parent.verticalCenter
44
 
        }
45
 
        color: styleMusic.common.white
46
 
        fontSize: "small"
47
 
        // TRANSLATORS: this refers to deleting a playlist
48
 
        text: i18n.tr("Delete")
49
 
    }
50
 
    MouseArea {
51
 
        anchors.fill: parent
52
 
        onClicked: {
53
 
            parent.parent.parent.expanderLink.expanderVisible = false;
54
 
            customdebug("Delete")
55
 
            oldPlaylistName = parent.parent.parent.expanderLink.model.name
56
 
            PopupUtils.open(removePlaylistDialog, mainView)
57
 
        }
58
 
    }
59
 
}