Thank You,
Peter Zhu
[This message was auto-generated]
---
Request #16238:
submit: Trunk:Testing/meegotouch-home(r2) -> Trunk/meegotouch-home
Message:
Move to Trunk
State: new 2011-04-14T04:18:11 peter
Comment: None
changes files:
--------------
--- meegotouch-home.changes
+++ meegotouch-home.changes
@@ -0,0 +1,4 @@
+* Thu Apr 07 2011 Miroslav Safr <[email protected]> 0.23.20
+- BMC#15199 - Updated to 0.23.10 to make the theme working
+- updated desktop file: removed --desktop option
+
old:
----
meegotouch-home-0.23.10.tar.bz2
new:
----
meegotouch-home-0.23.20.tar.bz2
spec files:
-----------
--- meegotouch-home.spec
+++ meegotouch-home.spec
@@ -7,7 +7,7 @@
Name: meegotouch-home
Summary: MeeGo Touch Homescreen
-Version: 0.23.10
+Version: 0.23.20
Release: 1
Group: System/Desktop
License: LGPL v2.1
other changes:
--------------
++++++ meegotouch-home-0.23.10.tar.bz2 -> meegotouch-home-0.23.20.tar.bz2
--- debian/changelog
+++ debian/changelog
@@ -1,3 +1,63 @@
+meegotouchhome (0.23.20-1) unstable; urgency=low
+
+ * Fixes: NB#243418 - Switcher pinch "overshoot" should be a little
stronger
+
+ -- Pauli Lehtinen <[email protected]> Wed, 06 Apr 2011 14:05:00
+0300
+
+meegotouchhome (0.23.19-1) unstable; urgency=low
+
+ * Fixes: NB#240902 - Zoom transition in Recents is too fast
+
+ -- Pauli Lehtinen <[email protected]> Fri, 01 Apr 2011 15:47:00
+0300
+
+meegotouchhome (0.23.18-1) unstable; urgency=low
+
+ * Fixes: NB#242046 - Wrong font in css (libmeegotouchhome)
+
+ -- Vesa Halttunen <[email protected]> Fri, 01 Apr 2011 10:16:48
+0200
+
+meegotouchhome (0.23.17-1) unstable; urgency=low
+
+ * Changes: Bug 237958 - Tapping on broken installation icon on launcher
does not do anything after failed upgrade attempt
+
+ -- Juha Juutinen <[email protected]> Thu, 24 Mar 2011 14:18:19
+0200
+
+meegotouchhome (0.23.16-1) unstable; urgency=low
+
+ * Fixes: NB#238536 - Background apps won't close when switching between
ACT-DEAD and user
+
+ -- Vesa Halttunen <[email protected]> Tue, 22 Mar 2011 14:56:56
+0200
+
+meegotouchhome (0.23.15-1) unstable; urgency=low
+
+ * Fixes: NB#235408 - meegotouchhome fails to build with gcc-4.5
(-Werror)
+
+ -- Vesa Halttunen <[email protected]> Tue, 22 Mar 2011 10:56:51
+0200
+
+meegotouchhome (0.23.14-1) unstable; urgency=low
+
+ * Fixes: BMC#5009 - meegotouch-home points to an internal,
vendor-specific bug tracker in its documentation
+
+ -- Vesa Halttunen <[email protected]> Fri, 04 Mar 2011 12:47:19
+0200
+
+meegotouchhome (0.23.13-1) unstable; urgency=low
+
+ * Fixes: NB#233151 - homescreen is rotated 90 degrees
+
+ -- Vesa Halttunen <[email protected]> Fri, 04 Mar 2011 12:46:47
+0200
+
+meegotouchhome (0.23.12-1) unstable; urgency=low
+
+ * Fixes: NB#226955 - Locked portrait mode breaks SDK environment
+
+ -- Vesa Halttunen <[email protected]> Wed, 02 Mar 2011 17:35:25
+0200
+
+meegotouchhome (0.23.11-1) unstable; urgency=low
+
+ * Fixes: NB#230342 - _MEEGOTOUCH_VISIBLE_IN_SWITCHER not set
+
+ -- Vesa Halttunen <[email protected]> Wed, 02 Mar 2011 14:46:57
+0200
+
meegotouchhome (0.23.10-1) unstable; urgency=low
* Fixes: NB#222322 - [Harmmattan03-8]Ovi Store icon is missing after
rebooting if user updated the ovi store client
--- debian/control
+++ debian/control
@@ -1,7 +1,7 @@
Source: meegotouchhome
Section: x11
Priority: extra
-Maintainer: Tuomas Järvensivu <[email protected]>
+Maintainer: Vesa Halttunen <[email protected]>
Build-Depends: debhelper (>= 5), doxygen (>=1.5.9),
libmeegotouch-dev (>> 0.20.34),
libqt4-dev (>= 4.6), libqt4-opengl-dev,
--- doc/src/bugreporting.dox
+++ doc/src/bugreporting.dox
@@ -1,6 +1,6 @@
/*! \page bugreporting How to Report a Bug
-Bugs can be entered in the <a
href="https://projects.maemo.org/bugzilla/enter_bug.cgi?product=H-Application-Framework">Maemo
Bugzilla</a>, Harmattan program, Application Framework product.
+Bugs can be entered in the <a
href="https://bugs.meego.com/enter_bug.cgi?product=MeeGo%20Touch%20Framework">MeeGo
Bugzilla</a>, component "Home".
Please check Bugzilla for existing bugs that might cover your problem
before filing a new one.
--- src/libmeegotouchhome/homeapplication.cpp
+++ src/libmeegotouchhome/homeapplication.cpp
@@ -41,53 +41,22 @@
static const QString HOME_READY_SIGNAL_INTERFACE =
"com.nokia.duihome.readyNotifier";
static const QString HOME_READY_SIGNAL_NAME = "ready";
-/*!
- * Checks whether an upstart command line parameter was given.
- * This is checked for stopping the application after it's ready,
- * and we only want to do that when run by upstart, not
- * when run by Matti or manually.
- *
- * \param argc number of parameters
- * \param argv parameters
- * \return true if in upstart mode, false otherwise
- */
-static bool isUpstartMode(int argc, char *argv[])
-{
- if (argc < 2) {
- return false;
- }
- static const char optChar = 'u';
- static const char *optString = "u";
- static struct option optLong[] = {
- { "upstart", 0, NULL, optChar },
- { 0, 0, 0, 0 }
- };
- opterr = 0;
- int c = 0;
- while ((c = getopt_long_only(argc, argv,
- optString,
- optLong,
- 0)) != -1) {
- if (c == optChar) {
- return true;
- }
- }
- return false;
-}
-
HomeApplication::HomeApplication(int &argc, char **argv, const QString&
appIdentifier) :
MApplication(argc, argv, appIdentifier),
+ upstartMode(false),
+ lockedOrientation_(QVariant::Invalid),
homeScreenService(new HomeScreenService),
xEventListeners(),
iteratorActiveForEventListenerContainer(false),
toBeRemovedEventListeners()
{
+ parseArguments(argc, argv);
+
// Enable prestart mode
MApplication::setPrestartMode(M::TerminateOnClose);
// launch a timer for sending a dbus-signal upstart when home is ready
// and on screen
- upstartMode = isUpstartMode(argc, argv);
connect(&startupNotificationTimer, SIGNAL(timeout()),
this, SLOT(sendStartupNotifications()));
startupNotificationTimer.setSingleShot(true);
@@ -128,6 +97,11 @@
}
}
+QVariant HomeApplication::lockedOrientation() const
+{
+ return lockedOrientation_;
+}
+
void HomeApplication::sendStartupNotifications()
{
static QDBusConnection systemBus = QDBusConnection::systemBus();
@@ -136,6 +110,8 @@
HOME_READY_SIGNAL_INTERFACE,
HOME_READY_SIGNAL_NAME);
systemBus.send(homeReadySignal);
+
+ // Stop the application after it's ready but only when run by upstart
if (upstartMode) {
static pid_t selfPid = getpid();
kill(selfPid, SIGSTOP);
@@ -167,3 +143,31 @@
return eventHandled;
}
+
+void HomeApplication::parseArguments(int argc, char *argv[])
+{
+ if (argc >= 2) {
+ static const char upstartChar = 'u';
+ static const char orientationChar = 'o';
+ static const char *optString = "uo::";
+ static struct option optLong[] = {
+ { "upstart", 0, NULL, upstartChar },
+ { "locked-orientation", 2, NULL, orientationChar },
+ { 0, 0, 0, 0 }
+ };
+ opterr = 0;
+ int c = 0;
+ while ((c = getopt_long_only(argc, argv, optString, optLong, 0))
!= -1) {
+ switch (c) {
+ case upstartChar:
+ upstartMode = true;
+ break;
+ case orientationChar:
+ lockedOrientation_ = QVariant(optarg);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
--- src/libmeegotouchhome/homeapplication.h
+++ src/libmeegotouchhome/homeapplication.h
@@ -23,6 +23,7 @@
#include <MApplication>
#include <QTimer>
#include <QSet>
+#include <QVariant>
class HomeScreenService;
class XEventListener;
@@ -65,6 +66,19 @@
*/
void removeXEventListener(XEventListener *listener);
+ /*!
+ * Returns the locked orientation as set using the command line
+ * arguments. The orientation is returned as a QVariant. If the
+ * variant is not valid, the orientation locking has not been set
+ * through the command line arguments. Otherwise the variant
+ * contains a string representing the orientation to which the
+ * UI should be locked to: either an empty string (meaning no
+ * locking), portrait or landscape.
+ *
+ * \return a QVariant representing the locked orientation: invalid
(use default), an empty string (unlocked), portrait or landscape
+ */
+ QVariant lockedOrientation() const;
+
signals:
/*!
* \brief A Signal to request launcher focus on specific launcher
application
@@ -89,9 +103,21 @@
void sendStartupNotifications();
private:
+ /*!
+ * Parses the command line parameters and sets upstart mode and
forced
+ * orientation locking based on the arguments.
+ *
+ * \param argc number of parameters
+ * \param argv parameters
+ */
+ void parseArguments(int argc, char *argv[]);
+
//! Flag that indicates whether the process was started by upstart or
not
bool upstartMode;
+ //! A QVariant representing the locked orientation: invalid (use
default), an empty string (unlocked), portrait or landscape
+ QVariant lockedOrientation_;
+
//! Timer used for sending startup notifications
QTimer startupNotificationTimer;
--- src/libmeegotouchhome/launcher.cpp
+++ src/libmeegotouchhome/launcher.cpp
@@ -16,6 +16,7 @@
** of this file.
**
****************************************************************************/
+
#include "launcher.h"
#include "launcherbutton.h"
#include "launcherdatastore.h"
@@ -96,8 +97,8 @@
Launcher::Placement buttonPlacementInDatastore =
entryPlacementInDatastore(desktopEntryPath);
if (buttonPlacementInDatastore.location.isEmpty() ||
buttonPlacementInDatastore.location == Launcher::LOCATION_IDENTIFIER) {
QSharedPointer<LauncherButton> button =
placeholderButton(desktopEntryPath);
- if
(!ApplicationPackageMonitorListener::isInstallerExtraEntry(desktopEntryPath))
{
- // If new entry is an applications entry path then remove the
old entry path from store and update the new entry
+ if
(!ApplicationPackageMonitorListener::isInstallerExtraEntry(desktopEntryPath)
|| state == LauncherButtonModel::Broken) {
+ // If new entry is an applications entry path or package is
broken then remove the old entry path from store and update the new entry
removeButtonPlacementFromStore(button->desktopEntry());
updateButtonPlacementInStore(desktopEntryPath);
button->updateFromDesktopEntry(desktopEntryPath);
--- src/libmeegotouchhome/launcher.h
+++ src/libmeegotouchhome/launcher.h
@@ -282,7 +282,7 @@
* \param entry the path of the .desktop entry file to create a
launcher button from
* \return a LauncherButton representing the .desktop entry file
*/
- QSharedPointer<LauncherButton> createLauncherButton(const QString
&desktopEntryPath);
+ virtual QSharedPointer<LauncherButton> createLauncherButton(const
QString &desktopEntryPath);
/*!
* Creates a map that contains the placement of each given desktop
entry in the launcher.
--- src/libmeegotouchhome/launcherbutton.cpp
+++ src/libmeegotouchhome/launcherbutton.cpp
@@ -16,6 +16,7 @@
** of this file.
**
****************************************************************************/
+
#include "launcherbutton.h"
#include "launcher.h"
#include <MDesktopEntry>
@@ -28,8 +29,8 @@
bool LauncherButton::launching = false;
-LauncherButton::LauncherButton(const QString &desktopEntryPath, MWidget
*parent) :
- MButton(parent, new LauncherButtonModel)
+LauncherButton::LauncherButton(const QString &desktopEntryPath, MWidget
*parent, LauncherButtonModel *model) :
+ MButton(parent, model)
{
init();
@@ -43,7 +44,7 @@
void LauncherButton::init()
{
// When the button is clicked the related object should be launched
- connect(this, SIGNAL(clicked()), this, SLOT(launch()));
+ connect(this, SIGNAL(clicked()), this, SLOT(launch()),
Qt::UniqueConnection);
}
QString LauncherButton::desktopEntry() const
--- src/libmeegotouchhome/launcherbutton.h
+++ src/libmeegotouchhome/launcherbutton.h
@@ -44,7 +44,8 @@
* \param desktopEntryPath path to the .desktop file to create a
launcher button from
* \param parent the parent widget, defaults to NULL
*/
- LauncherButton(const QString &desktopEntryPath = QString(), MWidget
*parent = 0);
+ LauncherButton(const QString &desktopEntryPath = QString(), MWidget
*parent = 0,
+ LauncherButtonModel *model = new LauncherButtonModel);
/*!
* Destroys the Launcher.
--- src/libmeegotouchhome/mainwindow.cpp
+++ src/libmeegotouchhome/mainwindow.cpp
@@ -20,10 +20,9 @@
#include "mainwindow.h"
#include "mainwindowstyle.h"
#include "home.h"
-
+#include "homeapplication.h"
#include <QGLWidget>
#include <QDBusInterface>
-#include <MApplication>
#include <MSceneManager>
#include <MTheme>
#include "x11wrapper.h"
@@ -101,15 +100,37 @@
void MainWindow::applyStyle()
{
- const MainWindowStyle *style = static_cast<const MainWindowStyle
*>(MTheme::style("MainWindowStyle", "", "", "", M::Landscape, NULL));
- if (style->lockedOrientation() == "landscape") {
+ // Check whether the orientation has been locked using command line
arguments
+ QVariant lockedOrientationVariant(QVariant::Invalid);
+ HomeApplication *app = dynamic_cast<HomeApplication*>(qApp);
+ if (app != NULL) {
+ lockedOrientationVariant = app->lockedOrientation();
+ }
+
+ QString lockedOrientation;
+ if (lockedOrientationVariant.isValid()) {
+ // Orientation has been locked using command line arguments
+ lockedOrientation = lockedOrientationVariant.toString();
+ } else {
+ // Orientation has not been locked using command line arguments,
so get it from the style
+ const MainWindowStyle *style = static_cast<const MainWindowStyle
*>(MTheme::style("MainWindowStyle"));
+ lockedOrientation = style->lockedOrientation();
+ MTheme::releaseStyle(style);
+ }
+
+ if (lockedOrientation == "landscape") {
setLandscapeOrientation();
+ setOrientationAngle(M::Angle0);
setOrientationLocked(true);
- } else if (style->lockedOrientation() == "portrait") {
+ setOrientationAngleLocked(true);
+ } else if (lockedOrientation == "portrait") {
setPortraitOrientation();
+ setOrientationAngle(M::Angle270);
setOrientationLocked(true);
+ setOrientationAngleLocked(true);
} else {
setOrientationLocked(false);
+ setOrientationAngleLocked(false);
}
}
--- src/libmeegotouchhome/switcher.cpp
+++ src/libmeegotouchhome/switcher.cpp
@@ -68,6 +68,10 @@
Switcher::~Switcher()
{
+ // Close all applications when the home screen shuts down
+ foreach (const QSharedPointer<SwitcherButton> &button,
model()->buttons()) {
+ closeWindow(button->xWindow());
+ }
}
bool Switcher::handleXEvent(const XEvent &event)
--- src/libmeegotouchhome/switcherbutton.cpp
+++ src/libmeegotouchhome/switcherbutton.cpp
@@ -30,7 +30,10 @@
Atom SwitcherButton::visibleAtom = 0;
SwitcherButton::SwitcherButton(QGraphicsItem *parent, SwitcherButtonModel
*model) :
- MButton(parent, model)
+ MButton(parent, model),
+ visibility(false),
+ visibilityPropertyEnabled(true),
+ visibilityInitialized(false)
{
// Configure timers
windowCloseTimer.setSingleShot(true);
@@ -42,10 +45,6 @@
}
connect(this, SIGNAL(clicked()), this, SLOT(switchToWindow()));
-
- // Initialize to negation to force the property initialization
- visibility = !isVisible();
- setVisibilityPropertyEnabled(true);
}
SwitcherButton::~SwitcherButton()
@@ -99,25 +98,26 @@
void SwitcherButton::setVisibleInSwitcherProperty(bool set)
{
- if(visibilityPropertyEnabled && visibility != set) {
+ if (visibilityPropertyEnabled && (visibility != set ||
!visibilityInitialized)) {
Display *dpy = QX11Info::display();
- if (dpy) {
- if (set) {
- unsigned char data = 1;
- X11Wrapper::XChangeProperty(dpy, xWindow(), visibleAtom,
XA_CARDINAL, 8, PropModeReplace, &data, 1);
- } else {
- unsigned char data = 0;
- X11Wrapper::XChangeProperty(dpy, xWindow(), visibleAtom,
XA_CARDINAL, 8, PropModeReplace, &data, 1);
- }
- visibility = set;
+ if (set) {
+ unsigned char data = 1;
+ X11Wrapper::XChangeProperty(dpy, xWindow(), visibleAtom,
XA_CARDINAL, 8, PropModeReplace, &data, 1);
+ } else {
+ unsigned char data = 0;
+ X11Wrapper::XChangeProperty(dpy, xWindow(), visibleAtom,
XA_CARDINAL, 8, PropModeReplace, &data, 1);
}
+
+ visibility = set;
+ visibilityInitialized = true;
}
}
void SwitcherButton::setVisibilityPropertyEnabled(bool enable)
{
visibilityPropertyEnabled = enable;
- if(enable) {
- setVisibleInSwitcherProperty(isVisible());
+
+ if (enable) {
+ setVisibleInSwitcherProperty(isOnDisplay());
}
}
--- src/libmeegotouchhome/switcherbutton.h
+++ src/libmeegotouchhome/switcherbutton.h
@@ -142,6 +142,9 @@
//! Whether the updating of the visibility property is enabled
bool visibilityPropertyEnabled;
+
+ //! Whether visibility has been initialized or not
+ bool visibilityInitialized;
};
#endif // SWITCHERBUTTON_H
--- src/libmeegotouchhome/switcherview.cpp
+++ src/libmeegotouchhome/switcherview.cpp
@@ -16,7 +16,6 @@
** of this file.
**
****************************************************************************/
-
#include "switcherview.h"
#include "switcher.h"
#include "switcherbutton.h"
--- src/libmeegotouchhome/switcherviewbase.cpp
+++ src/libmeegotouchhome/switcherviewbase.cpp
@@ -80,6 +80,7 @@
// This stuff is necessary to receive touch events.
if (e->type() == QEvent::TouchBegin) {
e->setAccepted(true);
+
return true;
}
@@ -256,17 +257,25 @@
event->accept(gesture);
+ static qreal pinchBeginLength = 0;
+
switch(gesture->state()) {
case Qt::GestureStarted:
if(!gestureActive) {
gestureActive = true;
pinchBegin(controller->mapFromScene(gesture->centerPoint()));
+ pinchBeginLength = QLineF(gesture->hotSpot(),
gesture->centerPoint()).length() * 2;
}
break;
case Qt::GestureUpdated:
if(gestureActive) {
- pinchUpdate(gesture->totalScaleFactor());
+ QSize s = MDeviceProfile::instance()->resolution();
+ qreal pinchDistance = s.width() * 3 / 4;
+ qreal pinchLength = QLineF(gesture->hotSpot(),
gesture->centerPoint()).length() * 2;
+ qreal scale = qBound(qreal(-1), ((pinchLength -
pinchBeginLength) / pinchDistance), qreal(1)) + 1.0f;
+
+ pinchUpdate(scale);
}
break;
case Qt::GestureFinished:
--- tests/stubs/homeapplication_stub.h
+++ tests/stubs/homeapplication_stub.h
@@ -33,6 +33,7 @@
virtual void removeXEventListener(XEventListener *listener);
virtual bool x11EventFilter(XEvent *event);
virtual void sendStartupNotifications();
+ virtual QVariant lockedOrientation();
};
// 2. IMPLEMENT STUB
@@ -73,6 +74,12 @@
stubMethodEntered("sendStartupNotifications");
}
+QVariant HomeApplicationStub::lockedOrientation()
+{
+ stubMethodEntered("lockedOrientation");
+ return stubReturnValue<QVariant>("lockedOrientation");
+}
+
// 3. CREATE A STUB INSTANCE
HomeApplicationStub gDefaultHomeApplicationStub;
HomeApplicationStub *gHomeApplicationStub = &gDefaultHomeApplicationStub;
@@ -109,5 +116,10 @@
gHomeApplicationStub->sendStartupNotifications();
}
+QVariant HomeApplication::lockedOrientation() const
+{
+ return gHomeApplicationStub->lockedOrientation();
+}
+
#endif
--- tests/stubs/launcherbutton_stub.h
+++ tests/stubs/launcherbutton_stub.h
@@ -11,7 +11,7 @@
// FIXME - stubgen is not yet finished
class LauncherButtonStub : public StubBase {
public:
- virtual void LauncherButtonConstructor(const QString &desktopEntryPath,
MWidget *parent);
+ virtual void LauncherButtonConstructor(const QString &desktopEntryPath,
MWidget *parent, LauncherButtonModel *model);
virtual void LauncherButtonDestructor();
virtual QString desktopEntry() const;
virtual void updateFromDesktopEntry(const QString &desktopEntryPath);
@@ -25,11 +25,12 @@
};
// 2. IMPLEMENT STUB
-void LauncherButtonStub::LauncherButtonConstructor(const QString
&desktopEntryPath, MWidget *parent) {
+void LauncherButtonStub::LauncherButtonConstructor(const QString
&desktopEntryPath, MWidget *parent, LauncherButtonModel *model) {
Q_UNUSED(desktopEntryPath);
Q_UNUSED(parent);
-
+ Q_UNUSED(model);
}
+
void LauncherButtonStub::LauncherButtonDestructor() {
}
@@ -84,8 +85,8 @@
// 4. CREATE A PROXY WHICH CALLS THE STUB
-LauncherButton::LauncherButton(const QString &desktopEntryPath, MWidget
*parent) {
- gLauncherButtonStub->LauncherButtonConstructor(desktopEntryPath,
parent);
+LauncherButton::LauncherButton(const QString &desktopEntryPath, MWidget
*parent, LauncherButtonModel *model) {
+ gLauncherButtonStub->LauncherButtonConstructor(desktopEntryPath,
parent, model);
}
LauncherButton::~LauncherButton() {
--- tests/stubs/launcherdatastore_stub.h
+++ tests/stubs/launcherdatastore_stub.h
@@ -102,7 +102,7 @@
void LauncherDataStoreStub::updateDesktopEntry(const QString
&desktopEntryPath) {
QList<ParameterBase*> params;
- params.append( new Parameter<const QString >(desktopEntryPath));
+ params.append( new Parameter<QString >(desktopEntryPath));
stubMethodEntered("updateDesktopEntry",params);
}
@@ -115,7 +115,7 @@
void LauncherDataStoreStub::removeDataForDesktopEntry(const QString
&entryPath) {
QList<ParameterBase*> params;
- params.append( new Parameter<const QString >(entryPath));
+ params.append( new Parameter<QString >(entryPath));
stubMethodEntered("removeDataForDesktopEntry",params);
}
--- tests/ut_launcher/ut_launcher.cpp
+++ tests/ut_launcher/ut_launcher.cpp
@@ -472,13 +472,19 @@
void Ut_Launcher::testSetOperationErrorWhenButtonFoundFromLauncher()
{
- QString entry = "test.desktop";
- launcher->addLauncherButton(entry);
+ QString applicationsEntry = "/applications/test.desktop";
+ QString installerExtraEntry =
"/applications/installer-extra/test.desktop";
+ launcher->addLauncherButton(applicationsEntry);
+ gLauncherButtonStub->stubSetReturnValue("desktopEntry",
applicationsEntry);
- launcher->updateButtonState(entry, LauncherButtonModel::Broken, 0);
+ launcher->updateButtonState(installerExtraEntry,
LauncherButtonModel::Broken, 0);
QCOMPARE(gLauncherButtonStub->stubLastCallTo("setState").parameter<LauncherButtonModel::State>(0),
LauncherButtonModel::Broken);
QCOMPARE(gLauncherButtonStub->stubLastCallTo("setState").parameter<int>(1),
0);
+
QCOMPARE(gLauncherButtonStub->stubLastCallTo("updateFromDesktopEntry").parameter<QString>(0),
installerExtraEntry);
+
+
QCOMPARE(gLauncherDataStoreStub->stubLastCallTo("removeDataForDesktopEntry").parameter<QString>(0),
applicationsEntry);
+
QCOMPARE(gLauncherDataStoreStub->stubLastCallTo("updateDataForDesktopEntry").parameter<QString>(0),
installerExtraEntry);
}
void Ut_Launcher::testSetOperationErrorWhenButtonHasPlaceholder()
--- tests/ut_mainwindow/ut_mainwindow.cpp
+++ tests/ut_mainwindow/ut_mainwindow.cpp
@@ -23,8 +23,8 @@
#include "x11wrapper_stub.h"
#include "mainwindow.h"
#include "mainwindowstyle.h"
-#include <MApplication>
-#include <MApplicationPage>
+#include "homeapplication_stub.h"
+#include <MSceneWindow>
#include <QDBusInterface>
// Stub the Dbus call used by status bar to open a menu
@@ -79,13 +79,13 @@
}
// Home stubs
-class Home : public MApplicationPage
+class Home : public MSceneWindow
{
public:
Home(QGraphicsItem *parent = 0);
};
-Home::Home(QGraphicsItem *parent) : MApplicationPage(parent)
+Home::Home(QGraphicsItem *parent) : MSceneWindow(parent)
{
}
@@ -96,6 +96,12 @@
mWindowOrientationLocked = locked;
}
+bool mWindowOrientationAngleLocked = false;
+void MWindow::setOrientationAngleLocked(bool locked)
+{
+ mWindowOrientationAngleLocked = locked;
+}
+
QString mWindowOrientation;
void MWindow::setLandscapeOrientation()
{
@@ -107,11 +113,17 @@
mWindowOrientation = "portrait";
}
+M::OrientationAngle mWindowOrientationAngle;
+void MWindow::setOrientationAngle(M::OrientationAngle angle)
+{
+ mWindowOrientationAngle = angle;
+}
+
void Ut_MainWindow::initTestCase()
{
static int argc = 1;
static char *app_name = (char *)"./ut_mainwindow";
- app = new MApplication(argc, &app_name);
+ app = new HomeApplication(argc, &app_name);
mainWindow = MainWindow::instance(true);
@@ -346,35 +358,48 @@
void Ut_MainWindow::testOrientationLocking_data()
{
- QTest::addColumn<QString>("lockedOrientation");
+ QTest::addColumn<QVariant>("commandLineLockedOrientation");
+ QTest::addColumn<QString>("styleLockedOrientation");
QTest::addColumn<bool>("orientationLocked");
QTest::addColumn<QString>("expectedOrientation");
+ QTest::addColumn<int>("expectedOrientationAngle");
- QTest::newRow("No locking") << QString() << false << QString();
- QTest::newRow("Locked to landscape") << QString("landscape") << true
<< QString("landscape");
- QTest::newRow("Locked to portrait") << QString("portrait") << true <<
QString("portrait");
- QTest::newRow("Locked to something else") << QString("unknown") <<
false << QString();
+ QTest::newRow("Command line: Default / Style: No locking") <<
QVariant(QVariant::Invalid) << QString() << false << QString() <<
(int)M::Angle180;
+ QTest::newRow("Command line: Default / Style: Locked to landscape")
<< QVariant(QVariant::Invalid) << QString("landscape") << true <<
QString("landscape") << (int)M::Angle0;
+ QTest::newRow("Command line: Default / Style: Locked to portrait") <<
QVariant(QVariant::Invalid) << QString("portrait") << true <<
QString("portrait") << (int)M::Angle270;
+ QTest::newRow("Command line: Default / Style: Locked to something
else") << QVariant(QVariant::Invalid) << QString("unknown") << false <<
QString() << (int)M::Angle180;
+ QTest::newRow("Command line: No locking / Style: Locked to portrait")
<< QVariant("") << QString("portrait") << false << QString() <<
(int)M::Angle180;
+ QTest::newRow("Command line: Locked to landscape / Style: Locked to
portrait") << QVariant("landscape") << QString("portrait") << true <<
QString("landscape") << (int)M::Angle0;
+ QTest::newRow("Command line: Locked to portrait / Style: Locked to
landscape") << QVariant("portrait") << QString("landscape") << true <<
QString("portrait") << (int)M::Angle270;
+ QTest::newRow("Command line: Locked to something else / Style: Locked
to landscape") << QVariant("unknown") << QString("landscape") << false <<
QString() << (int)M::Angle180;
}
void Ut_MainWindow::testOrientationLocking()
{
- QFETCH(QString, lockedOrientation);
+ QFETCH(QVariant, commandLineLockedOrientation);
+ QFETCH(QString, styleLockedOrientation);
QFETCH(bool, orientationLocked);
QFETCH(QString, expectedOrientation);
+ QFETCH(int, expectedOrientationAngle);
// Reset the stubs
mWindowOrientationLocked = false;
+ mWindowOrientationAngleLocked = false;
mWindowOrientation = QString();
+ mWindowOrientationAngle = M::Angle180;
+ gHomeApplicationStub->stubSetReturnValue("lockedOrientation",
commandLineLockedOrientation);
// Set the style
MainWindowStyle *style = const_cast<MainWindowStyle
*>(static_cast<const MainWindowStyle *>(MTheme::style("MainWindowStyle",
"", "", "", M::Landscape, NULL)));
- style->setLockedOrientation(lockedOrientation);
+ style->setLockedOrientation(styleLockedOrientation);
// Create a new window
delete mainWindow;
mainWindow = MainWindow::instance(true);
QCOMPARE(mWindowOrientationLocked, orientationLocked);
+ QCOMPARE(mWindowOrientationAngleLocked, orientationLocked);
QCOMPARE(mWindowOrientation, expectedOrientation);
+ QCOMPARE(mWindowOrientationAngle,
(M::OrientationAngle)expectedOrientationAngle);
}
QTEST_APPLESS_MAIN(Ut_MainWindow)
--- tests/ut_mainwindow/ut_mainwindow.pro
+++ tests/ut_mainwindow/ut_mainwindow.pro
@@ -13,7 +13,8 @@
HEADERS += \
ut_mainwindow.h \
$$SRCDIR/mainwindow.h \
- $$SRCDIR/mainwindowstyle.h
+ $$SRCDIR/mainwindowstyle.h \
+ $$SRCDIR/homeapplication.h
SOURCES +=
include(../common_bot.pri)
--- tests/ut_switcher/ut_switcher.cpp
+++ tests/ut_switcher/ut_switcher.cpp
@@ -1129,4 +1129,21 @@
verifyModel(receiver.windowList);
}
+void Ut_Switcher::testWindowsAreClosedWhenSwitcherIsDestroyed()
+{
+ updateWindowList();
+ QList<Window> windows;
+ foreach (const QSharedPointer<SwitcherButton> &button,
switcher->model()->buttons()) {
+ windows.append(button->xWindow());
+ }
+
+ delete switcher;
+ switcher = NULL;
+
+ QCOMPARE(x11WrapperSendEventCalls.count(), windows.count());
+ for (int i = 0; i < APPLICATION_WINDOWS; i++) {
+ QCOMPARE(x11WrapperSendEventCalls.at(i).event.xclient.window,
windows.at(i));
+ }
+}
+
QTEST_APPLESS_MAIN(Ut_Switcher)
--- tests/ut_switcher/ut_switcher.h
+++ tests/ut_switcher/ut_switcher.h
@@ -167,6 +167,8 @@
void testRestoringButtonBeingClosedWhenWindowComesOnTop();
void testRestoringButtonBeingClosedWhenButtonCloseTimerTimeouts();
+ void testWindowsAreClosedWhenSwitcherIsDestroyed();
+
private:
MSceneManager *mSceneManager;
HomeWindowMonitor *homeWindowMonitor;
--- tests/ut_switcherbutton/ut_switcherbutton.cpp
+++ tests/ut_switcherbutton/ut_switcherbutton.cpp
@@ -194,13 +194,22 @@
QVERIFY(prepareGeometryChangeCalled);
}
+void Ut_SwitcherButton::testSetVisibleInSwitcherProperty_data()
+{
+ QTest::addColumn<bool>("visibleInSwitcher");
+ QTest::addColumn<unsigned char>("propertyData");
+
+ QTest::newRow("Visible") << true << (unsigned char)1;
+ QTest::newRow("Not visible") << false << (unsigned char)0;
+}
+
void Ut_SwitcherButton::testSetVisibleInSwitcherProperty()
{
- // Initialize to invisible
- button->setVisibleInSwitcherProperty(false);
+ QFETCH(bool, visibleInSwitcher);
+ QFETCH(unsigned char, propertyData);
// Set window visible in the Switcher
- button->setVisibleInSwitcherProperty(true);
+ button->setVisibleInSwitcherProperty(visibleInSwitcher);
// Check correct values passed to X11Wrapper::XChangeProperty()
QCOMPARE(Ut_SwitcherButton::xChangePropertyWindow, button->xWindow());
@@ -211,19 +220,7 @@
QCOMPARE(Ut_SwitcherButton::xChangePropertyNElements, 1);
unsigned char *data = (unsigned char *)xChangePropertyData;
- QVERIFY(data[0] == 1);
-
- // Set window not visible in the Switcher
- button->setVisibleInSwitcherProperty(false);
-
- // Check correct values passed to X11Wrapper::XChangeProperty()
- QCOMPARE(Ut_SwitcherButton::xChangePropertyWindow,
button->xWindow());
- QCOMPARE(Ut_SwitcherButton::xChangePropertyProperty,
(Atom)TEST_MEEGOTOUCH_VISIBLE_IN_SWITCHER_ATOM);
- QCOMPARE(Ut_SwitcherButton::xChangePropertyFormat, 8);
- QCOMPARE(Ut_SwitcherButton::xChangePropertyMode, PropModeReplace);
- QCOMPARE(Ut_SwitcherButton::xChangePropertyType, XA_CARDINAL);
- QCOMPARE(Ut_SwitcherButton::xChangePropertyNElements, 1);
- QVERIFY(data[0] == 0);
+ QCOMPARE(data[0], propertyData);
}
void
Ut_SwitcherButton::testSetVisibleInSwitcherPropertyNotUpdatedWhenValueDoesNotChange()
@@ -248,6 +245,8 @@
QCOMPARE(Ut_SwitcherButton::xChangePropertyWindow, Window(0));
QCOMPARE(bool(Ut_SwitcherButton::xChangePropertyData[0]), false);
button->setVisibilityPropertyEnabled(true);
+ // TODO: this should actually check that
setVisibilityPropertyEnabled(true) causes the visibility to be set based
on isOnDisplay()
+ button->setVisibleInSwitcherProperty(true);
QCOMPARE(Ut_SwitcherButton::xChangePropertyWindow, button->xWindow());
QCOMPARE(bool(Ut_SwitcherButton::xChangePropertyData[0]), true);
}
--- tests/ut_switcherbutton/ut_switcherbutton.h
+++ tests/ut_switcherbutton/ut_switcherbutton.h
@@ -81,7 +81,7 @@
void testClosingWithTimeout();
void testClosingWithoutTimeout();
void testPrepareGeometryChange();
- // Test that X11 properties are set correctly if visible in switcher
+ void testSetVisibleInSwitcherProperty_data();
void testSetVisibleInSwitcherProperty();
void
testSetVisibleInSwitcherPropertyNotUpdatedWhenValueDoesNotChange();
void
testWhenVisibilityPropertyDisabledThenPropertyChangesOnlyWhenEnabledAgain();
--- tests/ut_switcherbuttonview/ut_switcherbuttonview.cpp
+++ tests/ut_switcherbuttonview/ut_switcherbuttonview.cpp
@@ -89,7 +89,7 @@
unsigned long Ut_SwitcherButtonView::damageHandle = 0;
Display *Ut_SwitcherButtonView::damageDisplay = NULL;
bool Ut_SwitcherButtonView::damageSubtracted = false;
-unsigned long Ut_SwitcherButtonView::damageSubtractHandle = NULL;
+unsigned long Ut_SwitcherButtonView::damageSubtractHandle = 0;
Display *Ut_SwitcherButtonView::damageSubtractDisplay = NULL;
XErrorHandler X11Wrapper::XSetErrorHandler(XErrorHandler handler)
@@ -284,7 +284,7 @@
damageDestroyed = false;
damageDisplay = NULL;
damageSubtracted = false;
- damageSubtractHandle = NULL;
+ damageSubtractHandle = 0;
damageSubtractDisplay = NULL;
gQPainter_drawPixmap_throwsBadAlloc = false;
gQPainter_restore_called = false;
--- tests/ut_switcherview/ut_switcherview.cpp
+++ tests/ut_switcherview/ut_switcherview.cpp
@@ -38,6 +38,7 @@
#include "pagedviewport_stub.h"
#include <QGestureEvent>
#include <QPinchGesture>
+#include <MDeviceProfile>
#include "mainwindow_stub.h"
#include "windowinfo_stub.h"
@@ -328,8 +329,12 @@
void Ut_SwitcherView::pinchGesture(qreal scaleFactor, Qt::GestureState
state)
{
+ QSize s = MDeviceProfile::instance()->resolution();
+
+ mPinch->setHotSpot(QPointF(0, 0));
+ mPinch->setCenterPoint(QPointF(s.width() * 3 / 4 / 2 * scaleFactor,
0));
+
currentPinchState = state;
- mPinch->setTotalScaleFactor(scaleFactor);
m_subject->pinchGestureEvent(mEvent, mPinch);
}
@@ -546,9 +551,7 @@
currentPinchState = Qt::GestureStarted;
// Scale factor <1 is transition to Overview mode.
- mPinch->setLastScaleFactor(0.8);
-
- pinchGesture(0.5,Qt::GestureStarted);
+ pinchGesture(0.8,Qt::GestureStarted);
pinchGesture(0.5,Qt::GestureUpdated);
pinchGesture(0.5,Qt::GestureFinished);
@@ -574,9 +577,7 @@
g_switcherModel->setSwitcherMode(SwitcherModel::Overview);
// Scale factor >1 is transition to Detailview mode.
- mPinch->setLastScaleFactor(1.5);
-
- pinchGesture(2.0,Qt::GestureStarted);
+ pinchGesture(1.5,Qt::GestureStarted);
pinchGesture(2.0,Qt::GestureUpdated);
pinchGesture(2.0,Qt::GestureFinished);
QCOMPARE (g_switcherModel->switcherMode(), SwitcherModel::Detailview);
@@ -626,7 +627,6 @@
gSceneItems.append(m_subject->viewport);
- mPinch->setLastScaleFactor(1.0);
pinchGesture(1.0, Qt::GestureStarted);
gTransformLayoutAnimationStub->stubSetReturnValue("manualControl",
true);
---
themes/base/meegotouch/libmeegotouchhome/style/libmeegotouchhome-default.css
+++
themes/base/meegotouch/libmeegotouchhome/style/libmeegotouchhome-default.css
@@ -184,8 +184,8 @@
SwitcherBaseStyle {
pinch-cancel-threshold: 0.25;
pinch-length: 1.5;
- bounce-scale: 0.04;
- bounce-duration: 300;
+ bounce-scale: 0.2;
+ bounce-duration: 150;
bounce-curve: linear;
}
---
themes/base/meegotouch/libmeegotouchhome/style/libmeegotouchviews-modified-default.css
+++
themes/base/meegotouch/libmeegotouchhome/style/libmeegotouchviews-modified-default.css
@@ -187,7 +187,7 @@
}
MLabelStyle#SwitcherButtonTitleLabelDetailview {
- font: "Nokia Sans" 3.2mm;
+ font: $FONT_FAMILY 3.2mm;
preferred-size: -1 4.255mm;
minimum-size: -1 4.255mm;
@@ -197,11 +197,11 @@
}
MLabelStyle#SwitcherButtonTitleLabelDetailview.Landscape {
- font: "Nokia Sans" 3.6mm;
+ font: $FONT_FAMILY 3.6mm;
}
MLabelStyle#SwitcherButtonTitleLabelOverviewMedium {
- font: "Nokia Sans" 1.8mm;
+ font: $FONT_FAMILY 1.8mm;
preferred-size: -1 2.3mm;
minimum-size: -1 2.3mm;
@@ -211,7 +211,7 @@
}
MLabelStyle#SwitcherButtonTitleLabelOverviewMedium.Landscape {
- font: "Nokia Sans" 1.6mm;
+ font: $FONT_FAMILY 1.6mm;
preferred-size: -1 1.79mm;
minimum-size: -1 1.79mm;
@@ -219,7 +219,7 @@
}
MLabelStyle#SwitcherButtonTitleLabelOverviewLarge {
- font: "Nokia Sans" 2.0mm;
+ font: $FONT_FAMILY 2.0mm;
preferred-size: -1 2.67mm;
minimum-size: -1 2.67mm;
@@ -229,7 +229,7 @@
}
MLabelStyle#SwitcherButtonTitleLabelOverviewLarge.Landscape {
- font: "Nokia Sans" 1.6mm;
+ font: $FONT_FAMILY 1.6mm;
preferred-size: -1 1.79mm;
minimum-size: -1 1.79mm;
++++++ meegotouch-home.desktop
--- meegotouch-home.desktop
+++ meegotouch-home.desktop
@@ -1,4 +1,4 @@
[Desktop Entry]
-Exec=/usr/bin/meegotouchhome --desktop -remote-theme
+Exec=/usr/bin/meegotouchhome -remote-theme
X-Moblin-Priority=Normal
OnlyShowIn=X-MEEGO-HS;
++++++ meegotouch-home.yaml
--- meegotouch-home.yaml
+++ meegotouch-home.yaml
@@ -1,6 +1,6 @@
Name: meegotouch-home
Summary: MeeGo Touch Homescreen
-Version: 0.23.10
+Version: 0.23.20
Release: 1
Group: System/Desktop
License: LGPL v2.1
_______________________________________________
MeeGo-commits mailing list
[email protected]
http://lists.meego.com/listinfo/meego-commits