ScrobbleSettingsWidget::ScrobbleSettingsWidget( QWidget* parent ) : SettingsWidget( parent ), ui( new Ui::ScrobbleSettingsWidget ) { ui->setupUi( this ); int scrobblePointValue = unicorn::UserSettings().value( SETTING_SCROBBLE_POINT, ui->scrobblePoint->value() ).toInt(); ui->scrobblePoint->setValue( scrobblePointValue ); onSliderMoved( scrobblePointValue ); ui->percentText->setFixedWidth( ui->percentText->fontMetrics().width( "100" ) ); ui->allowFingerprint->setChecked( unicorn::UserSettings().value( SETTING_ALLOW_FINGERPRINTING, ui->allowFingerprint->isChecked() ).toBool() ); ui->scrobblingOn->setChecked( unicorn::UserSettings().value( "scrobblingOn", ui->scrobblingOn->isChecked() ).toBool() ); ui->podcasts->setChecked( unicorn::UserSettings().value( SETTING_PODCASTS, ui->podcasts->isChecked() ).toBool() ); ui->line->setFrameShape( QFrame::HLine ); connect( ui->scrobblePoint, SIGNAL(sliderMoved(int)), SLOT(onSliderMoved(int)) ); connect( ui->scrobblePoint, SIGNAL(sliderMoved(int)), SLOT(onSettingsChanged()) ); connect( ui->allowFingerprint, SIGNAL(stateChanged(int)), SLOT(onSettingsChanged()) ); connect( aApp, SIGNAL(scrobbleToggled(bool)), ui->scrobblingOn, SLOT(setChecked(bool))); connect( ui->scrobblingOn, SIGNAL(clicked(bool)), SLOT(onSettingsChanged()) ); connect( ui->podcasts, SIGNAL(stateChanged(int)), SLOT(onSettingsChanged()) ); }
void CountDialog::onEditTextChange(MyGUI::EditBox* _sender) { if (_sender->getCaption() == "") return; unsigned int count; try { count = boost::lexical_cast<unsigned int>(_sender->getCaption()); } catch (std::bad_cast&) { count = 1; } if (count > mSlider->getScrollRange()) { count = mSlider->getScrollRange(); } mSlider->setScrollPosition(count-1); onSliderMoved(mSlider, count-1); }