Example #1
0
void QtMarbleConfigDialog::readSettings()
{
    d->m_initialGraphicsSystem = graphicsSystem();
    d->m_previousGraphicsSystem = d->m_initialGraphicsSystem;

    // Sync settings to make sure that we read the current settings.
    syncSettings();
    
    // View
    d->ui_viewSettings.kcfg_distanceUnit->setCurrentIndex( measurementSystem() );
    d->ui_viewSettings.kcfg_angleUnit->setCurrentIndex( angleUnit() );
    d->ui_viewSettings.kcfg_stillQuality->setCurrentIndex( stillQuality() );
    d->ui_viewSettings.kcfg_animationQuality->setCurrentIndex( animationQuality() );
    d->ui_viewSettings.kcfg_labelLocalization->setCurrentIndex( Marble::Native );
    d->ui_viewSettings.kcfg_mapFont->setCurrentFont( mapFont() );
    d->ui_viewSettings.kcfg_graphicsSystem->setCurrentIndex( graphicsSystem() );
    
    // Navigation
    d->ui_navigationSettings.kcfg_dragLocation->setCurrentIndex( Marble::KeepAxisVertically );
    d->ui_navigationSettings.kcfg_onStartup->setCurrentIndex( onStartup() );
    d->ui_navigationSettings.kcfg_inertialEarthRotation->setChecked( inertialEarthRotation() );
    d->ui_navigationSettings.kcfg_animateTargetVoyage->setChecked( animateTargetVoyage() );
    int editorIndex = 0;
    if ( externalMapEditor() == "potlatch") {
        editorIndex = 1;
    } else if ( externalMapEditor() == "josm") {
        editorIndex = 2;
    } else if ( externalMapEditor() == "merkaartor") {
        editorIndex = 3;
    }
    d->ui_navigationSettings.kcfg_externalMapEditor->setCurrentIndex( editorIndex );

    // Cache
    d->ui_cacheSettings.kcfg_volatileTileCacheLimit->setValue( volatileTileCacheLimit() );
    d->ui_cacheSettings.kcfg_persistentTileCacheLimit->setValue( persistentTileCacheLimit() );
    d->ui_cacheSettings.kcfg_proxyUrl->setText( proxyUrl() );
    d->ui_cacheSettings.kcfg_proxyPort->setValue( proxyPort() );
    d->ui_cacheSettings.kcfg_proxyUser->setText( proxyUser() );
    d->ui_cacheSettings.kcfg_proxyPass->setText( proxyPass() );
    d->ui_cacheSettings.kcfg_proxyType->setCurrentIndex( proxyType() );
    d->ui_cacheSettings.kcfg_proxyAuth->setChecked( proxyAuth() );
 
    // Time
    d->ui_timeSettings.kcfg_systemTimezone->setChecked( systemTimezone() );
    d->ui_timeSettings.kcfg_customTimezone->setChecked( customTimezone() );
    d->ui_timeSettings.kcfg_chosenTimezone->setCurrentIndex( chosenTimezone() );
    d->ui_timeSettings.kcfg_utc->setChecked( UTC() );
    d->ui_timeSettings.kcfg_systemTime->setChecked( systemTime() );
    d->ui_timeSettings.kcfg_lastSessionTime->setChecked( lastSessionTime() );
    if( systemTimezone() == true  )
    {
        QDateTime localTime = QDateTime::currentDateTime().toLocalTime();
        localTime.setTimeSpec( Qt::UTC );
        d->m_marbleWidget->model()->setClockTimezone( QDateTime::currentDateTime().toUTC().secsTo( localTime ) );
    }
    else if( UTC() == true )
    {
        d->m_marbleWidget->model()->setClockTimezone( 0 );
    }
    else if( customTimezone() == true )
    {
        d->m_marbleWidget->model()->setClockTimezone( d->m_timezone.value( chosenTimezone() ) );
    }

    // Routing

    // ownCloud
    d->ui_cloudSyncSettings.kcfg_enableSync->setChecked( syncEnabled() );
    d->ui_cloudSyncSettings.kcfg_syncBookmarks->setChecked( syncBookmarks() );
    d->ui_cloudSyncSettings.kcfg_syncRoutes->setChecked( syncRoutes() );
    d->ui_cloudSyncSettings.kcfg_owncloudServer->setText( owncloudServer() );
    d->ui_cloudSyncSettings.kcfg_owncloudUsername->setText( owncloudUsername() );
    d->ui_cloudSyncSettings.kcfg_owncloudPassword->setText( owncloudPassword() );
    
    // Read the settings of the plugins
    d->m_marbleWidget->readPluginSettings( d->m_settings );

    // The settings loaded in the config dialog have been changed.
    emit settingsChanged();
}
Example #2
0
QUrl CloudSyncManager::apiUrl() const
{
    return QUrl( QString( "http://%0:%1@%2/%3" )
                .arg( owncloudUsername() ).arg( owncloudPassword() )
                .arg( owncloudServer() ).arg( apiPath() ) );
}