1
0
mirror of https://github.com/bpozdena/OneDriveGUI.git synced 2026-10-24 04:59:17 +03:00

Show trashed files in file history #233

This commit is contained in:
Boris Pozdena
2025-06-09 16:22:41 +02:00
parent 9f658ff490
commit 731f84f78b
2 changed files with 15 additions and 5 deletions

View File

@@ -527,6 +527,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
item_widget.set_label_1(f"Deleted from {parent_dir}")
item_widget.set_label_2(f"")
elif file_operation == "Moving":
item_widget.set_label_1(f"Trashed from {parent_dir}")
item_widget.set_label_2(f"")
elif transfer_complete and file_operation == "Uploading":
shortened_path = shorten_path(relative_path_display, 32)
item_widget.set_label_1(f"Uploaded from <a href=file:///{absolute_path}>{shortened_path}</a>")
@@ -563,6 +567,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
myQCustomQWidget.set_label_1(f"Deleted from {parent_dir}")
myQCustomQWidget.set_label_2(f"")
elif file_operation == "Moving":
myQCustomQWidget.set_label_1(f"Trashed from {parent_dir}")
myQCustomQWidget.set_label_2(f"")
elif transfer_complete and file_operation == "Uploading":
shortened_path = shorten_path(relative_path_display, 32)
myQCustomQWidget.set_label_1(f"Uploaded from <a href=file:///{absolute_path}>{shortened_path}</a>")

View File

@@ -81,7 +81,9 @@ class WorkerThread(QThread):
"Uploading new file",
"Uploading modified file",
"Downloading modified file",
"Deleting item",
"Deleting item", # File deleted locally and then removed in the cloud
"Deleting local file", # File deleted in the cloud and then removed locally
"Moving this local file", # File deleted in the cloud and then moved to recycling bin locally
]
self.profile_status = {
@@ -193,17 +195,17 @@ class WorkerThread(QThread):
elif any(_ in stdout for _ in self.tasks):
# Capture information about file that is being uploaded/downloaded/deleted by OneDrive.
file_operation = re.search(r"\b([Uploading|Downloading|Deleting]+)*", stdout).group(1)
file_operation = re.search(r"\b([Uploading|Downloading|Deleting|Moving]+)*", stdout).group(1)
if file_operation == "Deleting":
if file_operation in {"Deleting", "Moving"}:
self.file_name = re.search(r".*/(.+)$", stdout)
self.file_path = re.search(r"\b[item|OneDrive:]\s(.+)$", stdout)
self.file_path = re.search(r".+\:\s(.+)$", stdout)
else:
self.file_name = re.search(r".*/(.+)\s+\.+", stdout)
self.file_path = re.search(r"\b[file:]+\s(.+)\s+\.\.\.", stdout)
transfer_complete = any(["done" in stdout, "Deleting" in stdout])
transfer_complete = any(["done" in stdout, "Deleting" in stdout, "Moving" in stdout])
progress = "0"
transfer_progress_new = {