Example #1
0
	
	return widget

def closeAll():
	print "clicked"
	ICore.documentController().closeAllDocuments()

def trigg():
	print "I have been triggered"

def contextMenuExtension(ctx, cme):
	print "ctxmenuuuu"
	print "xxxxxxxx: "+str(ctx)
	print "aaaaaaaa: "+str(ctx.type())
	act=forms.createAction(0)
	act.text="I am a snake"
	
	act.connect("triggered()", trigg)
	cme.addAction(cme.ExtensionGroup, act)
	
	return "potatoes"

print "holaaaaa"
print "opening1"+str(ICore)
print "opening2"+str(ICore.documentController())

print "opening3"+str(ICore.documentController().encoding())

IPlugin.createToolViewFactory("createView", "org.kdevelop.GUIExample", 33)

from urlparse import urlparse

forms=Kross.module("forms")

def compileCurrent():
	comp=ICore.documentController().activeDocument().url()
	project=ICore.projectController().findProjectForUrl(comp)
	
	if project is not None:
		items=project.filesForUrl(comp)
		
		for item in items:
			builder=project.buildSystemManager().builder(item)
			buildjob=builder.build(item)
			ICore.runController().registerJob(buildjob)

def contextMenuExtension(ctx, cme):
	comp=ICore.documentController().activeDocument().url()
	project=ICore.projectController().findProjectForUrl(comp)
	if project is not None:
		cme.addAction(cme.ExtensionGroup, act)


act=forms.createAction(IPlugin)
act.text="Compile this file"
act.shortcut="Shift+F10"
act.connect("triggered()", compileCurrent)

toolBar=IPlugin.createToolBar("CompileOne", ICore.uiController().activeMainWindow())
toolBar.addAction(act)