void ProgressDialog::connectParser(AbstractLogParser *parser){
    if(AppInfo::DEBUG_PROGRESS_DIALOG) qDebug() << "ProgressDialog::connectParser()";
    disconnect(this);
    connect(parser, SIGNAL(signalSetProgressMaximumValue(int)), this, SLOT(setProgressMaximum(int)));
    connect(parser, SIGNAL(signalSetProgressValue(int)), this, SLOT(setProgressValue(int)));
    connect(parser, SIGNAL(signalSetProgressString(QString)), this, SLOT(setProgressString(QString)));
    connect(parser, SIGNAL(finished()), this, SLOT(creationComplete()));
}
void Application::updateClientProgress(qint64 numBytes)
{
    bytesWritten += (int)numBytes;

    if (tcpClient.bytesToWrite() < payloadSize)
        setButtonsAreLocked(false);

    setCurrentWritten(bytesWritten);
    setProgressString(tr("%1MB").arg(bytesWritten / (1024 * 1024)));
}
void Application::displayError(QAbstractSocket::SocketError socketError)
{
    if (socketError == QTcpSocket::RemoteHostClosedError)
        return;

    QString errStr("Network error: ");
    errStr.append(tcpClient.errorString());
    Q_EMIT newMessage(errStr);

    tcpClient.close();
    setTotalSize(0);
    setCurrentWritten(0);
    setProgressString("");
    Q_EMIT newMessage("Client ready");
    setButtonsAreLocked(false);
}