Skip to content

Commit

Permalink
fix: add header title for file dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhd1701 committed Jul 13, 2022
1 parent 3d82901 commit c950928
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion gridplayer/player/managers/add_videos.py
Expand Up @@ -23,7 +23,10 @@ def commands(self):
return {"add_videos": self.cmd_add_videos, "add_urls": self.cmd_add_urls}

def cmd_add_videos(self):
dialog = QFileDialog(self.parent())
dialog = QFileDialog(
parent=self.parent(),
caption=translate("Dialog - Add Files", "Add Files", "Header"),
)
dialog.setFileMode(QFileDialog.ExistingFiles)

dialog.setNameFilters(_get_name_filters())
Expand Down
15 changes: 9 additions & 6 deletions gridplayer/player/managers/playlist.py
Expand Up @@ -44,13 +44,16 @@ def commands(self):
}

def cmd_open_playlist(self):
dialog = QFileDialog(self.parent())
dialog = QFileDialog(
parent=self.parent(),
caption=translate("Dialog - Open Playlist", "Open Playlist", "Header"),
)
dialog.setFileMode(QFileDialog.ExistingFile)

dialog.setNameFilter(
"{0} (*.gpls)".format(
translate(
"Dialog - Playlist open", "GridPlayer Playlists", "File format"
"Dialog - Open Playlist", "GridPlayer Playlists", "File format"
)
)
)
Expand Down Expand Up @@ -80,10 +83,10 @@ def cmd_save_playlist(self):
self._log.debug(f"Proposed playlist save path: {save_path}")

file_path, _ = QFileDialog.getSaveFileName(
self.parent(),
translate("Dialog - Save playlist", "Where to save playlist", "Header"),
str(save_path),
"*.gpls",
parent=self.parent(),
caption=translate("Dialog - Save Playlist", "Save Playlist", "Header"),
directory=str(save_path),
filter="*.gpls",
)

if not file_path:
Expand Down

0 comments on commit c950928

Please sign in to comment.