~ubuntu-branches/ubuntu/oneiric/kdeplasma-addons/oneiric

« back to all changes in this revision

Viewing changes to containments/groupingdesktop/lib/groups/floatinggroup.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-26 13:35:18 UTC
  • mto: (0.4.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: james.westby@ubuntu.com-20101126133518-remqkgqjafk2a4jc
Tags: upstream-4.5.80
ImportĀ upstreamĀ versionĀ 4.5.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright 2009-2010 by Giulio Camuffo <giuliocamuffo@gmail.com>
 
3
 *
 
4
 *   This program is free software; you can redistribute it and/or modify
 
5
 *   it under the terms of the GNU Library General Public License as
 
6
 *   published by the Free Software Foundation; either version 2, or
 
7
 *   (at your option) any later version.
 
8
 *
 
9
 *   This program 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
 
12
 *   GNU General Public License for more details
 
13
 *
 
14
 *   You should have received a copy of the GNU Library General Public
 
15
 *   License along with this program; if not, write to the
 
16
 *   Free Software Foundation, Inc.,
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#include "floatinggroup.h"
 
21
 
 
22
REGISTER_GROUP(FloatingGroup)
 
23
 
 
24
FloatingGroup::FloatingGroup(QGraphicsItem *parent, Qt::WindowFlags wFlags)
 
25
             : AbstractGroup(parent, wFlags)
 
26
{
 
27
    resize(200,200);
 
28
    setGroupType(AbstractGroup::FreeGroup);
 
29
}
 
30
 
 
31
FloatingGroup::~FloatingGroup()
 
32
{
 
33
 
 
34
}
 
35
 
 
36
QString FloatingGroup::pluginName() const
 
37
{
 
38
    return QString("floating");
 
39
}
 
40
 
 
41
void FloatingGroup::restoreChildGroupInfo(QGraphicsWidget *child, const KConfigGroup &group)
 
42
{
 
43
    QPointF pos = group.readEntry("Position", QPointF());
 
44
 
 
45
    child->setPos(pos);
 
46
}
 
47
 
 
48
void FloatingGroup::saveChildGroupInfo(QGraphicsWidget *child, KConfigGroup group) const
 
49
{
 
50
    group.writeEntry("Position", child->pos());
 
51
}
 
52
 
 
53
void FloatingGroup::layoutChild(QGraphicsWidget *, const QPointF &)
 
54
{
 
55
 
 
56
}
 
57
 
 
58
GroupInfo FloatingGroup::groupInfo()
 
59
{
 
60
    GroupInfo gi("floating", i18n("Floating Group"));
 
61
 
 
62
    return gi;
 
63
}
 
64
 
 
65
#include "floatinggroup.moc"