Search in sources :

Example 1 with ConfigManager

use of com.google.security.zynamics.binnavi.config.ConfigManager in project binnavi by google.

the class CIdaSelectionDialog method approve.

/**
   * Handles file selection.
   */
private void approve() {
    if (m_chooser.getCurrentDirectory() == null) {
        return;
    }
    final ConfigManager configFile = ConfigManager.instance();
    if (InstallationState.Installed.equals(CBinExportInstallationChecker.getState(m_chooser.getCurrentDirectory())) && configFile.getGeneralSettings().getIdaDirectory().equals(m_chooser.getCurrentDirectory())) {
        CMessageBox.showInformation(this, "Settings unchanged.");
        dispose();
        return;
    }
    final InstallationState cppState = CBinExportInstallationChecker.getState(m_chooser.getSelectedFile());
    if (cppState != InstallationState.Installed) {
        CMessageBox.showError(this, "Please install the BinExport IDA plugin.");
        return;
    }
    m_selectedFile = m_chooser.getSelectedFile();
    dispose();
}
Also used : ConfigManager(com.google.security.zynamics.binnavi.config.ConfigManager)

Example 2 with ConfigManager

use of com.google.security.zynamics.binnavi.config.ConfigManager in project binnavi by google.

the class CGraphBuilder method loadNativeSettings.

/**
   * Generates the default graph settings for a native view.
   *
   * @param view The view whose graph settings are generated.
   *
   * @return The generated graph settings.
   */
private static Pair<Map<String, String>, ZyGraphViewSettings> loadNativeSettings(final INaviView view) {
    final ConfigManager configFile = ConfigManager.instance();
    // Native views receive the default settings when they are loaded.
    final ZyGraphViewSettings graphSettings = view.getGraphType() == GraphType.CALLGRAPH ? configFile.getDefaultCallGraphSettings() : configFile.getDefaultFlowGraphSettings();
    graphSettings.getProximitySettings().setProximityBrowsing(view.getGraph().nodeCount() >= graphSettings.getProximitySettings().getProximityBrowsingActivationThreshold());
    return new Pair<Map<String, String>, ZyGraphViewSettings>(new HashMap<String, String>(), graphSettings);
}
Also used : ZyGraphViewSettings(com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings) ConfigManager(com.google.security.zynamics.binnavi.config.ConfigManager) Pair(com.google.security.zynamics.zylib.general.Pair)

Aggregations

ConfigManager (com.google.security.zynamics.binnavi.config.ConfigManager)2 ZyGraphViewSettings (com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings)1 Pair (com.google.security.zynamics.zylib.general.Pair)1