Commit 5459a533 authored by David Redondo's avatar David Redondo 🏎

Improve StatusNotifierTest

Summary:
Allows to set Icon, AttentionIcon and OverlayIcon either by name or pixmap.
Makes it easier to test combinations of those.

Reviewers: kmaterka, apol

Reviewed By: kmaterka, apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D29619
parent c8deafbb
......@@ -63,6 +63,7 @@ StatusNotifierTest::StatusNotifierTest(QWidget* parent) :
connect(updateButton, &QPushButton::clicked, this, &StatusNotifierTest::updateNotifier);
connect(jobEnabledCheck, &QCheckBox::toggled, this, &StatusNotifierTest::enableJob);
updateUi();
iconName->setText(QStringLiteral("plasma"));
show();
raise();
log(QStringLiteral("started"));
......@@ -126,7 +127,6 @@ void StatusNotifierTest::updateUi()
statusPassive->setEnabled(!statusAuto->isChecked());
statusNeedsAttention->setEnabled(!statusAuto->isChecked());
iconName->setText(d->systemNotifier->iconName());
tooltipText->setText(d->systemNotifier->toolTipTitle());
tooltipSubtext->setText(d->systemNotifier->toolTipSubTitle());
......@@ -163,7 +163,12 @@ void StatusNotifierTest::updateNotifier()
}
d->systemNotifier->setStatus(s);
d->systemNotifier->setIconByName(iconName->text());
iconPixmapCheckbox->isChecked() ? d->systemNotifier->setIconByPixmap(QIcon::fromTheme(iconName->text()))
: d->systemNotifier->setIconByName(iconName->text());
overlayIconPixmapCheckbox->isChecked() ? d->systemNotifier->setOverlayIconByPixmap(QIcon::fromTheme(overlayIconName->text()))
: d->systemNotifier->setOverlayIconByName(overlayIconName->text());
attentionIconPixmapCheckbox->isChecked() ? d->systemNotifier->setAttentionIconByPixmap(QIcon::fromTheme(attentionIconName->text()))
: d->systemNotifier->setAttentionIconByName(attentionIconName->text());
d->systemNotifier->setToolTip(iconName->text(), tooltipText->text(), tooltipSubtext->text());
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>434</width>
<height>572</height>
<width>471</width>
<height>692</height>
</rect>
</property>
<property name="minimumSize">
......@@ -21,14 +21,13 @@
</property>
<property name="windowIcon">
<iconset theme="plasma">
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QTabWidget" name="JobTab">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
......@@ -110,10 +109,7 @@
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="iconName"/>
</item>
<item row="10" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;b&gt;ToolTip&lt;/b&gt;</string>
......@@ -126,9 +122,6 @@
<item row="12" column="1">
<widget class="QLineEdit" name="tooltipSubtext"/>
</item>
<item row="14" column="1">
<layout class="QHBoxLayout" name="horizontalLayout"/>
</item>
<item row="13" column="1">
<widget class="QPushButton" name="updateButton">
<property name="text">
......@@ -136,6 +129,73 @@
</property>
</widget>
</item>
<item row="8" column="1">
<layout class="QFormLayout" name="iconsLayout">
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Icon</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>AttentionIcon</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>OverlayIcon</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="iconLayout">
<item>
<widget class="QLineEdit" name="iconName"/>
</item>
<item>
<widget class="QCheckBox" name="iconPixmapCheckbox">
<property name="text">
<string>Use Pixmap</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="attentionIconLayout">
<item>
<widget class="QLineEdit" name="attentionIconName"/>
</item>
<item>
<widget class="QCheckBox" name="attentionIconPixmapCheckbox">
<property name="text">
<string>Use Pixmap</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="overlayIconLayout">
<item>
<widget class="QLineEdit" name="overlayIconName"/>
</item>
<item>
<widget class="QCheckBox" name="overlayIconPixmapCheckbox">
<property name="text">
<string>Use Pixmap</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
......
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