diff --git a/FF_About_UI.py b/FF_About_UI.py new file mode 100644 index 0000000..cf6f231 --- /dev/null +++ b/FF_About_UI.py @@ -0,0 +1,175 @@ +# This source file is a part of File Find made by Pixel-Master +# +# Copyright 2022-2024 Pixel-Master +# +# This software is licensed under the "GPLv3" License as described in the "LICENSE" file, +# which should be included with this package. The terms are also available at +# http://www.gnu.org/licenses/gpl-3.0.html + +# This file contains the code for the about-window + +# Imports +import logging +import os +from sys import platform +from subprocess import run + +# PySide6 Gui Imports +from PySide6.QtGui import QFont, QPixmap, QAction +from PySide6.QtWidgets import QMainWindow, QLabel, QPushButton, QWidget, QGridLayout + +import FF_Additional_UI +# Projects Libraries +import FF_Files +import FF_Settings + + +# The class for the about-window +class AboutWindow: + def __init__(self, parent): + # Debug + logging.debug("Called Help UI") + + # Test if window was already build + global about_window_global + if about_window_global is None: + logging.debug("About UI wasn't build already") + about_window_global = self.setup(parent) + about_window_global.show() + else: + logging.debug("About UI was build already") + logging.debug("Displaying About Window...") + about_window_global.show() + + @staticmethod + def setup(parent): + # Debug + logging.info("Building About UI...") + + # The Base Window with Labels + about_window = QMainWindow(parent) + about_window.setWindowTitle("About File Find") + + # Main Layout + # Create a central widget + central_widget = QWidget(about_window) + about_window.setCentralWidget(central_widget) + # Create the main Layout + about_layout = QGridLayout(central_widget) + about_layout.setContentsMargins(30, 30, 30, 30) + about_layout.setVerticalSpacing(10) + + # File Find for macOS Label + ff_info = QLabel(about_window) + # Change Font and Text + ff_info.setText("File Find") + ff_info.setFont(QFont("Futura", 30)) + # Display the Label + about_layout.addWidget(ff_info, 3, 1) + + # File Find Logo + ff_logo = QLabel(about_window) + # Set the Icon + ff_logo_img = QPixmap(os.path.join(FF_Files.ASSETS_FOLDER, "FFlogo_small.png")) + ff_logo.setPixmap(ff_logo_img) + # Display the Icon + about_layout.addWidget(ff_logo, 0, 1, 2, 1) + + # The Version Label + version_label = QLabel(about_window) + # Font and Text + version_label.setText(f"v. {FF_Files.VERSION_SHORT} ({FF_Files.VERSION})") + version_label.setFont(QFont("Arial", 15)) + # The command and tooltip + version_label.setToolTip(f"Version: {FF_Files.VERSION_SHORT} Extended Version: {FF_Files.VERSION}") + # Display the Label + about_layout.addWidget(version_label, 4, 1) + + # The Author Label + author_label = QLabel(about_window) + # Font and Text + author_label.setText( + "Created by Pixel Master, Copyright © 2022–2024 Pixel Master.\nLicensed under the GNU GPLv3") + author_label.setFont(QFont("Arial", 15)) + # The command and tooltip + author_label.setToolTip(f"Version: {FF_Files.VERSION_SHORT} Extended Version: {FF_Files.VERSION}") + # Display the Label + author_label.setFixedHeight(50) + about_layout.addWidget(author_label, 8, 0, 8, 3) + + # Links using QPushButton + def generate_link_button(displayed_text, domain, color): + link = QPushButton(about_window) + # Font and Text + link.setText(displayed_text) + link.setFont(QFont("Arial", 20)) + # The command and tooltip + link.setToolTip(domain) + # Depends on the os + + if platform == "darwin": + link.clicked.connect(lambda: run(["open", domain])) + elif platform == "win32" or platform == "cygwin": + link.clicked.connect(lambda: run(["start", domain], shell=True)) + elif platform == "linux": + link.clicked.connect(lambda: run(["xdg-open", domain])) + + # Set the color to blue + link.setStyleSheet(f"color: {color};") + # Display the Label + link.adjustSize() + link.show() + # Return the Label to move it + return link + + sourcecode = generate_link_button("Website", "https://pixel-master.github.io/File-Find/", "blue") + about_layout.addWidget(sourcecode, 7, 0) + + update = generate_link_button("Update", "https://github.com/Pixel-Master/File-Find/releases", "green") + about_layout.addWidget(update, 7, 1) + + faq_link = generate_link_button("FaQ", "https://pixel-master.github.io/File-Find/#faq", "red") + about_layout.addWidget(faq_link, 7, 2) + + # Menu bar + menu_bar = about_window.menuBar() + + # Menus + window_menu = menu_bar.addMenu("&Window") + help_menu = menu_bar.addMenu("&Help") + + # Close Window + close_action = QAction("&Close Window", about_window) + close_action.triggered.connect(about_window.hide) + close_action.setShortcut("Ctrl+W") + window_menu.addAction(close_action) + + # About File Find + about_action = QAction("&About File Find", about_window) + about_action.triggered.connect(about_window.show) + help_menu.addAction(about_action) + + # Settings + settings_action = QAction("&Settings", about_window) + settings_action.triggered.connect(lambda: FF_Settings.SettingsWindow(about_window)) + settings_action.setShortcut("Ctrl+,") + help_menu.addAction(settings_action) + + # Help + help_action = QAction("&About File Find", about_window) + help_action.triggered.connect(about_window.show) + help_menu.addAction(help_action) + + # Tutorial + tutorial_action = QAction("&Tutorial", about_window) + tutorial_action.triggered.connect(lambda: FF_Additional_UI.welcome_popups(parent, force_popups=True)) + help_menu.addAction(tutorial_action) + + # Debug + logging.info("Finished Setting up About UI\n") + + # Sets the Window + return about_window + + +about_window_global = None diff --git a/FF_Additional_UI.py b/FF_Additional_UI.py index 7842b92..b653b16 100644 --- a/FF_Additional_UI.py +++ b/FF_Additional_UI.py @@ -306,7 +306,7 @@ def show_delete_question(parent, file): # Displaying Welcome Popups -def welcome_popups(parent): +def welcome_popups(parent, force_popups=False): # Debug logging.debug("Testing for PopUps...") @@ -315,12 +315,13 @@ def welcome_popups(parent): settings = load(settings_file) popup_dict = settings["popup"] - if popup_dict["FF_welcome"]: + if popup_dict["FF_welcome"] or force_popups: # Debug logging.info("Showing Welcomes PopUp...") # Asking if tutorial is necessary - question_popup = QMessageBox(text="Would you like to have a short tutorial?", parent=parent) + question_popup = QMessageBox(text="Would you like to have a short tutorial?\n\n" + "By going to Help > Tutorial, you can get it later.", parent=parent) question_popup.setStandardButtons(QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) # Entering the mainloop @@ -336,7 +337,7 @@ def welcome_popups(parent): text="Welcome to File Find!\n\nThanks for downloading File Find!\n" "File Find is an open-source macOS utility," " that makes it easy to search and find files.\n\n" - "To search fill in the filters you need and leave those" + "To search, fill in the filters you need and leave those" " you don't need empty.\n\n\n" "File Find version: " f"{FF_Files.VERSION_SHORT}[{FF_Files.VERSION}]", @@ -344,10 +345,20 @@ def welcome_popups(parent): PopUps.show_info_messagebox( title="Welcome to File Find", text="Welcome to File Find!\n\nSearch with the Find button.\n\n" - "You can find all info's and settings in the Settings section!\n\n" + "You can find all and settings in the settings menu.\n" + "(find it by going to File Find > Setting in the menubar)\n\n" "If you press on the File Find icon in the menu bar and go to \"Searches:\"," - " you can see the state of all your searches", + " you can see the state of all your active searches.", parent=parent) + PopUps.show_info_messagebox( + title="Welcome to File Find", + text="Welcome to File Find!\n\nSave a search or a filter preset \n" + "by pressing CMD/Ctrl + S in the result or main window.\n\n" + "After you opened a search, you can find duplicated files\n" + "or compare the opened search to an search saved on the disk,\n" + "by pressing the corresponding buttons in the top right.", + parent=parent) + PopUps.show_info_messagebox( title="Welcome to File Find", text="Welcome to File Find!\n\n" diff --git a/FF_Duplicated.py b/FF_Duplicated.py index bcf66f8..a4cc5bd 100644 --- a/FF_Duplicated.py +++ b/FF_Duplicated.py @@ -13,23 +13,23 @@ import os from json import load from threading import Thread +from time import perf_counter, time, ctime import difflib -import hashlib import gc -from time import perf_counter, time, ctime +import hashlib # PySide6 Gui Imports -from PySide6.QtWidgets import (QMainWindow, QWidget, QGridLayout, QHBoxLayout, QVBoxLayout, QLabel, QButtonGroup, - QRadioButton, QSlider, QSpinBox, QDialogButtonBox, QSpacerItem, QSizePolicy, QPushButton, - QTreeWidget, QTreeWidgetItem) +from PySide6.QtWidgets import (QMainWindow, QWidget, QGridLayout, QHBoxLayout, QVBoxLayout, QLabel, QSlider, QSpinBox, + QDialogButtonBox, QSpacerItem, QSizePolicy, QPushButton, + QTreeWidget, QTreeWidgetItem, QComboBox) from PySide6.QtCore import Qt, QSize, Signal, QObject from PySide6.QtGui import QFont, QAction # Projects Libraries import FF_Menubar -import FF_Files -import FF_Help_UI import FF_Additional_UI +import FF_Files +import FF_About_UI # Global variables global duplicated_dict, time_dict, duplicated_display_dict @@ -46,8 +46,8 @@ def __init__(self, parent, search_path, matched_list): # Set the Title of the Window self.Duplicated_Settings.setWindowTitle(f"Find duplicated in: {FF_Files.display_path(search_path)}") # Set the start size of the Window, because it's resizable - self.BASE_WIDTH = 400 - self.BASE_HEIGHT = 400 + self.BASE_WIDTH = 350 + self.BASE_HEIGHT = 300 self.Duplicated_Settings.setBaseSize(self.BASE_WIDTH, self.BASE_HEIGHT) # Display the Window self.Duplicated_Settings.show() @@ -64,8 +64,8 @@ def __init__(self, parent, search_path, matched_list): self.Central_Widget.setLayout(self.Duplicated_Settings_Layout) # Upper Horizontal Layout - self.Upper_Layout = QHBoxLayout(self.Duplicated_Settings) - self.Upper_Layout.setContentsMargins(0, 0, 0, 0) + self.vertical_layout = QHBoxLayout(self.Duplicated_Settings) + self.vertical_layout.setContentsMargins(0, 0, 0, 0) # Middle Horizontal Layout self.Middle_Layout = QHBoxLayout(self.Duplicated_Settings) @@ -80,7 +80,7 @@ def __init__(self, parent, search_path, matched_list): # Title label self.title_label = QLabel(parent=self.Duplicated_Settings) - self.title_label.setText(f"Find duplicated files in: {FF_Files.display_path(search_path, 30)}") + self.title_label.setText(f"Find duplicated files in:\n{FF_Files.display_path(search_path, 45)}") self.title_label.setToolTip(search_path) # Make the Font bigger font = self.title_label.font() @@ -91,156 +91,72 @@ def __init__(self, parent, search_path, matched_list): self.title_label.adjustSize() self.Duplicated_Settings_Layout.addWidget(self.title_label) - # Button group - self.button_group = QButtonGroup(self.Duplicated_Settings) + # Combobox for selecting mode + self.mode_selector_combobox = QComboBox() + self.duplicated_mode_display_name_dict = { + "name": "File name", + "size": "File size (faster than File content)", + "content": "File content"} + self.mode_selector_combobox.addItems([self.duplicated_mode_display_name_dict["name"], + self.duplicated_mode_display_name_dict["size"], + self.duplicated_mode_display_name_dict["content"]]) - # File name - # Checkbox - self.name_checkbox = QRadioButton(parent=self.Duplicated_Settings) - self.name_checkbox.setText("File name") - self.button_group.addButton(self.name_checkbox) - self.Duplicated_Settings_Layout.addWidget(self.name_checkbox) + self.Duplicated_Settings_Layout.addWidget(self.mode_selector_combobox) # Match percentage label - self.match_name_label = QLabel(parent=self.Duplicated_Settings) - self.match_name_label.setText("Files must match at least:") - self.Upper_Layout.addWidget(self.match_name_label) - # Slider - self.name_slider = QSlider(parent=self.Duplicated_Settings) - self.name_slider.setOrientation(Qt.Orientation.Horizontal) - self.name_slider.setRange(1, 100) - self.Upper_Layout.addWidget(self.name_slider) - # Spinbox - self.name_spinbox = QSpinBox(parent=self.Duplicated_Settings) - self.name_spinbox.setMaximum(100) - self.Upper_Layout.addWidget(self.name_spinbox) - # Connecting slider and Spinbox - self.name_spinbox.valueChanged.connect(self.name_slider.setValue) - self.name_slider.valueChanged.connect(self.name_spinbox.setValue) - # Set value to 100 % - self.name_spinbox.setValue(100) - - # Deactivate and activate functions - def de_activate_name(): - if self.name_checkbox.isChecked(): - logging.debug("activating name") - self.match_name_label.setDisabled(False) - self.name_slider.setDisabled(False) - self.name_spinbox.setDisabled(False) - - elif not self.name_checkbox.isChecked(): - logging.debug("deactivating name") - self.match_name_label.setDisabled(True) - self.name_slider.setDisabled(True) - self.name_spinbox.setDisabled(True) - - # Connecting - self.button_group.buttonToggled.connect(de_activate_name) - # Deactivating - de_activate_name() + self.match_label = QLabel(parent=self.Duplicated_Settings) + self.match_label.setText("Files must match at least:") + self.Duplicated_Settings_Layout.addWidget(self.match_label) - # Add to main Layout - self.Duplicated_Settings_Layout.addLayout(self.Upper_Layout) - # Add a Spacer - self.Duplicated_Settings_Layout.addItem(spacer) - - # File size - # Checkbox - self.size_checkbox = QRadioButton(parent=self.Duplicated_Settings) - self.size_checkbox.setText("File size (faster than File content)") - self.button_group.addButton(self.size_checkbox) - self.Duplicated_Settings_Layout.addWidget(self.size_checkbox) - - # Match percentage label - self.match_size_label = QLabel(parent=self.Duplicated_Settings) - self.match_size_label.setText("Files must match at least:") - self.Middle_Layout.addWidget(self.match_size_label) # Slider - self.size_slider = QSlider(parent=self.Duplicated_Settings) - self.size_slider.setOrientation(Qt.Orientation.Horizontal) - self.size_slider.setRange(1, 100) - self.Middle_Layout.addWidget(self.size_slider) + self.slider = QSlider(parent=self.Duplicated_Settings) + self.slider.setOrientation(Qt.Orientation.Horizontal) + self.slider.setRange(1, 100) + self.vertical_layout.addWidget(self.slider) # Spinbox - self.size_spinbox = QSpinBox(parent=self.Duplicated_Settings) - self.size_spinbox.setMaximum(100) - self.Middle_Layout.addWidget(self.size_spinbox) + self.spinbox = QSpinBox(parent=self.Duplicated_Settings) + self.spinbox.setMaximum(100) + self.vertical_layout.addWidget(self.spinbox) # Connecting slider and Spinbox - self.size_spinbox.valueChanged.connect(self.size_slider.setValue) - self.size_slider.valueChanged.connect(self.size_spinbox.setValue) + self.spinbox.valueChanged.connect(self.slider.setValue) + self.slider.valueChanged.connect(self.spinbox.setValue) # Set value to 100 % - self.size_spinbox.setValue(100) - - # Deactivate and activate functions - def de_activate_size(): - if self.size_checkbox.isChecked(): - logging.debug("activating size") - self.match_size_label.setDisabled(False) - self.size_slider.setDisabled(False) - self.size_spinbox.setDisabled(False) - - elif not self.size_checkbox.isChecked(): - logging.debug("deactivating size") - self.match_size_label.setDisabled(True) - self.size_slider.setDisabled(True) - self.size_spinbox.setDisabled(True) + self.spinbox.setValue(100) - # Connecting - self.button_group.buttonToggled.connect(de_activate_size) - # Deactivating - de_activate_size() - - # Add to main Layout - self.Duplicated_Settings_Layout.addLayout(self.Middle_Layout) - # Add a Spacer - self.Duplicated_Settings_Layout.addItem(spacer) + # Deactivate and activate the slider and spinbox if content is selected + def de_activate_content(): + if self.mode_selector_combobox.currentText() == self.duplicated_mode_display_name_dict["content"]: + logging.debug("deactivating content") + self.match_label.setDisabled(True) + self.slider.setDisabled(True) + self.spinbox.setDisabled(True) + # Set it to 100% + self.spinbox.setValue(100) - # File content - # Checkbox - self.content_checkbox = QRadioButton(parent=self.Duplicated_Settings) - self.content_checkbox.setText("File content") - self.button_group.addButton(self.content_checkbox) - self.Duplicated_Settings_Layout.addWidget(self.content_checkbox) + else: + logging.debug("activating name") + self.match_label.setDisabled(False) + self.slider.setDisabled(False) + self.spinbox.setDisabled(False) + # Set it to the saved value + self.spinbox.setValue(self.saved_value) - # Match percentage label - self.match_content_label = QLabel(parent=self.Duplicated_Settings) - self.match_content_label.setText("Files must match at least:") - self.Lower_Layout.addWidget(self.match_content_label) - # Slider - self.content_slider = QSlider(parent=self.Duplicated_Settings) - self.content_slider.setOrientation(Qt.Orientation.Horizontal) - self.content_slider.setRange(1, 100) - self.Lower_Layout.addWidget(self.content_slider) - # Spinbox - self.content_spinbox = QSpinBox(parent=self.Duplicated_Settings) - self.content_spinbox.setMaximum(100) - self.Lower_Layout.addWidget(self.content_spinbox) - # Connecting slider and Spinbox - self.content_spinbox.valueChanged.connect(self.content_slider.setValue) - self.content_slider.valueChanged.connect(self.content_spinbox.setValue) - # Set value to 100 % - self.content_spinbox.setValue(100) + # Connecting + self.mode_selector_combobox.currentTextChanged.connect(de_activate_content) - # Deactivate and activate functions - def de_activate_content(): - if self.content_checkbox.isChecked(): - logging.debug("activating content") - self.match_content_label.setDisabled(False) - self.content_slider.setDisabled(False) - self.content_spinbox.setDisabled(False) + # Store value to insert it, if content is deactivated + def store_value(): + # Only if anything else than content is activated + if self.mode_selector_combobox.currentText() != self.duplicated_mode_display_name_dict["content"]: + self.saved_value = self.spinbox.value() - elif not self.content_checkbox.isChecked(): - logging.debug("deactivating content") - self.match_content_label.setDisabled(True) - self.content_slider.setDisabled(True) - self.content_spinbox.setDisabled(True) + self.spinbox.valueChanged.connect(store_value) - # Connecting - self.button_group.buttonToggled.connect(de_activate_content) - # Deactivating - de_activate_content() + # Default + self.saved_value = 100 # Add to main Layout - self.Duplicated_Settings_Layout.addLayout(self.Lower_Layout) + self.Duplicated_Settings_Layout.addLayout(self.vertical_layout) # Add a Spacer self.Duplicated_Settings_Layout.addItem(spacer) @@ -251,22 +167,33 @@ def de_activate_content(): # Connect events def start_duplicated(): + + # Default criteria + criteria = { + "name": {"activated": False, + "match_percentage": self.spinbox.value()}, + "size": {"activated": False, + "match_percentage": self.spinbox.value()}, + "content": {"activated": False, + "match_percentage": self.spinbox.value()}} + # Events for threading class Events(QObject): finished = Signal() finished_event_class = Events() + if self.mode_selector_combobox.currentText() == self.duplicated_mode_display_name_dict["name"]: + criteria["name"]["activated"] = True + elif self.mode_selector_combobox.currentText() == self.duplicated_mode_display_name_dict["size"]: + criteria["size"]["activated"] = True + elif self.mode_selector_combobox.currentText() == self.duplicated_mode_display_name_dict["content"]: + criteria["content"]["activated"] = True + # Starting Thread Thread( target=lambda: FindDuplicated( - criteria={ - "name": {"activated": self.name_checkbox.isChecked(), - "match_percentage": self.name_spinbox.value()}, - "size": {"activated": self.size_checkbox.isChecked(), - "match_percentage": self.size_spinbox.value()}, - "content": {"activated": self.content_checkbox.isChecked(), - "match_percentage": self.content_spinbox.value()}}, + criteria=criteria, search_path=search_path, matched_list=matched_list, finished_signal=finished_event_class)).start() @@ -306,14 +233,19 @@ class Events(QObject): # About File Find about_action = QAction("&About File Find", self.Duplicated_Settings) - about_action.triggered.connect(lambda: FF_Help_UI.HelpWindow(parent)) + about_action.triggered.connect(lambda: FF_About_UI.AboutWindow(parent)) help_menu.addAction(about_action) - # Help - help_action = QAction("&File Find Settings", self.Duplicated_Settings) - help_action.triggered.connect(lambda: FF_Help_UI.HelpWindow(parent)) + # About + help_action = QAction("&About File Find", self.Duplicated_Settings) + help_action.triggered.connect(lambda: FF_About_UI.AboutWindow(parent)) help_menu.addAction(help_action) + # Tutorial + tutorial_action = QAction("&Tutorial", self.Duplicated_Settings) + tutorial_action.triggered.connect(lambda: FF_Additional_UI.welcome_popups(parent, force_popups=True)) + help_menu.addAction(tutorial_action) + # Debug logging.info("Finished Setting up Help UI\n") logging.info("Finished duplicated question setup!\n\n") @@ -469,7 +401,7 @@ def generate_button(text, command, icon=None): logging.info(f"\nSeconds needed:\n" f"Indexing: {time_needed_dict['time_before_building_ui'] - time_needed_dict['start_time']}\n" f"Building UI: " - f"{time_needed_dict['time_after_building_ui']- time_needed_dict['time_before_building_ui']}\n" + f"{time_needed_dict['time_after_building_ui'] - time_needed_dict['time_before_building_ui']}\n" f"Total: {time_needed_dict['time_after_building_ui'] - time_needed_dict['start_time']}") time_stamp = time() diff --git a/FF_Main_UI.py b/FF_Main_UI.py index 8ec0333..dd1a87a 100644 --- a/FF_Main_UI.py +++ b/FF_Main_UI.py @@ -24,7 +24,7 @@ # Projects Libraries import FF_Additional_UI import FF_Files -import FF_Help_UI +import FF_About_UI import FF_Search import FF_Settings @@ -1087,7 +1087,7 @@ def menu_bar(self, shell_cmd, app: QApplication): # About File Find about_action = QAction("&About File Find", self.Root_Window) - about_action.triggered.connect(lambda: FF_Help_UI.HelpWindow(self.Root_Window)) + about_action.triggered.connect(lambda: FF_About_UI.AboutWindow(self.Root_Window)) help_menu.addAction(about_action) # Settings @@ -1097,11 +1097,16 @@ def menu_bar(self, shell_cmd, app: QApplication): help_menu.addAction(settings_action) # Help - help_action = QAction("&File Find Settings", self.Root_Window) - help_action.triggered.connect(lambda: FF_Help_UI.HelpWindow(self.Root_Window)) + help_action = QAction("&About File Find", self.Root_Window) + help_action.triggered.connect(lambda: FF_About_UI.AboutWindow(self.Root_Window)) help_action.setShortcut(QKeySequence.StandardKey.HelpContents) help_menu.addAction(help_action) + # Tutorial + tutorial_action = QAction("&Tutorial", self.Root_Window) + tutorial_action.triggered.connect(lambda: FF_Additional_UI.welcome_popups(self.Root_Window, force_popups=True)) + help_menu.addAction(tutorial_action) + # Show File Find window reopen_action = QAction("&Show File Find Window", self.Root_Window) reopen_action.setShortcut("Ctrl+D") @@ -1230,7 +1235,7 @@ def delete_cache_and_search(self): class SearchUpdate: - def __init__(self, stopping_search, path: str): + def __init__(self, path: str): # Updating Label MainWindow.update_search_status_label() @@ -1246,15 +1251,10 @@ def __init__(self, stopping_search, path: str): self.search_status: QAction = QAction("Setup Search Status...") self.search_status.setDisabled(True) - # Setup stop search (doesn't work) - self.stop_search: QAction = QAction("Stop") - self.stop_search.triggered.connect(stopping_search) - # Setup search_status_menu.addSeparator() search_status_menu.addAction(self.search_path) search_status_menu.addAction(self.search_status) - # search_status_menu.addAction(self.stop_search) def update(self, text: str): self.search_status.setText(text) diff --git a/FF_Menubar.py b/FF_Menubar.py index 5e89c65..c91cd28 100644 --- a/FF_Menubar.py +++ b/FF_Menubar.py @@ -28,7 +28,7 @@ import FF_Compare import FF_Duplicated import FF_Files -import FF_Help_UI +import FF_About_UI import FF_Settings @@ -161,7 +161,7 @@ def __init__( # About File Find about_action = QAction("&About File Find", self.parent) - about_action.triggered.connect(lambda: FF_Help_UI.HelpWindow(self.parent)) + about_action.triggered.connect(lambda: FF_About_UI.AboutWindow(self.parent)) self.help_menu.addAction(about_action) # Settings @@ -178,10 +178,15 @@ def __init__( self.window_menu.addAction(close_action) # Help - help_action = QAction("&File Find Settings", self.parent) - help_action.triggered.connect(lambda: FF_Help_UI.HelpWindow(self.parent)) + help_action = QAction("&About File Find", self.parent) + help_action.triggered.connect(lambda: FF_About_UI.AboutWindow(self.parent)) self.help_menu.addAction(help_action) + # Tutorial + tutorial_action = QAction("&Tutorial", self.parent) + tutorial_action.triggered.connect(lambda: FF_Additional_UI.welcome_popups(self.parent, force_popups=True)) + self.help_menu.addAction(tutorial_action) + if window == "search": # Compare Search compare_action = QAction("&Compare to other Search...", self.parent) diff --git a/FF_Search.py b/FF_Search.py index b9a7457..b8d9945 100644 --- a/FF_Search.py +++ b/FF_Search.py @@ -13,7 +13,7 @@ import os from fnmatch import fnmatch from json import dump, load -from sys import exit, platform +from sys import platform from time import perf_counter, mktime # PySide6 Gui Imports @@ -301,7 +301,7 @@ def __init__(self, data_name, data_in_name, data_filetype, data_file_size_min, d ACTIVE_SEARCH_THREADS += 1 # Defining menu bar log - self.ui_logger = FF_Main_UI.SearchUpdate(lambda: exit(0), data_search_from_valid) + self.ui_logger = FF_Main_UI.SearchUpdate(data_search_from_valid) # Testing Cache FF_Files.cache_test(is_launching=False) diff --git a/FF_Settings.py b/FF_Settings.py index ebae914..f0f4e57 100644 --- a/FF_Settings.py +++ b/FF_Settings.py @@ -24,7 +24,7 @@ # Projects Libraries import FF_Additional_UI import FF_Files -import FF_Help_UI +import FF_About_UI # The class for the help window @@ -462,14 +462,19 @@ def update_cache_settings(): # About File Find about_action = QAction("&About File Find", self.Settings_Window) - about_action.triggered.connect(lambda: FF_Help_UI.HelpWindow(self.Settings_Window)) + about_action.triggered.connect(lambda: FF_About_UI.AboutWindow(self.Settings_Window)) help_menu.addAction(about_action) # Help - help_action = QAction("&File Find Settings", self.Settings_Window) - help_action.triggered.connect(self.Settings_Window.show) + help_action = QAction("&About File Find", self.Settings_Window) + help_action.triggered.connect(lambda: FF_About_UI.AboutWindow(self.Settings_Window)) help_menu.addAction(help_action) + # Tutorial + tutorial_action = QAction("&Tutorial", self.Settings_Window) + tutorial_action.triggered.connect(lambda: FF_Additional_UI.welcome_popups(parent, force_popups=True)) + help_menu.addAction(tutorial_action) + # Debug logging.info("Finished Setting up Help UI\n") diff --git a/README.md b/README.md index c8f0844..c0bf7e1 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ File Find isn't ready for Release yet Run from source or download pre-build macO ### Note: -###### File Find works on Linux or Windows, but currently only in beta. Please report any errory. +###### File Find works on Linux or Windows, but currently only in beta. Please report any errors. ### Dependencies for building