void QupZillaSchemeReply::loadPage()
{
    if (m_loaded)
        return;

    QTextStream stream(&m_buffer);
    stream.setCodec("UTF-8");

    if (m_pageName == QLatin1String("about")) {
        stream << aboutPage();
    }
    else if (m_pageName == QLatin1String("reportbug")) {
        stream << reportbugPage();
    }
    else if (m_pageName == QLatin1String("start")) {
        stream << startPage();
    }
    else if (m_pageName == QLatin1String("speeddial")) {
        stream << speeddialPage();
    }
    else if (m_pageName == QLatin1String("config")) {
        stream << configPage();
    }
    else if (m_pageName == QLatin1String("restore")) {
        stream << restorePage();
    }
    else if (m_pageName == QLatin1String("adblock")) {
        stream << adblockPage();
    }

    stream.flush();
    m_buffer.reset();
    m_loaded = true;
}
void WizardPage_Finish::initializePage()
{
    setFinalPage(true);

    setTitle( tr("Finish") );
    setSubTitle( tr("Configuring...") );
    wizard()->button( QWizard::CancelButton )->hide();

    // locale
    QString locale = field("locale").toString();
    locale = QLocale(locale).name();

    locale = locale + ".UTF-8";
    qDebug() << locale;
    g_engine->cmdSetLang( locale.toLatin1() );

    // grub
    QString pathGrub = field("pathGrub").toString();
    if( !pathGrub.isEmpty() ) {
        qDebug() << "install grub on:" << pathGrub;
        g_engine->cmdSetBootEntry( pathGrub.toLatin1() );
    }

    // useradd
    ( static_cast<WizardPage_UserAdd*>(wizard()->page(Page_UserAdd)) )->setPasswdUser();


    // start the postscript dialog.
    m_thread = new PostThread();
    connect( m_thread, SIGNAL( poststate(bool, QString) ), this, SLOT( setPostState(bool, QString) ) );
    connect( m_thread, SIGNAL( finished() ), this, SLOT( restorePage() ) );

    m_dialog = new DialogPostscript(this);
    m_dialog->setModal( true );
    //connect( m_thread, SIGNAL( finished() ), m_dialog, SLOT( accept() ) );

    m_dialog->setLabelText();
    QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );
    QTimer::singleShot(0, this, SLOT(start()));
}