예제 #1
0
  /* public void activateProfile(Profile profile) throws InitializationException {

  // And the rest
  try {
  profile.getRepository().update();
  }
  catch (CacheException ex) {
  throw new InitializationException("Unable to initialize cache. EXITING.", ex);
  }
  catch (StorageConnectException ex) {
  logger.warning("Could not connect to storage. Profile "+profile.getName()+" stays disabled.");
  return;
  }
  catch (NoRepositoryFoundException ex) {
  logger.severe("Unable to update repository of profile "+profile.getName()+". Not a valid repository.");
  return;
  }
  catch (StorageException ex) {
  logger.log(Level.SEVERE, null, ex);
  return;
  }


  // Locla watcher
  indexer.index(profile);
  localWatcher.watch(profile);
  }*/
  private void initProfiles() {
    for (Profile profile : config.getProfiles().list()) {
      if (!profile.isEnabled()) {
        continue;
      }

      profile.setActive(true);
    }
  }
예제 #2
0
  public void initFirstTimeWizard() {
    Profile profile = WizardDialog.showWizard();

    // Ok clicked
    if (profile != null) {
      config.getProfiles().add(profile);
      settingsDialog.addProfileToTree(profile, false);
      tray.updateUI();

      try {
        config.save();
      } catch (ConfigException ex) {
        logger.log(Level.SEVERE, "Could not save profile from first-start wizard. EXITING.", ex);
        throw new RuntimeException("Could not save profile from first-start wizard. EXITING.", ex);
      }

      profile.setActive(true);
    }
  }