mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[arch] improvement -> 'keep' as the default button for 'no longer needed deps' dialog | [ui] adding missing 'pointing hand' cursors
This commit is contained in:
@@ -1142,17 +1142,15 @@ class ArchManager(SoftwareManager):
|
||||
|
||||
def _request_unncessary_uninstall_confirmation(self, uninstalled: Iterable[str], unnecessary: Iterable[str], watcher: ProcessWatcher) -> Optional[List[str]]:
|
||||
reqs = [InputOption(label=p, value=p, icon_path=get_icon_path(), read_only=False) for p in unnecessary]
|
||||
reqs_select = MultipleSelectComponent(options=reqs, default_options=set(reqs), label="", max_per_line=3)
|
||||
reqs_select = MultipleSelectComponent(options=reqs, default_options=set(reqs), label="", max_per_line=3 if len(reqs) > 9 else 1)
|
||||
|
||||
if not watcher.request_confirmation(title=self.i18n['arch.uninstall.unnecessary.l1'].capitalize(),
|
||||
body='<p>{}</p>'.format(self.i18n['arch.uninstall.unnecessary.l2']),
|
||||
body='<p>{}</p>'.format(self.i18n['arch.uninstall.unnecessary.l2'] + ':'),
|
||||
components=[reqs_select],
|
||||
confirmation_label=self.i18n['arch.uninstall.unnecessary.proceed'].capitalize(),
|
||||
deny_label=self.i18n['arch.uninstall.unnecessary.cancel'].capitalize(),
|
||||
deny_label=self.i18n['arch.uninstall.unnecessary.proceed'].capitalize(),
|
||||
confirmation_label=self.i18n['arch.uninstall.unnecessary.cancel'].capitalize(),
|
||||
window_cancel=False):
|
||||
return
|
||||
|
||||
return reqs_select.get_selected_values()
|
||||
return reqs_select.get_selected_values()
|
||||
|
||||
def _request_all_unncessary_uninstall_confirmation(self, pkgs: Iterable[str], context: TransactionContext):
|
||||
reqs = [InputOption(label=p, value=p, icon_path=get_icon_path(), read_only=True) for p in pkgs]
|
||||
|
||||
@@ -218,7 +218,7 @@ arch.uninstall.required_by.advice=It is necessary to uninstall them as well to p
|
||||
arch.uninstall.unnecessary.all=The following {} packages will be uninstalled
|
||||
arch.uninstall.unnecessary.cancel=Keep
|
||||
arch.uninstall.unnecessary.l1=Packages successfully uninstalled!
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary. Select those you want to uninstall
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary
|
||||
arch.uninstall.unnecessary.proceed=Uninstall
|
||||
arch.uninstalling.conflict=Uninstalling conflicting packages
|
||||
arch.uninstalling.conflict.fail=It was not possible to uninstall the conflicting packages: {}
|
||||
|
||||
@@ -218,7 +218,7 @@ arch.uninstall.required_by.advice=It is necessary to uninstall them as well to p
|
||||
arch.uninstall.unnecessary.all=The following {} packages will be uninstalled
|
||||
arch.uninstall.unnecessary.cancel=Keep
|
||||
arch.uninstall.unnecessary.l1=Packages successfully uninstalled!
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary. Select those you want to uninstall
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary
|
||||
arch.uninstall.unnecessary.proceed=Uninstall
|
||||
arch.uninstalling.conflict=Uninstalling conflicting packages
|
||||
arch.uninstalling.conflict.fail=It was not possible to uninstall the conflicting packages: {}
|
||||
|
||||
@@ -219,7 +219,7 @@ arch.uninstall.required_by.advice=It is necessary to uninstall them as well to p
|
||||
arch.uninstall.unnecessary.all=The following {} packages will be uninstalled
|
||||
arch.uninstall.unnecessary.cancel=Keep
|
||||
arch.uninstall.unnecessary.l1=Packages successfully uninstalled!
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary. Select those you want to uninstall
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary
|
||||
arch.uninstall.unnecessary.proceed=Uninstall
|
||||
arch.uninstalling.conflict=Uninstalling conflicting packages
|
||||
arch.uninstalling.conflict.fail=It was not possible to uninstall the conflicting packages: {}
|
||||
|
||||
@@ -218,7 +218,7 @@ arch.uninstall.required_by.advice=Es necesario desinstalarlos también para cont
|
||||
arch.uninstall.unnecessary.all=Los {} seguintes paquetes serán desinstalados
|
||||
arch.uninstall.unnecessary.cancel=Mantener
|
||||
arch.uninstall.unnecessary.l1=¡Paquetes desinstalados con éxito!
|
||||
arch.uninstall.unnecessary.l2=Parece que los paquetes abajo ya no son necesarios. Seleccione los que desea desinstalar
|
||||
arch.uninstall.unnecessary.l2=Parece que los paquetes abajo ya no son necesarios
|
||||
arch.uninstall.unnecessary.proceed=Desinstalar
|
||||
arch.uninstalling.conflict=Eliminando paquetes conflictivos
|
||||
arch.uninstalling.conflict.fail=No fue posible desinstalar los paquetes conflictivos: {}
|
||||
|
||||
@@ -218,7 +218,7 @@ arch.uninstall.required_by.advice=It is necessary to uninstall them as well to p
|
||||
arch.uninstall.unnecessary.all=The following {} packages will be uninstalled
|
||||
arch.uninstall.unnecessary.cancel=Keep
|
||||
arch.uninstall.unnecessary.l1=Packages successfully uninstalled!
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary. Select those you want to uninstall
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary
|
||||
arch.uninstall.unnecessary.proceed=Uninstall
|
||||
arch.uninstalling.conflict=Uninstalling conflicting packages
|
||||
arch.uninstalling.conflict.fail=It was not possible to uninstall the conflicting packages: {}
|
||||
|
||||
@@ -218,7 +218,7 @@ arch.uninstall.required_by.advice=Para prosseguir será necessário desinstá-lo
|
||||
arch.uninstall.unnecessary.all=Os seguintes {} pacotes serão desinstalados
|
||||
arch.uninstall.unnecessary.cancel=Manter
|
||||
arch.uninstall.unnecessary.l1=Pacotes desinstalados com sucesso!
|
||||
arch.uninstall.unnecessary.l2=Os pacotes abaixo parecem não ser mais necessários. Selecione os desejados para desinstalação
|
||||
arch.uninstall.unnecessary.l2=Os pacotes abaixo parecem não ser mais necessários
|
||||
arch.uninstall.unnecessary.proceed=Desinstalar
|
||||
arch.uninstalling.conflict=Desinstalando pacotes conflitante
|
||||
arch.uninstalling.conflict.fail=Não foi possível desinstalar os pacotes conflitantes: {}
|
||||
|
||||
@@ -218,7 +218,7 @@ arch.uninstall.required_by.advice=It is necessary to uninstall them as well to p
|
||||
arch.uninstall.unnecessary.all=The following {} packages will be uninstalled
|
||||
arch.uninstall.unnecessary.cancel=Keep
|
||||
arch.uninstall.unnecessary.l1=Packages successfully uninstalled!
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary. Select those you want to uninstall
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary
|
||||
arch.uninstall.unnecessary.proceed=Uninstall
|
||||
arch.uninstalling.conflict=Uninstalling conflicting packages
|
||||
arch.uninstalling.conflict.fail=It was not possible to uninstall the conflicting packages: {}
|
||||
|
||||
@@ -218,7 +218,7 @@ arch.uninstall.required_by.advice=Devam etmek için bunları da kaldırmak gerek
|
||||
arch.uninstall.unnecessary.all=Aşağıdaki {} paketler kaldırılacak
|
||||
arch.uninstall.unnecessary.cancel=Tut
|
||||
arch.uninstall.unnecessary.l1=Packages successfully uninstalled!
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary. Select those you want to uninstall
|
||||
arch.uninstall.unnecessary.l2=The packages below seem to be no longer necessary
|
||||
arch.uninstall.unnecessary.proceed=Kaldır
|
||||
arch.uninstalling.conflict=Uninstalling conflicting packages
|
||||
arch.uninstalling.conflict.fail=It was not possible to uninstall the conflicting packages: {}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from typing import List
|
||||
|
||||
from PyQt5.QtCore import QSize, Qt
|
||||
from PyQt5.QtGui import QCursor
|
||||
from PyQt5.QtWidgets import QMessageBox, QVBoxLayout, QLabel, QWidget, QScrollArea, QFrame
|
||||
|
||||
from bauh.api.abstract.view import ViewComponent
|
||||
@@ -25,11 +26,13 @@ class ConfirmationDialog(QMessageBox):
|
||||
self.bt_yes = None
|
||||
if confirmation_button:
|
||||
self.bt_yes = self.addButton(i18n['popup.button.yes'] if not confirmation_label else confirmation_label.capitalize(), QMessageBox.YesRole)
|
||||
self.bt_yes.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
self.bt_yes.setStyleSheet(css.OK_BUTTON)
|
||||
self.setDefaultButton(self.bt_yes)
|
||||
|
||||
if deny_button:
|
||||
self.bt_no = self.addButton(i18n['popup.button.no'] if not deny_label else deny_label.capitalize(), QMessageBox.NoRole)
|
||||
self.bt_no.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
|
||||
if not confirmation_button:
|
||||
self.bt_no.setStyleSheet(css.OK_BUTTON)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import List
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtGui import QIcon, QCursor
|
||||
from PyQt5.QtWidgets import QMessageBox, QLabel, QWidget, QHBoxLayout
|
||||
|
||||
from bauh.api.abstract.view import MessageType
|
||||
@@ -47,9 +47,11 @@ def ask_confirmation(title: str, body: str, i18n: I18n, icon: QIcon = QIcon(reso
|
||||
|
||||
bt_yes = diag.addButton(i18n['popup.button.yes'], QMessageBox.YesRole)
|
||||
bt_yes.setStyleSheet(css.OK_BUTTON)
|
||||
bt_yes.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
diag.setDefaultButton(bt_yes)
|
||||
|
||||
diag.addButton(i18n['popup.button.no'], QMessageBox.NoRole)
|
||||
bt_no = diag.addButton(i18n['popup.button.no'], QMessageBox.NoRole)
|
||||
bt_no.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
|
||||
if icon:
|
||||
diag.setWindowIcon(icon)
|
||||
|
||||
Reference in New Issue
Block a user