Merge lp:~uriboni/unity-2d/launcher-shortcuts-on-hold-dash-on-tap into lp:unity-2d/3.0

Proposed by Ugo Riboni
Status: Superseded
Proposed branch: lp:~uriboni/unity-2d/launcher-shortcuts-on-hold-dash-on-tap
Merge into: lp:unity-2d/3.0
Prerequisite: lp:~uriboni/unity-2d/clean-up-dash-dbus
Diff against target: 80 lines (+14/-15)
3 files modified
launcher/Launcher.qml (+4/-5)
launcher/app/launcherview.cpp (+9/-4)
launcher/app/launcherview.h (+1/-6)
To merge this branch: bzr merge lp:~uriboni/unity-2d/launcher-shortcuts-on-hold-dash-on-tap
Reviewer Review Type Date Requested Status
Olivier Tilloy (community) Approve
Florian Boucault Pending
Review via email: mp+52043@code.launchpad.net

This proposal has been superseded by a proposal from 2011-03-22.

Description of the change

[launcher] Make the Dash appear when the user just "taps" the Super key, and force the Launcher to appear and display the keyboard shortcuts when the Super key is held instead.

To post a comment you must log in.
Revision history for this message
Florian Boucault (fboucault) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

In launcherview.cpp, the following include is useless, it is already included in launcherview.h:

+#include <QTimer>

review: Needs Fixing (code)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Having two attributes for the state of the super key, m_superKeyPressed and m_superKeyHeld, is rather confusing, even if m_superKeyPressed is private. I would expect 'held' to imply 'press'.
If I read the code correctly, the only place where m_superKeyPressed is used is in LauncherView::updateSuperKeyHoldState(). Can’t you get rid of the attribute and test the state of the modifier using KeyboardModifiersMonitor::keyboardModifiers()?

Revision history for this message
Olivier Tilloy (osomon) wrote :

When I tap the super key, the dash shows up, but it is empty, and searching has no effect. I suspect setting the 'active' property of the dash to true is not enough.

review: Needs Fixing (functional)
Revision history for this message
Ugo Riboni (uriboni) wrote :

Fixed all the remarks, except for the code simplification that as discussed caused more harm than benefit.

Revision history for this message
Olivier Tilloy (osomon) wrote :

In launcher/app/launcherview.cpp, for consistency with the naming scheme you picked, 'DASH_DBUS_HOME' should be renamed to 'DASH_DBUS_METHOD_ACTIVATE_HOME'.

review: Needs Fixing (code)
Revision history for this message
Olivier Tilloy (osomon) wrote :

In launcher/Launcher.qml, please add curly braces around the code connected to launcherView.onSuperKeyHeldChanged for readability and consistency with the other handlers that are not one-liners.

review: Needs Fixing (code)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Once you have applied those tweaks, please go ahead and mark the request approved.

review: Approve
Revision history for this message
Bob The Builder (bobthebuilder-deactivatedaccount) wrote :

No proposals found for merge of lp:~uriboni/unity-2d/clean-up-dash-dbus into lp:unity-2d.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/Launcher.qml'
2--- launcher/Launcher.qml 2011-03-22 11:58:51 +0000
3+++ launcher/Launcher.qml 2011-03-22 11:58:51 +0000
4@@ -107,14 +107,13 @@
5 onDesktopFileDropped: applications.insertFavoriteApplication(path)
6 onWebpageUrlDropped: applications.insertWebFavorite(url)
7 onAddWebFavoriteRequested: applications.insertWebFavorite(url)
8-<<<<<<< TREE
9+ onSuperKeyHeldChanged: {
10+ if (superKeyHeld) visibilityController.beginForceVisible()
11+ else visibilityController.endForceVisible()
12+ }
13 onFocusChanged: {
14 if (focus) visibilityController.beginForceVisible()
15 else visibilityController.endForceVisible()
16 }
17-=======
18- onSuperKeyHeldChanged: if (superKeyHeld) visibilityController.beginForceVisible()
19- else visibilityController.endForceVisible()
20->>>>>>> MERGE-SOURCE
21 }
22 }
23
24=== modified file 'launcher/app/launcherview.cpp'
25--- launcher/app/launcherview.cpp 2011-03-22 11:58:51 +0000
26+++ launcher/app/launcherview.cpp 2011-03-22 11:58:51 +0000
27@@ -28,8 +28,8 @@
28 #include <QDeclarativeEngine>
29 #include <QDeclarativeContext>
30 #include <QDeclarativeImageProvider>
31-#include <QTimer>
32 #include <QtDBus/QDBusInterface>
33+#include <QtDBus/QDBusPendingCall>
34
35 #include <X11/Xlib.h>
36 #include <X11/Xatom.h>
37@@ -45,6 +45,7 @@
38 static const char* DASH_DBUS_PATH = "/Dash";
39 static const char* DASH_DBUS_INTERFACE = "com.canonical.Unity2d.Dash";
40 static const char* DASH_DBUS_PROPERTY_ACTIVE = "active";
41+static const char* DASH_DBUS_METHOD_ACTIVATE_HOME = "activateHome";
42
43 LauncherView::LauncherView(QWidget* parent) :
44 QDeclarativeView(parent),
45@@ -208,9 +209,13 @@
46 }
47
48 bool dashActive = dashActiveResult.toBool();
49- if (!dashInterface.setProperty(DASH_DBUS_PROPERTY_ACTIVE, !dashActive)) {
50- qWarning() << "Can't set the DBUS Dash property" << DASH_DBUS_PROPERTY_ACTIVE
51- << "on" << DASH_DBUS_SERVICE << DASH_DBUS_PATH << DASH_DBUS_INTERFACE;
52+ if (dashActive) {
53+ if (!dashInterface.setProperty(DASH_DBUS_PROPERTY_ACTIVE, false)) {
54+ qWarning() << "Can't set the DBUS Dash property" << DASH_DBUS_PROPERTY_ACTIVE
55+ << "on" << DASH_DBUS_SERVICE << DASH_DBUS_PATH << DASH_DBUS_INTERFACE;
56+ }
57+ } else {
58+ dashInterface.asyncCall(DASH_DBUS_METHOD_ACTIVATE_HOME);
59 }
60 }
61
62
63=== modified file 'launcher/app/launcherview.h'
64--- launcher/app/launcherview.h 2011-03-22 11:58:51 +0000
65+++ launcher/app/launcherview.h 2011-03-22 11:58:51 +0000
66@@ -33,13 +33,8 @@
67 class LauncherView : public QDeclarativeView
68 {
69 Q_OBJECT
70-<<<<<<< TREE
71- Q_PROPERTY(bool superKeyPressed READ superKeyPressed
72- NOTIFY superKeyPressedChanged)
73+ Q_PROPERTY(bool superKeyHeld READ superKeyHeld NOTIFY superKeyHeldChanged)
74 Q_PROPERTY(bool focus READ hasFocus NOTIFY focusChanged) // overridden
75-=======
76- Q_PROPERTY(bool superKeyHeld READ superKeyHeld NOTIFY superKeyHeldChanged)
77->>>>>>> MERGE-SOURCE
78
79 public:
80 explicit LauncherView(QWidget* parent = NULL);

Subscribers

People subscribed via source and target branches

to all changes: