on xenial help sign in
Merge from trunk
commitd196328dd01c12385700939280b7cc5969a908b8 authorMichael Terry <michael.terry@canonical.com> dateTue 17 Sep 2013, 09:22 (13 years ago) parenta2a3f8e6a74c57
22 files changed+104−27
Dash/graphics/phone/home.png Dash/graphics/phone/music.png Dash/graphics/phone/videos.png Dash/graphics/tablet/apps.png Dash/graphics/tablet/home.png Dash/graphics/tablet/music.png Dash/graphics/tablet/people.png Dash/graphics/tablet/videos.png Greeter/Greeter.qml+2 Greeter/GreeterContent.qml+4−3 Launcher/Launcher.qml+2−2 Panel/Indicators/DefaultIndicatorWidget.qml+1−5 Shell.qml+3−1 debian/changelog+14 plugins/Unity/Launcher/backend/launcherbackend.cpp+8−9 run_on_device+2−1 tests/mocks/AccountsService/AccountsService.cpp+9−2 tests/mocks/AccountsService/AccountsService.h+5 tests/plugins/Unity/Launcher/click-icon.svg tests/plugins/Unity/Launcher/launcherbackendtest.cpp+10−2 tests/qmltests/Greeter/tst_Phone.qml+19−1 tests/qmltests/tst_Shell.qml+25−1
Dash/graphics/phone/home.pngdeleted

Binary file not shown.

Dash/graphics/phone/music.pngdeleted

Binary file not shown.

Dash/graphics/phone/videos.pngdeleted

Binary file not shown.

Dash/graphics/tablet/apps.pngdeleted

Binary file not shown.

Dash/graphics/tablet/home.pngdeleted

Binary file not shown.

Dash/graphics/tablet/music.pngdeleted

Binary file not shown.

Dash/graphics/tablet/people.pngdeleted

Binary file not shown.

Dash/graphics/tablet/videos.pngdeleted

Binary file not shown.

