Skip to content

Commit

Permalink
Changes: Separating the lock screen to an application extension, part 1
Browse files Browse the repository at this point in the history
RevBy: TrustMe
  • Loading branch information
Vesa Halttunen committed Dec 2, 2010
1 parent 10398a3 commit 78812a6
Show file tree
Hide file tree
Showing 126 changed files with 2,138 additions and 1,489 deletions.
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ lib
.cproject
core
doc/html
debian/system-ui
debian/system-ui-dbg*
debian/system-ui-dev*
debian/system-ui-doc*
debian/system-ui-tests*
debian/systemui-l10n-engineering-english*
debian/files
debian/tmp
debian/system-ui.substvars
build-stamp
configure-stamp
localconfig.pri
15 changes: 14 additions & 1 deletion debian/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
libnotificationsystem*
system-ui
system-ui-dbg
system-ui-dev
system-ui-doc
system-ui-tests
systemui-l10n-engineering-english
libnotificationsystem0
libnotificationsystem-dev
files
tmp
system-ui-screenlock
*.substvars
*.log
*.debhelper
5 changes: 5 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,8 @@ Section: devel
Architecture: all
Description: Engineering English translations for system-ui daemon.

Package: system-ui-screenlock
Architecture: any
Section: libs
Depends: ${shlibs:Depends}
Description: Screen lock extension for system-ui
4 changes: 4 additions & 0 deletions debian/system-ui-screenlock.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
usr/share/themes/base/meegotouch/libsysuid-screenlock/style/*.css
usr/share/themes/base/meegotouch/libsysuid-screenlock/*.conf
usr/lib/meegotouch/applicationextensions/libsysuid-screenlock.so
usr/share/meegotouch/applicationextensions/sysuid-screenlock.desktop
2 changes: 0 additions & 2 deletions demos/plugins/call/call.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ desktop_entry.files = *.desktop
INSTALLS += \
target \
desktop_entry

include(../check.pri)
4 changes: 3 additions & 1 deletion demos/plugins/call/callplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
**
****************************************************************************/

#include <MLibrary>
#include "callplugin.h"
#include "call.h"

Q_EXPORT_PLUGIN2(call, CallPlugin)


CallPlugin::CallPlugin() : statusIndicatorMenu(0), call(0)
{
}
Expand All @@ -49,3 +49,5 @@ QGraphicsWidget *CallPlugin::widget()
{
return call;
}

M_LIBRARY
8 changes: 0 additions & 8 deletions demos/plugins/check.pri

This file was deleted.

2 changes: 0 additions & 2 deletions demos/plugins/profile/profile.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ desktop_entry.files = *.desktop
INSTALLS += \
target \
desktop_entry

include(../check.pri)
4 changes: 3 additions & 1 deletion demos/plugins/profile/profileplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
**
****************************************************************************/

#include <MLibrary>
#include "profileplugin.h"
#include "profile.h"

Q_EXPORT_PLUGIN2(profile, ProfilePlugin)


ProfilePlugin::ProfilePlugin() : statusIndicatorMenu(0), profile(0)
{
}
Expand All @@ -49,3 +49,5 @@ QGraphicsWidget *ProfilePlugin::widget()
{
return profile;
}

M_LIBRARY
2 changes: 2 additions & 0 deletions src/extensions/extensions.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TEMPLATE = subdirs
SUBDIRS = screenlock screenlock/themes
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ void Date::applyStyle()
MStylableWidget::applyStyle();

label->setAlignment(style()->horizontalAlign());
dateFormat = style()->dateFormat();
updateDate();
}

