Skip to content

Commit c4383be

Browse files
authored
Bugfixes
- Fixed "open in file explorer" (again) - Fixed sha256 hash title - Open wth specific app now only available in macOS - Fixed copy to clipboard
1 parent e8b102d commit c4383be

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

FF_Files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from PySide6.QtCore import QDate, Qt
2020

2121
# Versions
22-
VERSION: str = "15-june-2025"
22+
VERSION: str = "21-june-2025"
2323
VERSION_SHORT: str = "2.0"
2424
# Versions of file formats
2525
FF_FILTER_VERSION = 2

FF_Menubar.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
# PySide6 Gui Imports
2323
from 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
2828
import 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

Comments
 (0)