Skip to content

Commit

Permalink
Changes: Separate volume user interface into an application extension
Browse files Browse the repository at this point in the history
RevBy: TrustMe
  • Loading branch information
Vesa Halttunen committed Feb 14, 2011
1 parent 149b929 commit 78d5329
Show file tree
Hide file tree
Showing 26 changed files with 241 additions and 46 deletions.
1 change: 1 addition & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ system-ui-dev
system-ui-doc
system-ui-tests
system-ui-screenlock-padlock
system-ui-volume-fullscreen
systemui-l10n-engineering-english
libnotificationsystem0
libnotificationsystem-dev
Expand Down
8 changes: 8 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ Provides: system-ui-screenlock
Conflicts: system-ui-screenlock
Description: Screen lock extension for system-ui with a padlock

Package: system-ui-volume-fullscreen
Architecture: any
Section: libs
Depends: ${shlibs:Depends}
Provides: system-ui-volume
Conflicts: system-ui-volume
Description: Volume extension for system-ui with a full screen view

Package: duicontrolpanel-privatemodeapplet
Architecture: any
Section: libs
Expand Down
2 changes: 2 additions & 0 deletions debian/system-ui-volume-fullscreen.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/lib/meegotouch/applicationextensions/libsysuid-volume.so
usr/share/meegotouch/applicationextensions/sysuid-volume.desktop
1 change: 1 addition & 0 deletions src/extensions/extensions.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ TEMPLATE = subdirs
include(../../shared.pri)
addSubDirs(screenlock)
addSubDirs(screenlock/themes)
addSubDirs(volume)
7 changes: 7 additions & 0 deletions src/extensions/volume/sysuid-volume.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Type=X-MeeGoApplicationExtension
Name=Volume Extension

[X-MeeGoApplicationExtension]
Interface=com.meego.core.VolumeExtensionInterface/0.20
Extension=libsysuid-volume.so
58 changes: 58 additions & 0 deletions src/extensions/volume/volume.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
MOC_DIR = .moc
M_MGEN_OUTDIR = .gen
OBJECTS_DIR = .obj
LOCALLIBSDIR = ../../../lib

include(../../../mconfig.pri)
include(../../../localconfig.pri)

TEMPLATE = lib
CONFIG += plugin gui meegotouch system-ui link_pkgconfig
QT += dbus
INCLUDEPATH += \
../../libnotificationsystem \
../../systemui \
/usr/include/resource/qt4

QMAKE_LIBDIR += $$LOCALLIBSDIR

STYLE_HEADERS += volumebarstyle.h

HEADERS += \
volumeextension.h \
volumebarlogic.h \
volumebar.h \
volumebarwindow.h \
volumebarstyle.h \
../../systemui/closeeventeater.h

SOURCES += \
volumeextension.cpp \
volumebarlogic.cpp \
volumebar.cpp \
volumebarwindow.cpp \
../../systemui/closeeventeater.cpp

TARGET = $$qtLibraryTarget(sysuid-volume)
DESTDIR = $$LOCALLIBSDIR

contains(DEFINES, HAVE_QMSYSTEM) {
PKGCONFIG += qmsystem2
}

contains(DEFINES, HAVE_LIBRESOURCEQT) {
PKGCONFIG += libresourceqt1
}

PKGCONFIG += \
dbus-1 \
dbus-glib-1

target.path += $$M_APPLICATION_EXTENSION_DIR

desktop_entry.path = $$M_APPLICATION_EXTENSION_DATA_DIR
desktop_entry.files = *.desktop

INSTALLS += \
target \
desktop_entry
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 49 additions & 0 deletions src/extensions/volume/volumeextension.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/****************************************************************************
**
** 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.
**
****************************************************************************/
#include <QDebug>
#include <MLibrary>
#include "volumeextension.h"
#include "volumebarlogic.h"

Q_EXPORT_PLUGIN2(sysuid-volume, VolumeExtension)

VolumeExtension::VolumeExtension() :
volumeBarLogic(NULL)
{
qDebug() << "XX VOLUME EXTENSION INSTANTIATION";
}

VolumeExtension::~VolumeExtension()
{
delete volumeBarLogic;
}

bool VolumeExtension::initialize(const QString &)
{
qDebug() << "XX VOLUME EXTENSION INITIALIZATION";
volumeBarLogic = new VolumeBarLogic(this);
return true;
}

QGraphicsWidget *VolumeExtension::widget()
{
return NULL;
}

