From e0237e901fa18882c2650a2369b28c32cde97d48 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Mon, 16 Nov 2015 17:34:16 +0200 Subject: [PATCH 1/2] Added help label to detail mode --HG-- branch : feature --- .../16x16/status/dialog-warning.png | Bin 0 -> 1596 bytes .../icons/win.icon.theme/index.theme | 7 +++++- src/libs/vmisc/share/resources/theme.qrc | 1 + .../vtools/dialogs/tools/dialogdetail.cpp | 20 +++++++++++++++++- src/libs/vtools/dialogs/tools/dialogdetail.ui | 13 ++++++++++++ 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/status/dialog-warning.png diff --git a/src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/status/dialog-warning.png b/src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/status/dialog-warning.png new file mode 100644 index 0000000000000000000000000000000000000000..2f4532b954da44d9864aa04b1a0f3f14f14ebb6d GIT binary patch literal 1596 zcmV-C2E+M@P)QUjFH?y7rO7omoD9Xn_0tvNq3hODvhBB{T0f?_R|u{~b;Rr-I{6NV{cwc5e?M;wZ7O zAlvtx%(1qOYxL)sBwoVcavrz`KK$>t)hih3mgwQK63WdFZWV=_3ic`|6ZzXs%1(iA<<8M@QaCeH|Od|hYb3k+1t-FL2`xH-9z40{feA0F|H{jWg7iU$K7O6msye?+-8en(NZpy0< z2(k$H!r2Z`u4(mHS_%vdwwiCV1ZteBdP;QKdVP29iT3|`SySY}$cQKb`DgqHK8G(R z{>g1HD7 z<}}h5+5s9Dxn%BKpd+TfCWiJ`Px{9hd$K+_^@>c=9;OY_x@ncPc4Z1@7$Bj0Ie_6X?L zFIzdy1yE@!{Io6ty{6JMx)i8cSvH!JHpB~d3b8veZsR5q6wQ;GkhetNh$6+O3CWxy zd_PxVYE|?48aMBCPt8M@8x7W-fJWNHnJxr0CmMrvX+XUt-+G!ez&2wT&p!r4=>+~| z{xQ&>UMSbn0LmcAX5s=2wC8HHltAk%Nw%L0z#HMa2+s)@E`77?;_|Qbc5NEo)VAq2 zLP*$XxK8-&_ofzl7fwi9602L6R4WdK15|=&Q`TjH1^QfF%BFg&w3~N|vbo+}kstuIzAn9dm!Og|y|%45 zgO{OHm0rl};_4_{3Qe*TF5FjM5y$d+<0<9Itb><5&!#AM@E2chO14ls98m@@KN`=Q zNo>`&6U@g;OBlvhvCJ42bDfOQ%c8R&A%`Un=;*vIy@&bD2?VT|p>7_jlTBP`XrUMpXgA4_Nv u%FtpGR_t1)g*RgrYrdh%@UEenUi3Fw1x(loAhWRm0000icons/win.icon.theme/16x16/actions/go-previous.png icons/win.icon.theme/24x24/actions/go-previous.png icons/win.icon.theme/32x32/actions/go-previous.png + icons/win.icon.theme/16x16/status/dialog-warning.png diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index 97b2f3b20..d4023da8d 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -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(""; + + 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; } diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.ui b/src/libs/vtools/dialogs/tools/dialogdetail.ui index 1e5536314..a0d11eb81 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.ui +++ b/src/libs/vtools/dialogs/tools/dialogdetail.ui @@ -390,6 +390,19 @@ + + + + Ready! + + + Qt::RichText + + + false + + + From fe236312515b4160c0921c1a8666980ee7e70618 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Mon, 16 Nov 2015 17:54:45 +0200 Subject: [PATCH 2/2] Changed pixmap and icon to const, removed setTextFormat --HG-- branch : feature --- src/libs/vtools/dialogs/tools/dialogdetail.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index d4023da8d..83276d43e 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -455,20 +455,18 @@ void DialogDetail::ScrollDown() //--------------------------------------------------------------------------------------------------------------------- bool DialogDetail::DetailIsValid() const { - QIcon icon = QIcon::fromTheme("dialog-warning", + const QIcon icon = QIcon::fromTheme("dialog-warning", QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png")); - QPixmap pixmap = icon.pixmap(QSize(16, 16)); + const QPixmap pixmap = icon.pixmap(QSize(16, 16)); QByteArray byteArray; QBuffer buffer(&byteArray); pixmap.save(&buffer, "PNG"); QString url = QString(""; - ui.helpLabel->setTextFormat(Qt::RichText); - if (ui.listWidget->count() < 3) { - url += QString(tr(" You need more points!")); + url += QString(" ") + tr("You need more points!"); ui.helpLabel->setText(url); return false; } @@ -476,7 +474,7 @@ bool DialogDetail::DetailIsValid() const { if (FirstPointEqualLast()) { - url += QString(tr(" First point can not equal the last point!")); + url += QString(" ") +tr("First point can not equal the last point!"); ui.helpLabel->setText(url); return false; } @@ -489,14 +487,14 @@ bool DialogDetail::DetailIsValid() const if (QString::compare(previousRow, nextRow) == 0) { - url += QString(tr(" You have double points!")); + url += QString(" ") +tr("You have double points!"); ui.helpLabel->setText(url); return false; } } } } - ui.helpLabel->setText(QString(tr("Ready!"))); + ui.helpLabel->setText(tr("Ready!")); return true; }