| 1549 | } |
| 1550 | |
| 1551 | QPushButton *SynchronizerGUI::createButton(QWidget *parent, |
| 1552 | const QString &iconName, |
| 1553 | bool checked, |
| 1554 | const QKeySequence &shortCut, |
| 1555 | const QString &description, |
| 1556 | const QString &text, |
| 1557 | bool textAndIcon) |
| 1558 | { |
| 1559 | auto *button = new QPushButton(parent); |
| 1560 | bool iconExists = Icon::exists(iconName); |
| 1561 | if (!text.isEmpty() && (textAndIcon || !iconExists)) { |
| 1562 | button->setText(text); |
| 1563 | } |
| 1564 | if (iconExists) { |
| 1565 | button->setIcon(Icon(iconName)); |
| 1566 | } |
| 1567 | button->setCheckable(true); |
| 1568 | button->setChecked(checked); |
| 1569 | button->setShortcut(shortCut); |
| 1570 | const QString infoText = QString("%1 (%2)").arg(description, shortCut.toString(QKeySequence::NativeText)); |
| 1571 | button->setWhatsThis(infoText); |
| 1572 | button->setToolTip(infoText); |
| 1573 | return button; |
| 1574 | } |
| 1575 | |
| 1576 | void SynchronizerGUI::copyToClipboard(bool isLeft) |
| 1577 | { |