1
/* This file is part of KDevelop
2
Copyright 2010 Aleix Pol Gonzalez <aleixpol@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
20
#include "dashboardcorona.h"
22
#include <plasma/context.h>
23
#include <interfaces/iproject.h>
24
#include "dashboarddataengine.h"
25
#include "dashboardpluginloader.h"
28
#include <project/projectmodel.h>
30
DashboardCorona::DashboardCorona(KDevelop::IProject *project, QObject* parent)
31
: Plasma::Corona(parent), m_project(project)
33
DashboardPluginLoader::self()->engine().data()->addConnection(m_project->name(), m_project);
35
setPreferredToolBoxPlugin(Plasma::Containment::CustomContainment, "org.kde.nettoolbox");
39
KDevelop::IProject* DashboardCorona::project() const
44
void DashboardCorona::loadDefaultLayout()
46
Plasma::Containment* c=addContainment("newspaper");
47
c->context()->setCurrentActivity(m_project->name());
51
KConfigGroup invalidConfig;
52
c->setWallpaper("color");
53
// c->updateConstraints(Plasma::StartupCompletedConstraint);
54
// c->flushPendingConstraintsEvents();
55
c->save(invalidConfig);
57
emit containmentAdded(c);
59
if(m_project->projectFileUrl().isLocalFile()) {
60
QDir d(m_project->projectItem()->url().toLocalFile());
62
if(d.exists("README"))
63
c->addApplet("plasma_kdev_projectfileelement", QVariantList() << "README");
65
c->addApplet("plasma_kdev_projectfileelement", QVariantList() << "TODO");