Back to index

kdeartwork  4.3.2
Public Member Functions | Protected Member Functions | Private Slots | Private Attributes
KBlobSetup Class Reference

#include <blob.h>

Collaboration diagram for KBlobSetup:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 KBlobSetup (QWidget *parent=NULL)

Protected Member Functions

void readSettings ()

Private Slots

void slotOk ()
void slotHelp ()
void setAlgorithm (QListWidgetItem *item)

Private Attributes

int showtime
int alg
QListWidget * algs
KIntNumInput * stime
KBlobSaversaver

Detailed Description

Definition at line 93 of file blob.h.


Constructor & Destructor Documentation

KBlobSetup::KBlobSetup ( QWidget *  parent = NULL)

Definition at line 432 of file blob.cpp.

    : KDialog( parent)
{
    setCaption(i18n( "Setup Blob Screen Saver" ));
    setButtons(Ok|Cancel|Help);
    setDefaultButton(Ok);
    setModal(true);
    initAlg();

    // get saver configuration from kde registry
    readSettings();

    setButtonText( Help, i18n( "A&bout" ) );
    QWidget *main = new QWidget(this);
    setMainWidget(main);

    QHBoxLayout *tl = new QHBoxLayout( main );
    //tl->setContentsMargins(0, 0, 0, 0);
    tl->setSpacing(spacingHint());

    QVBoxLayout *vbox = new QVBoxLayout;
    tl->addLayout(vbox);

    // seconds to generate on a frame
    QLabel *label = new QLabel(i18n("Frame duration:"), main);
    stime = new KIntNumInput( showtime, main );
    stime->setSuffix( i18n( " sec" ) );
    vbox->addWidget(label);
    vbox->addWidget(stime);

    // available algorithms
    label = new QLabel(i18n("Algorithm:"), main);
    algs = new QListWidget(main);
    algs->setMinimumSize(150, 105);
    for (int i = 0; i <= ALG_RANDOM; i++)
        algs->addItem(alg_str[i]);
    algs->setCurrentRow(alg);
    vbox->addWidget(label);
    vbox->addWidget(algs);

    // preview window
    QWidget *preview = new QWidget( main );
    preview->setFixedSize(220, 170);
    {
        QPalette palette;
        palette.setColor( preview->backgroundRole(), Qt::black );
        preview->setPalette( palette );
    }
    preview->show();
    tl->addWidget(preview);
    saver = new KBlobSaver(preview->winId());
    saver->setDimension(3);
    if (QPixmap::defaultDepth() > 8)
        saver->setColorInc(7);
    else
        saver->setColorInc(4);

    tl->addStretch();

    // so selecting an algorithm will start previewing that alg
    connect(algs, SIGNAL(itemChanged(QListWidgetItem*)), this,
            SLOT(setAlgorithm(QListWidgetItem*)));
    connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
    connect(this,SIGNAL(helpClicked()),this, SLOT(slotHelp()));
}

Here is the call graph for this function:


Member Function Documentation

void KBlobSetup::readSettings ( ) [protected]

Definition at line 506 of file blob.cpp.

{
    KConfigGroup config(KGlobal::config(), "Settings");

    // number of seconds to spend on a frame
    showtime = config.readEntry("Showtime", 3*60);

    // algorithm to use. if not set then use random
    alg = config.readEntry("Algorithm", (int)ALG_LAST);
}

Here is the caller graph for this function:

void KBlobSetup::setAlgorithm ( QListWidgetItem *  item) [private, slot]

Definition at line 498 of file blob.cpp.

{
   if(!item)
     return;
   int pos = algs->currentRow();
   saver->setAlgorithm(pos);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void KBlobSetup::slotHelp ( ) [private, slot]

Definition at line 529 of file blob.cpp.

{
    KMessageBox::about(this,
                       i18n("Blobsaver Version 0.1\n\nWritten by Tiaan Wessels 1997\ntiaan@netsys.co.za"));
    if (saver)
        setAlgorithm(algs->currentItem());
}

Here is the call graph for this function:

Here is the caller graph for this function:

void KBlobSetup::slotOk ( ) [private, slot]

Definition at line 518 of file blob.cpp.

{
    KConfigGroup config( KGlobal::config(), "Settings");
    config.writeEntry("Showtime", stime->value());
    config.writeEntry("Algorithm", algs->currentRow());

    config.sync();

    accept();
}

Here is the caller graph for this function:


Member Data Documentation

int KBlobSetup::alg [private]

Definition at line 98 of file blob.h.

QListWidget* KBlobSetup::algs [private]

Definition at line 99 of file blob.h.

Definition at line 113 of file blob.h.

int KBlobSetup::showtime [private]

Definition at line 97 of file blob.h.

KIntNumInput* KBlobSetup::stime [private]

Definition at line 100 of file blob.h.


The documentation for this class was generated from the following files: