mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 00:44:16 +02:00
[ui] removed more unnecessary 'x' buttons from some dialogs
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
from typing import List
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtWidgets import QMessageBox, QLabel, QWidget, QHBoxLayout
|
||||
from bauh.api.abstract.view import MessageType
|
||||
|
||||
from bauh.view.util import resource
|
||||
from bauh.api.abstract.view import MessageType
|
||||
from bauh.view.qt import css
|
||||
from bauh.view.util import resource
|
||||
from bauh.view.util.translation import I18n
|
||||
|
||||
MSG_TYPE_MAP = {
|
||||
@@ -32,6 +33,7 @@ def ask_confirmation(title: str, body: str, i18n: I18n, icon: QIcon = QIcon(reso
|
||||
diag.setIcon(QMessageBox.Question)
|
||||
diag.setWindowTitle(title)
|
||||
diag.setStyleSheet('QLabel { margin-right: 25px; }')
|
||||
diag.setWindowFlags(Qt.CustomizeWindowHint | Qt.WindowTitleHint)
|
||||
|
||||
wbody = QWidget()
|
||||
wbody.setLayout(QHBoxLayout())
|
||||
|
||||
@@ -50,7 +50,7 @@ class AsyncAction(QThread, ProcessWatcher):
|
||||
self.stop = False
|
||||
|
||||
def request_confirmation(self, title: str, body: str, components: List[ViewComponent] = None,
|
||||
confirmation_label: str = None, deny_label: str = None, deny_button: bool = True, window_cancel: bool = True) -> bool:
|
||||
confirmation_label: str = None, deny_label: str = None, deny_button: bool = True, window_cancel: bool = False) -> bool:
|
||||
self.wait_confirmation = True
|
||||
self.signal_confirmation.emit({'title': title, 'body': body, 'components': components, 'confirmation_label': confirmation_label, 'deny_label': deny_label, 'deny_button': deny_button, 'window_cancel': window_cancel})
|
||||
self.wait_user()
|
||||
|
||||
@@ -1193,7 +1193,7 @@ class ManageWindow(QWidget):
|
||||
def execute_custom_action(self, pkg: PackageView, action: CustomSoftwareAction):
|
||||
|
||||
if pkg is None and not dialog.ask_confirmation(title=self.i18n['confirmation'].capitalize(),
|
||||
body=self.i18n['custom_action.proceed_with'].capitalize().format('"{}"'.format(self.i18n[action.i18_label_key].capitalize())),
|
||||
body=self.i18n['custom_action.proceed_with'].capitalize().format('"{}"'.format(self.i18n[action.i18_label_key])),
|
||||
icon=QIcon(action.icon_path) if action.icon_path else QIcon(resource.get_path('img/logo.svg')),
|
||||
i18n=self.i18n):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user