1 /* 2 * Copyright 2017 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Brian Hill 7 */ 8 #ifndef REPOSITORIES_CONSTANTS_H 9 #define REPOSITORIES_CONSTANTS_H 10 11 12 #include <Catalog.h> 13 #include <String.h> 14 15 #undef B_TRANSLATION_CONTEXT 16 #define B_TRANSLATION_CONTEXT "Constants" 17 18 static const float kAddWindowOffset = 10.0; 19 static const int16 kTimerAlertOffset = 15; 20 static const int16 kTimerTimeoutSeconds = 10; 21 static const int16 kTimerRetrySeconds = 20; 22 23 static const BString kOKLabel = B_TRANSLATE_COMMENT("OK", "Button label"); 24 static const BString kCancelLabel = B_TRANSLATE_COMMENT("Cancel", 25 "Button label"); 26 static const BString kRemoveLabel = B_TRANSLATE_COMMENT("Remove", 27 "Button label"); 28 static const BString kNewRepoDefaultName = B_TRANSLATE_COMMENT("Unknown", 29 "Unknown repository name"); 30 31 32 typedef struct { 33 const char* name; 34 const char* url; 35 } Repository; 36 37 38 static const Repository kDefaultRepos[] = { 39 { "Haiku", "https://packages.haiku-os.org/haiku/master/"B_HAIKU_ABI_NAME 40 "/current"}, 41 { "HaikuPorts", "https://packages.haiku-os.org/haikuports/master/repo/" 42 B_HAIKU_ABI_NAME"/current" } 43 }; 44 45 46 // Message keys 47 #define key_frame "frame" 48 #define key_name "repo_name" 49 #define key_url "repo_url" 50 #define key_text "text" 51 #define key_details "details" 52 #define key_rowptr "row_ptr" 53 #define key_taskptr "task_ptr" 54 #define key_count "count" 55 #define key_ID "ID" 56 57 58 // Messages 59 enum { 60 ADD_REPO_WINDOW = 'BHRa', 61 ADD_BUTTON_PRESSED, 62 CANCEL_BUTTON_PRESSED, 63 ADD_REPO_URL, 64 ADD_WINDOW_CLOSED, 65 REMOVE_REPOS, 66 LIST_SELECTION_CHANGED, 67 ENABLE_BUTTON_PRESSED, 68 DISABLE_BUTTON_PRESSED, 69 ITEM_INVOKED, 70 DELETE_KEY_PRESSED, 71 DO_TASK, 72 STATUS_VIEW_COMPLETED_TIMEOUT, 73 TASK_STARTED, 74 TASK_COMPLETED, 75 TASK_COMPLETED_WITH_ERRORS, 76 TASK_CANCELED, 77 UPDATE_LIST, 78 NO_TASKS, 79 ENABLE_REPO, 80 DISABLE_REPO, 81 TASK_TIMEOUT, 82 TIMEOUT_ALERT_BUTTON_SELECTION, 83 TASK_KILL_REQUEST 84 }; 85 86 87 // Repo row task state 88 enum { 89 STATE_NOT_IN_QUEUE = 0, 90 STATE_IN_QUEUE_WAITING, 91 STATE_IN_QUEUE_RUNNING 92 }; 93 94 95 #endif 96