Added help label to detail mode

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2015-11-16 17:34:16 +02:00
parent f46a494d3b
commit e0237e901f
5 changed files with 39 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -5,13 +5,18 @@ Inherits=gnome,hicolor
Example=x-directory-normal
#Directories
Directories=16x16/actions,24x24/actions,32x32/actions,32x32/emblems
Directories=16x16/actions,16x16/status,24x24/actions,32x32/actions,32x32/emblems
[16x16/actions]
Size=16
Context=Actions
Type=Fixed
[16x16/status]
Size=16
Context=Status
Type=Fixed
[24x24/actions]
Size=24
Context=Actions

View File

@ -80,5 +80,6 @@
<file alias="16x16/actions/go-previous.png">icons/win.icon.theme/16x16/actions/go-previous.png</file>
<file alias="24x24/actions/go-previous.png">icons/win.icon.theme/24x24/actions/go-previous.png</file>
<file alias="32x32/actions/go-previous.png">icons/win.icon.theme/32x32/actions/go-previous.png</file>
<file alias="16x16/status/dialog-warning.png">icons/win.icon.theme/16x16/status/dialog-warning.png</file>
</qresource>
</RCC>

View File

@ -455,14 +455,29 @@ void DialogDetail::ScrollDown()
//---------------------------------------------------------------------------------------------------------------------
bool DialogDetail::DetailIsValid() const
{
QIcon icon = QIcon::fromTheme("dialog-warning",
QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png"));
QPixmap pixmap = icon.pixmap(QSize(16, 16));
QByteArray byteArray;
QBuffer buffer(&byteArray);
pixmap.save(&buffer, "PNG");
QString url = QString("<img src=\"data:image/png;base64,") + byteArray.toBase64() + "\"/>";
ui.helpLabel->setTextFormat(Qt::RichText);
if (ui.listWidget->count() < 3)
{
url += QString(tr(" You need more points!"));
ui.helpLabel->setText(url);
return false;
}
else
{
if (FirstPointEqualLast())
{
url += QString(tr(" First point can not equal the last point!"));
ui.helpLabel->setText(url);
return false;
}
else
@ -474,11 +489,14 @@ bool DialogDetail::DetailIsValid() const
if (QString::compare(previousRow, nextRow) == 0)
{
url += QString(tr(" You have double points!"));
ui.helpLabel->setText(url);
return false;
}
}
}
}
ui.helpLabel->setText(QString(tr("Ready!")));
return true;
}

View File

@ -390,6 +390,19 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="helpLabel">
<property name="text">
<string>Ready!</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">