void Date::updateDate()
{
// Set current time in the labels
QDateTime currentTime = QDateTime::currentDateTime();
QString dateFormat = style()->dateFormat();
if (dateFormat.isEmpty()) {
label->setText(locale->formatDateTime(currentTime, MLocale::DateFull, MLocale::TimeNone));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ private slots:
//! Update timer
QTimer timer;

//! Date format string
QString dateFormat;

#ifdef HAVE_QMSYSTEM
//! QmTime object for listening date changes
MeeGo::QmTime qmTime;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
#include "lockscreen.h"

LockScreen::LockScreen(QGraphicsItem *parent) :
MSceneWindow(parent),
MWidgetController(parent),
displayOn(true)

{
connect(this, SIGNAL(displayExited()), this, SLOT(sliderUnlocked()));

Expand All @@ -46,8 +45,7 @@ void LockScreen::updateDisplayState(MeeGo::QmDisplayState::DisplayState state)

void LockScreen::sliderUnlocked()
{
if(displayOn)
{
if(displayOn) {
emit unlocked();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
#ifndef LOCKSCREEN_H
#define LOCKSCREEN_H

#include <MSceneWindow>
#include <MWidgetController>

#ifdef HAVE_QMSYSTEM
#include <qmdisplaystate.h>
#endif

class LockScreen : public MSceneWindow
class LockScreen : public MWidgetController
{
Q_OBJECT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ LockScreenStatusAreaView::LockScreenStatusAreaView(StatusArea *controller) :
connect(phoneNetworkTypeIndicator, SIGNAL(networkAvailabilityChanged(bool)), phoneSignalStrengthIndicator, SLOT(setDisplay(bool)));

// Connect notification signals
connect(&Sysuid::instance()->notifierNotificationSink(), SIGNAL(notifierSinkActive(bool)), notifierIndicator, SLOT(setActive(bool)));
// TODO
//connect(&Sysuid::instance()->notifierNotificationSink(), SIGNAL(notifierSinkActive(bool)), notifierIndicator, SLOT(setActive(bool)));

// Put indicators into the layout
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
Expand Down
36 changes: 36 additions & 0 deletions src/extensions/screenlock/lockscreenstyle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation ([email protected])
**
** This file is part of systemui.
**
** If you have questions regarding the use of this file, please contact
** Nokia at [email protected].
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#ifndef LOCKSCREENSTYLE_H
#define LOCKSCREENSTYLE_H

#include <mwidgetstyle.h>

class LockScreenStyle : public MWidgetStyle
{
Q_OBJECT
M_STYLE(LockScreenStyle)
};

class LockScreenStyleContainer : public MWidgetStyleContainer
{
M_STYLE_CONTAINER(LockScreenStyle)
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
**
****************************************************************************/
#include <QGraphicsLinearLayout>
#include "lockscreenview.h"
#include <MGConfItem>
#include <MViewCreator>
#include <MSceneManager>
#include "lockscreen.h"
#include "lockscreenview.h"

const QString GCONF_KEY_LANDSCAPE = "/desktop/meego/background/landscape/picture_filename";
const QString GCONF_KEY_PORTRAIT = "/desktop/meego/background/portrait/picture_filename";
Expand Down Expand Up @@ -76,10 +76,10 @@ void LockScreenBackgroundPixmap::destroyPixmap()
}
}

LockScreenView::LockScreenView(MSceneWindow* controller) : MSceneWindowView(controller),
LockScreenView::LockScreenView(MWidgetController* controller) : MWidgetView(controller),
controller(controller),
layout(new QGraphicsLinearLayout(Qt::Vertical)),
lockScreenHeader(new MWidgetController),
controller(controller),
landscapePixmap(GCONF_KEY_LANDSCAPE),
portraitPixmap(GCONF_KEY_PORTRAIT)
{
Expand Down Expand Up @@ -109,7 +109,7 @@ void LockScreenView::drawBackground(QPainter *painter, const QStyleOptionGraphic

if (pixmap == NULL || pixmap->isNull()) {
// If no specific pixmap has been loaded or the pixmap is not valid, use the default
MSceneWindowView::drawBackground(painter, option);
MWidgetView::drawBackground(painter, option);
} else {
// Otherwise draw the specific pixmap
painter->drawPixmap(QRectF(QPointF(), controller->geometry().size()), *pixmap, QRectF(0, 0, pixmap->width(), pixmap->height()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
#ifndef LOCKSCREENVIEW_H
#define LOCKSCREENVIEW_H

#include <mscenewindowview.h>
#include <MWidgetView>
#include "lockscreenstyle.h"

class QGraphicsLinearLayout;
class MGConfItem;
Expand Down Expand Up @@ -74,18 +75,18 @@ private slots:
/*!
* LockScreenView renders the background image of the lock screen.
*/
class LockScreenView : public MSceneWindowView
class LockScreenView : public MWidgetView
{
Q_OBJECT
M_VIEW(MSceneWindowModel, MSceneWindowStyle)
M_VIEW(MWidgetModel, LockScreenStyle)

public:
/*!
* Creates a lock screen view.
*
* \param controller controller for the view
*/
LockScreenView(MSceneWindow* controller);
LockScreenView(MWidgetController* controller);

/*!
* Destroys the lock screen view.
Expand All @@ -97,6 +98,9 @@ class LockScreenView : public MSceneWindowView
virtual void drawBackground(QPainter *painter, const QStyleOptionGraphicsItem *option) const;
//! \reimp_end

//! Controller for the view
MWidgetController *controller;

//! Layout for the view
QGraphicsLinearLayout *layout;

Expand All @@ -108,9 +112,6 @@ private slots:
void updateStyleName();

private:
//! Controller for the view
MSceneWindow *controller;

//! Data for the landscape pixmap
LockScreenBackgroundPixmap landscapePixmap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
#include "lockscreen.h"
#include "notificationarea.h"

LockScreenWithoutPadlockView::LockScreenWithoutPadlockView(MSceneWindow* controller) :
LockScreenWithoutPadlockView::LockScreenWithoutPadlockView(MWidgetController* controller) :
LockScreenView(controller)
{
notificationArea = new NotificationArea(controller, false);
notificationArea->setObjectName("LockScreenNotificationArea");
notificationArea->setHonorPrivacySetting(true);
// TODO
//notificationArea->setNotificationManager(Sysuid::instance()->notifierNotificationSink());
layout->addStretch();
layout->addItem(notificationArea);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,22 @@ class NotificationArea;
class LockScreenWithoutPadlockView : public LockScreenView
{
Q_OBJECT
M_VIEW(MSceneWindowModel, MSceneWindowStyle)
M_VIEW(MWidgetModel, LockScreenStyle)

public:
/*!
* \brief Constructs a new LockScreenWithoutPadlockView.
*
* \param controller the controller this is a view for
*/
LockScreenWithoutPadlockView (MSceneWindow* controller);
LockScreenWithoutPadlockView(MWidgetController *controller);

/*!
* \brief Destroys the LockScreenWithoutPadlockView.
*/
~LockScreenWithoutPadlockView ();
~LockScreenWithoutPadlockView();

private:

//! Notification area
NotificationArea* notificationArea;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@
#include "lockscreen.h"
#include "unlockarea.h"

LockScreenWithPadlockView::LockScreenWithPadlockView(MSceneWindow* controller) :
LockScreenWithPadlockView::LockScreenWithPadlockView(MWidgetController* controller) :
LockScreenView(controller),
dragAndDropWindow(dynamic_cast<MWindow*>(controller->parent())),
dragAndDropIcon(0),
dragAndDropState(STATE_NONE),
lockLandArea(new UnlockArea),
drawPending(false),
notificationArea(new UnlockNotifications),
controller(controller)
notificationArea(new UnlockNotifications)
{
lockScreenHeader->setObjectName("LockLiftAreaWithPadlock");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class UnlockNotifications;
class LockScreenWithPadlockView : public LockScreenView
{
Q_OBJECT
M_VIEW(MSceneWindowModel, MSceneWindowStyle)
M_VIEW(MWidgetModel, LockScreenStyle)

public:
LockScreenWithPadlockView (MSceneWindow* controller);
~LockScreenWithPadlockView ();
LockScreenWithPadlockView(MWidgetController *controller);
~LockScreenWithPadlockView();

enum dnd_state {
STATE_NONE = 0,
Expand Down Expand Up @@ -72,7 +72,6 @@ private slots:
bool drawPending;
QPointF dragAndDropPosition;
UnlockNotifications *notificationArea;
MSceneWindow* controller;

#ifdef UNIT_TEST
friend class Ut_LockScreenWithPadlockView;
Expand Down
Loading

0 comments on commit 78812a6

Please sign in to comment.