Help - Search - Members - Calendar
Full Version: columns ui extension plugin instance
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
Acropolis
I want to limit my ui extension plugin (panel) to be single instance, from the source comment, I think the below 2 functions in the class should be used:
class NOVTABLE window : public extension_base
{
public:
virtual const bool get_is_single_instance() const = 0;
virtual bool is_available(const window_host_ptr & p_host) const =0;
....................
....................
};

if I override get_is_single_instance(), seems useless.
if I override is_available() and return false, the panel still can be added to the layout. how can I limit the panel to be add to the layout once?

for example, the foo_uie_albumart, once the panel of it is added to the layout, the popup menu of the layout will not list its name anymore, this is what I want.

Thanks
falling down the stairs
I haven't actually used the aforementioned class, but I'd imagine you'd want to do something like

CODE

virtual const bool get_is_single_instance() const
{
  return true;
}
Acropolis
QUOTE(falling down the stairs @ May 24 2006, 18:21) *

I haven't actually used the aforementioned class, but I'd imagine you'd want to do something like

CODE

virtual const bool get_is_single_instance() const
{
  return true;
}



I've tried, it just didn't even get called.
musicmusic
QUOTE(Acropolis @ May 24 2006, 05:53) *

I want to limit my ui extension plugin (panel) to be single instance, from the source comment, I think the below 2 functions in the class should be used:

You mean this part of the source comment? tongue.gif
QUOTE
Do not explicitly override. The service factory implements this method.


That is in regard to get_is_single_instance(). The relevant window service factories (uie::window_factory, uie::window_factory_single) implement the method, hence your overriding of it proved useless (since the factory overrided that).

So I would guess you are using the wrong factory.
Acropolis
thanks very much, you are right, wrong factory. I was based on other code,
so didn't realise there's classes for sing window unsure.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.