#include "kdialog.h"
#include "k9common.h"
#include "ui_kdialog.h"

KDialog::KDialog(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::KDialog)
{
    m_ui->setupUi(this);
}

KDialog::~KDialog()
{
    delete m_ui;
}

QString KDialog::makeStandardCaption(QString title,QWidget *) {
    return QString("%1 - %2").arg(title).arg(qApp->applicationName());
}

void KDialog::setMainWidget(QWidget *widget) {
    m_ui->mainWidget=widget;
    m_ui->gridLayout->addWidget(widget,0,0);
}

void KDialog::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}
