cmake: use KMessageWidget in build dir choose dialog instead custom code

parent ff03ebfc
Pipeline #14264 failed with stage
in 60 minutes
......@@ -29,7 +29,6 @@
#include <interfaces/iruntime.h>
#include <interfaces/iruntimecontroller.h>
#include <KColorScheme>
#include <KLocalizedString>
#include <QDir>
......@@ -283,14 +282,8 @@ void CMakeBuildDirChooser::setExtraArguments(const QString& args)
void CMakeBuildDirChooser::setStatus(const QString& message, bool canApply)
{
KColorScheme scheme(QPalette::Normal);
KColorScheme::ForegroundRole role;
if (canApply) {
role = KColorScheme::PositiveText;
} else {
role = KColorScheme::NegativeText;
}
m_chooserUi->status->setText(QStringLiteral("<i><font color='%1'>%2</font></i>").arg(scheme.foreground(role).color().name(), message));
m_chooserUi->status->setMessageType(canApply ? KMessageWidget::Positive : KMessageWidget::Warning);
m_chooserUi->status->setText(message);
auto okButton = m_buttonBox->button(QDialogButtonBox::Ok);
okButton->setEnabled(canApply);
......
......@@ -187,12 +187,9 @@
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="status">
<property name="text">
<string notr="true">Status Message...</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<widget class="KMessageWidget" name="status">
<property name="closeButtonVisible">
<bool>false</bool>
</property>
</widget>
</item>
......@@ -209,6 +206,11 @@
<extends>QWidget</extends>
<header>KUrlRequester</header>
</customwidget>
<customwidget>
<class>KMessageWidget</class>
<extends>QFrame</extends>
<header>KMessageWidget</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment