mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 09:48:51 +01:00
use system() rather than popen() in FunKey menu
Signed-off-by: Vincent-FK <vincent.buso@funkey-project.com>
This commit is contained in:
parent
9a9989d6ac
commit
67e0f34b93
@ -717,7 +717,6 @@ int MenuMode::launch( )
|
||||
int start_scroll=0;
|
||||
uint8_t screen_refresh = 1;
|
||||
char shell_cmd[100];
|
||||
FILE *fp;
|
||||
uint8_t menu_confirmation = 0;
|
||||
stop_menu_loop = 0;
|
||||
char fname[MAXPATHLEN];
|
||||
@ -845,12 +844,7 @@ int MenuMode::launch( )
|
||||
|
||||
/// ----- Shell cmd ----
|
||||
sprintf(shell_cmd, "%s %d", SHELL_CMD_VOLUME_SET, volume_percentage);
|
||||
fp = popen(shell_cmd, "r");
|
||||
if (fp == NULL) {
|
||||
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
||||
} else {
|
||||
pclose(fp);
|
||||
}
|
||||
system(shell_cmd);
|
||||
|
||||
/// ------ Refresh screen ------
|
||||
screen_refresh = 1;
|
||||
@ -863,12 +857,8 @@ int MenuMode::launch( )
|
||||
|
||||
/// ----- Shell cmd ----
|
||||
sprintf(shell_cmd, "%s %d", SHELL_CMD_BRIGHTNESS_SET, brightness_percentage);
|
||||
fp = popen(shell_cmd, "r");
|
||||
if (fp == NULL) {
|
||||
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
||||
} else {
|
||||
pclose(fp);
|
||||
}
|
||||
system(shell_cmd);
|
||||
|
||||
/// ------ Refresh screen ------
|
||||
screen_refresh = 1;
|
||||
}
|
||||
@ -910,12 +900,8 @@ int MenuMode::launch( )
|
||||
|
||||
/// ----- Shell cmd ----
|
||||
sprintf(shell_cmd, "%s %d", SHELL_CMD_VOLUME_SET, volume_percentage);
|
||||
fp = popen(shell_cmd, "r");
|
||||
if (fp == NULL) {
|
||||
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
||||
} else {
|
||||
pclose(fp);
|
||||
}
|
||||
system(shell_cmd);
|
||||
|
||||
/// ------ Refresh screen ------
|
||||
screen_refresh = 1;
|
||||
}
|
||||
@ -927,12 +913,8 @@ int MenuMode::launch( )
|
||||
|
||||
/// ----- Shell cmd ----
|
||||
sprintf(shell_cmd, "%s %d", SHELL_CMD_BRIGHTNESS_SET, brightness_percentage);
|
||||
fp = popen(shell_cmd, "r");
|
||||
if (fp == NULL) {
|
||||
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
||||
} else {
|
||||
pclose(fp);
|
||||
}
|
||||
system(shell_cmd);
|
||||
|
||||
/// ------ Refresh screen ------
|
||||
screen_refresh = 1;
|
||||
}
|
||||
@ -1005,14 +987,7 @@ int MenuMode::launch( )
|
||||
menu_screen_refresh(menuItem, prevItem, scroll, menu_confirmation, 1);
|
||||
|
||||
/// ----- Shell cmd ----
|
||||
/*fp = popen(usb_sharing?SHELL_CMD_USB_UNMOUNT:SHELL_CMD_USB_MOUNT, "r");
|
||||
if (fp == NULL) {
|
||||
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
||||
}
|
||||
else{
|
||||
usb_sharing = !usb_sharing;
|
||||
pclose(fp);
|
||||
}*/
|
||||
/*system(usb_sharing?SHELL_CMD_USB_UNMOUNT:SHELL_CMD_USB_MOUNT);*/
|
||||
|
||||
bool res = Utils::executeRawPath(usb_sharing?SHELL_CMD_USB_UNMOUNT:SHELL_CMD_USB_MOUNT);
|
||||
if (!res) {
|
||||
@ -1099,13 +1074,7 @@ int MenuMode::launch( )
|
||||
|
||||
/// ----- Shell cmd ----
|
||||
sprintf(shell_cmd, "%s", SHELL_CMD_POWERDOWN);
|
||||
fp = popen(shell_cmd, "r");
|
||||
if (fp == NULL) {
|
||||
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
||||
} else {
|
||||
pclose(fp);
|
||||
}
|
||||
|
||||
system(shell_cmd);
|
||||
return MENU_RETURN_EXIT;
|
||||
}
|
||||
else{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user