[view.qt.settings] fix: confirmation dialog icon when launched alone

This commit is contained in:
Vinicius Moreira
2022-01-28 19:24:50 -03:00
parent d07e0e326c
commit c718fe0a36
3 changed files with 15 additions and 7 deletions

View File

@@ -24,6 +24,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- not informing all the provided packages on the transaction context to the dependency sorting algorithm (could lead to a wrong installation order) - not informing all the provided packages on the transaction context to the dependency sorting algorithm (could lead to a wrong installation order)
- not displaying all possible AUR providers for a given dependency - not displaying all possible AUR providers for a given dependency
- UI:
- settings panel: confirmation dialog icon when launched alone
### UI ### UI
- new logo by [DN-debug](https://github.com/DN-debug) - new logo by [DN-debug](https://github.com/DN-debug)
- new dark theme (**knight**) based on Kimi-dark gtk by [DN-debug](https://github.com/DN-debug) - new dark theme (**knight**) based on Kimi-dark gtk by [DN-debug](https://github.com/DN-debug)

View File

@@ -33,7 +33,8 @@ class ConfirmationDialog(QDialog):
def __init__(self, title: str, body: Optional[str], i18n: I18n, icon: QIcon = QIcon(resource.get_path('img/logo.svg')), def __init__(self, title: str, body: Optional[str], i18n: I18n, icon: QIcon = QIcon(resource.get_path('img/logo.svg')),
widgets: Optional[List[QWidget]] = None, confirmation_button: bool = True, deny_button: bool = True, widgets: Optional[List[QWidget]] = None, confirmation_button: bool = True, deny_button: bool = True,
window_cancel: bool = False, confirmation_label: Optional[str] = None, deny_label: Optional[str] = None): window_cancel: bool = False, confirmation_label: Optional[str] = None, deny_label: Optional[str] = None,
confirmation_icon: bool = True):
super(ConfirmationDialog, self).__init__() super(ConfirmationDialog, self).__init__()
if not window_cancel: if not window_cancel:
@@ -64,9 +65,10 @@ class ConfirmationDialog(QDialog):
container_body.setLayout(QHBoxLayout()) container_body.setLayout(QHBoxLayout())
self.layout().addWidget(container_body) self.layout().addWidget(container_body)
lb_icon = QLabel() if confirmation_icon:
lb_icon.setObjectName("confirm_dialog_icon") lb_icon = QLabel()
container_body.layout().addWidget(lb_icon) lb_icon.setObjectName("confirm_dialog_icon")
container_body.layout().addWidget(lb_icon)
if body: if body:
lb_msg = QLabel(body) lb_msg = QLabel(body)

View File

@@ -110,9 +110,12 @@ class SettingsWindow(QWidget):
if success: if success:
if not self.window: if not self.window:
dialog.show_message(title=self.i18n['success'].capitalize(), ConfirmationDialog(title=self.i18n['success'].capitalize(),
body=self.i18n['settings.changed.success.warning'], body=f"<p>{self.i18n['settings.changed.success.warning']}</p>",
type_=MessageType.INFO) i18n=self.i18n,
confirmation_label=self.i18n['ok'],
confirmation_icon=False,
deny_button=False).ask()
QCoreApplication.exit() QCoreApplication.exit()
elif ConfirmationDialog(title=self.i18n['warning'].capitalize(), elif ConfirmationDialog(title=self.i18n['warning'].capitalize(),
body=f"<p>{self.i18n['settings.changed.success.warning']}</p>" body=f"<p>{self.i18n['settings.changed.success.warning']}</p>"