Back to index

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

#include <kvm.h>

Collaboration diagram for kVmSetup:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 kVmSetup (QWidget *parent=NULL)
 ~kVmSetup ()

Protected Member Functions

void readSettings ()

Private Slots

void slotSpeed (int)
void slotRefreshTimeout (int num)
void slotOk ()
void slotHelp ()

Private Attributes

QWidget * preview
kVmSaversaver
int speed
int refreshTimeout

Detailed Description

Definition at line 69 of file kvm.h.


Constructor & Destructor Documentation

kVmSetup::kVmSetup ( QWidget *  parent = NULL)

Definition at line 278 of file kvm.cpp.

       : KDialog( parent)
{
       setCaption(i18n( "Setup Virtual Machine" ));
       setButtons(Ok|Cancel|Help);
       setDefaultButton(Ok);
       setModal(true);
       readSettings();

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

       QHBoxLayout *tl = new QHBoxLayout( main );
        tl->setSpacing( spacingHint() );
       QVBoxLayout *tl1 = new QVBoxLayout();
       tl->addLayout(tl1);

       QLabel *label = new QLabel( i18n("Virtual machine speed:"), main );
       tl1->addWidget(label);

       QSlider *slider = new QSlider( Qt::Horizontal, main );
       slider->setMinimumSize( 120, 20 );
       slider->setRange( 0, 100 );
        slider->setSingleStep( 10 );
       slider->setPageStep( 20 );
       slider->setTickPosition( QSlider::TicksBelow );
       slider->setTickInterval( 10 );
       slider->setValue( speed );
       connect( slider, SIGNAL( valueChanged( int ) ),
               SLOT( slotSpeed( int ) ) );
       tl1->addWidget(slider);

       label = new QLabel( i18n("Display update speed:"), main );
       tl1->addWidget(label);

       slider = new QSlider( Qt::Horizontal, main );
       slider->setMinimumSize( 120, 20 );
       slider->setRange( 0, MAX_REFRESH_TIMEOUT );
       slider->setSingleStep( MAX_REFRESH_TIMEOUT/10 );
       slider->setPageStep( MAX_REFRESH_TIMEOUT/5 );
       slider->setTickPosition( QSlider::TicksBelow );
       slider->setTickInterval( MAX_REFRESH_TIMEOUT/10 );
       slider->setValue( MAX_REFRESH_TIMEOUT - refreshTimeout );
       connect( slider, SIGNAL( valueChanged( int ) ),
               SLOT( slotRefreshTimeout( int ) ) );
       tl1->addWidget(slider);
       tl1->addStretch();

       preview = new QWidget( main );
       preview->setFixedSize( 220, 165 );
       preview->show();    // otherwise saver does not get correct size
       saver = new kVmSaver( preview->winId() );
       tl->addWidget(preview);
       connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
       connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
}

Here is the call graph for this function:

Definition at line 336 of file kvm.cpp.

{
    delete saver;
}

Member Function Documentation

void kVmSetup::readSettings ( ) [protected]

Definition at line 341 of file kvm.cpp.

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

       speed = config.readEntry( "Speed", 50 );
       if ( speed > 100 )
              speed = 100;
       else if ( speed < 0 )
              speed = 0;
       refreshTimeout = config.readEntry( "DisplayRefreshTimeout", 0 );
       if ( refreshTimeout > MAX_REFRESH_TIMEOUT )
              refreshTimeout = MAX_REFRESH_TIMEOUT;
       else if ( refreshTimeout < 0 )
              refreshTimeout = 0;
}

Here is the caller graph for this function:

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

Definition at line 384 of file kvm.cpp.

{
       KMessageBox::about(this,
              i18n("Virtual Machine Version 0.1\n\nCopyright (c) 2000 Artur Rataj <art@zeus.polsl.gliwice.pl>\n"),
               i18n("About Virtual Machine")
       );
}

Here is the caller graph for this function:

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

Definition at line 370 of file kvm.cpp.

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

       QString sspeed;
       sspeed.setNum( speed );
       config.writeEntry( "Speed", sspeed );
       sspeed.setNum( refreshTimeout );
       config.writeEntry( "DisplayRefreshTimeout", sspeed );

       config.sync();
       accept();
}

Here is the caller graph for this function:

void kVmSetup::slotRefreshTimeout ( int  num) [private, slot]

Definition at line 363 of file kvm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 357 of file kvm.cpp.

{
       speed = num;
       if ( saver )
              saver->setSpeed( num );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

QWidget* kVmSetup::preview [private]

Definition at line 85 of file kvm.h.

int kVmSetup::refreshTimeout [private]

Definition at line 89 of file kvm.h.

Definition at line 86 of file kvm.h.

int kVmSetup::speed [private]

Definition at line 88 of file kvm.h.


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