void Themes::progressColorRemaining_clicked() { QColor color=QColorDialog::getColor(progressColorRemaining,this,tr("Select a color")); if(!color.isValid()) return; progressColorRemaining=color; QPixmap pixmap(75,20); pixmap.fill(progressColorRemaining); uiOptions->progressColorRemaining->setIcon(pixmap); updateProgressionColorBar(); }
QWidget * ThemesFactory::options() { if(optionsEngine!=NULL) { bool ok; currentSpeed=optionsEngine->getOptionValue("currentSpeed").toUInt(&ok); if(!ok) currentSpeed=0; ui->comboBox_copyEnd->setCurrentIndex(optionsEngine->getOptionValue("comboBox_copyEnd").toUInt()); ui->speedWithProgressBar->setChecked(optionsEngine->getOptionValue("speedWithProgressBar").toBool()); ui->checkBoxShowSpeed->setChecked(optionsEngine->getOptionValue("checkBoxShowSpeed").toBool()); ui->checkBoxStartWithMoreButtonPushed->setChecked(optionsEngine->getOptionValue("moreButtonPushed").toBool()); ui->showDualProgression->setChecked(optionsEngine->getOptionValue("showDualProgression").toBool()); ui->showProgressionInTheTitle->setChecked(optionsEngine->getOptionValue("showProgressionInTheTitle").toBool()); ui->alwaysOnTop->setChecked(optionsEngine->getOptionValue("alwaysOnTop").toBool()); ui->minimizeToSystray->setChecked(optionsEngine->getOptionValue("minimizeToSystray").toBool()); progressColorWrite=optionsEngine->getOptionValue("progressColorWrite").value<QColor>(); progressColorRead=optionsEngine->getOptionValue("progressColorRead").value<QColor>(); progressColorRemaining=optionsEngine->getOptionValue("progressColorRemaining").value<QColor>(); QPixmap pixmap(75,20); pixmap.fill(progressColorWrite); ui->progressColorWrite->setIcon(pixmap); pixmap.fill(progressColorRead); ui->progressColorRead->setIcon(pixmap); pixmap.fill(progressColorRemaining); ui->progressColorRemaining->setIcon(pixmap); updateSpeed(); updateProgressionColorBar(); connect(ui->alwaysOnTop,&QCheckBox::stateChanged,this,&ThemesFactory::alwaysOnTop); connect(ui->checkBoxShowSpeed,&QCheckBox::stateChanged,this,&ThemesFactory::checkBoxShowSpeed); connect(ui->minimizeToSystray,&QCheckBox::stateChanged,this,&ThemesFactory::minimizeToSystray); connect(ui->checkBox_limitSpeed,&QCheckBox::stateChanged,this,&ThemesFactory::uiUpdateSpeed); connect(ui->SliderSpeed,&QAbstractSlider::valueChanged,this,&ThemesFactory::on_SliderSpeed_valueChanged); connect(ui->limitSpeed,static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &ThemesFactory::uiUpdateSpeed); connect(ui->checkBoxShowSpeed,&QAbstractButton::toggled,this,&ThemesFactory::checkBoxShowSpeedHaveChanged); connect(ui->checkBoxStartWithMoreButtonPushed,&QAbstractButton::toggled,this,&ThemesFactory::checkBoxStartWithMoreButtonPushedHaveChanged); connect(ui->speedWithProgressBar,&QAbstractButton::toggled,this,&ThemesFactory::speedWithProgressBar); connect(ui->comboBox_copyEnd, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,&ThemesFactory::comboBox_copyEnd); connect(ui->showDualProgression,&QCheckBox::stateChanged,this,&ThemesFactory::showDualProgression); connect(ui->showDualProgression,&QCheckBox::stateChanged,this,&ThemesFactory::updateProgressionColorBar); connect(ui->showProgressionInTheTitle,&QCheckBox::stateChanged,this,&ThemesFactory::setShowProgressionInTheTitle); connect(ui->progressColorWrite,&QAbstractButton::clicked,this,&ThemesFactory::progressColorWrite_clicked); connect(ui->progressColorRead, &QAbstractButton::clicked,this,&ThemesFactory::progressColorRead_clicked); connect(ui->progressColorRemaining,&QAbstractButton::clicked,this,&ThemesFactory::progressColorRemaining_clicked); } else ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"return the options"); return tempWidget; }
void Themes::showDualProgression_toggled(bool checked) { Q_UNUSED(checked); ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); updateProgressionColorBar(); }