Пример #1
0
void SatellitesPlugin::initialize()
{
    // FIXME: remove the const_cast, it may be best to create a new type of
    // plugins where marbleModel() is not const, since traditional
    // RenderPlugins do not require that
    m_satModel = new SatellitesModel(
        const_cast<MarbleModel *>( marbleModel() )->treeModel(),
        marbleModel()->clock() );

    m_configModel = new SatellitesConfigModel( this );
    m_configDialog->configWidget()->treeView->setModel( m_configModel );

    connect( m_satModel, SIGNAL(fileParsed(QString)),
        SLOT(dataSourceParsed(QString)) );
    connect( m_satModel, SIGNAL(fileParsed(QString)),
        SLOT(updateDataSourceConfig(QString)) );
    connect( m_configDialog, SIGNAL(dataSourcesReloadRequested()),
        SLOT(updateSettings()) );
    connect( m_configDialog, SIGNAL(accepted()), SLOT(writeSettings()) );
    connect( m_configDialog, SIGNAL(rejected()), SLOT(readSettings()) );
    connect( m_configDialog->configWidget()->buttonBox->button(
        QDialogButtonBox::Reset ),
        SIGNAL(clicked()), SLOT(restoreDefaultSettings()) );
    connect( m_configDialog, SIGNAL(userDataSourcesChanged()),
        SLOT(writeSettings()) );
    connect( m_configDialog, SIGNAL(userDataSourceAdded(QString)),
        SLOT(userDataSourceAdded(QString)) );

    m_isInitialized = true;
    readSettings();
    updateSettings();
    enableModel( enabled() );
}
Пример #2
0
void SatellitesConfigDialog::reloadDataSources()
{
    emit dataSourcesReloadRequested();
}