Skip to content

Commit

Permalink
Fix send button in image mode in 3.X
Browse files Browse the repository at this point in the history
  • Loading branch information
sacredbanana committed Mar 8, 2024
1 parent df444d4 commit 4c2d245
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 53 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- Improved error handling for connection errors
- Use a stack cookie to set minimum stack size to 32768 bytes (AmigaOS 3.1.4 or higher required)
- Shows a warning if the stack size is smaller than 32768 bytes (AmigaOS 3 only)
- TODO - Fix send button in corner of screen on image mode in 3.X
- Send button no longer appears in corner of screen on image mode in 3.X after an error message is dismissed
- TODO - Fix colour of text cursor in OS4

## 1.4.2 (2024-01-31)
Expand Down
103 changes: 52 additions & 51 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,59 +221,59 @@ static struct TextAttr chatTextAttr = {0};
static struct TextAttr uiTextAttr = {0};
static struct Menu *menu;
static struct NewMenu amigaGPTMenu[] = {
{NM_TITLE, "Project", 0, 0, 0, NULL_ID},
{NM_ITEM, "About", 0, 0, 0, MENU_ITEM_ABOUT_ID},
{NM_ITEM, NM_BARLABEL, 0, 0, 0, NULL_ID},
{NM_ITEM, "Quit", "Q", 0, 0, MENU_ITEM_QUIT_ID},
{NM_TITLE, "Edit", 0, 0, 0, NULL_ID},
{NM_ITEM, "Cut", "X", 0, 0, MENU_ITEM_CUT_ID},
{NM_ITEM, "Copy", "C", 0, 0, MENU_ITEM_COPY_ID},
{NM_ITEM, "Paste", "V", 0, 0, MENU_ITEM_PASTE_ID},
{NM_ITEM, "Clear", "L", 0, 0, MENU_ITEM_CLEAR_ID},
{NM_ITEM, "Select all", "A", 0, 0, MENU_ITEM_SELECT_ALL_ID},
{NM_TITLE, "View", 0, 0, 0, NULL_ID},
{NM_ITEM, "Chat Font", 0, 0, 0, MENU_ITEM_CHAT_FONT_ID},
{NM_ITEM, "UI Font", 0, 0, 0, MENU_ITEM_UI_FONT_ID},
{NM_TITLE, "Speech", 0, 0, 0, NULL_ID},
{NM_ITEM, "Enabled", 0, CHECKIT|CHECKED, 0, MENU_ITEM_SPEECH_ENABLED_ID},
{NM_TITLE, "Project", 0, 0, 0, (APTR)NULL_ID},
{NM_ITEM, "About", 0, 0, 0, (APTR)MENU_ITEM_ABOUT_ID},
{NM_ITEM, NM_BARLABEL, 0, 0, 0, (APTR)NULL_ID},
{NM_ITEM, "Quit", "Q", 0, 0, (APTR)MENU_ITEM_QUIT_ID},
{NM_TITLE, "Edit", 0, 0, 0, (APTR)NULL_ID},
{NM_ITEM, "Cut", "X", 0, 0, (APTR)MENU_ITEM_CUT_ID},
{NM_ITEM, "Copy", "C", 0, 0, (APTR)MENU_ITEM_COPY_ID},
{NM_ITEM, "Paste", "V", 0, 0, (APTR)MENU_ITEM_PASTE_ID},
{NM_ITEM, "Clear", "L", 0, 0, (APTR)MENU_ITEM_CLEAR_ID},
{NM_ITEM, "Select all", "A", 0, 0, (APTR)MENU_ITEM_SELECT_ALL_ID},
{NM_TITLE, "View", 0, 0, 0, (APTR)NULL_ID},
{NM_ITEM, "Chat Font", 0, 0, 0, (APTR)MENU_ITEM_CHAT_FONT_ID},
{NM_ITEM, "UI Font", 0, 0, 0, (APTR)MENU_ITEM_UI_FONT_ID},
{NM_TITLE, "Speech", 0, 0, 0, (APTR)NULL_ID},
{NM_ITEM, "Enabled", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_SPEECH_ENABLED_ID},
#ifdef __AMIGAOS3__
{NM_ITEM, "Accent", 0, 0, 0, MENU_ITEM_SPEECH_ACCENT_ID},
{NM_ITEM, "Speech system", 0, 0, 0, MENU_ITEM_SPEECH_SYSTEM_ID},
{NM_SUB, "Workbench 1.x v34", 0, CHECKIT|CHECKED, 0, MENU_ITEM_SPEECH_SYSTEM_34_ID},
{NM_SUB, "Workbench 2.0 v37", 0, CHECKIT, 0, MENU_ITEM_SPEECH_SYSTEM_37_ID},
{NM_ITEM, "Accent", 0, 0, 0, (APTR)MENU_ITEM_SPEECH_ACCENT_ID},
{NM_ITEM, "Speech system", 0, 0, 0, (APTR)MENU_ITEM_SPEECH_SYSTEM_ID},
{NM_SUB, "Workbench 1.x v34", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_SPEECH_SYSTEM_34_ID},
{NM_SUB, "Workbench 2.0 v37", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_SYSTEM_37_ID},
#else
{NM_ITEM, "Voice", 0, 0, 0, MENU_ITEM_VOICE_ID},
{NM_SUB, "kal (fast)", 0, CHECKIT, 0, MENU_ITEM_SPEECH_VOICE_KAL_ID},
{NM_SUB, "kal16 (fast)", 0, CHECKIT, 0, MENU_ITEM_SPEECH_VOICE_KAL16_ID},
{NM_SUB, "awb (slow)", 0, CHECKIT|CHECKED, 0, MENU_ITEM_SPEECH_VOICE_AWB_ID},
{NM_SUB, "rms (slow)", 0, CHECKIT, 0, MENU_ITEM_SPEECH_VOICE_RMS_ID},
{NM_SUB, "slt (slow)", 0, CHECKIT, 0, MENU_ITEM_SPEECH_VOICE_SLT_ID},
{NM_ITEM, "Voice", 0, 0, 0, (APTR)MENU_ITEM_VOICE_ID},
{NM_SUB, "kal (fast)", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_VOICE_KAL_ID},
{NM_SUB, "kal16 (fast)", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_VOICE_KAL16_ID},
{NM_SUB, "awb (slow)", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_SPEECH_VOICE_AWB_ID},
{NM_SUB, "rms (slow)", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_VOICE_RMS_ID},
{NM_SUB, "slt (slow)", 0, CHECKIT, 0, (APTR)MENU_ITEM_SPEECH_VOICE_SLT_ID},
#endif
{NM_TITLE, "OpenAI", 0, 0, 0, NULL_ID},
{NM_ITEM, "API key", 0, 0, 0, MENU_ITEM_OPENAI_API_KEY_ID},
{NM_ITEM, "Chat System", 0, 0, 0, MENU_ITEM_CHAT_SYSTEM_ID},
{NM_ITEM, "Chat Model", 0, 0, 0, MENU_ITEM_CHAT_MODEL_ID},

{NM_SUB, "gpt-4-0125-preview", 0, CHECKIT, 0, MENU_ITEM_CHAT_MODEL_GPT_4_0125_PREVIEW_ID},
{NM_SUB, "gpt-4-turbo-preview", 0, CHECKIT, 0, MENU_ITEM_CHAT_MODEL_GPT_4_TURBO_PREVIEW_ID},
{NM_SUB, "gpt-4-1106-preview", 0, CHECKIT, 0, MENU_ITEM_CHAT_MODEL_GPT_4_1106_PREVIEW_ID},
{NM_SUB, "gpt-4-0613", 0, CHECKIT, 0, MENU_ITEM_CHAT_MODEL_GPT_4_0613_ID},
{NM_SUB, "gpt-3.5-turbo-0125", 0, CHECKIT, 0, MENU_ITEM_CHAT_MODEL_GPT_3_5_TURBO_0125_ID},
{NM_SUB, "gpt-3.5-turbo", 0, CHECKIT|CHECKED, 0, MENU_ITEM_CHAT_MODEL_GPT_3_5_TURBO_ID},
{NM_SUB, "gpt-3.5-turbo-1106", 0, CHECKIT, 0, MENU_ITEM_CHAT_MODEL_GPT_3_5_TURBO_1106_ID},
{NM_ITEM, "Image Model", 0, 0, 0, MENU_ITEM_IMAGE_MODEL_ID},
{NM_SUB, "dall-e-2", 0, CHECKIT, 0, MENU_ITEM_IMAGE_MODEL_DALL_E_2_ID},
{NM_SUB, "dall-e-3", 0, CHECKIT|CHECKED, 0, MENU_ITEM_IMAGE_MODEL_DALL_E_3_ID},
{NM_ITEM, "DALL-E 2 Image Size", 0, 0, 0, MENU_ITEM_IMAGE_SIZE_DALL_E_2_ID},
{NM_SUB, "256x256", 0, CHECKIT|CHECKED, 0, MENU_ITEM_IMAGE_SIZE_DALL_E_2_256X256_ID},
{NM_SUB, "512x512", 0, CHECKIT, 0, MENU_ITEM_IMAGE_SIZE_DALL_E_2_512X512_ID},
{NM_SUB, "1024x1024", 0, CHECKIT, 0, MENU_ITEM_IMAGE_SIZE_DALL_E_2_1024X1024_ID},
{NM_ITEM, "DALL-E 3 Image Size", 0, 0, 0, MENU_ITEM_IMAGE_SIZE_DALL_E_3_ID},
{NM_SUB, "1024x1024", 0, CHECKIT|CHECKED, 0, MENU_ITEM_IMAGE_SIZE_DALL_E_3_1024X1024_ID},
{NM_SUB, "1792x1024", 0, CHECKIT, 0, MENU_ITEM_IMAGE_SIZE_DALL_E_3_1792X1024_ID},
{NM_SUB, "1024x1792", 0, CHECKIT, 0, MENU_ITEM_IMAGE_SIZE_DALL_E_3_1024X1792_ID},
{NM_TITLE, "Help", 0, 0, 0, NULL_ID},
{NM_ITEM, "View Documentation", 0, 0, 0, MENU_ITEM_VIEW_DOCUMENTATION_ID},
{NM_TITLE, "OpenAI", 0, 0, 0, (APTR)NULL_ID},
{NM_ITEM, "API key", 0, 0, 0, (APTR)MENU_ITEM_OPENAI_API_KEY_ID},
{NM_ITEM, "Chat System", 0, 0, 0, (APTR)MENU_ITEM_CHAT_SYSTEM_ID},
{NM_ITEM, "Chat Model", 0, 0, 0, (APTR)MENU_ITEM_CHAT_MODEL_ID},

{NM_SUB, "gpt-4-0125-preview", 0, CHECKIT, 0, (APTR)MENU_ITEM_CHAT_MODEL_GPT_4_0125_PREVIEW_ID},
{NM_SUB, "gpt-4-turbo-preview", 0, CHECKIT, 0, (APTR)MENU_ITEM_CHAT_MODEL_GPT_4_TURBO_PREVIEW_ID},
{NM_SUB, "gpt-4-1106-preview", 0, CHECKIT, 0, (APTR)MENU_ITEM_CHAT_MODEL_GPT_4_1106_PREVIEW_ID},
{NM_SUB, "gpt-4-0613", 0, CHECKIT, 0, (APTR)MENU_ITEM_CHAT_MODEL_GPT_4_0613_ID},
{NM_SUB, "gpt-3.5-turbo-0125", 0, CHECKIT, 0, (APTR)MENU_ITEM_CHAT_MODEL_GPT_3_5_TURBO_0125_ID},
{NM_SUB, "gpt-3.5-turbo", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_CHAT_MODEL_GPT_3_5_TURBO_ID},
{NM_SUB, "gpt-3.5-turbo-1106", 0, CHECKIT, 0, (APTR)MENU_ITEM_CHAT_MODEL_GPT_3_5_TURBO_1106_ID},
{NM_ITEM, "Image Model", 0, 0, 0, (APTR)MENU_ITEM_IMAGE_MODEL_ID},
{NM_SUB, "dall-e-2", 0, CHECKIT, 0, (APTR)MENU_ITEM_IMAGE_MODEL_DALL_E_2_ID},
{NM_SUB, "dall-e-3", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_IMAGE_MODEL_DALL_E_3_ID},
{NM_ITEM, "DALL-E 2 Image Size", 0, 0, 0, (APTR)MENU_ITEM_IMAGE_SIZE_DALL_E_2_ID},
{NM_SUB, "256x256", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_IMAGE_SIZE_DALL_E_2_256X256_ID},
{NM_SUB, "512x512", 0, CHECKIT, 0, (APTR)MENU_ITEM_IMAGE_SIZE_DALL_E_2_512X512_ID},
{NM_SUB, "1024x1024", 0, CHECKIT, 0, (APTR)MENU_ITEM_IMAGE_SIZE_DALL_E_2_1024X1024_ID},
{NM_ITEM, "DALL-E 3 Image Size", 0, 0, 0, (APTR)MENU_ITEM_IMAGE_SIZE_DALL_E_3_ID},
{NM_SUB, "1024x1024", 0, CHECKIT|CHECKED, 0, (APTR)MENU_ITEM_IMAGE_SIZE_DALL_E_3_1024X1024_ID},
{NM_SUB, "1792x1024", 0, CHECKIT, 0, (APTR)MENU_ITEM_IMAGE_SIZE_DALL_E_3_1792X1024_ID},
{NM_SUB, "1024x1792", 0, CHECKIT, 0, (APTR)MENU_ITEM_IMAGE_SIZE_DALL_E_3_1024X1792_ID},
{NM_TITLE, "Help", 0, 0, 0, (APTR)NULL_ID},
{NM_ITEM, "View Documentation", 0, 0, 0, (APTR)MENU_ITEM_VIEW_DOCUMENTATION_ID},
{NM_END, NULL, 0, 0, 0, 0}
};
/**
Expand Down Expand Up @@ -2670,7 +2670,8 @@ void displayError(STRPTR message) {
};
EasyRequest(mainWindow, &errorRequester, NULL, NULL);

SetGadgetAttrs(sendMessageButton, mainWindow, NULL, GA_Disabled, FALSE, TAG_DONE);
if (!isAmigaOS3X)
SetGadgetAttrs(sendMessageButton, mainWindow, NULL, GA_Disabled, FALSE, TAG_DONE);

FreeVec(adjustedMsg);
}
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define APP_VERSION "1.4.3"
#define BUILD_NUMBER "2734"
#define BUILD_NUMBER "2739"
#define APP_NAME "AmigaGPT"

0 comments on commit 4c2d245

Please sign in to comment.