Skip to content

Commit

Permalink
Minor UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
carlrobertoh committed Nov 9, 2023
1 parent c3da76f commit 3a35514
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public LlamaModelPreferencesForm() {
progressLabel = new JBLabel("");
progressLabel.setBorder(JBUI.Borders.emptyLeft(2));
progressLabel.setFont(JBUI.Fonts.smallFont());
modelExistsIcon = new JBLabel(Actions.Commit);
modelExistsIcon = new JBLabel(Actions.Checked);
modelExistsIcon.setVisible(isModelExists(llamaSettings.getHuggingFaceModel()));
helpIcon = new JBLabel(General.ContextHelp);
huggingFaceComboBoxModel = new DefaultComboBoxModel<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public LlamaServiceSelectionForm() {
} else {
if (!isModelExists(llamaModelPreferencesForm.getSelectedModel())) {
OverlayUtils.showBalloon(
CodeGPTBundle.get("settingsConfigurable.service.llama.overlay.modelNotDownloaded.text"),
CodeGPTBundle.get(
"settingsConfigurable.service.llama.overlay.modelNotDownloaded.text"),
MessageType.ERROR,
llamaModelPreferencesForm.getHuggingFaceModelComboBox());
return;
Expand All @@ -71,15 +72,19 @@ public LlamaServiceSelectionForm() {

if (llamaServerAgent.isServerRunning()) {
setFormEnabled(true);
serverButton.setText(CodeGPTBundle.get("settingsConfigurable.service.llama.startServer.label"));
serverButton.setText(
CodeGPTBundle.get("settingsConfigurable.service.llama.startServer.label"));
serverButton.setIcon(Actions.Execute);
serverProgressPanel.updateText(CodeGPTBundle.get("settingsConfigurable.service.llama.progress.stoppingServer"));
serverProgressPanel.updateText(
CodeGPTBundle.get("settingsConfigurable.service.llama.progress.stoppingServer"));
llamaServerAgent.stopAgent();
} else {
setFormEnabled(false);
serverButton.setText(CodeGPTBundle.get("settingsConfigurable.service.llama.stopServer.label"));
serverButton.setText(
CodeGPTBundle.get("settingsConfigurable.service.llama.stopServer.label"));
serverButton.setIcon(Actions.Suspend);
serverProgressPanel.startProgress(CodeGPTBundle.get("settingsConfigurable.service.llama.progress.startingServer"));
serverProgressPanel.startProgress(
CodeGPTBundle.get("settingsConfigurable.service.llama.progress.startingServer"));

// TODO: Move to LlamaModelPreferencesForm
var modelPath = llamaModelPreferencesForm.isUseCustomLlamaModel() ?
Expand All @@ -94,10 +99,8 @@ public LlamaServiceSelectionForm() {
serverProgressPanel,
() -> {
setFormEnabled(false);
serverProgressPanel.displayComponent(new JBLabel(
"Server running",
Actions.Commit,
SwingConstants.LEADING));
serverProgressPanel.displayComponent(
new JBLabel("Server running", Actions.Checked, SwingConstants.LEADING));
});
}
});
Expand All @@ -109,15 +112,20 @@ public LlamaServiceSelectionForm() {

setLayout(new BorderLayout());
add(FormBuilder.createFormBuilder()
.addComponent(new TitledSeparator(CodeGPTBundle.get("settingsConfigurable.service.llama.modelPreferences.title")))
.addComponent(new TitledSeparator(
CodeGPTBundle.get("settingsConfigurable.service.llama.modelPreferences.title")))
.addComponent(withEmptyLeftBorder(llamaModelPreferencesForm.getForm()))
.addComponent(new TitledSeparator(CodeGPTBundle.get("settingsConfigurable.service.llama.serverPreferences.title")))
.addComponent(new TitledSeparator(
CodeGPTBundle.get("settingsConfigurable.service.llama.serverPreferences.title")))
.addComponent(withEmptyLeftBorder(FormBuilder.createFormBuilder()
.addLabeledComponent(CodeGPTBundle.get("settingsConfigurable.service.llama.contextSize.label"), maxTokensField)
.addLabeledComponent(
CodeGPTBundle.get("settingsConfigurable.service.llama.contextSize.label"),
maxTokensField)
.addComponentToRightColumn(contextSizeHelpText)
.addLabeledComponent(CodeGPTBundle.get("settingsConfigurable.service.llama.port.label"), JBUI.Panels.simplePanel()
.addToLeft(portField)
.addToRight(serverButton))
.addLabeledComponent(CodeGPTBundle.get("settingsConfigurable.service.llama.port.label"),
JBUI.Panels.simplePanel()
.addToLeft(portField)
.addToRight(serverButton))
.getPanel()))
.addVerticalGap(4)
.addComponent(withEmptyLeftBorder(serverProgressPanel))
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/messages/codegpt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ toolwindow.chat.youProCheckBox.text=Use GPT-4 model
toolwindow.chat.youProCheckBox.enable=Turn on for complex queries
toolwindow.chat.youProCheckBox.disable=Turn off for faster responses
toolwindow.chat.youProCheckBox.notAllowed=Enable by subscribing to YouPro plan
toolwindow.chat.textArea.emptyText=Ask me anything
toolwindow.chat.textArea.emptyText=Ask me anything...
service.openai.title=OpenAI Service
service.azure.title=Azure Service
service.you.title=You.com Service (Free, Cloud)
Expand Down

0 comments on commit 3a35514

Please sign in to comment.