self.download.quit ()
self.download = None
+ @QtCore.Slot (QtCore.QObject)
+ def save_song (self, songItem):
+ if songItem.dirty:
+ print "The song was modified and we should write the file!"
+ print " **** Implement me! ****"
+ else:
+ print "Nothing to write into the file"
+
def get_all_albums (self):
"""
Return a list of AlbumItem objects to build the model
self.__title = title
self.__album = album
self.__artist = artist
+ self.dirty = False
def _title (self):
return self.__title
def _setTitle (self, value):
- self.__title = value
- self.title_changed.emit ()
+ if value != self.__title:
+ self.dirty = True
+ self.__title = value
+ self.title_changed.emit ()
title_changed = QtCore.Signal ()
title = QtCore.Property (unicode, _title, _setTitle, notify=title_changed)
def _album (self):
return self.__album
def _setAlbum (self, value):
- self.__album = value
- self.album_changed.emit ()
+ if value != self.__album:
+ self.dirty = True
+ self.__album = value
+ self.album_changed.emit ()
album_changed = QtCore.Signal ()
album = QtCore.Property (unicode, _album, _setAlbum, notify=album_changed)
def _artist (self):
return self.__artist
def _setArtist (self, value):
+ self.dirty = True
self.__artist = value
self.artist_changed.emit ()
Page {
id: songsPage
- tools: commonTools
+ anchors.fill: parent
ListView {
id: listView
anchors.leftMargin: 6
anchors.rightMargin: 6
model: songModel
- pressDelay: 140
+ //pressDelay: 140
delegate: Item {
id: listItem
id: background
anchors.fill: parent
// Fill page porders
- anchors.leftMargin: -songsPage.anchors.leftMargin
- anchors.rightMargin: -songsPage.anchors.rightMargin
+ //anchors.leftMargin: listItem.leftMargin
+ //anchors.rightMargin: listItem.rightMargin
visible: mouseArea.pressed
source: "image://theme/meegotouch-list-background-pressed-center"
}
MouseArea {
id: mouseArea
- anchors.fill: background
+ anchors.fill: listItem
onClicked: {
console.log ("Well, well, well")
+ editionSheet.song = model.song
+ editionSheet.open ()
}
}
}
}
+ SongEditor { id: editionSheet ; visualParent: songsPage }
+
}