feat: clear directory

This commit is contained in:
RedDeadDepresso
2024-09-29 18:36:06 +01:00
parent fd6ef77857
commit 9eb703d12a
10 changed files with 222 additions and 20 deletions

View File

@@ -0,0 +1,35 @@
from PySide6.QtCore import Qt, Signal
from qfluentwidgets import MessageBox, CheckBox
class ClearMessageBox(MessageBox):
mainWindow = None
yesSignal = Signal()
cancelSignal = Signal()
def __init__(self, title: str, content: str, parent=None):
parent = parent if parent is not None else self.mainWindow
if parent is None:
raise Exception("Please, assign mainWindow")
super().__init__(title, content, parent)
self.yesButtonPressed = False
self.deleteFolder = False
self.checkBox = CheckBox('Delete folder')
self.textLayout.insertWidget(2, self.checkBox, 0, alignment=Qt.AlignLeft)
self.__connectSignalToSlot()
def __connectSignalToSlot(self):
self.checkBox.checkStateChanged.connect(self.onChecked)
self.yesSignal.connect(self.onYesSignal)
def onYesSignal(self):
self.yesButtonPressed = True
def onChecked(self, value: bool):
self.deleteFolder = value
def getResponse(self) -> tuple[bool, bool]:
return self.yesButtonPressed, self.deleteFolder