Merge lp:~uriboni/unity-2d/alt-f2-commands-place into lp:unity-2d/3.0

Proposed by Ugo Riboni
Status: Merged
Approved by: Florian Boucault
Approved revision: 464
Merged at revision: 478
Proposed branch: lp:~uriboni/unity-2d/alt-f2-commands-place
Merge into: lp:unity-2d/3.0
Diff against target: 73 lines (+22/-1)
4 files modified
debian/20_unity-2d-gconf-mandatory (+1/-0)
launcher/app/launcherview.cpp (+20/-0)
launcher/app/launcherview.h (+1/-0)
places/app/dashdeclarativeview.cpp (+0/-1)
To merge this branch: bzr merge lp:~uriboni/unity-2d/alt-f2-commands-place
Reviewer Review Type Date Requested Status
Florian Boucault (community) Needs Fixing
Review via email: mp+54476@code.launchpad.net

Commit message

[dash] Pressing Alt+F2 will bring up the commands place entry in the dash (AKA runner)

Description of the change

[dash] Pressing Alt+F2 will bring up the commands place entry in the dash (AKA runner)

Please note that to test this you will probably need to install the package. This is because metacity grabs the alt+f2 key for itself by default, so we install a gconf key together with the package to disable that.

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

It will not work if the dash is not running.

review: Needs Fixing
464. By Ugo Riboni

Move the alt+f2 monitoring to the launcher, so that it works even when the dash is not active yet

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/20_unity-2d-gconf-mandatory'
2--- debian/20_unity-2d-gconf-mandatory 2011-03-15 12:27:52 +0000
3+++ debian/20_unity-2d-gconf-mandatory 2011-03-23 11:32:29 +0000
4@@ -1,2 +1,3 @@
5 /apps/nautilus/preferences/exit_with_last_window false
6 /apps/metacity/global_keybindings/panel_main_menu disabled
7+/apps/metacity/global_keybindings/panel_run_dialog disabled
8
9=== modified file 'launcher/app/launcherview.cpp'
10--- launcher/app/launcherview.cpp 2011-03-22 11:56:07 +0000
11+++ launcher/app/launcherview.cpp 2011-03-23 11:32:29 +0000
12@@ -46,6 +46,8 @@
13 static const char* DASH_DBUS_INTERFACE = "com.canonical.Unity2d.Dash";
14 static const char* DASH_DBUS_PROPERTY_ACTIVE = "active";
15 static const char* DASH_DBUS_METHOD_ACTIVATE_HOME = "activateHome";
16+static const char* APPLICATIONS_PLACE = "/usr/share/unity/places/applications.place";
17+static const char* COMMANDS_PLACE_ENTRY = "Runner";
18
19 LauncherView::LauncherView(QWidget* parent) :
20 QDeclarativeView(parent),
21@@ -64,6 +66,10 @@
22 /* Alt+F1 gives the keyboard focus to the launcher. */
23 Hotkey* altF1 = HotkeyMonitor::instance().getHotkeyFor(Qt::Key_F1, Qt::AltModifier);
24 connect(altF1, SIGNAL(pressed()), SLOT(activateWindow()));
25+
26+ /* Alt+F2 shows the dash with the commands place entry activated. */
27+ Hotkey* altF2 = HotkeyMonitor::instance().getHotkeyFor(Qt::Key_F2, Qt::AltModifier);
28+ connect(altF2, SIGNAL(pressed()), SLOT(showCommandsPlace()));
29 }
30
31 void
32@@ -320,3 +326,17 @@
33
34 return colors;
35 }
36+
37+void
38+LauncherView::showCommandsPlace()
39+{
40+ QDBusInterface dashInterface(DASH_DBUS_SERVICE, DASH_DBUS_PATH, DASH_DBUS_INTERFACE);
41+ if (!dashInterface.isValid()) {
42+ qWarning() << "Can't access the dash via DBUS on" << DASH_DBUS_SERVICE
43+ << DASH_DBUS_PATH << DASH_DBUS_INTERFACE;
44+ return;
45+ }
46+
47+ dashInterface.asyncCall("activatePlaceEntry",
48+ APPLICATIONS_PLACE, COMMANDS_PLACE_ENTRY, 0);
49+}
50
51=== modified file 'launcher/app/launcherview.h'
52--- launcher/app/launcherview.h 2011-03-22 11:21:52 +0000
53+++ launcher/app/launcherview.h 2011-03-23 11:32:29 +0000
54@@ -60,6 +60,7 @@
55 void updateSuperKeyHoldState();
56 void toggleDash();
57 void changeKeyboardShortcutsState(bool enabled);
58+ void showCommandsPlace();
59
60 public Q_SLOTS:
61 void activateWindow();
62
63=== modified file 'places/app/dashdeclarativeview.cpp'
64--- places/app/dashdeclarativeview.cpp 2011-03-17 10:07:18 +0000
65+++ places/app/dashdeclarativeview.cpp 2011-03-23 11:32:29 +0000
66@@ -30,7 +30,6 @@
67 #include <QGraphicsObject>
68 #include <QtDBus/QDBusConnection>
69 #include <QTimer>
70-#include <QDebug>
71
72 #include <X11/Xlib.h>
73 #include <X11/Xatom.h>

Subscribers

People subscribed via source and target branches

to all changes: