commit 6446d6685996e36cd6fe9b2b25e66287211bae68
parent b854c3e173d0de18469addb97767ff614e2af202
Author: ThomasV <thomasv@gitorious>
Date: Fri, 12 Sep 2014 16:49:01 +0200
do not call _ in default parameters
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gui/qt/util.py b/gui/qt/util.py
@@ -85,28 +85,28 @@ class HelpButton(QPushButton):
-def close_button(dialog, label=_("Close") ):
+def close_button(dialog, label=None):
hbox = QHBoxLayout()
hbox.addStretch(1)
- b = QPushButton(label)
+ b = QPushButton(label or _("Close"))
hbox.addWidget(b)
b.clicked.connect(dialog.close)
b.setDefault(True)
return hbox
-def ok_cancel_buttons2(dialog, ok_label=_("OK"), cancel_label=_('Cancel')):
+def ok_cancel_buttons2(dialog, ok_label=None, cancel_label=None):
hbox = QHBoxLayout()
hbox.addStretch(1)
- b = QPushButton(cancel_label)
+ b = QPushButton(cancel_label or _('Cancel'))
hbox.addWidget(b)
b.clicked.connect(dialog.reject)
- b = QPushButton(ok_label)
+ b = QPushButton(ok_label or _("OK"))
hbox.addWidget(b)
b.clicked.connect(dialog.accept)
b.setDefault(True)
return hbox, b
-def ok_cancel_buttons(dialog, ok_label=_("OK"), cancel_label=_('Cancel')):
+def ok_cancel_buttons(dialog, ok_label=None, cancel_label=None):
hbox, b = ok_cancel_buttons2(dialog, ok_label, cancel_label)
return hbox