@@ -607,6 +607,9 @@ def menu_context_tree_results(self, point: QtCore.QPoint) -> None:
607607 def menu_context_queue_download (self , point : QtCore .QPoint ) -> None :
608608 """Show context menu for download queue.
609609
610+ Provides options like 'Remove from Queue' (for Waiting items)
611+ or 'Show in Explorer' (for Finished items).
612+
610613 Args:
611614 point (QPoint): The point where the menu is requested.
612615 """
@@ -616,14 +619,26 @@ def menu_context_queue_download(self, point: QtCore.QPoint) -> None:
616619 if not item :
617620 return
618621
622+ model_item = item .data (0 , QtCore .Qt .ItemDataRole .UserRole )
623+ if not isinstance (model_item , QueueDownloadItem ):
624+ return
625+
619626 # Build the menu
620627 menu = QtWidgets .QMenu ()
621628
629+ status = model_item .get_status ()
630+
622631 # Show remove option for waiting items
623- status = item .text (0 )
624632 if status == QueueDownloadStatus .Waiting :
625633 menu .addAction ("🗑️ Remove from Queue" , lambda : self .on_queue_download_remove_item (item ))
626634
635+ # Show "Show in Explorer" if "Finished"
636+ elif status == QueueDownloadStatus .Finished :
637+ file_path = model_item .get_file_path ()
638+ if file_path :
639+ action = menu .addAction ("📂 Show in Explorer" )
640+ action .triggered .connect (lambda : self .on_show_in_explorer (file_path ))
641+
627642 if menu .isEmpty ():
628643 return
629644
@@ -2047,37 +2062,6 @@ def on_download_album_from_track(self, point: QtCore.QPoint) -> None:
20472062 else :
20482063 logger_gui .warning ("Could not retrieve album information from the selected track." )
20492064
2050- def menu_context_tree_queue (self , point : QtCore .QPoint ) -> None :
2051- """
2052- Show context menu for the download queue tree.
2053- Improved validation and error handling.
2054- """
2055- item = self .tr_queue_download .itemAt (point )
2056- if not item :
2057- return
2058-
2059- # Retrieve our data model from the GUI item
2060- model_item = item .data (0 , QtCore .Qt .ItemDataRole .UserRole )
2061-
2062- # Verify that it is our model
2063- if not isinstance (model_item , QueueDownloadItem ):
2064- return
2065-
2066- if model_item .get_status () != QueueDownloadStatus .Finished :
2067- return
2068-
2069- file_path = model_item .get_file_path ()
2070- if not file_path :
2071- return
2072-
2073- # Path validation is now deferred to on_show_in_explorer
2074- # and open_in_explorer, so we don't log warnings prematurely.
2075-
2076- menu = QtWidgets .QMenu ()
2077- action = menu .addAction ("Show in Explorer" )
2078- action .triggered .connect (lambda : self .on_show_in_explorer (file_path ))
2079- menu .exec (self .tr_queue_download .mapToGlobal (point ))
2080-
20812065 def on_show_in_explorer (self , path : str ) -> None :
20822066 """
20832067 Opens the file explorer at the given path.
0 commit comments