Пример #1
0
bool CdbSymbolPathListEditor::promptToAddSymbolServer(const QString &settingsGroup, QStringList *symbolPaths)
{
    // Check symbol server unless the user has an external/internal setup
    if (!qgetenv("_NT_SYMBOL_PATH").isEmpty()
            || CdbSymbolPathListEditor::indexOfSymbolServerPath(*symbolPaths) != -1)
        return false;
    // Prompt to use Symbol server unless the user checked "No nagging".
    Core::ICore *core = Core::ICore::instance();
    const QString nagSymbolServerKey = settingsGroup + QLatin1String("/NoPromptSymbolServer");
    bool noFurtherNagging = core->settings()->value(nagSymbolServerKey, false).toBool();
    if (noFurtherNagging)
        return false;

    const QString symServUrl = QLatin1String("http://support.microsoft.com/kb/311503");
    const QString msg = tr("<html><head/><body><p>The debugger is not configured to use the public "
                           "<a href=\"%1\">Microsoft Symbol Server</a>. This is recommended "
                           "for retrieval of the symbols of the operating system libraries.</p>"
                           "<p><i>Note:</i> A fast internet connection is required for this to work smoothly. Also, a delay "
                           "might occur when connecting for the first time.</p>"
                           "<p>Would you like to set it up?</p></br>"
                           "</body></html>").arg(symServUrl);
    const QDialogButtonBox::StandardButton answer =
        Utils::CheckableMessageBox::question(core->mainWindow(), tr("Symbol Server"), msg,
                tr("Do not ask again"), &noFurtherNagging);
    core->settings()->setValue(nagSymbolServerKey, noFurtherNagging);
    if (answer == QDialogButtonBox::No)
        return false;
    // Prompt for path and add it. Synchronize QSetting and debugger.
    const QString cacheDir = CdbSymbolPathListEditor::promptCacheDirectory(core->mainWindow());
    if (cacheDir.isEmpty())
        return false;

    symbolPaths->push_back(CdbSymbolPathListEditor::symbolServerPath(cacheDir));
    return true;
}
Пример #2
0
void BehaviorSettingsPage::apply()
{
    TabSettings newTabSettings;
    StorageSettings newStorageSettings;
    InteractionSettings newInteractionSettings;

    settingsFromUI(newTabSettings, newStorageSettings, newInteractionSettings);

    Core::ICore *core = Core::ICore::instance();
    QSettings *s = core->settings();

    if (newTabSettings != m_d->m_tabSettings) {
        m_d->m_tabSettings = newTabSettings;
        if (s)
            m_d->m_tabSettings.toSettings(m_d->m_parameters.settingsPrefix, s);

        emit tabSettingsChanged(newTabSettings);
    }

    if (newStorageSettings != m_d->m_storageSettings) {
        m_d->m_storageSettings = newStorageSettings;
        if (s)
            m_d->m_storageSettings.toSettings(m_d->m_parameters.settingsPrefix, s);

        emit storageSettingsChanged(newStorageSettings);
    }

    if (newInteractionSettings != m_d->m_interactionSettings) {
        m_d->m_interactionSettings = newInteractionSettings;
        if (s)
            m_d->m_interactionSettings.toSettings(m_d->m_parameters.settingsPrefix, s);
    }
}
QuickToolBarSettings QuickToolBarSettings::get()
{
    Core::ICore *core = Core::ICore::instance();
    QuickToolBarSettings settings;
    settings.fromSettings(core->settings());
    return settings;
}
Пример #4
0
void QuickOpenPlugin::saveSettings()
{
    Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
    if (core && core->settings()) {
        QSettings *s = core->settings();
        s->beginGroup("QuickOpen");
        s->setValue("Interval", m_refreshTimer.interval()/60000);
        s->remove("");
        foreach (IQuickOpenFilter *filter, m_filter) {
            if (!m_customFilter.contains(filter)) {
                s->setValue(filter->name(), filter->saveState());
            }
        }
        s->beginGroup("CustomFilters");
        int i = 0;
        foreach (IQuickOpenFilter *filter, m_customFilter) {
            s->setValue(QString("directory%1").arg(i), filter->saveState());
            ++i;
        }
void DisplaySettingsPage::setDisplaySettings(const DisplaySettings &newDisplaySettings)
{
    if (newDisplaySettings != m_d->m_displaySettings) {
        m_d->m_displaySettings = newDisplaySettings;
        Core::ICore *core = Core::ICore::instance();
        if (QSettings *s = core->settings())
            m_d->m_displaySettings.toSettings(m_d->m_parameters.settingsPrefix, s);

        emit displaySettingsChanged(newDisplaySettings);
    }
}
Пример #6
0
bool RegExpPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
    Q_UNUSED(arguments)
    Q_UNUSED(errorMessage)
    Core::ICore *core = Core::ICore::instance();
    m_regexpWindow = new RegExpWindow;
    Settings settings;
    settings.fromQSettings(core->settings());
    m_regexpWindow->setSettings(settings);
    addAutoReleasedObject(new Core::BaseView("TextEditor.RegExpWindow",
                                             m_regexpWindow,
                                             Core::Contect("RegExpPlugin"),
                                             plugId,
                                             Qt::RightDockWidgetArea));
    return true;
}