mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-28 02:23:58 +00:00
Merge pull request #544 from samj1912/picard884
PICARD-884: Add the parent directory if file selected from filebrowser
This commit is contained in:
@@ -129,15 +129,21 @@ class FileBrowser(QtGui.QTreeView):
|
||||
self.expand(index)
|
||||
self.scrollTo(index, scrolltype)
|
||||
|
||||
def _get_destination_from_path(self, path):
|
||||
destination = os.path.normpath(unicode(path))
|
||||
if not os.path.isdir(destination):
|
||||
destination = os.path.dirname(destination)
|
||||
return destination
|
||||
|
||||
def move_files_here(self):
|
||||
indexes = self.selectedIndexes()
|
||||
if not indexes:
|
||||
return
|
||||
path = self.model.filePath(indexes[0])
|
||||
config.setting["move_files_to"] = os.path.normpath(unicode(path))
|
||||
config.setting["move_files_to"] = self._get_destination_from_path(path)
|
||||
|
||||
def set_as_starting_directory(self):
|
||||
indexes = self.selectedIndexes()
|
||||
if indexes:
|
||||
path = self.model.filePath(indexes[0])
|
||||
config.setting["starting_directory_path"] = os.path.normpath(unicode(path))
|
||||
config.setting["starting_directory_path"] = self._get_destination_from_path(path)
|
||||
|
||||
Reference in New Issue
Block a user