/** * Update the settings from the dialog. * Example use: User clicks Ok or Apply button in a configure dialog. * REIMPLEMENTED */ void AmarokConfigDialog::updateSettings() { OSDPreviewWidget *osd = (OSDPreviewWidget*)child( "osdpreview" ); AmarokConfig::setOsdAlignment( osd->alignment() ); AmarokConfig::setOsdYOffset( osd->y() ); amaroK::OSD::instance()->applySettings(); static_cast<CollectionSetup*>(child("CollectionSetup"))->writeConfig(); if ( m_engineConfig ) m_engineConfig->save(); // When sound system has changed, update engine config page if ( m_soundSystem->currentText() != m_pluginAmarokName[AmarokConfig::soundSystem()] ) { AmarokConfig::setSoundSystem( m_pluginName[m_soundSystem->currentText()] ); emit settingsChanged(); soundSystemChanged(); } if ( m_opt2->styleComboBox->currentText() != AmarokConfig::contextBrowserStyleSheet() ) { //can't use kconfigxt for the style comboxbox's since we need the string, not the index AmarokConfig::setContextBrowserStyleSheet( m_opt2->styleComboBox->currentText() ); ContextBrowser::instance()->setStyleSheet(); } const QString dbType = databaseType(); if ( dbType != AmarokConfig::databaseEngine() ) { AmarokConfig::setDatabaseEngine( dbType ); emit settingsChanged(); } }
/** * Update the settings from the dialog. * Example use: User clicks Ok or Apply button in a configure dialog. * REIMPLEMENTED */ void AmarokConfigDialog::updateSettings() { OSDPreviewWidget *osd = static_cast<OSDPreviewWidget*>( child( "osdpreview" ) ); AmarokConfig::setOsdAlignment( osd->alignment() ); AmarokConfig::setOsdYOffset( osd->y() ); amaroK::OSD::instance()->applySettings(); static_cast<CollectionSetup*>(child("CollectionSetup"))->writeConfig(); if ( m_engineConfig ) m_engineConfig->save(); AmarokConfig::setExternalBrowser( externalBrowser() ); // When sound system has changed, update engine config page if ( m_soundSystem->currentText() != m_pluginAmarokName[AmarokConfig::soundSystem()] ) { AmarokConfig::setSoundSystem( m_pluginName[m_soundSystem->currentText()] ); emit settingsChanged(); soundSystemChanged(); } if ( m_opt2->styleComboBox->currentText() != AmarokConfig::contextBrowserStyleSheet() ) { //can't use kconfigxt for the style comboxbox's since we need the string, not the index AmarokConfig::setContextBrowserStyleSheet( m_opt2->styleComboBox->currentText() ); ContextBrowser::instance()->reloadStyleSheet(); } int dbType = amaroK::databaseTypeCode( m_opt7->dbSetupFrame->databaseEngine->currentText() ); if ( dbType != AmarokConfig::databaseEngine().toInt() ) { AmarokConfig::setDatabaseEngine( QString::number( dbType ) ); emit settingsChanged(); } m_deviceManager->finished(); if( MediaBrowser::isAvailable() ) { PlaylistWindow::self()->addBrowser( "MediaBrowser", MediaBrowser::instance(), i18n( "Media Device" ), amaroK::icon( "device" ) ); } amaroK::setUseScores( m_opt1->kcfg_UseScores->isChecked() ); amaroK::setUseRatings( m_opt1->kcfg_UseRatings->isChecked() ); }
/** * Update the configuration-widgets in the dialog based on amaroK's current settings. * Example use: Initialisation of dialog. * Example use: User clicks Reset button in a configure dialog. * REIMPLEMENTED */ void AmarokConfigDialog::updateWidgets() { m_soundSystem->setCurrentText( m_pluginAmarokName[AmarokConfig::soundSystem()] ); soundSystemChanged(); }