on xenial help sign in
Add -windowgeometry option to the Dash and drop any user-visible mentions of Dash
d276e0eMichał Sawicz
data/unity8-dash.desktop.in+3−3
@@ -1,9 +1,9 @@
1[Desktop Entry]
1[Desktop Entry]
2Type=Application
2Type=Application
3−Name=Unity 8 Dash
3+Name=Scopes
4−Comment=The converged Unity shell dash
4+Comment=An interface for using the Scopes system
5Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-dash
5Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-dash
6Terminal=false
6Terminal=false
7−Icon=unity8
7+Icon=
8NoDisplay=true
8NoDisplay=true
9X-Ubuntu-Touch=true
9X-Ubuntu-Touch=true
data/unity8.desktop.in+1−1
@@ -4,6 +4,6 @@ Name=Unity 8
4Comment=The converged Unity shell
4Comment=The converged Unity shell
5Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8
5Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8
6Terminal=false
6Terminal=false
7−Icon=unity8
7+Icon=
8NoDisplay=true
8NoDisplay=true
9X-Ubuntu-Touch=true
9X-Ubuntu-Touch=true
qml/Dash/DashApplication.qml+2−2
@@ -19,8 +19,8 @@ import Ubuntu.Components 1.0
19import Ubuntu.Thumbnailer 0.1 // Register support for image://thumbnailer/ and image://albumart/
19import Ubuntu.Thumbnailer 0.1 // Register support for image://thumbnailer/ and image://albumart/
20
20
21MainView {
21MainView {
22− width: units.gu(40)
22+ width: applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
23− height: units.gu(71)
23+ height: applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(68)
24
24
25 useDeprecatedToolbar: false
25 useDeprecatedToolbar: false
26
26
qml/Dash/ScopesOverview.qml+1−1
@@ -203,7 +203,7 @@ Item {
203 }
203 }
204 width: parent.width
204 width: parent.width
205 clip: true
205 clip: true
206− title: i18n.tr("Manage Dash")
206+ title: i18n.tr("Manage Scopes")
207 scopeStyle: overviewScopeStyle
207 scopeStyle: overviewScopeStyle
208 showSignatureLine: false
208 showSignatureLine: false
209 searchEntryEnabled: true
209 searchEntryEnabled: true
src/Dash/CMakeLists.txt+1
@@ -1,5 +1,6 @@
1set(DASH_SRCS
1set(DASH_SRCS
2 main.cpp
2 main.cpp
3+ ../ApplicationArguments.h
3 ../MouseTouchAdaptor.cpp
4 ../MouseTouchAdaptor.cpp
4 ../CachingNetworkManagerFactory.cpp
5 ../CachingNetworkManagerFactory.cpp
5)
6)
src/Dash/main.cpp+16−2
@@ -28,6 +28,7 @@
28
28
29#include <paths.h>
29#include <paths.h>
30#include "../MouseTouchAdaptor.h"
30#include "../MouseTouchAdaptor.h"
31+#include "../ApplicationArguments.h"
31#include "../CachingNetworkManagerFactory.h"
32#include "../CachingNetworkManagerFactory.h"
32
33
33int main(int argc, const char *argv[])
34int main(int argc, const char *argv[])
@@ -42,7 +43,11 @@ int main(int argc, const char *argv[])
42 "Allow the mouse to provide touch input");
43 "Allow the mouse to provide touch input");
43 parser.addOption(mousetouchOption);
44 parser.addOption(mousetouchOption);
44
45
46+ QCommandLineOption windowGeometryOption(QStringList() << "windowgeometry",
47+ "Specify the window geometry as [<width>x<height>]", "windowgeometry", "1");
48+ parser.addOption(windowGeometryOption);
49+
45− // FIXME Remove once we drop the need of the hint
50+ // FIXME Remove once we drop the need of the hint
46 QCommandLineOption desktopFileHintOption("desktop_file_hint",
51 QCommandLineOption desktopFileHintOption("desktop_file_hint",
47 "The desktop_file_hint option for QtMir", "hint_file");
52 "The desktop_file_hint option for QtMir", "hint_file");
48 parser.addOption(desktopFileHintOption);
53 parser.addOption(desktopFileHintOption);
@@ -52,6 +57,14 @@ int main(int argc, const char *argv[])
52 parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
57 parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
53 parser.process(*application);
58 parser.process(*application);
54
59
60+ ApplicationArguments qmlArgs;
61+ if (parser.isSet(windowGeometryOption) &&
62+ parser.value(windowGeometryOption).split('x').size() == 2)
63+ {
64+ QStringList geom = parser.value(windowGeometryOption).split('x');
65+ qmlArgs.setSize(geom.at(0).toInt(), geom.at(1).toInt());
66+ }
67+
55 if (getenv("QT_LOAD_TESTABILITY")) {
68 if (getenv("QT_LOAD_TESTABILITY")) {
56 QLibrary testLib(QLatin1String("qttestability"));
69 QLibrary testLib(QLatin1String("qttestability"));
57 if (testLib.load()) {
70 if (testLib.load()) {
@@ -72,7 +85,8 @@ int main(int argc, const char *argv[])
72
85
73 QQuickView* view = new QQuickView();
86 QQuickView* view = new QQuickView();
74 view->setResizeMode(QQuickView::SizeRootObjectToView);
87 view->setResizeMode(QQuickView::SizeRootObjectToView);
75− view->setTitle("Unity Dash");
88+ view->setTitle("Scopes");
89+ view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
76
90
77 // You will need this if you want to interact with touch-only components using a mouse
91 // You will need this if you want to interact with touch-only components using a mouse
78 // Needed only when manually testing on a desktop.
92 // Needed only when manually testing on a desktop.
tests/autopilot/unity8/shell/tests/__init__.py+4−21
@@ -432,12 +432,6 @@ class DashBaseTestCase(AutopilotTestCase):
432 binary_path = get_binary_path('unity8-dash')
432 binary_path = get_binary_path('unity8-dash')
433 dash_proxy = self.launch_dash(binary_path, self.environment)
433 dash_proxy = self.launch_dash(binary_path, self.environment)
434
434
435− if self.should_simulate_device():
436− # XXX Currently we have no way to launch the application with a
437− # specific size, so we must resize it after it's launched.
438− # --elopio - 2014-06-25
439− self.resize_window()
440−
441 self.dash_app = dash_helpers.DashApp(dash_proxy)
435 self.dash_app = dash_helpers.DashApp(dash_proxy)
442 self.dash = self.dash_app.dash
436 self.dash = self.dash_app.dash
443 self.wait_for_dash()
437 self.wait_for_dash()
@@ -470,18 +464,7 @@ class DashBaseTestCase(AutopilotTestCase):
470 simulate_device_fixture = self.useFixture(
464 simulate_device_fixture = self.useFixture(
471 toolkit_fixtures.SimulateDevice(
465 toolkit_fixtures.SimulateDevice(
472 self.app_width, self.app_height, self.grid_unit_px))
466 self.app_width, self.app_height, self.grid_unit_px))
473− self.app_width = simulate_device_fixture.app_width
467+ self.environment['GRID_UNIT_PX'] = simulate_device_fixture.grid_unit_px
474− self.app_height = simulate_device_fixture.app_height
468+ self.environment['ARGS'] = '-windowgeometry {0}x{1}'\
475−
469+ .format(simulate_device_fixture.app_width,
476− def resize_window(self):
470+ simulate_device_fixture.app_height)
477− application = self.process_manager.get_running_applications()[0]
478− window = application.get_windows()[0]
479− window.resize(self.app_width, self.app_height)
480−
481− def get_window_size():
482− _, _, window_width, window_height = window.geometry
483− return window_width, window_height
484−
485− self.assertThat(
486− get_window_size,
487− Eventually(Equals((self.app_width, self.app_height))))