|
From: Ben G. <goo...@fa...> - 2005-08-21 19:25:09
|
Hi,
I am attempting to add the "Pipe to Console" functionality to kile 1.8.1 -- the
same as for kate --and would appreciate tremendously some guidance. It seems as
if this should not be too difficult. I know some C++ but have never hacked a KDE
application before, so I do not quite grasp how all the parts work together yet.
Here are the files that I think are relevant in kile and kate and with which I
am familiar:
kileui.rc
kateconsole.cpp
katemainwindow.cpp
It seems as if I need to add a code chunk like this into kileui.rc
<Menu name="tools"><text>&Tools</text>
<Action name="tools_pipe_to_terminal"/>
</Menu>
And then I see two parts of katemainwindow.cpp (which use functionality from
kateconsole)
// pipe to terminal action
if (kapp->authorize("shell_access"))
new KAction(i18n("&Pipe to Console"), "pipe", 0, this,
SLOT(slotPipeToConsole()), actionCollection(), "tools_pipe_to_terminal");
[snip]
void KateMainWindow::slotPipeToConsole ()
{
if (!console)
return;
Kate::View *v = m_viewManager->activeView();
if (!v)
return;
if (v->getDoc()->hasSelection ())
console->sendInput (v->getDoc()->selection());
else
console->sendInput (v->getDoc()->text());
}
Where would I put similar code into kile? Also, do I need to do anything special
to get the Pipe to Console to show up in Configure Toolbars and Configure
Shortcuts in kile?
Thanks,
Ben
|