Skip to content

Commit

Permalink
Add default value for destination text field
Browse files Browse the repository at this point in the history
  • Loading branch information
carlrobertoh committed Oct 2, 2023
1 parent 730ed51 commit b4881be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ee.carlrobert.codegpt.settings;

import com.intellij.notification.NotificationType;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.ui.ComponentValidator;
import com.intellij.openapi.ui.ValidationInfo;
Expand All @@ -23,7 +22,6 @@
import ee.carlrobert.codegpt.user.auth.AuthenticationService;
import ee.carlrobert.codegpt.user.auth.response.AuthenticationResponse;
import ee.carlrobert.codegpt.user.auth.response.User;
import ee.carlrobert.codegpt.util.OverlayUtils;
import ee.carlrobert.codegpt.util.SwingUtils;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectUtil;
import com.intellij.openapi.ui.DialogBuilder;
import com.intellij.openapi.ui.TextBrowseFolderListener;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
Expand All @@ -17,6 +18,7 @@
import com.intellij.util.ui.FormBuilder;
import ee.carlrobert.codegpt.CodeGPTBundle;
import ee.carlrobert.codegpt.actions.ActionType;
import ee.carlrobert.codegpt.util.ApplicationUtils;
import ee.carlrobert.codegpt.util.FileUtils;
import java.util.Objects;
import org.jetbrains.annotations.NotNull;
Expand All @@ -41,6 +43,7 @@ public void handleAction(@NotNull AnActionEvent e) {
var fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
fileChooserDescriptor.setForcedToUseIdeaFileChooser(true);
var textFieldWithBrowseButton = new TextFieldWithBrowseButton();
textFieldWithBrowseButton.setText(project.getBasePath());
textFieldWithBrowseButton.addBrowseFolderListener(
new TextBrowseFolderListener(fileChooserDescriptor, project));
var fileNameTextField = new JBTextField("Untitled" + fileExtension);
Expand Down

0 comments on commit b4881be

Please sign in to comment.