/*************************************************************************** * Copyright (C) 2007 Nicolas Hadacek * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include "console.h" #include #include #include #include #include #include #include ConsoleView::ConsoleView(TQWidget *parent) : TQWidget(parent, "console_view"), _initialized(false) {} void ConsoleView::showEvent(TQShowEvent *e) { if ( !_initialized ) { _initialized = true; KLibFactory *factory = KLibLoader::self()->factory("libkonsolepart"); TQVBoxLayout *top = new TQVBoxLayout(this, 0, 10); if ( factory==0 ) { TQLabel *label = new TQLabel(i18n("Could not find \"konsolepart\"; please install tdebase."), this); label->show(); top->addWidget(label); return; } else { TQWidget *pwidget = static_cast(factory->create(TQT_TQOBJECT(this), "konsole"))->widget(); pwidget->show(); top->addWidget(pwidget); setFocusProxy(pwidget); } } TQWidget::showEvent(e); }