Exemplo n.º 1
0
 private void setupDirectorySelectMenuItem() {
   gitoliteDirectorySelectMenuItem.setOnAction(
       event -> {
         ApplicationModel model = ApplicationModel.getInstance();
         DirectoryChooser chooser = new DirectoryChooser();
         if (model.isRepoDirectoryDefined()) {
           chooser.setInitialDirectory(model.getRepoDirectory());
         }
         File selectedDirectory = chooser.showDialog(null);
         if (selectedDirectory != null) {
           model.setRepoDirectory(selectedDirectory);
           checkForDefinedGitRepoDirectory();
         }
       });
 }
Exemplo n.º 2
0
 private void checkForDefinedGitRepoDirectory() {
   if (!ApplicationModel.getInstance().isRepoDirectoryDefined()) {
     publicKeysTab.setDisable(true);
     reposTab.setDisable(true);
     Platform.runLater(
         () -> {
           Alert alert =
               new Alert(
                   AlertType.ERROR,
                   "Please select the root directory of the gitolite admin repository.");
           alert.showAndWait();
         });
   } else {
     publicKeysTab.setDisable(false);
     reposTab.setDisable(false);
     addTabContent();
   }
 }