[wingide-users] Auto-change version control tab

Wingware Support support at wingware.com
Fri Apr 16 12:20:27 MDT 2010


Ken Kinder wrote:
> On 04/16/2010 11:44 AM, Wingware Support wrote:
>> Ken Kinder wrote:
>>> I have perspectives for all projects, so I'll have an svn tab under
>>> my "Edit" perspective. Problem is, as I change projects, I have to
>>> have profiles like, "EditSvn" and "EditHg", and that messes
>>> everything up.
>>>
>>> It would be handy to have a "Versioning" tool that just auto-changed
>>> based on the current project's version control system, like how the
>>> menu does.
>> Yes, this would make more sense here.  I think they all have their own
>> panel ids now and this
>> wouldn't be easy to change.  We do want people to be able to show
>> multiple version control
>> tools (e.g. svn and hg) at the same time, which further complicates this.
>>
> 
> Could I write a script that would enable/disable the panels based on my
> own preferences? It would just have to trigger when a project is loaded,
> look at the project version control type, and issue some show/hide
> commands... Would that be feasible? I'm not sure how the triggers work.

Yes, you could probably patch up what the perspectives tool is doing by
connecting to the perspective-changed signal on the CAPIApplication.
There are examples of using Connect() w/ signals in various scripts in
the 'scripts' folder in your Wing IDE installation.

Either way, showing a panel would be with the show-panel command,
which has the panel names in its documentation:

http://wingware.com/doc/commands/toplevel

So something like this would do it:

app = wingapi.gApplication
app.ExecuteCommand('show-panel', panel_type='versioncontrol.hg')

Hiding is another question... there is no API or command for that
now.  You could however do this reaching-through-the-API approach:

view = app.fSingletons.fGuiMgr.FindPanel('versioncontrol.svn')
app.fSingletons.fGuiMgr.HidePanel(view)

Hope that helps.

Thanks,

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com


More information about the wingide-users mailing list