hplip/hplip-dialog-infinite-loop.patch

35 lines
1016 B
Diff
Raw Normal View History

diff --git a/ui5/devmgr5.py b/ui5/devmgr5.py
index c23957a..48b248f 100644
--- a/ui5/devmgr5.py
+++ b/ui5/devmgr5.py
@@ -2247,7 +2247,7 @@ class PasswordDialog(QDialog):
self.prompt = prompt
Layout= QGridLayout(self)
- Layout.setMargin(11)
+ Layout.setContentsMargins(11, 11, 11, 11)
Layout.setSpacing(6)
self.PromptTextLabel = QLabel(self)
@@ -2300,14 +2300,15 @@ class PasswordDialog(QDialog):
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
def showPasswordUI(prompt):
+ dlg = None
+
try:
dlg = PasswordDialog(prompt, None)
+ except Exception as e:
+ log.error('Unable to open password dialog due following error:\n {}'.format(e))
- if dlg.exec_() == QDialog.Accepted:
- return (dlg.getUsername(), dlg.getPassword())
-
- finally:
- pass
+ if dlg and dlg.exec_() == QDialog.Accepted:
+ return (dlg.getUsername(), dlg.getPassword())
return ("", "")