Back to index

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

#include <space.h>

Collaboration diagram for kSpaceSetup:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 kSpaceSetup (QWidget *parent=NULL, const char *name=NULL)

Protected Member Functions

void readSettings ()

Private Slots

void slotSpeed (int)
void slotWarp (int)
void slotOk ()
void slotHelp ()

Private Attributes

QWidget * preview
kSpaceSaversaver
int speed
int warpinterval

Detailed Description

Definition at line 38 of file space.h.


Constructor & Destructor Documentation

kSpaceSetup::kSpaceSetup ( QWidget *  parent = NULL,
const char *  name = NULL 
)

Definition at line 575 of file space.cpp.

       : KDialogBase( parent, name, true, i18n("Setup Space Screen Saver"),
                     Ok|Cancel|Help, Ok, true )
{
    setButtonText( Help, i18n( "A&bout" ) );
    readSettings();

    QWidget *page = new QWidget( this );
    setMainWidget( page );
    QHBoxLayout *hb = new QHBoxLayout( page, 0, spacingHint() );
    QVBoxLayout *vb = new QVBoxLayout( hb, spacingHint() );

    QLabel *label;
    QSlider *slider;

    label = new QLabel( i18n("Speed:"), page );
    vb->addWidget( label );

    slider = new QSlider(MINSPEED, MAXSPEED, 10, speed, Qt::Horizontal,
                  page );
    vb->addWidget( slider );
    slider->setTickmarks(QSlider::TicksBelow);
    slider->setTickInterval(10);
    connect( slider, SIGNAL( valueChanged( int ) ), SLOT( slotSpeed( int ) ) );

    label = new QLabel( i18n("Warp interval:"), page );
    vb->addWidget( label );

    slider = new QSlider(MINWARP, MAXWARP, 3, warpinterval, Qt::Horizontal, page );
    vb->addWidget( slider );
    slider->setTickmarks(QSlider::TicksBelow);
    slider->setTickInterval(3);
    connect( slider, SIGNAL( valueChanged( int ) ), SLOT( slotWarp( int ) ) );

    vb->addStrut( 150 );
    vb->addStretch();

    preview = new QWidget( page );
    hb->addWidget( preview );
    preview->setFixedSize( 220, 170 );
    preview->setBackgroundColor( Qt::black );
    preview->setAutoFillBackground(true);
    preview->show();    // otherwise saver does not get correct size
    saver = new kSpaceSaver( preview->winId() );
}

Here is the call graph for this function:


Member Function Documentation

void kSpaceSetup::readSettings ( ) [protected]

Definition at line 621 of file space.cpp.

{
       KConfig *config = klock_config();
       KConfigGroup group = config->group( "Settings" );

       speed = group.configEntry( "Speed", speed );

       if ( speed > MAXSPEED )
              speed = MAXSPEED;
       else if ( speed < MINSPEED )
              speed = MINSPEED;

       warpinterval = group.configEntry( "WarpInterval", 15 );

       delete config;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 671 of file space.cpp.

{
       KMessageBox::about(this,
              i18n("KSpace\nCopyright (c) 1998\n"
                               "Bernd Johannes Wuebben <wuebben@kde.org>"));
}
void kSpaceSetup::slotOk ( ) [private, slot]

Definition at line 653 of file space.cpp.

{
       KConfig *config = klock_config();
       KConfigGroup group = config->group( "Settings" );

       QString sspeed;
       sspeed.setNum( speed );
       group.writeEntry( "Speed", sspeed );

       QString interval;
       interval.setNum( (int)warpinterval );
       group.writeEntry( "WarpInterval", interval );

       config->sync();
       delete config;
       accept();
}

Here is the call graph for this function:

void kSpaceSetup::slotSpeed ( int  num) [private, slot]

Definition at line 638 of file space.cpp.

{
       speed = num ;

       if ( saver )
              saver->setSpeed( speed );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void kSpaceSetup::slotWarp ( int  num) [private, slot]

Definition at line 646 of file space.cpp.

{
        warpinterval = num;
       if ( saver )
              saver->setWarp( warpinterval );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

QWidget* kSpaceSetup::preview [private]

Definition at line 54 of file space.h.

Definition at line 55 of file space.h.

int kSpaceSetup::speed [private]

Definition at line 57 of file space.h.

Definition at line 58 of file space.h.


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