[ui] removed more unnecessary 'x' buttons from some dialogs

This commit is contained in:
Vinicius Moreira
2020-04-29 16:58:39 -03:00
parent 5bd6858f7d
commit 780667f5c3
6 changed files with 13 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ class ProcessWatcher:
pass
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:
deny_label: str = None, deny_button: bool = True, window_cancel: bool = False) -> bool:
"""
request a user confirmation. In the current GUI implementation, it shows a popup to the user.
:param title: popup title

View File

@@ -23,7 +23,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -44,7 +44,7 @@
showgrid="false"
showborder="false"
inkscape:zoom="3.2091769"
inkscape:cx="-43.249858"
inkscape:cx="-13.285588"
inkscape:cy="-0.030460959"
inkscape:window-x="0"
inkscape:window-y="0"
@@ -57,17 +57,17 @@
<g
id="g6"
transform="matrix(1.7476186,0,0,1.8929335,1.1861681,-0.60813528)"
style="fill:none;fill-opacity:1;stroke:#44aa00;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none">
style="fill:none;fill-opacity:1;stroke:#91a069;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<path
d="m 25,17 h -2 c -0.6,0 -1,0.4 -1,1 v 2.5 C 22,20.8 21.8,21 21.5,21 H 4.5 C 4.2,21 4,20.8 4,20.5 V 18 C 4,17.4 3.6,17 3,17 H 1 c -0.6,0 -1,0.4 -1,1 v 6 c 0,0.6 0.4,1 1,1 h 24 c 0.6,0 1,-0.4 1,-1 v -6 c 0,-0.6 -0.4,-1 -1,-1 z"
id="path2"
inkscape:connector-curvature="0"
style="fill:none;fill-opacity:1;stroke:#44aa00;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none" />
style="fill:none;fill-opacity:1;stroke:#91a069;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
d="m 12.3,16.7 c 0.2,0.2 0.5,0.3 0.7,0.3 0.2,0 0.5,-0.1 0.7,-0.3 l 6,-6 C 19.9,10.5 20,10.3 20,10 20,9.7 19.9,9.5 19.7,9.3 L 18.3,7.9 C 18.1,7.7 17.9,7.6 17.6,7.6 c -0.3,0 -0.5,0.1 -0.7,0.3 l -1,1 C 15.6,9.2 15,9 15,8.5 V 2 C 15,1.4 14.6,1 14,1 H 12 C 11.4,1 11,1.4 11,2 V 8.6 C 11,9 10.5,9.3 10.1,9 L 9.1,8 C 8.9,7.8 8.7,7.7 8.4,7.7 8.1,7.7 7.9,7.8 7.7,8 L 6.3,9.4 C 6.1,9.6 6,9.8 6,10.1 c 0,0.3 0.1,0.5 0.3,0.7 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:none;fill-opacity:1;stroke:#44aa00;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none" />
style="fill:none;fill-opacity:1;stroke:#91a069;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
transform="matrix(3.7795276,0,0,3.7795276,669.63626,-482.15866)"

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -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())

View File

@@ -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()

View File

@@ -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