Hello,
I'm struggling to interact with a file in a folder based on the selection in a listWidget.
I have verified the selection works as I can remove selected items from the listWidget. I however am having difficult moving the file in dropbox to another folder. Here's my method:
def archive():
itemList = []
currentIndex = listWidget.currentRow()
item = listWidget.item(currentIndex)
for x in dbx.files_list_folder('/Testing Application').entries:
itemList.append(str(x.name))
dbx.files_move(from_path ='/Testing Application',to_path= '/Archived', autorename=False)
item = listWidget.takeItem(currentIndex)
del item
Here is how I listed the files in the listWidget:
activeList = []
for item in dbx.files_list_folder('/Testing Application').entries:
cell = QListWidgetItem(str(item.name))
activeList.append(str(item.name))
listWidget.addItems(activeList)
So I know I only have the name and I need to connect the selection of the name back to the original file. I could just do that by index, if index[list] = index[dbx] Move file.
But I am having difficulty moving the file. I have my selection mode in the app set to singleSelection so currently it throws an error because it's trying to move everything in the folder. When it was set to multiSelection it moved everything.
Need help selecting an individual file and moving just that one file.