[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5

Maximiliano Curia maxy at moszumanska.debian.org
Fri May 27 23:59:34 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=13643fe

The following commit has been merged in the master branch:
commit 13643fea3431e9860bb0c4e89d32b7fd70cab9de
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Sun Apr 24 14:53:06 2011 +0100

    Add missing files from last commit that I forgot to git add.
---
 src/KCMTelepathyAccounts/feedback-widget.cpp | 106 +++++++++++++++++++++++++++
 src/KCMTelepathyAccounts/feedback-widget.h   |  52 +++++++++++++
 2 files changed, 158 insertions(+)

diff --git a/src/KCMTelepathyAccounts/feedback-widget.cpp b/src/KCMTelepathyAccounts/feedback-widget.cpp
new file mode 100644
index 0000000..057456a
--- /dev/null
+++ b/src/KCMTelepathyAccounts/feedback-widget.cpp
@@ -0,0 +1,106 @@
+/*
+ * This file is part of telepathy-accounts-kcm and contains
+ * code from Bluedevil
+ *
+ * Copyright (C) 2010 Rafael Fernández López <ereslibre at kde.org>
+ * Copyright (C) 2010 UFO Coders <info at ufocoders.com>
+ * Copyright (C) 2011 Thomas Richard <thomas.richard at proan.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "feedback-widget.h"
+
+#include <KTitleWidget>
+#include <KDebug>
+#include <KLocale>
+#include <KIcon>
+#include <KPushButton>
+#include <KColorScheme>
+
+#include <QtGui/QWidget>
+#include <QtGui/QLabel>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QPaintEvent>
+#include <QtGui/QPainter>
+#include <QtCore/QTimer>
+
+FeedbackWidget::FeedbackWidget(QWidget *parent)
+    : KTitleWidget(parent)
+{
+    // Hide by default because we only want to show ourselfs when an error came up
+    this->hide();
+
+    m_type = KTitleWidget::PlainMessage;
+}
+
+FeedbackWidget::~FeedbackWidget()
+{
+}
+
+void FeedbackWidget::setMessage(const QString &text, const QString &comment, KTitleWidget::MessageType type)
+{
+    setText(text, type);
+    setComment(comment, type);
+}
+
+void FeedbackWidget::setText(const QString &text, KTitleWidget::MessageType type)
+{
+    m_type = type;
+    KTitleWidget::setText(text, type);
+}
+
+void FeedbackWidget::setComment(const QString &comment, KTitleWidget::MessageType type)
+{
+    m_type = type;
+    KTitleWidget::setComment(comment, type);
+}
+
+void FeedbackWidget::paintEvent(QPaintEvent *event)
+{
+    const QRect r = rect();
+
+    const KColorScheme colorScheme(QPalette::Active, KColorScheme::Window);
+
+    QPainter p(this);
+    p.setRenderHint(QPainter::Antialiasing);
+
+    QPainterPath path;
+    path.addRoundedRect(0, 0, r.width(), r.height(), 10, 10);
+
+    QBrush brush;
+
+    switch(m_type) {
+        case KTitleWidget::PlainMessage:
+            brush = colorScheme.background(KColorScheme::NormalBackground);
+            break;
+        case KTitleWidget::ErrorMessage:
+            brush = colorScheme.background(KColorScheme::NegativeBackground);
+            break;
+        case KTitleWidget::WarningMessage:
+            brush = colorScheme.background(KColorScheme::NeutralBackground);
+            break;
+        case KTitleWidget::InfoMessage:
+            brush = QBrush(QColor(156,213,219));
+            break;
+    }
+
+    p.fillPath(path, brush);
+
+    KTitleWidget::paintEvent(event);
+}
+
+#include "feedback-widget.moc"
diff --git a/src/KCMTelepathyAccounts/feedback-widget.h b/src/KCMTelepathyAccounts/feedback-widget.h
new file mode 100644
index 0000000..e547857
--- /dev/null
+++ b/src/KCMTelepathyAccounts/feedback-widget.h
@@ -0,0 +1,52 @@
+/*
+ * This file is part of telepathy-accounts-kcm and contains
+ * code from Bluedevil
+ *
+ * Copyright (C) 2010 Rafael Fernández López <ereslibre at kde.org>
+ * Copyright (C) 2010 UFO Coders <info at ufocoders.com>
+ * Copyright (C) 2011 Thomas Richard <thomas.richard at proan.be>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef TELEPATHY_ACCOUNTS_KCM_FEEDBACK_WIDGET_H
+#define TELEPATHY_ACCOUNTS_KCM_FEEDBACK_WIDGET_H
+
+#include <KTitleWidget>
+
+class QLabel;
+class QHBoxLayout;
+class QTimer;
+
+class FeedbackWidget : public KTitleWidget
+{
+Q_OBJECT
+public:
+    FeedbackWidget(QWidget *parent = 0);
+    virtual ~FeedbackWidget();
+
+public slots:
+    void setMessage(const QString &text, const QString &comment, KTitleWidget::MessageType type);
+    void setText(const QString &text, KTitleWidget::MessageType type);
+    void setComment(const QString &comment, KTitleWidget::MessageType type=KTitleWidget::PlainMessage);
+
+protected:
+    virtual void paintEvent(QPaintEvent *event);
+
+private:
+    KTitleWidget::MessageType m_type;
+};
+
+#endif

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list