Search in sources :

Example 1 with PreferencesDialog

use of org.rstudio.studio.client.workbench.prefs.views.PreferencesDialog in project rstudio by rstudio.

the class OptionsLoader method showOptions.

public void showOptions(final Class<?> paneClass) {
    final ProgressIndicator indicator = globalDisplay_.getProgressIndicator("Error Reading Options");
    indicator.onProgress("Reading options...");
    server_.getRPrefs(new SimpleRequestCallback<RPrefs>() {

        @Override
        public void onResponseReceived(RPrefs rPrefs) {
            indicator.onCompleted();
            PreferencesDialog prefDialog = pPrefDialog_.get();
            prefDialog.initialize(rPrefs);
            if (paneClass != null)
                prefDialog.activatePane(paneClass);
            prefDialog.showModal();
            // if the user changes global sweave or latex options notify
            // them if this results in the current project being out
            // of sync with the global settings
            new SweaveProjectOptionsNotifier(prefDialog);
            // the mac you can actually show prefs from a satellite window)
            if (Desktop.isDesktop())
                Desktop.getFrame().bringMainFrameToFront();
        }

        @Override
        public void onError(ServerError error) {
            indicator.onError(error.getUserMessage());
        }
    });
}
Also used : RPrefs(org.rstudio.studio.client.workbench.prefs.model.RPrefs) ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) ServerError(org.rstudio.studio.client.server.ServerError) PreferencesDialog(org.rstudio.studio.client.workbench.prefs.views.PreferencesDialog)

Aggregations

ProgressIndicator (org.rstudio.core.client.widget.ProgressIndicator)1 ServerError (org.rstudio.studio.client.server.ServerError)1 RPrefs (org.rstudio.studio.client.workbench.prefs.model.RPrefs)1 PreferencesDialog (org.rstudio.studio.client.workbench.prefs.views.PreferencesDialog)1