Logo Search packages:      
Sourcecode: debconf-kde version File versions  Download package

void DebconfGui::init (  ) [private]

This routine is called by all constructors to perform common initialization.

Definition at line 108 of file DebconfGui.cpp.

References deactivated().

Referenced by DebconfGui().

{
    Q_D(DebconfGui);
    d->elementProgress = 0;
    d->parentWidget = 0;
    d->setupUi(this);
    setMinimumSize(500, 400);
    d->nextPB->setIcon(KIcon(QLatin1String( "go-next" )));
    d->backPB->setIcon(KIcon(QLatin1String( "go-previous" )));
    d->cancelPB->setIcon(KIcon(QLatin1String( "dialog-cancel" )));
    d->cancelPB->setVisible(false);

    connect(d->frontend, SIGNAL(go(const QString &, const QStringList &)),
            this, SLOT(cmd_go(const QString &, const QStringList &)));
    connect(d->frontend, SIGNAL(finished()),
            this, SIGNAL(deactivated()));
    connect(d->frontend, SIGNAL(progress(const QString &)),
            this, SLOT(cmd_progress(const QString &)));
    connect(d->frontend, SIGNAL(backup(bool)),
            d->backPB, SLOT(setEnabled(bool)));

    // find out the distribution logo
    QString distro_logo(QLatin1String( "/usr/share/pixmaps/debian-logo.png" ));
    QProcess *myProcess = new QProcess(this);

    myProcess->start(QLatin1String( "hostname" ));
    myProcess->waitForFinished();
    QString hostname = QString::fromLatin1( myProcess->readAllStandardOutput() );
    setWindowTitle(i18n("Debconf on %1", hostname.trimmed()));

    myProcess->start(QLatin1String( "lsb_release" ), QStringList() << QLatin1String( "-is" ));
    if (myProcess->waitForFinished()) {
        if (myProcess->exitCode() == 0){
            QString data = QLatin1String( myProcess->readAllStandardOutput() );
            data = QString(QLatin1String( "/usr/share/pixmaps/%1-logo.png" )).arg(data.trimmed().toLower());
            if (QFile::exists(data)) {
                distro_logo = data;
            }
        }
    }

    QPixmap icon = KIconLoader::global()->loadIcon(distro_logo,
                                                   KIconLoader::NoGroup,
                                                   KIconLoader::SizeLarge,
                                                   KIconLoader::DefaultState);
    if (!icon.isNull()) {
        d->iconL->setPixmap(icon);
        setWindowIcon(icon);
    }

    d->scrollArea->viewport()->setAutoFillBackground(false);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index