aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-12-11 13:45:26 +0100
committerMontel Laurent <[email protected]>2017-12-11 13:45:26 +0100
commitd4a4a9e1db1b0de01cb72005f2b84d833b829a47 (patch)
tree2e693931de59b403565e938ad0f4d1d91ec33819
parent4df53674bcd10654b3a1d13ff437ac21622e398c (diff)
Remove button and make label clickable
-rw-r--r--autotests/libs/conflictresolvedialogtest.cpp5
-rw-r--r--src/widgets/conflictresolvedialog.cpp18
2 files changed, 7 insertions, 16 deletions
diff --git a/autotests/libs/conflictresolvedialogtest.cpp b/autotests/libs/conflictresolvedialogtest.cpp
index be5fc22..d4c3779 100644
--- a/autotests/libs/conflictresolvedialogtest.cpp
+++ b/autotests/libs/conflictresolvedialogtest.cpp
@@ -60,8 +60,5 @@ void ConflictResolveDialogTest::shouldHaveDefaultValues()
QVERIFY(docuLabel);
QVERIFY(!docuLabel->text().isEmpty());
QVERIFY(docuLabel->wordWrap());
-
- QPushButton *openEditorButton = dlg.findChild<QPushButton *>(QStringLiteral("openEditorButton"));
- QVERIFY(openEditorButton);
- QVERIFY(!openEditorButton->text().isEmpty());
+ QCOMPARE(docuLabel->contextMenuPolicy(), Qt::NoContextMenu);
}
diff --git a/src/widgets/conflictresolvedialog.cpp b/src/widgets/conflictresolvedialog.cpp
index 4ce8110..4e87705 100644
--- a/src/widgets/conflictresolvedialog.cpp
+++ b/src/widgets/conflictresolvedialog.cpp
@@ -232,23 +232,17 @@ ConflictResolveDialog::ConflictResolveDialog(QWidget *parent)
mView->setObjectName(QStringLiteral("view"));
mView->setOpenLinks(false);
- QLabel *docuLabel = new QLabel(i18n("Your changes conflict with those made by someone else meanwhile.\n"
- "Unless one version can just be thrown away, you will have to integrate those changes manually.\n"
- "Click on \"Open text editor\" to keep a copy of the texts, then select which version is most correct, then re-open it and modify it again to add what's missing."));
+ QLabel *docuLabel = new QLabel(i18n("<qt>Your changes conflict with those made by someone else meanwhile.<br>"
+ "Unless one version can just be thrown away, you will have to integrate those changes manually.<br>"
+ "Click on <a href=\"opentexteditor\">\"Open text editor\"</a> to keep a copy of the texts, then select which version is most correct, then re-open it and modify it again to add what's missing."));
+ connect(docuLabel, &QLabel::linkActivated, this, &ConflictResolveDialog::slotOpenEditor);
+ docuLabel->setContextMenuPolicy(Qt::NoContextMenu);
+
docuLabel->setWordWrap(true);
docuLabel->setObjectName(QStringLiteral("doculabel"));
- // TODO it would be even better if this was a clickable link in the label...
- QPushButton *openEditorButton = new QPushButton(this);
- openEditorButton->setText(i18nc("@action:button", "Open text editor"));
- connect(openEditorButton, &QPushButton::clicked, this, &ConflictResolveDialog::slotOpenEditor);
- openEditorButton->setObjectName(QStringLiteral("openEditorButton"));
- QHBoxLayout *separateLayout = new QHBoxLayout;
- separateLayout->addWidget(openEditorButton);
- separateLayout->addStretch();
mainLayout->addWidget(mView);
mainLayout->addWidget(docuLabel);
- mainLayout->addLayout(separateLayout);
mainLayout->addLayout(buttonLayout);
// default size is tiny, and there's usually lots of text, so make it much bigger