Hourglass when loading apps.
This commit is contained in:
parent
97503080a5
commit
09da5f3857
1 changed files with 8 additions and 0 deletions
|
|
@ -343,12 +343,16 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
|
||||||
// Snapshot free memory before loading so we can estimate app usage
|
// Snapshot free memory before loading so we can estimate app usage
|
||||||
dvxMemSnapshotLoad(id);
|
dvxMemSnapshotLoad(id);
|
||||||
|
|
||||||
|
// Show hourglass during the load (dlopen + symbol resolution + appMain)
|
||||||
|
dvxSetBusy(ctx, true);
|
||||||
|
|
||||||
// Load the DXE
|
// Load the DXE
|
||||||
void *handle = dlopen(loadPath, RTLD_GLOBAL);
|
void *handle = dlopen(loadPath, RTLD_GLOBAL);
|
||||||
|
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
char msg[512];
|
char msg[512];
|
||||||
snprintf(msg, sizeof(msg), "Failed to load %s:\n%s", baseName(path), dlerror());
|
snprintf(msg, sizeof(msg), "Failed to load %s:\n%s", baseName(path), dlerror());
|
||||||
|
dvxSetBusy(ctx, false);
|
||||||
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
|
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
|
||||||
|
|
||||||
if (tempPath[0]) {
|
if (tempPath[0]) {
|
||||||
|
|
@ -364,6 +368,7 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
|
||||||
if (!desc) {
|
if (!desc) {
|
||||||
char msg[256];
|
char msg[256];
|
||||||
snprintf(msg, sizeof(msg), "%s: missing appDescriptor", baseName(path));
|
snprintf(msg, sizeof(msg), "%s: missing appDescriptor", baseName(path));
|
||||||
|
dvxSetBusy(ctx, false);
|
||||||
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
|
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
|
||||||
dlclose(handle);
|
dlclose(handle);
|
||||||
|
|
||||||
|
|
@ -379,6 +384,7 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
char msg[256];
|
char msg[256];
|
||||||
snprintf(msg, sizeof(msg), "%s: missing appMain", baseName(path));
|
snprintf(msg, sizeof(msg), "%s: missing appMain", baseName(path));
|
||||||
|
dvxSetBusy(ctx, false);
|
||||||
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
|
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
|
||||||
dlclose(handle);
|
dlclose(handle);
|
||||||
|
|
||||||
|
|
@ -464,6 +470,7 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
|
||||||
|
|
||||||
if (taskId < 0) {
|
if (taskId < 0) {
|
||||||
ctx->currentAppId = 0;
|
ctx->currentAppId = 0;
|
||||||
|
dvxSetBusy(ctx, false);
|
||||||
dvxMessageBox(ctx, "Error", "Failed to create task for application.", MB_OK | MB_ICONERROR);
|
dvxMessageBox(ctx, "Error", "Failed to create task for application.", MB_OK | MB_ICONERROR);
|
||||||
dlclose(handle);
|
dlclose(handle);
|
||||||
free(app->dxeCtx);
|
free(app->dxeCtx);
|
||||||
|
|
@ -485,6 +492,7 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
|
||||||
app->state = AppStateRunningE;
|
app->state = AppStateRunningE;
|
||||||
|
|
||||||
dvxLog("Shell: loaded '%s' (id=%ld, mainLoop=%s, entry=0x%08lx, desc=0x%08lx)", app->name, (long)id, app->hasMainLoop ? "yes" : "no", (unsigned long)entry, (unsigned long)desc);
|
dvxLog("Shell: loaded '%s' (id=%ld, mainLoop=%s, entry=0x%08lx, desc=0x%08lx)", app->name, (long)id, app->hasMainLoop ? "yes" : "no", (unsigned long)entry, (unsigned long)desc);
|
||||||
|
dvxSetBusy(ctx, false);
|
||||||
shellDesktopUpdate();
|
shellDesktopUpdate();
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue