summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-01 11:36:27 (GMT)
committerSwift Review <review@swift.im>2014-10-08 07:58:57 (GMT)
commit54351d4b9d8d3580c4f60306c3e1dfcba304777b (patch)
tree7a1cfea12e59e7b13a2b903c0eb8e30b640473c4 /Swift/QtUI/QtVCardWidget
parent3e40b302af0e2abde3c002c7f25ec5276f68f230 (diff)
downloadswift-54351d4b9d8d3580c4f60306c3e1dfcba304777b.zip
swift-54351d4b9d8d3580c4f60306c3e1dfcba304777b.tar.bz2
Explain the use of preffered stars in 'Edit Profile' dialog if they are checked.
Test-Information: Verified this works by running Swift and editing a profile. Change-Id: I965ef374ceed2ba5b3225070931b6c06e3b9e800
Diffstat (limited to 'Swift/QtUI/QtVCardWidget')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp8
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
index 74d9c59..155bd4f 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.cpp
@@ -15,6 +15,7 @@
#include <cassert>
#include <QHBoxLayout>
+#include <QToolTip>
namespace Swift {
@@ -38,6 +39,7 @@ void QtVCardGeneralField::initialize() {
);
layout->addWidget(preferredCheckBox, row, 0, Qt::AlignVCenter);
childWidgets << preferredCheckBox;
+ connect(preferredCheckBox, SIGNAL(stateChanged(int)), SLOT(handlePreferredStarStateChanged(int)));
}
label = new QLabel(this);
label->setText(labelText);
@@ -124,6 +126,12 @@ void QtVCardGeneralField::handleCloseButtonClicked() {
deleteField(this);
}
+void QtVCardGeneralField::handlePreferredStarStateChanged(int state) {
+ if (state == Qt::Checked) {
+ QToolTip::showText(QCursor::pos(), tr("Marked as your preferred %1. Click again to undo.").arg(labelText));
+ }
+}
+
void QtVCardGeneralField::updatePreferredStarVisibility() {
if (preferredCheckBox) {
bool showStar = false;
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h
index 93d326b..4f4cccd 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h
+++ b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h
@@ -65,6 +65,7 @@ class QtVCardGeneralField : public QWidget {
public slots:
void handleCloseButtonClicked();
+ void handlePreferredStarStateChanged(int statte);
protected:
QList<QWidget*> childWidgets;