-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support to reset all settings (#104)
- Loading branch information
1 parent
dc44f71
commit 9b60b89
Showing
9 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from typing import Final | ||
|
||
from PySide6.QtCore import Signal | ||
from PySide6.QtGui import Qt | ||
from PySide6.QtWidgets import QWidget, QPushButton, QVBoxLayout, QMessageBox | ||
|
||
from eon_timer.util.injector import component | ||
|
||
|
||
@component() | ||
class AdvancedSettingsWidget(QWidget): | ||
on_reset: Final[Signal] = Signal() | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.__init_components() | ||
|
||
def __init_components(self): | ||
layout = QVBoxLayout(self) | ||
layout.setSpacing(10) | ||
# ----- reset button ----- | ||
button = QPushButton('Reset Settings') | ||
button.clicked.connect(self.__on_reset) | ||
layout.addWidget(button, alignment=Qt.AlignmentFlag.AlignTop) | ||
|
||
def __on_reset(self): | ||
reply = QMessageBox.warning(self, | ||
'Warning', | ||
'Are you sure you want to reset all settings? This operation cannot be undone.', | ||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No, | ||
QMessageBox.StandardButton.No) | ||
if reply == QMessageBox.StandardButton.Yes: | ||
self.on_reset.emit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters