from PyQt6.QtWidgets import QDialog
from _finding_files_dialog_Window import Ui_FindProgress

class FindProgress(QDialog, Ui_FindProgress):
    def __init__(self,*args,**kwargs):
        super(FindProgress,self).__init__(*args,**kwargs)
        self.setupUi(self)
        # self.set_progress_finding_files(0)

    def is_shown(self):
        print(f'is_shown: {self.isVisible()}')
        return self.isVisible()

    def open_find_files_dialog(self):
        print(f'open_import_dialog: {self.is_shown()}')
        if not self.is_shown():
            print('Inside if  not self.is_shown')
            print('showing window')
            self.show()

    def close_find_files_dialog(self):
        print('close_import_dialog')
        if self.is_shown():
            print('inside self.is_shown()')
            print('hiding window')
            self.hide()

    def set_progress_finding_files(self,n):
        print("%d%% done" % n)
        self.progressBar_importing.setValue(float(n))
        self.lcd_import_progress.display(n)