RKDebugConsole::RKDebugConsole (QWidget *parent, bool tool_window, const char *name) : RKMDIWindow (parent, DebugConsoleWindow, tool_window, name) {
	RK_TRACE (APP);

	QVBoxLayout *main_layout = new QVBoxLayout (this);
	main_layout->setContentsMargins (0, 0, 0, 0);
	QHBoxLayout *upper_layout = new QHBoxLayout ();
	main_layout->addLayout (upper_layout);

	context_view = new QTextEdit (this);
	context_view->setReadOnly (true);
	context_view->setAcceptRichText (false);
	upper_layout->addWidget (context_view);

	QVBoxLayout *button_layout = new QVBoxLayout ();
	upper_layout->addLayout (button_layout);
	step_button = new QPushButton (i18n ("Next"), this);
	connect (step_button, SIGNAL (clicked()), this, SLOT (stepButtonClicked()));
	button_layout->addWidget (step_button);
	step_out_button = new QPushButton (i18n ("Step out"), this);
	connect (step_out_button, SIGNAL (clicked()), this, SLOT (stepOutButtonClicked()));
	RKCommonFunctions::setTips (i18n ("<p>Continue until the caller of this function is reached (unless another debug statement is hit, earlier)</p>"
	                                  "<p><b>Note:</b> In some cases, the calling function will never be reached, because the call was the last step in the caller."
	                                  "In these cases, the behavior is identical to 'Continue'.</p>"), step_out_button);
	button_layout->addWidget (step_out_button);
	continue_button = new QPushButton (i18n ("Continue"), this);
	connect (continue_button, SIGNAL (clicked()), this, SLOT (continueButtonClicked()));
	button_layout->addWidget (continue_button);
	cancel_button = new QPushButton (i18n ("Cancel"), this);
	connect (cancel_button, SIGNAL (clicked()), this, SLOT (cancelButtonClicked()));
	button_layout->addWidget (cancel_button);
	button_layout->addStretch ();

	QHBoxLayout *lower_layout = new QHBoxLayout ();
	main_layout->addLayout (lower_layout);

	prompt_label = new QLabel (this);
	lower_layout->addWidget (prompt_label);
	reply_edit = new KHistoryComboBox (this);
	reply_edit->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
	connect (reply_edit, SIGNAL (returnPressed()), this, SLOT (sendReply()));
	lower_layout->addWidget (reply_edit);
	setFocusProxy (reply_edit);

	setFocusPolicy (Qt::StrongFocus);

	setPart (new RKDummyPart (this, this));
	initializeActivationSignals ();

	connect (RKDebugHandler::instance (), SIGNAL (newDebugState()), this, SLOT (newDebugState()));
	newDebugState ();
}
int tcpServer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: { QString _r = currentTime();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
        case 1: changeString((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 2: stopButtonClicked(); break;
        case 3: continueButtonClicked(); break;
        }
        _id -= 4;
    }
    return _id;
}