Greeter/Greeter.qml+2
@@ -26,6 +26,8 @@ Showable {
2626 enabled: shown
2727 created: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.ready
2828
29+ property url defaultBackground
30+
2931 // 1 when fully shown and 0 when fully hidden
3032 property real showProgress: MathLocal.clamp((width + x) / width, 0, 1)
3133
Greeter/GreeterContent.qml+4−3
@@ -40,11 +40,12 @@ MouseArea {
4040 color: "black"
4141 }
4242
43− property url backgroundValue: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : shell.defaultBackground
43+ property url backgroundValue: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : greeter.defaultBackground
4444 onBackgroundValueChanged: wallpaper.source = backgroundValue
4545
4646 CrossFadeImage {
4747 id: wallpaper
48+ objectName: "wallpaper"
4849 anchors.fill: parent
4950 fadeInFirst: false
5051 }
@@ -58,8 +59,8 @@ MouseArea {
5859 sourceSize.height: 0
5960 sourceSize.width: 0
6061 onStatusChanged: {
61− if (status == Image.Error && source != shell.defaultBackground) {
62− wallpaper.source = shell.defaultBackground
62+ if (status == Image.Error && source != greeter.defaultBackground) {
63+ wallpaper.source = greeter.defaultBackground
6364 }
6465 }
6566 }
Launcher/Launcher.qml+2−2
@@ -192,12 +192,12 @@ Item {
192192
193193 direction: Direction.Rightwards
194194
195− enabled: root.available && root.state !== "visible"
195+ enabled: root.available
196196 width: root.dragAreaWidth
197197 height: root.height
198198
199199 onTouchXChanged: {
200− if (status !== DirectionalDragArea.Recognized)
200+ if (status !== DirectionalDragArea.Recognized || launcher.state == "visible")
201201 return;
202202
203203 // When the gesture finally gets recognized, the finger will likely be
Panel/Indicators/DefaultIndicatorWidget.qml+1−5
@@ -24,6 +24,7 @@ import Unity.IndicatorsLegacy 0.1 as Indicators
2424Indicators.IndicatorWidget {
2525 id: indicatorWidget
2626
27+ enabled:true
2728 width: itemRow.width + units.gu(0.5)
2829
2930 property alias label: itemLabel.text
@@ -63,19 +64,14 @@ Indicators.IndicatorWidget {
6364
6465 onActionStateChanged: {
6566 if (action == undefined || !action.valid) {
66− enabled = false;
6767 return;
6868 }
6969
7070 if (action.state == undefined) {
71− label = "";
72− iconSource = "";
73− enabled = false;
7471 return;
7572 }
7673
7774 label = action.state[Indicators.ActionState.Label];
7875 iconSource = "image://theme/" + action.state[Indicators.ActionState.IconSource];
79− enabled = action.state[Indicators.ActionState.Visible];
8076 }
8177}
Shell.qml+3−1
@@ -260,7 +260,7 @@ FocusScope {
260260 property bool fullyShown: shown && x == 0 && parent.x == 0
261261 property bool fullyHidden: !shown && x == width
262262 available: !greeter.shown
263− hides: [launcher, panel.indicators]
263+ hides: [panel.indicators]
264264 shown: false
265265 opacity: 1.0
266266 showAnimation: StandardAnimation { property: "x"; duration: 350; to: 0; easing.type: Easing.OutCubic }
@@ -461,6 +461,8 @@ FocusScope {
461461 hides: [launcher, panel.indicators, hud]
462462 shown: true
463463
464+ defaultBackground: shell.background
465+
464466 y: panel.panelHeight
465467 width: parent.width
466468 height: parent.height - panel.panelHeight
debian/changelog+14
@@ -1,3 +1,17 @@
1+unity8 (7.81.3+13.10.20130916-0ubuntu1) saucy; urgency=low
2+
3+ [ Michael Zanetti ]
4+ * allow left edge gesture to minimize apps even when launcher is
5+ already visible.
6+ * Don't hide the launcher on changes in the stages.
7+ * ssh is now installed per default, but it's set to manual in the
8+ ssh.override.
9+
10+ [ Ubuntu daily release ]
11+ * Automatic snapshot from revision 320
12+
13+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 16 Sep 2013 11:49:28 +0000
14+
115unity8 (7.81.3+13.10.20130912-0ubuntu1) saucy; urgency=low
216
317 [ Michael Zanetti ]
plugins/Unity/Launcher/backend/launcherbackend.cpp+8−9
@@ -132,11 +132,7 @@ QString LauncherBackend::icon(const QString &appId) const
132132 }
133133 }
134134
135− QFileInfo info(iconName);
136− if (info.exists()) {
137− return info.absoluteFilePath();
138− }
139− return "image://theme/" + iconName;
135+ return iconName;
140136}
141137
142138bool LauncherBackend::isPinned(const QString &appId) const
@@ -296,15 +292,18 @@ LauncherBackendItem* LauncherBackend::parseDesktopFile(const QString &desktopFil
296292{
297293 QSettings settings(desktopFile, QSettings::IniFormat);
298294
299−
300295 LauncherBackendItem* item = new LauncherBackendItem();
301296 item->desktopFile = desktopFile;
302297 item->displayName = settings.value("Desktop Entry/Name").toString();
303298
304− if (settings.contains("Desktop Entry/Path")) {
305− item->icon = settings.value("Desktop Entry/Path").toString() + "/" + settings.value("Desktop Entry/Icon").toString();
299+ QString iconString = settings.value("Desktop Entry/Icon").toString();
300+ QString pathString = settings.value("Desktop Entry/Path").toString();
301+ if (QFileInfo(iconString).exists()) {
302+ item->icon = QFileInfo(iconString).absoluteFilePath();
303+ } else if (QFileInfo(pathString + '/' + iconString).exists()) {
304+ item->icon = pathString + '/' + iconString;
306305 } else {
307− item->icon = settings.value("Desktop Entry/Icon").toString();
306+ item->icon = "image://theme/" + iconString;
308307 }
309308 item->pinned = false;
310309 return item;
run_on_device+2−1
@@ -65,8 +65,9 @@ setup_adb_forwarding() {
6565}
6666
6767install_dependencies() {
68+ exec_with_adb rm /etc/init/ssh.override
69+ exec_with_adb service ssh start
6870 exec_with_adb apt-get update
69− exec_with_adb apt-get -y install openssh-server
7071 exec_with_ssh $SUDO apt-get -y install build-essential rsync bzr ccache gdb ninja-build devscripts equivs
7172}
7273
tests/mocks/AccountsService/AccountsService.cpp+9−2
@@ -19,7 +19,8 @@
1919#include "AccountsService.h"
2020
2121AccountsService::AccountsService(QObject* parent)
22− : QObject(parent)
22+ : QObject(parent),
23+ m_backgroundFile(TOP_SRCDIR "/graphics/phone_background.jpg")
2324{
2425}
2526
@@ -45,5 +46,11 @@ void AccountsService::setDemoEdges(bool demoEdges)
4546
4647QString AccountsService::getBackgroundFile()
4748{
48− return TOP_SRCDIR "/graphics/phone_background.jpg";
49+ return m_backgroundFile;
50+}
51+
52+void AccountsService::setBackgroundFile(const QString &backgroundFile)
53+{
54+ m_backgroundFile = backgroundFile;
55+ backgroundFileChanged();
4956}
tests/mocks/AccountsService/AccountsService.h+5
@@ -37,6 +37,7 @@ class AccountsService: public QObject
3737 NOTIFY demoEdgesChanged)
3838 Q_PROPERTY (QString backgroundFile
3939 READ getBackgroundFile
40+ WRITE setBackgroundFile // only available in mock
4041 NOTIFY backgroundFileChanged)
4142
4243public:
@@ -47,11 +48,15 @@ public:
4748 bool getDemoEdges();
4849 void setDemoEdges(bool demoEdges);
4950 QString getBackgroundFile();
51+ void setBackgroundFile(const QString &backgroundFile);
5052
5153Q_SIGNALS:
5254 void userChanged();
5355 void demoEdgesChanged();
5456 void backgroundFileChanged();
57+
58+private:
59+ QString m_backgroundFile;
5560};
5661
5762#endif
tests/plugins/Unity/Launcher/click-icon.svgnew file

No changes to the content.

tests/plugins/Unity/Launcher/launcherbackendtest.cpp+10−2
@@ -26,6 +26,15 @@ class LauncherBackendTest : public QObject
2626 Q_OBJECT
2727
2828private Q_SLOTS:
29+
30+ void initTestCase()
31+ {
32+ // As we want to test absolute file paths in the .desktop file, we need to modify the
33+ // sample file and replace the path in there with the current build dir.
34+ QSettings settings(QDir::currentPath() + "/click-icon.desktop", QSettings::IniFormat);
35+ settings.setValue("Desktop Entry/Path", QDir::currentPath());
36+ }
37+
2938 void testFileNames()
3039 {
3140 LauncherBackend backend(false);
@@ -66,8 +75,7 @@ private Q_SLOTS:
6675 QTest::newRow("fallback on theme") << "abs-icon" << "image://theme//path/to/icon.png";
6776
6877 // Click packages have a relative icon path but an absolute path as a separate entry
69− // As we don't want to rely on a click app being installed for the test, accept it with the image://theme fallback
70− QTest::newRow("click package icon") << "click-icon" << "image://theme//path/to/some/click/app/click-icon.svg";
78+ QTest::newRow("click package icon") << "click-icon" << QDir::currentPath() + "/click-icon.svg";
7179 }
7280
7381 void testIcon() {
tests/qmltests/Greeter/tst_Phone.qml+19−1
@@ -18,8 +18,8 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
2020import "../../../Greeter"
21+import AccountsService 0.1
2122import Ubuntu.Components 0.1
22−import LightDM 0.1 as LightDM
2323import Unity.Test 0.1 as UT
2424
2525Item {
@@ -32,6 +32,8 @@ Item {
3232 height: parent.height
3333 x: 0; y: 0
3434
35+ defaultBackground: "../../../graphics/phone_background.jpg"
36+
3537 property int minX: 0
3638
3739 onXChanged: {
@@ -102,5 +104,21 @@ Item {
102104 // Wait until we're back to 0
103105 tryCompareFunction(function() { return greeter.x;}, 0);
104106 }
107+
108+ function test_wallpaper_data() {
109+ return [
110+ {tag: "set", accounts: "../tests/data/unity/backgrounds/blue.png", expected: "blue.png"},
111+ {tag: "unset", accounts: "", expected: "background.jpg"},
112+ {tag: "invalid", accounts: "invalid", expected: "background.jpg"},
113+ ]
114+ }
115+
116+ function test_wallpaper(data) {
117+ var loader = findChild(greeter, "greeterContentLoader")
118+ var wallpaper = findChild(loader.item, "wallpaper")
119+ AccountsService.backgroundFile = data.accounts
120+ tryCompareFunction(function() { return wallpaper.source.toString().indexOf(data.expected) !== -1; }, true)
121+ tryCompare(wallpaper, "status", Image.Ready)
122+ }
105123 }
106124}
tests/qmltests/tst_Shell.qml+25−1
@@ -114,6 +114,26 @@ Item {
114114 checkRightEdgeDragWithNoRunningApps();
115115 }
116116
117+ function test_leftEdgeDrag_data() {
118+ return [
119+ {tag: "without launcher", revealLauncher: false},
120+ {tag: "with launcher", revealLauncher: true},
121+ ];
122+ }
123+
124+ function test_leftEdgeDrag(data) {
125+ dragLauncherIntoView();
126+ tapOnAppIconInLauncher();
127+ waitUntilApplicationWindowIsFullyVisible();
128+
129+ if (data.revealLauncher) {
130+ dragLauncherIntoView();
131+ }
132+
133+ swipeFromLeftEdge();
134+ waitUntilApplicationWindowIsFullyHidden();
135+ }
136+
117137 function test_suspend() {
118138 var greeter = findChild(shell, "greeter");
119139
@@ -223,7 +243,11 @@ Item {
223243 function dragLauncherIntoView() {
224244 var launcherPanel = findChild(shell, "launcherPanel");
225245 verify(launcherPanel.x = - launcherPanel.width);
226− swipeFromLeftEdge();
246+
247+ var touchStartX = 2;
248+ var touchStartY = shell.height / 2;
249+ touchFlick(shell, touchStartX, touchStartY, launcherPanel.width + units.gu(1), touchStartY);
250+
227251 tryCompare(launcherPanel, "x", 0);
228252 }
229253