2121
2222# PySide6 Gui Imports
2323from PySide6 .QtCore import QThreadPool , QSize
24- from PySide6 .QtGui import QAction , QColor , QKeySequence , QClipboard , QBrush , Qt
25- from PySide6 .QtWidgets import QFileDialog , QListWidget , QTreeWidget , QMenu , QPushButton , QTreeWidgetItem
24+ from PySide6 .QtGui import QAction , QColor , QKeySequence , QBrush , Qt
25+ from PySide6 .QtWidgets import QFileDialog , QListWidget , QTreeWidget , QMenu , QPushButton , QTreeWidgetItem , QApplication
2626
2727# Projects Libraries
2828import FF_Additional_UI
@@ -121,10 +121,11 @@ def __init__(
121121 self .tools_menu .addAction (self .show_action )
122122
123123 # Select an app to open the selected file
124- self .open_in_app_action = QAction ("&Select an app to open the selected file..." , self .parent )
125- self .open_in_app_action .triggered .connect (self .open_in_app )
126- self .open_in_app_action .setShortcut ("Alt+O" )
127- self .tools_menu .addAction (self .open_in_app_action )
124+ if platform == "darwin" :
125+ self .open_in_app_action = QAction ("&Select an app to open the selected file..." , self .parent )
126+ self .open_in_app_action .triggered .connect (self .open_in_app )
127+ self .open_in_app_action .setShortcut ("Alt+O" )
128+ self .tools_menu .addAction (self .open_in_app_action )
128129
129130 # Separator
130131 self .tools_menu .addSeparator ()
@@ -204,8 +205,11 @@ def __init__(
204205 "Open" , self .open_file , icon = os .path .join (FF_Files .ASSETS_FOLDER , "Open_icon_small.png" ))
205206 bottom_layout .addWidget (open_file )
206207 # Menu when Right-clicking
207- self .create_context_menu (
208- open_file , (self .show_action , self .open_in_app_action , self .open_terminal_action ))
208+ if platform == "darwin" :
209+ self .create_context_menu (
210+ open_file , (self .show_action , self .open_in_app_action , self .open_terminal_action ))
211+ else :
212+ self .create_context_menu (open_file , (self .show_action , self .open_terminal_action ))
209213
210214 # Button to show info about the file
211215 file_info_button = self .generate_button (
@@ -652,7 +656,7 @@ def open_in_finder(self):
652656 # Collecting the return code
653657 return_code = run (["open" , "-R" , selected_file ]).returncode
654658 elif platform == "win32" or platform == "cygwin" :
655- return_code = run (["explorer" , f"/select{ selected_file } " ]).returncode
659+ return_code = run (["explorer" , f"/select, { selected_file } " ]).returncode
656660 elif platform == "linux" :
657661 return_code = run (["xdg-open" , os .path .dirname (selected_file )]).returncode
658662
@@ -788,7 +792,7 @@ def calc_hash(hash_str: str, hash_func: hashlib):
788792 "\n "
789793 f"MD5:\n { md5_hash } \n \n "
790794 f"SHA1:\n { sha1_hash } \n \n "
791- f"SHA265 :\n { sha256_hash } \n \n \n "
795+ f"SHA256 :\n { sha256_hash } \n \n \n "
792796 f"Took: { round (final_time , 3 )} sec." ,
793797 self .parent , large = True )
794798 else :
@@ -802,12 +806,12 @@ def calc_hash(hash_str: str, hash_func: hashlib):
802806
803807 # Copy file name to clipboard
804808 def copy_file (self ):
805- clipboard = QClipboard ()
809+ clipboard = QApplication . clipboard ()
806810 clipboard .setText (self .get_current_item ())
807811
808812 # Copy file name to clipboard
809813 def copy_name (self ):
810- clipboard = QClipboard ()
814+ clipboard = QApplication . clipboard ()
811815 clipboard .setText (os .path .basename (self .get_current_item ()))
812816
813817 # TODO: remove or implement correctly
@@ -816,7 +820,7 @@ def quick_look(self):
816820
817821 # Copy path for Terminal
818822 def copy_path_for_terminal (self ):
819- clipboard = QClipboard ()
823+ clipboard = QApplication . clipboard ()
820824 clipboard .setText (self .get_current_item ().replace (" " , r"\ " ))
821825
822826 # Remove moved file from cache
0 commit comments