#include "ConsoleClient.h"
#include "PikMain.h"

#include <kapplication.h>
#include <qstring.h>

ConsoleClient::ConsoleClient()
{
    // cannot get console addr here, because main window not created yet ...
}


ConsoleClient::~ConsoleClient()
{}


/*!
    \fn ConsoleClient::clearConsole()
 */
void ConsoleClient::clearConsole()
{
    PikMain *main = dynamic_cast<PikMain *>(kapp->mainWidget()) ;
    main->getConsole()->clear() ;
}


/*!
    \fn ConsoleClient::addText(const QString &txt)
 */
void ConsoleClient::addTextConsole(const QString &txt)
{
    PikMain *main = dynamic_cast<PikMain *>(kapp->mainWidget()) ;
    main->getConsole()->insertParagraph(txt,-1) ; // at end
    KApplication::kApplication()->processEvents() ;
}
