Removal of all unported/unbuilt applets, dataengines, runners, wallpapers

Summary:
With no-one having invested into porting/maintaining any of those plugins,
the disadvantages of keeping that code in the development branches
(translators getting data of dead code, developers searching for usage
examples hitting lots of dead code, seeing all the unported plugins/
lost work making sad) are not worth it.

Besides, all the applets will need to be substantially rewritten from
C++ to QML anyway, so a direct code history will not be that useful.

R.I.P., dear code, thanks for all the services. And may you find some
development gods to help you into a reincarnation soon
(special thoughts to eyes and bubblemon applets).

        @}-,-`-

Reviewers: jriddell, mart, davidedmundson

Reviewed By: mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10163
parent e761c3e9
......@@ -34,9 +34,6 @@ plasma_install_package(konsoleprofiles/package org.kde.plasma.konsoleprofiles)
plasma_install_package(kickerdash org.kde.plasma.kickerdash)
add_subdirectory(quicklaunch)
#This applet is disabled because although ported it does not work
# add_subdirectory(eyes)
add_subdirectory(userswitcher)
add_subdirectory(weather)
add_subdirectory(grouping)
# Find the required Libaries
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
)
# We add our source code here
set(blackboard_SRCS blackboard.cpp blackboardwidget.cpp)
# Now make sure all files get to the right place
kde4_add_plugin(plasma_applet_blackboard ${blackboard_SRCS})
target_link_libraries(plasma_applet_blackboard
${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
install(TARGETS plasma_applet_blackboard
DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-applet-blackboard.desktop
DESTINATION ${SERVICES_INSTALL_DIR})
/***************************************************************************
* Copyright 2009 by Davide Bettio <davide.bettio@kdemail.net> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "blackboard.h"
#include <QGraphicsLinearLayout>
#include <KDebug>
#include <KIcon>
#include <Plasma/Theme>
#include <Plasma/ToolButton>
BlackBoard::BlackBoard(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args),
blackBoard(0)
{
setAspectRatioMode(Plasma::IgnoreAspectRatio);
resize(200, 200);
setHasConfigurationInterface(false);
//setBackgroundHints(NoBackground);
}
BlackBoard::~BlackBoard()
{
if (blackBoard) {
blackBoard->saveImage();
}
}
void BlackBoard::init()
{
QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
blackBoard = new BlackBoardWidget(this);
blackBoard->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
mainLayout->addItem(blackBoard);
buttonsLayout = new QGraphicsLinearLayout(Qt::Horizontal);
addColorButton(QColor(Qt::red));
addColorButton(QColor(Qt::yellow));
addColorButton(QColor(Qt::green));
addColorButton(QColor(Qt::blue));
addColorButton(Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor));
Plasma::ToolButton *eraseB = new Plasma::ToolButton(this);
eraseB->setIcon(KIcon(QLatin1String("edit-delete")));
buttonsLayout->addItem(eraseB);
connect(eraseB, SIGNAL(clicked()), blackBoard, SLOT(erase()));
mainLayout->addItem(buttonsLayout);
setLayout(mainLayout);
}
void BlackBoard::addColorButton(QColor color)
{
QPixmap colorPixmap(22, 22);
colorPixmap.fill(color);
Plasma::ToolButton *tB = new Plasma::ToolButton(this);
tB->setProperty("color", color);
tB->setIcon(colorPixmap);
buttonsLayout->addItem(tB);
connect(tB, SIGNAL(clicked()), this, SLOT(changeColor()));
}
void BlackBoard::changeColor()
{
QObject *sender = QObject::sender();
if (!sender || sender->property("color").type() != QVariant::Color) {
return;
}
blackBoard->setBrushColor(sender->property("color").value<QColor>());
}
/***************************************************************************
* Copyright 2009 by Davide Bettio <davide.bettio@kdemail.net> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#ifndef BLACKBOARD_H
#define BLACKBOARD_H
#include <Plasma/Containment>
#include "blackboardwidget.h"
class QGraphicsLinearLayout;
class BlackBoard : public Plasma::Applet
{
Q_OBJECT
public:
BlackBoard(QObject *parent, const QVariantList &args);
~BlackBoard();
void init();
void addColorButton(QColor color);
private slots:
void changeColor();
private:
BlackBoardWidget *blackBoard;
QGraphicsLinearLayout *buttonsLayout;
};
K_EXPORT_PLASMA_APPLET(blackboard, BlackBoard)
#endif
/***************************************************************************
* Copyright 2009 by Davide Bettio <davide.bettio@kdemail.net> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "blackboardwidget.h"
#include <QGraphicsSceneMouseEvent>
#include <QStyleOptionGraphicsItem>
#include <QPainter>
#include <QTimer>
#include <KDebug>
#include <KIO/DeleteJob>
#include <KSaveFile>
#include <KStandardDirs>
#include <Plasma/Applet>
#include <Plasma/Theme>
BlackBoardWidget::BlackBoardWidget(Plasma::Applet *parent)
: QGraphicsWidget(parent)
{
m_changed = false;
setAcceptTouchEvents(true);
m_parentApplet = parent;
m_color = QColor(Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor));
m_oldPoint = QPointF(-1, 0);
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(saveImage()));
timer->start(600000);
QTimer::singleShot(500, this, SLOT(loadImage()));
}
BlackBoardWidget::~BlackBoardWidget()
{
}
void BlackBoardWidget::saveImage()
{
if (m_parentApplet->destroyed()){
KIO::del(imagePath());
}else{
if (m_changed){
KSaveFile imageFile(imagePath());
imageFile.open();
m_pixmap.save(&imageFile, "PNG");
imageFile.finalize();
imageFile.close();
}
}
}
void BlackBoardWidget::loadImage()
{
m_painter.end();
m_pixmap.load(imagePath(), "PNG");
update(contentsRect());
m_painter.begin(&m_pixmap);
m_painter.setPen(QPen(m_color, 3));
}
void BlackBoardWidget::mousePressEvent(QGraphicsSceneMouseEvent *)
{
update(contentsRect());
}
void BlackBoardWidget::drawSegment(QPointF point0, QPointF point1, qreal penRadius)
{
m_painter.setPen(QPen(m_color, penRadius));
m_painter.drawLine(point0, point1);
qreal x = qMin(point0.x(), point1.x()) -(penRadius + 1);
qreal y = qMin(point0.y(), point1.y()) -(penRadius + 1);
qreal w = qMax(point0.x(), point1.x()) + penRadius + 1 - x;
qreal h = qMax(point0.y(), point1.y()) + penRadius + 1 - y;
update(x,y,w,h);
m_changed = true;
}
bool BlackBoardWidget::event(QEvent *event)
{
switch (event->type()) {
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd: {
QList<QTouchEvent::TouchPoint> touchPoints = static_cast<QTouchEvent *>(event)->touchPoints();
foreach (const QTouchEvent::TouchPoint &touchPoint, touchPoints) {
switch (touchPoint.state()) {
case Qt::TouchPointStationary:
// don't do anything if this touch point hasn't moved
continue;
default:
drawSegment(touchPoint.lastPos(), touchPoint.pos(), 3*touchPoint.pressure());
break;
}
}
break;
}
default:
return QGraphicsWidget::event(event);
}
return true;
}
void BlackBoardWidget::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
{
QPointF lastPos = event->lastPos();
if (m_oldPoint.x() != -1){
drawSegment(m_oldPoint, lastPos, 1);
}
m_oldPoint = lastPos;
}
void BlackBoardWidget::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event )
{
mouseMoveEvent(event);
m_oldPoint.setX(-1);
}
void BlackBoardWidget::resizeEvent(QGraphicsSceneResizeEvent *event)
{
Q_UNUSED(event)
if (m_painter.isActive())
m_painter.end();
QPixmap tmpPixmap = m_pixmap;
m_pixmap = QPixmap(contentsRect().width(), contentsRect().height());
m_pixmap.fill(Qt::transparent);
m_painter.begin(&m_pixmap);
m_painter.drawPixmap(0, 0, tmpPixmap);
m_painter.setPen(QPen(m_color, 3));
}
void BlackBoardWidget::paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(widget)
p->drawPixmap(option->exposedRect, m_pixmap, option->exposedRect);
}
void BlackBoardWidget::setBrushColor(QColor color)
{
m_color = color;
m_painter.setPen(QPen(m_color, 3));
}
void BlackBoardWidget::erase()
{
m_pixmap.fill(Qt::transparent);
update(contentsRect());
KIO::del(imagePath());
}
QString BlackBoardWidget::imagePath()
{
return KStandardDirs::locateLocal("data", QLatin1String("plasma-desktop-datastorage/blackboard-") + QString::number(m_parentApplet->id()) + QLatin1String(".png"));
}
/***************************************************************************
* Copyright 2009 by Davide Bettio <davide.bettio@kdemail.net> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#ifndef BLACKBOARDWIDGET_H
#define BLACKBOARDWIDGET_H
#include <QGraphicsWidget>
#include <QPainter>
#include <QPixmap>
#include <QPointF>
class QGraphicsSceneMouseEvent;
class QStyleOptionGraphicsItem;
namespace Plasma
{
class Applet;
}
class BlackBoardWidget : public QGraphicsWidget
{
Q_OBJECT
public:
BlackBoardWidget(Plasma::Applet *parent);
~BlackBoardWidget();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent ( QGraphicsSceneMouseEvent *event );
void mouseReleaseEvent ( QGraphicsSceneMouseEvent *event );
void resizeEvent(QGraphicsSceneResizeEvent *event);
void setBrushColor(QColor color);
protected:
bool event(QEvent *event);
public Q_SLOTS:
void saveImage();
void erase();
private Q_SLOTS:
void loadImage();
private:
QString imagePath();
void drawSegment(QPointF point0, QPointF point1, qreal penRadius);
bool m_changed;
Plasma::Applet *m_parentApplet;
QString m_id;
QColor m_color;
QPixmap m_pixmap;
QPointF m_oldPoint;
QPainter m_painter;
};