I’ve seen that there is a method #package:class:category:method: which is called sometimes with nil values and the method sends 4 messages, and in each message if the arg is not nil it announces the selection.
What I’ve done was to break in into 4 methods: #package:, #package:class: and so on. Then I’ve changes all the messages that contained hardcoded nil, to use only the method they need. And each method fires only one announcement. This is not perfect, but at least we don’t have to send model package: aPackage class: aClass category: nil method: nil if we only want to select a class. Maybe in the future this can be reduced to a simple "class: aClass”, because I’ve seen that many of parameters some from “self selectedPackage”, “self selectedClass” and so on. Uko > On 04 Sep 2015, at 14:02, Franck Warlouzet <[email protected]> > wrote: > > I will take a look at it, thanks to continue this effort. > I agree with Nicolai, there is too many announcements raised but the way to > manage selection complicates a deep change. But I trust us, step by step we > can simplify all of this. > > Franck > > From: [email protected] > Date: Fri, 4 Sep 2015 12:08:55 +0200 > To: [email protected] > Subject: Re: [Pharo-dev] Announcements in Nautilus > > I’ve made a prototype, and it seems to work well, though I’d really like if > Franck or Esteban can take a look. > https://pharo.fogbugz.com/f/cases/16475/Nautilus-sends-too-many-announcements-for-a-single-action > > <https://pharo.fogbugz.com/f/cases/16475/Nautilus-sends-too-many-announcements-for-a-single-action> > > Cheers. > Uko > > > On 04 Sep 2015, at 10:25, stepharo <[email protected] > <mailto:[email protected]>> wrote: > > I will not reply publicly on the true reason of that situation :) > Now what we should do is to continue to simplify the code of Nautilus (we > made great steps with Franck). > And yuriy if you have some fixes please let us know. > > Stef > > Le 4/9/15 09:22, Yuriy Tymchuk a écrit : > Hi, > > I find announcements in Nautilus a bit strange. I guess you are familiar with > QualityAssistant. To display the critics about the currently selected entity > I need to know which one is selected. There is NautilusMethodSelected and > NautilusClassSelected announcements. But here is a small detail, if you > select a method, both of them are fired i.e. for the method’s class and the > method itself. For me it does not make any sense because I need to show > critics only for currently selected source code. > > Moreover if I need to show something about the class while a method is > selected, I can just ask the method for its class, right? > > Does anybody need this double announcing? (Maybe it is quadruple, I haven’t > checked for a package and protocol) > > Cheers! > Uko
