Logo Search packages:      
Sourcecode: ultracopier version File versions  Download package

void Main_window::abstractLayerSetSpeed ( int  speed ) [private]

Set speed.

Abstract layer for set speed

Definition at line 2371 of file Mwindow.cpp.

References MaxSpeedValueInt, and UpdateSliderSpeedText().

Referenced by abstractLayerUpdateSpeedType(), and setDefaultOptions().

{
      DEBUGCONSOLE(70,"Main_window::abstractLayerSetSpeed","set speed at: "+QString::number(speed));
      if(speed<0)
      {
            DEBUGCONSOLE(10,"Main_window::abstractLayerSetSpeed","speed too low, in negative: "+QString::number(speed));
            speed=0;
      }
      if(!speed)
      {
            MaxSpeedValueInt=0;
            if(comboBox_TypeSpeedMax->currentText()==tr("Direct value"))
            {
                  checkBox_limitSpeed->setChecked(false);
                  limitSpeed->setEnabled(false);
            }
            else
            {
                  SliderSpeed->setSliderPosition(0);
                  UpdateSliderSpeedText();
            }
      }
      else
      {
            MaxSpeedValueInt=speed;
            if(comboBox_TypeSpeedMax->currentText()==tr("Direct value"))
            {
                  checkBox_limitSpeed->setChecked(true);
                  limitSpeed->setEnabled(true);
                  limitSpeed->setValue(speed);
            }
            else
            {
                  if(speed>=128*1024 || speed<=0)
                  {
                        SliderSpeed->setSliderPosition(0);
                        MaxSpeedValueInt=0;
                  }
                  else if(speed<=1024)
                  {
                        SliderSpeed->setSliderPosition(1);
                        MaxSpeedValueInt=1024;
                  }
                  else if(speed<=4*1024)
                  {
                        SliderSpeed->setSliderPosition(2);
                        MaxSpeedValueInt=4*1024;
                  }
                  else if(speed<=8*1024)
                  {
                        SliderSpeed->setSliderPosition(3);
                        MaxSpeedValueInt=8*1024;
                  }
                  else if(speed<=16*1024)
                  {
                        SliderSpeed->setSliderPosition(4);
                        MaxSpeedValueInt=16*1024;
                  }
                  else if(speed<=32*1024)
                  {
                        SliderSpeed->setSliderPosition(5);
                        MaxSpeedValueInt=32*1024;
                  }
                  else if(speed<=64*1024)
                  {
                        SliderSpeed->setSliderPosition(6);
                        MaxSpeedValueInt=64*1024;
                  }
                  else if(speed<=128*1024)
                  {
                        SliderSpeed->setSliderPosition(7);
                        MaxSpeedValueInt=128*1024;
                  }
                  else
                  {
                        DEBUGCONSOLE(10,"optionsDialog::abstractLayerSetSpeed","error value wrong");
                        SliderSpeed->setSliderPosition(0);
                        MaxSpeedValueInt=0;
                  }
            }
            UpdateSliderSpeedText();
      }
}

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