This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Embedding Konsolepart in PyKDE4 application

Tags: None
(comma "," separated)
User avatar
wbsoft
Registered Member
Posts
2
Karma
0
OS
Hi, I embed a konsolepart in my Python app like this:

(mainwin is my KMainWindow)

Code: Select all
factory = KPluginLoader("libkonsolepart").factory()
if factory:
    part = factory.create(mainwin)
    widget = part.widget()

This shows a terminal window with just a cursor in the upper left corner. So far so good, but now I want Konsole to open a shell in a directory.
In KDE 4.1 and 4.2 this works:
Code: Select all
part.openUrl(KUrl("file:///home/wilbert/"))

But in KDE 4.3 this has stopped working (results in garbled layout and X Errors on the starting terminal). It seems other terminal embedding apps (like Kate) now use the TerminalInterface with the openShellInDir() method.
But how can I use the TerminalInterface on a konsole part from inside PyKDE4? If this isn't possible I think the openUrl() method of the Konsole part needs fixing :-)

Last edited by wbsoft on Tue Sep 22, 2009 12:40 pm, edited 1 time in total.
User avatar
wbsoft
Registered Member
Posts
2
Karma
0
OS
Solved:

I found the problem: openUrl() on the konsole part does not work well if the
widget has not yet been added to a parent widget.

So I've got to be sure the part's widget() is added to a parent before calling openUrl().


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]