Browse Source

do not call _ in default parameters

283
ThomasV 11 years ago
parent
commit
6446d66859
  1. 12
      gui/qt/util.py

12
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

Loading…
Cancel
Save