Add "edit playlist" option
This commit is contained in:
parent
53d9c2a855
commit
65f6f4b4b9
@ -656,6 +656,7 @@ guiIcons = ['resources/accept.png', 'resources/arrow_undo.png', 'resources/clock
|
|||||||
'resources/world_explore.png', 'resources/application_get.png', 'resources/cog.png', 'resources/arrow_switch.png',
|
'resources/world_explore.png', 'resources/application_get.png', 'resources/cog.png', 'resources/arrow_switch.png',
|
||||||
'resources/film_go.png', 'resources/world_go.png', 'resources/arrow_refresh.png', 'resources/bullet_right_grey.png',
|
'resources/film_go.png', 'resources/world_go.png', 'resources/arrow_refresh.png', 'resources/bullet_right_grey.png',
|
||||||
'resources/film_folder_edit.png',
|
'resources/film_folder_edit.png',
|
||||||
|
'resources/film_edit.png',
|
||||||
'resources/shield_edit.png',
|
'resources/shield_edit.png',
|
||||||
'resources/world_add.png', 'resources/film_add.png', 'resources/delete.png', 'resources/spinner.mng'
|
'resources/world_add.png', 'resources/film_add.png', 'resources/delete.png', 'resources/spinner.mng'
|
||||||
]
|
]
|
||||||
|
|||||||
BIN
resources/film_edit.png
Normal file
BIN
resources/film_edit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 855 B |
@ -285,6 +285,7 @@ de = {
|
|||||||
"addfolder-label" : u"Add folder", # TODO: Translate
|
"addfolder-label" : u"Add folder", # TODO: Translate
|
||||||
|
|
||||||
"adduris-msgbox-label" : u"Add URLs to playlist (one per line)", # TODO: Translate
|
"adduris-msgbox-label" : u"Add URLs to playlist (one per line)", # TODO: Translate
|
||||||
|
"editplaylist-msgbox-label": u"Set playlist (one per line)", # TODO: Translate
|
||||||
"trusteddomains-msgbox-label" : u"Domains it is okay to automatically switch to (one per line)", # TODO: Translate
|
"trusteddomains-msgbox-label" : u"Domains it is okay to automatically switch to (one per line)", # TODO: Translate
|
||||||
|
|
||||||
"createcontrolledroom-msgbox-label" : u"Zentral gesteuerten Raum erstellen",
|
"createcontrolledroom-msgbox-label" : u"Zentral gesteuerten Raum erstellen",
|
||||||
@ -398,6 +399,7 @@ de = {
|
|||||||
"undoplaylist-menu-label" : u"Undo last change to playlist",
|
"undoplaylist-menu-label" : u"Undo last change to playlist",
|
||||||
"addfilestoplaylist-menu-label" : u"Add file(s) to bottom of playlist",
|
"addfilestoplaylist-menu-label" : u"Add file(s) to bottom of playlist",
|
||||||
"addurlstoplaylist-menu-label" : u"Add URL(s) to bottom of playlist",
|
"addurlstoplaylist-menu-label" : u"Add URL(s) to bottom of playlist",
|
||||||
|
"editplaylist-menu-label": u"Edit playlist",
|
||||||
|
|
||||||
"addusersfiletoplaylist-menu-label" : u"Add {} file to playlist", # item owner indicator
|
"addusersfiletoplaylist-menu-label" : u"Add {} file to playlist", # item owner indicator
|
||||||
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
||||||
|
|||||||
@ -287,6 +287,7 @@ en = {
|
|||||||
"addfolder-label" : u"Add folder",
|
"addfolder-label" : u"Add folder",
|
||||||
|
|
||||||
"adduris-msgbox-label" : u"Add URLs to playlist (one per line)",
|
"adduris-msgbox-label" : u"Add URLs to playlist (one per line)",
|
||||||
|
"editplaylist-msgbox-label" : u"Set playlist (one per line)",
|
||||||
"trusteddomains-msgbox-label" : u"Domains it is okay to automatically switch to (one per line)",
|
"trusteddomains-msgbox-label" : u"Domains it is okay to automatically switch to (one per line)",
|
||||||
|
|
||||||
"createcontrolledroom-msgbox-label" : "Create managed room",
|
"createcontrolledroom-msgbox-label" : "Create managed room",
|
||||||
@ -399,6 +400,7 @@ en = {
|
|||||||
"undoplaylist-menu-label" : u"Undo last change to playlist",
|
"undoplaylist-menu-label" : u"Undo last change to playlist",
|
||||||
"addfilestoplaylist-menu-label" : u"Add file(s) to bottom of playlist",
|
"addfilestoplaylist-menu-label" : u"Add file(s) to bottom of playlist",
|
||||||
"addurlstoplaylist-menu-label" : u"Add URL(s) to bottom of playlist",
|
"addurlstoplaylist-menu-label" : u"Add URL(s) to bottom of playlist",
|
||||||
|
"editplaylist-menu-label": u"Edit playlist",
|
||||||
|
|
||||||
"addusersfiletoplaylist-menu-label" : u"Add {} file to playlist", # item owner indicator
|
"addusersfiletoplaylist-menu-label" : u"Add {} file to playlist", # item owner indicator
|
||||||
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
||||||
|
|||||||
@ -287,6 +287,7 @@ ru = {
|
|||||||
"addfolder-label" : u"Add folder", # TODO: Translate
|
"addfolder-label" : u"Add folder", # TODO: Translate
|
||||||
|
|
||||||
"adduris-msgbox-label" : u"Add URLs to playlist (one per line)", # TODO: Translate
|
"adduris-msgbox-label" : u"Add URLs to playlist (one per line)", # TODO: Translate
|
||||||
|
"editplaylist-msgbox-label" : u"Set playlist (one per line)", # TODO: Translate
|
||||||
"trusteddomains-msgbox-label" : u"Domains it is okay to automatically switch to (one per line)", # TODO: Translate
|
"trusteddomains-msgbox-label" : u"Domains it is okay to automatically switch to (one per line)", # TODO: Translate
|
||||||
|
|
||||||
"createcontrolledroom-msgbox-label" : u"Создать управляемую комнату",
|
"createcontrolledroom-msgbox-label" : u"Создать управляемую комнату",
|
||||||
@ -398,6 +399,7 @@ ru = {
|
|||||||
"undoplaylist-menu-label" : u"Undo last change to playlist",
|
"undoplaylist-menu-label" : u"Undo last change to playlist",
|
||||||
"addfilestoplaylist-menu-label" : u"Add file(s) to bottom of playlist",
|
"addfilestoplaylist-menu-label" : u"Add file(s) to bottom of playlist",
|
||||||
"addurlstoplaylist-menu-label" : u"Add URL(s) to bottom of playlist",
|
"addurlstoplaylist-menu-label" : u"Add URL(s) to bottom of playlist",
|
||||||
|
"editplaylist-menu-label": u"Edit playlist",
|
||||||
|
|
||||||
"addusersfiletoplaylist-menu-label" : u"Add {} file to playlist", # item owner indicator
|
"addusersfiletoplaylist-menu-label" : u"Add {} file to playlist", # item owner indicator
|
||||||
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
"addusersstreamstoplaylist-menu-label" : u"Add {} stream to playlist", # item owner indicator
|
||||||
|
|||||||
@ -502,6 +502,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
menu.addSeparator()
|
menu.addSeparator()
|
||||||
menu.addAction(QtGui.QPixmap(resourcespath + u"arrow_switch.png"), getMessage("shuffleplaylist-menuu-label"), lambda: self.shufflePlaylist())
|
menu.addAction(QtGui.QPixmap(resourcespath + u"arrow_switch.png"), getMessage("shuffleplaylist-menuu-label"), lambda: self.shufflePlaylist())
|
||||||
menu.addAction(QtGui.QPixmap(resourcespath + u"arrow_undo.png"), getMessage("undoplaylist-menu-label"), lambda: self.undoPlaylistChange())
|
menu.addAction(QtGui.QPixmap(resourcespath + u"arrow_undo.png"), getMessage("undoplaylist-menu-label"), lambda: self.undoPlaylistChange())
|
||||||
|
menu.addAction(QtGui.QPixmap(resourcespath + u"film_edit.png"), getMessage("editplaylist-menu-label"), lambda: self.openEditPlaylistDialog())
|
||||||
menu.addAction(QtGui.QPixmap(resourcespath + u"film_add.png"),getMessage("addfilestoplaylist-menu-label"), lambda: self.OpenAddFilesToPlaylistDialog())
|
menu.addAction(QtGui.QPixmap(resourcespath + u"film_add.png"),getMessage("addfilestoplaylist-menu-label"), lambda: self.OpenAddFilesToPlaylistDialog())
|
||||||
menu.addAction(QtGui.QPixmap(resourcespath + u"world_add.png"), getMessage("addurlstoplaylist-menu-label"), lambda: self.OpenAddURIsToPlaylistDialog())
|
menu.addAction(QtGui.QPixmap(resourcespath + u"world_add.png"), getMessage("addurlstoplaylist-menu-label"), lambda: self.OpenAddURIsToPlaylistDialog())
|
||||||
menu.addSeparator()
|
menu.addSeparator()
|
||||||
@ -814,6 +815,36 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
self.addStreamToPlaylist(URI)
|
self.addStreamToPlaylist(URI)
|
||||||
self.updatingPlaylist = False
|
self.updatingPlaylist = False
|
||||||
|
|
||||||
|
@needsClient
|
||||||
|
def openEditPlaylistDialog(self):
|
||||||
|
oldPlaylist = utils.getListAsMultilineString(self.getPlaylistState())
|
||||||
|
editPlaylistDialog = QtGui.QDialog()
|
||||||
|
editPlaylistDialog.setWindowTitle(getMessage("editplaylist-msgbox-label"))
|
||||||
|
editPlaylistLayout = QtGui.QGridLayout()
|
||||||
|
editPlaylistLabel = QtGui.QLabel(getMessage("editplaylist-msgbox-label"))
|
||||||
|
editPlaylistLayout.addWidget(editPlaylistLabel, 0, 0, 1, 1)
|
||||||
|
editPlaylistTextbox = QtGui.QPlainTextEdit(oldPlaylist)
|
||||||
|
editPlaylistTextbox.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
|
||||||
|
editPlaylistLayout.addWidget(editPlaylistTextbox, 1, 0, 1, 1)
|
||||||
|
editPlaylistButtonBox = QtGui.QDialogButtonBox()
|
||||||
|
editPlaylistButtonBox.setOrientation(Qt.Horizontal)
|
||||||
|
editPlaylistButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.Cancel)
|
||||||
|
editPlaylistButtonBox.accepted.connect(editPlaylistDialog.accept)
|
||||||
|
editPlaylistButtonBox.rejected.connect(editPlaylistDialog.reject)
|
||||||
|
editPlaylistLayout.addWidget(editPlaylistButtonBox, 2, 0, 1, 1)
|
||||||
|
editPlaylistDialog.setLayout(editPlaylistLayout)
|
||||||
|
editPlaylistDialog.setModal(True)
|
||||||
|
editPlaylistDialog.setMinimumWidth(600)
|
||||||
|
editPlaylistDialog.setMinimumHeight(500)
|
||||||
|
editPlaylistDialog.show()
|
||||||
|
result = editPlaylistDialog.exec_()
|
||||||
|
if result == QtGui.QDialog.Accepted:
|
||||||
|
newPlaylist = utils.convertMultilineStringToList(editPlaylistTextbox.toPlainText())
|
||||||
|
if newPlaylist <> self.playlistState and self._syncplayClient and not self.updatingPlaylist:
|
||||||
|
self.setPlaylist(newPlaylist)
|
||||||
|
self._syncplayClient.playlist.changePlaylist(newPlaylist)
|
||||||
|
self._syncplayClient.fileSwitch.updateInfo()
|
||||||
|
|
||||||
@needsClient
|
@needsClient
|
||||||
def openSetMediaDirectoriesDialog(self):
|
def openSetMediaDirectoriesDialog(self):
|
||||||
MediaDirectoriesDialog = QtGui.QDialog()
|
MediaDirectoriesDialog = QtGui.QDialog()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user