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