jecisc / Bazard

0 stars 0 forks source link

We should be able to disable GTSpotter. #244

Closed jecisc closed 5 years ago

jecisc commented 5 years ago

Migrated case from Manuscript.

Original case: https://pharo.fogbugz.com/f/cases/17041 Status: Work Needed Project: GTools Original Author: CyrilFerlicot Date: 18 November 2015 12:42:22 pm

Description:

For now we cannot disable GTSpotter. An easy way to disable it and an entry inside the settings should be added.

jecisc commented 5 years ago

Reply: Author: CyrilFerlicot Date: 18 November 2015 12:44:09 pm

Message:

We can add a classVariable, "IsEnable" to GTSpotter and change the action of the global shortcut to open it only if the variable is true.

jecisc commented 5 years ago

Reply: Author: Sven Van Caekenberghe Date: 18 November 2015 12:50:31 pm

Message:

Aren't global keybindings managed by a key mapper or something like that ? Could you not just remove the binding then ?

jecisc commented 5 years ago

Reply: Author: CyrilFerlicot Date: 18 November 2015 1:22:17 pm

Message:

With the shortcut we can remove the shortcut but if we want to revert the change we have to reset KMRepository. I think an other way that the shortcut would be better. (Or maybe there is a way to enable a global shortcut without a reset? I don't really know how works KM).

jecisc commented 5 years ago

Reply: Author: Abdelghani Alidra Date: 18 December 2015 4:30:14 pm

Message:

By the way, how do you plan to disable the other shortcuts (e.g. Nautilus (CMD + O + N)) anyway. It should be nice to have the same implementation for the spotter.

Vincent Blondeau & Thibault Raffaillac

jecisc commented 5 years ago

Reply: Author: Abdelghani Alidra Date: 22 December 2015 11:48:03 pm

Message:

Hi,

Actually to disable GTSpotter shortcuts you need to remove the corresponding entry from KMRepository default grlobalCategories So : KMRepository default globalCategories removeAllSuchThat: [ :each| each class = GTSpotterGlobalShortcut ]. Should do it.

You can also disable GTSpotter shurtcuts using ... a shortcut :) for that just add a method in GTSpotterGlobalShortcuts associating a key combination to the disabling action. for example :

GTSpotterGlobalShortcuts >>keymapDisable

^ KMKeymap shortcut: Character space shift action: [ SystemNavigation new inform: 'GTSpotter global Shortcuts disabled'. self defaultShortcutsRepo remove: self ]. and another method in ToolShortcutsCategory to enable it back. someThing like : ToolShortcutsCategory >>enableGTSpotterGlobalShortcut ^ KMKeymap shortcut: Character tab shift action: [ GTSpotterGlobalShortcut enableShortcuts ] then, of Course, resetting KMRepository for the changes to take effect : KMRepository reset. Or just executing : KMRepository default globalCategories removeAll. KMRepository default globalCategories add: ToolShortcutsCategory new. Then GTSpotter shortcuts are disabled. Use Shift + tab to enable them and Shift + space for disabling. Hope it helps. Abdelghani
jecisc commented 5 years ago

Reply: Author: Tudor Girba Date: 8 February 2016 3:00:23 pm

Message:

As @Abdelghani pointed out, I think this is not a Spotter specific issue. Either we make this issue more generic and work on a new mechanism, or we close it. What do you think?

jecisc commented 5 years ago

Reply: Author: Nicolai Hess Date: 8 February 2016 3:06:06 pm

Message:

+1 for close it. We need a different way to make shortcuts configurabe / disable. I have an idea, needs some changes on the shortcut / action definitions.

jecisc commented 5 years ago

Reply: Author: Tudor Girba Date: 8 February 2016 3:06:53 pm

Message:

We close it for now.

jecisc commented 5 years ago

Reply: Author: Esteban Lorenzano Date: 28 August 2016 7:52:34 am

Message:

reopen.

enable/disable a tool is not about how good is our shortcut mechanism, is about enabling and disabling tools. As I said in list... also remove the shortcut would be an incomplete disable because we need also to remove the worldmenu entry.

so, better implement a enable setting as all other GTTools than waiting for a perfect solution that we don't know when will arrive (and that is also not a complete answer).

jecisc commented 5 years ago

Reply: Author: Tudor Girba Date: 4 September 2016 6:19:17 pm

Message:

It is important to be able to remove tools from the top level, but doing it at the Spotter level is not really useful because Spotter is not the only tool that is registered globally. We have about 8 more other shortcuts. There is no point in single-ing out only one tool because it will not solve the original problem of deploying a desktop application.

Furthermore, the issue is that right now global shortcuts are described statically, so I do not know how a reliable disabling mechanism would look like given the current design of Keymapping.  Please take a look at the shortcuts and propose a concrete solution.

jecisc commented 5 years ago

Reply: Author: Marcus Denker Date: 27 January 2017 12:19:26 pm

Message:

not specific to Pharo5. --> Later