M_LIBRARY
45 changes: 45 additions & 0 deletions src/extensions/volume/volumeextension.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/****************************************************************************
**
** 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 VOLUMEEXTENSION_H
#define VOLUMEEXTENSION_H

#include "volumeextensioninterface.h"
#include <QObject>

class VolumeBarLogic;

class VolumeExtension : public QObject, public VolumeExtensionInterface
{
Q_OBJECT
Q_INTERFACES(VolumeExtensionInterface MApplicationExtensionInterface)

public:
VolumeExtension();
virtual ~VolumeExtension();

//! Methods derived from MApplicationExtensionInterface
virtual bool initialize(const QString &interface);
virtual QGraphicsWidget *widget();

private:
VolumeBarLogic *volumeBarLogic;
};

#endif // VOLUMEEXTENSION_H
5 changes: 0 additions & 5 deletions src/systemui/systemui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ SOURCES += \
include(statusindicatormenu/statusindicatormenu.pri)
include(statusarea/statusarea.pri)
include(notifications/notifications.pri)
include(volumecontrol/volumecontrol.pri)
include(screenlock/screenlock.pri)
include(../../localconfig.pri)

Expand All @@ -71,10 +70,6 @@ contains(DEFINES, HAVE_AEGIS_CRYPTO) {
PKGCONFIG += aegis-crypto
}

contains(DEFINES, HAVE_LIBRESOURCEQT) {
PKGCONFIG += libresourceqt1
}

contains(DEFINES, HAVE_LIBNGF) {
PKGCONFIG += libngf0
}
Expand Down
10 changes: 7 additions & 3 deletions src/systemui/sysuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <MLocale>
#include <MTheme>
#include <MLocale>
#include <MApplicationExtensionArea>
#include <QDBusConnection>

#include "usbui.h"
Expand All @@ -37,7 +38,6 @@
#include "ngfnotificationsink.h"
#include "contextframeworkcontext.h"
#include "notifiernotificationsink.h"
#include "volumebarlogic.h"
#include "closeeventeater.h"
#include <QX11Info>

Expand Down Expand Up @@ -133,8 +133,11 @@ Sysuid::Sysuid(QObject* parent) :
#endif
updateCompositorNotificationSinkEnabledStatus();

// Instantiate the volume control logic
volumeBarLogic = new VolumeBarLogic(this);
// Create an extension area for the volume extension
volumeExtensionArea = new MApplicationExtensionArea("com.meego.core.VolumeExtensionInterface/0.20");
volumeExtensionArea->setInProcessFilter(QRegExp("/sysuid-volume.desktop$"));
volumeExtensionArea->setOutOfProcessFilter(QRegExp("$^"));
volumeExtensionArea->init();
}

Sysuid::~Sysuid()
Expand All @@ -144,6 +147,7 @@ Sysuid::~Sysuid()
delete ngfNotificationSink;
delete mCompositorNotificationSink;
delete notificationManager;
delete volumeExtensionArea;
instance_ = 0;
}

Expand Down
5 changes: 3 additions & 2 deletions src/systemui/sysuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class UnlockNotificationSink;
class NotifierNotificationSink;
class SysUidRequest;
class VolumeBarLogic;
class MApplicationExtensionArea;

class Sysuid : public QObject
{
Expand Down Expand Up @@ -114,8 +115,8 @@ private slots:
//! The system-bus adaptor class for unlock-screen interface
SysUidRequest *sysUidRequest;

//! The volume control logic
VolumeBarLogic *volumeBarLogic;
//! The volume extension area
MApplicationExtensionArea *volumeExtensionArea;

//! Context item for getting information about video recording status
QSharedPointer<ContextItem> useMode;
Expand Down
19 changes: 0 additions & 19 deletions src/systemui/volumecontrol/volumecontrol.pri

This file was deleted.

45 changes: 45 additions & 0 deletions src/systemui/volumeextensioninterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/****************************************************************************
**
** 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 VOLUMEEXTENSIONINTERFACE_H
#define VOLUMEEXTENSIONINTERFACE_H

#include <QObject>
#include <mapplicationextensioninterface.h>

/**
* VolumeExtensionInterface is the base class for volume extension classes.
*
* Extension developers need to implement this interface in their extension binary
* and export their implementation from the binary. The host application will maintain
* an inventory of available extensions and instantiate them using this interface
* when needed.
*/
class VolumeExtensionInterface : public MApplicationExtensionInterface
{
public:
/*!
* Destructor.
*/
virtual ~VolumeExtensionInterface() {}
};

Q_DECLARE_INTERFACE(VolumeExtensionInterface, "com.meego.core.VolumeExtensionInterface/0.20")

#endif // VOLUMEEXTENSIONINTERFACE_H
2 changes: 1 addition & 1 deletion tests/stubs/sysuid_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Sysuid::Sysuid(QObject* parent) :
usbUi (0), statusAreaRenderer (0), statusIndicatorMenuBusinessLogic (0), notificationManager (0),
mCompositorNotificationSink (0), ngfNotificationSink (0),
notifierNotificationSink_(0), sysUidRequest (0),
volumeBarLogic (0)
volumeExtensionArea (0)
{
gSysuidStub->SysuidConstructor(parent);
}
Expand Down
1 change: 0 additions & 1 deletion tests/ut_sysuid/ut_sysuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include "unlocknotifications_stub.h"
#include "unlockmissedevents_stub.h"
#include "unlocknotificationsinkstub.h"
#include "volumebarlogic_stub.h"
#include "x11wrapper_stub.h"
#include "closeeventeater_stub.h"
#include "notifiernotificationsink_stub.h"
Expand Down
1 change: 0 additions & 1 deletion tests/ut_sysuid/ut_sysuid.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ SOURCES += \
# unit test and unit classes
HEADERS += \
ut_sysuid.h \
$$SRCDIR/volumecontrol/volumebarlogic.h \
$$SRCDIR/shutdownui.h \
$$SRCDIR/usbui.h \
$$ROOTSRCDIR/extensions/screenlock/lockscreen.h \
Expand Down
8 changes: 4 additions & 4 deletions tests/ut_volumebar/ut_volumebar.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ include(../common_top.pri)
TARGET = ut_volumebar

INCLUDEPATH += \
$$SRCDIR/volumecontrol \
$$ROOTSRCDIR/extensions/volume \
/usr/include/resource/qt4

CONFIG += link_pkgconfig

STYLE_HEADERS += \
$$SRCDIR/volumecontrol/volumebarstyle.h
$$ROOTSRCDIR/extensions/volume/volumebarstyle.h

HEADERS += \
ut_volumebar.h \
$$SRCDIR/volumecontrol/volumebar.h \
$$ROOTSRCDIR/extensions/volume/volumebar.h \
$$STYLE_HEADERS


SOURCES += \
ut_volumebar.cpp \
$$SRCDIR/volumecontrol/volumebar.cpp
$$ROOTSRCDIR/extensions/volume/volumebar.cpp

include(../common_bot.pri)
Loading

0 comments on commit 78d5329

Please sign in to comment.