Yeah! It works ! konsole embeds properly in konqueror now ! ;-)

Fixed the key events not going through by:
-  if ( parent ) parent->installEventFilter( this );
+  qApp->installEventFilter( this );
Hmm, this approach sucks though - if embedding 2 konsoles one never gets
the keypresses.

And fixed crash on keypress by initialising the keytrans stuff in
konsole_part.C - looks like this could be better designed with the singleton
pattern...
Reminder: click on kdebase/konsole/src/sample.shell to test this.
Now, how to integrate this better...

svn path=/trunk/kdebase/konsole/; revision=45387
wilder-portage
David Faure 26 years ago
parent eaaee8db3f
commit 49c91a5365
  1. 1
      include/TEWidget.h
  2. 10
      src/TEWidget.C
  3. 12
      src/konsole_part.C

@ -31,6 +31,7 @@ class TEWidget : public QFrame
public:
TEWidget(QWidget *parent=0, const char *name=0);
virtual ~TEWidget();
public:

@ -264,10 +264,15 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
setVTFont( QFont("fixed") );
setColorTable(base_color_table); // init color table
if ( parent ) parent->installEventFilter( this ); //FIXME: see below
qApp->installEventFilter( this ); //FIXME: see below
}
//FIXME: make proper destructor
// Here's a start (David)
TEWidget::~TEWidget()
{
qApp->removeEventFilter( this );
}
/* ------------------------------------------------------------------------- */
/* */
@ -866,7 +871,8 @@ bool TEWidget::eventFilter( QObject *, QEvent *e )
QApplication::sendEvent(scrollbar, e);
}
if ( e->type() == QEvent::KeyPress )
{ QKeyEvent* ke = (QKeyEvent*)e;
{
QKeyEvent* ke = (QKeyEvent*)e;
actSel=0; // Key stroke implies a screen update, so TEWidget won't
// know where the current selection is.

@ -98,7 +98,6 @@ konsolePart::konsolePart(QWidget *parent, const char *name)
//bool welcome = true;
bool histon = true;
const char* wname = PACKAGE;
const char* shell = getenv("SHELL");
// QCString sz = "";
//sz = args->getOption("vt_sz");
@ -108,10 +107,10 @@ konsolePart::konsolePart(QWidget *parent, const char *name)
QStrList eargs;
// welcome = args->isSet("welcome");
const char* shell = getenv("SHELL");
if (shell == NULL || *shell == '\0') shell = "/bin/sh";
// shell = "/bin/ls";
shell = "/usr/bin/mc";
eargs.append(shell);
//shell = "/usr/bin/mc";
eargs.append(shell);
te = new TEWidget(parent);
te->setFocusPolicy(QWidget::ClickFocus);
te->setMinimumSize(150,70); // allow resizing, cause resize in TEWidget
@ -128,6 +127,11 @@ konsolePart::konsolePart(QWidget *parent, const char *name)
// kDebugInfo("Loading successful");
// kDebugInfo("XML file set");
// This is needed since only konsole.C does it
// Without those two -> crash on keypress... (David)
KeyTrans::loadAll();
initial->getEmulation()->setKeytrans(0);
}

Loading…
Cancel
Save