Accessing View from Plugin Part

Andreas Pakulat apaku at gmx.de
Mon Mar 12 11:10:39 UTC 2007


On 12.03.07 03:29:10, dukju ahn wrote:
> 2007/3/12, Andreas Pakulat <apaku at gmx.de>:
> > On 12.03.07 01:15:03, dukju ahn wrote:
> > > Hi, again.
> > >
> > > I also don't know how to access view pointer from plugin part.
> > >
> > > At the part constructor, we initialize view factory, addToolView(factory)
> > > And, upon the user's request, views are created and
> > > embedded. Am I right so far?
> > >
> > > However, I cannot find any interfaces to access already created views.
> > > It is the plugin part that starts any action. And we will have
> > > to know the pointer of view associated with that part.
> > >
> > > The problem is more complicated because one part can have
> > > more than two views.
> > >
> > > Is it not yet implemented? or is there any way to access views
> > > >from plugin part?
> >
> >
> > I'm not sure why you think you need to access a view/toolview of one
> > plugin from another. The way to access another plugin is to use the
> > extension interface of that plugin. See buildtools/builder/qmakebuilder,
> > buildtools/builder/makebuilder.
> 
> No, I did not say that I need to access a view/toolview of another plugin.
> What I want to access is plugin's own toolview.

No you don't because you can't. There might be hundreds of toolviews for
your plugin all showing the same data. What you want to do is let the
toolview know about the plugin (as it is done for the
projectmanagerview) and then react on signals sent by the part when
something happens (like a breakpoint is created).

> First example, think about debugger (which is not yet implemented).
> The user sets breakpoint. Then debugger part should update
> its breakpoint table. To update its table, the part needs to have pointer
> for its toolview.

No it doesn't need that, thats the beauty of signals+slots you don't
need tight coupling between the objects.

> Another example is subversion or CVS part. The part received log history
> >from repository. Then, part should print its history via toolview widgets.

No it should emit a signal that new log history can be fetched. 

> In any case, plugin part should handle its widget.

No, definetly not. The plugin doesn't know how many toolviews exist or
in which area they might be.

Andreas

-- 
You possess a mind not merely twisted, but actually sprained.




More information about the KDevelop-devel mailing list