Merge lp:~didrocks/unity/rebring-shortcuts-and-super-shift into lp:unity

Proposed by Didier Roche-Tolomelli
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 1544
Proposed branch: lp:~didrocks/unity/rebring-shortcuts-and-super-shift
Merge into: lp:unity
Diff against target: 55 lines (+9/-3)
3 files modified
plugins/unityshell/src/LauncherController.cpp (+1/-0)
plugins/unityshell/src/unityshell.cpp (+7/-2)
plugins/unityshell/src/unityshell.h (+1/-1)
To merge this branch: bzr merge lp:~didrocks/unity/rebring-shortcuts-and-super-shift
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+74977@code.launchpad.net

Description of the change

This branch does 2 things:
- bring back Super + Shift + Num to open a new instance of an app (LP: #842977)
- force sorting at start to get shortcut working (LP: #768076)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/LauncherController.cpp'
--- plugins/unityshell/src/LauncherController.cpp 2011-08-30 12:15:45 +0000
+++ plugins/unityshell/src/LauncherController.cpp 2011-09-12 12:16:03 +0000
@@ -378,6 +378,7 @@
378 icon->SetSortPriority(_sort_priority++);378 icon->SetSortPriority(_sort_priority++);
379 RegisterIcon(icon);379 RegisterIcon(icon);
380 }380 }
381 SortAndUpdate();
381382
382 _model->order_changed.connect(sigc::mem_fun(this, &LauncherController::SortAndUpdate));383 _model->order_changed.connect(sigc::mem_fun(this, &LauncherController::SortAndUpdate));
383 _model->saved.connect(sigc::mem_fun(this, &LauncherController::Save));384 _model->saved.connect(sigc::mem_fun(this, &LauncherController::Save));
384385
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2011-09-12 01:07:57 +0000
+++ plugins/unityshell/src/unityshell.cpp 2011-09-12 12:16:03 +0000
@@ -313,19 +313,24 @@
313 if (shortcut == 0)313 if (shortcut == 0)
314 continue;314 continue;
315 CreateSuperNewAction(static_cast<char>(shortcut));315 CreateSuperNewAction(static_cast<char>(shortcut));
316 CreateSuperNewAction(static_cast<char>(shortcut), true);
316 }317 }
317318
318 for (auto shortcut : dashController->GetAllShortcuts())319 for (auto shortcut : dashController->GetAllShortcuts())
319 CreateSuperNewAction(shortcut);320 CreateSuperNewAction(shortcut);
320}321}
321322
322void UnityScreen::CreateSuperNewAction(char shortcut)323void UnityScreen::CreateSuperNewAction(char shortcut, bool use_shift)
323{324{
324 CompActionPtr action(new CompAction());325 CompActionPtr action(new CompAction());
325326
326 CompAction::KeyBinding binding;327 CompAction::KeyBinding binding;
327 std::ostringstream sout;328 std::ostringstream sout;
328 sout << "<Super>" << shortcut;329 if (use_shift)
330 sout << "<Shift><Super>" << shortcut;
331 else
332 sout << "<Super>" << shortcut;
333
329 binding.fromString(sout.str());334 binding.fromString(sout.str());
330335
331 action->setKey(binding);336 action->setKey(binding);
332337
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2011-09-08 11:23:14 +0000
+++ plugins/unityshell/src/unityshell.h 2011-09-12 12:16:03 +0000
@@ -238,7 +238,7 @@
238 void SendExecuteCommand();238 void SendExecuteCommand();
239239
240 void EnsureSuperKeybindings ();240 void EnsureSuperKeybindings ();
241 void CreateSuperNewAction(char shortcut);241 void CreateSuperNewAction(char shortcut, bool use_shift=false);
242242
243 static gboolean initPluginActions(gpointer data);243 static gboolean initPluginActions(gpointer data);
244 static void initLauncher(nux::NThread* thread, void* InitData);244 static void initLauncher(nux::NThread* thread, void* InitData);