예제 #1
0
파일: Core.cpp 프로젝트: AlexWMF/REtypedef
Core::Core()
    : m_originalMangler(nullptr)
{
#if IDA_SDK_VERSION >= 670
    action_desc_t action = 
    {
        sizeof(action),
        "retypedef_open_name_subst_editor",
        "Edit name substitutions...",
        &m_optionsMenuItemClickedAction,
        &PLUGIN
    };

    register_action(action);
    attach_action_to_menu("Options/", "retypedef_open_name_subst_editor", 0);
#else
    add_menu_item("Options/", "Edit name substitutions...", nullptr, 0, 
        &Core::onOptionsMenuItemClicked, this);
#endif

    // First start? Initialize with default rules.
    Settings settings;
    if (settings.value(Settings::kFirstStart, true).toBool())
    {
        QSettings defaultRules(":/Misc/default_rules.ini", QSettings::IniFormat);
        SettingsImporterExporter importer(&m_substitutionManager, &defaultRules);
        importer.importRules();
        saveToSettings();
        settings.setValue(Settings::kFirstStart, false);
    }

    // Load rules from settings and subscribe to changes in the manager
    try
    {
        SettingsImporterExporter importer(&m_substitutionManager, &settings);
        importer.importRules();
    }
    catch (const SettingsImporterExporter::Error& e)
    {
        msg("[" PLUGIN_NAME "] Cannot load settings: %s\n", e.what());
    }
    connect(&m_substitutionManager, SIGNAL(entryAdded()), SLOT(saveToSettings()));
    connect(&m_substitutionManager, SIGNAL(entryDeleted()), SLOT(saveToSettings()));

    // Place demangler detour
    HMODULE hIdaWll = GetModuleHandleA("IDA.WLL");
    if (!hIdaWll)
        throw std::runtime_error("cannot find IDA.WLL");

    auto demangle = reinterpret_cast<demangler_t*>(GetProcAddress(hIdaWll, "demangle"));
    if (!demangle)
        throw std::runtime_error("cannot find exported function \"demangle\" in IDA.WLL");

    m_demanglerDetour.reset(new DemanglerDetour(demangle, &Core::demanglerHookCallback));
    m_demanglerDetour->attach(m_originalMangler);
}
void SenderIdentitiesModel::loadFromSettings(QSettings &s)
{
    beginResetModel();
    m_identities.clear();

    int num = s.beginReadArray(Common::SettingsNames::identitiesKey);
    if (num == 0) {
        s.endArray();
        // Load from the older format where only one identity was supported

        QString realName = s.value(Common::SettingsNames::obsRealNameKey).toString();
        QString email = s.value(Common::SettingsNames::obsAddressKey).toString();
        if (!realName.isEmpty() || !email.isEmpty()) {
            // Don't add empty identities
            m_identities << ItemSenderIdentity(realName, email,
                                               // Old format had no support for signatures/organizations
                                               QString(), QString());
        }

        // Thrash the old settings, replace with the new format
        saveToSettings(s);
    } else {
        // The new format with multiple identities
        for (int i = 0; i < num; ++i) {
            s.setArrayIndex(i);
            m_identities << ItemSenderIdentity(
                                s.value(Common::SettingsNames::realNameKey).toString(),
                                s.value(Common::SettingsNames::addressKey).toString(),
                                s.value(Common::SettingsNames::organisationKey).toString(),
                                s.value(Common::SettingsNames::signatureKey).toString());
        }
        s.endArray();
    }
    endResetModel();
}
예제 #3
0
void SettingsDialogJCW::accept()
{
    saveToSettings();

	if (!file_name->text().isEmpty())
		QDialog::accept();
	else
		QMessageBox::information(this, APPLICATION, tr("You must specify a filename."));
}
예제 #4
0
void SettingsDialog::accept()
{
    saveToSettings();
    // Due to a bug in Qt <= 4.5.1, enabling/disabling cache requires the browser to be restarted.
    if (QLatin1String(qVersion()) <= QLatin1String("4.5.1") && networkCache->isChecked() != m_cacheEnabled) {
        QMessageBox::information(this, tr("Restart required"),
                                 tr("The network cache configuration has changed. "
                                    "So that it can be taken into account, the browser has to be restarted."));
    }
    QDialog::accept();
}
예제 #5
0
파일: folder.cpp 프로젝트: stonerl/client
void Folder::setSyncPaused( bool paused )
{
    if (paused != _definition.paused) {
        _definition.paused = paused;
        saveToSettings();
    }

    if( !paused ) {
        // qDebug() << "Syncing enabled on folder " << name();
    } else {
        // do not stop or start the watcher here, that is done internally by
        // folder class. Even if the watcher fires, the folder does not
        // schedule itself because it checks the var. _enabled before.
        setSyncState(SyncResult::Paused);
    }
}
예제 #6
0
void FeatureClassDlg::accept()
{
    saveToSettings();
    QDialog::accept();
}
예제 #7
0
void SettingsDialog::accept()
{
    saveToSettings();
    QDialog::accept();
}
void SettingsDialog_Skeleton_Extraction::accept()
{
    saveToSettings();

    QDialog::accept();
}
void SettingsDialog_Hole_Filling_Fill::accept()
{
    saveToSettings();

    QDialog::accept();
}
예제 #10
0
void QGBSettings::on_applyButton_clicked(){
  saveToSettings();
}
void SettingsDialog_Hole_Filling_Position_Crossing_Point::accept()
{
    saveToSettings();

    QDialog::accept();
}
void SettingsDialog_Various_Processing_Noise::accept()
{
    saveToSettings();

    QDialog::accept();
}
void SettingsDialog_Hole_Filling_Preprocessing::accept()
{
    saveToSettings();

    QDialog::accept();
}