static int youtube_startVideoSearch(interfaceMenu_t *pMenu, char *value, void* pArg) { int search_length; char buf[sizeof(youtubeInfo.search)]; int thread_create = -1; if( value == NULL ) return 1; interface_hideMessageBox(); search_length = utf8_mbtouri(value, strlen(value), buf, sizeof(buf)-1 ); if( search_length < 0 ) { interface_showMessageBox(_T("ERR_INCORRECT_URL"), thumbnail_error, 5000); return 1; } buf[search_length] = 0; strncpy(youtubeInfo.search, buf, search_length+1); pthread_create(&youtubeInfo.search_thread, NULL, youtube_MenuVideoSearchThread, (void *) pMenu); pthread_detach(youtubeInfo.search_thread); return 0; }
static int voip_toggleEnabled(interfaceMenu_t *pMenu, void* pArg) { int showinfo = 1; appControlInfo.voipInfo.enabled = !appControlInfo.voipInfo.enabled; if( saveAppSettings() != 0) { interface_showMessageBox(_T("SETTINGS_SAVE_ERROR"), thumbnail_warning, 0); showinfo = 0; } voip_fillAccountMenu(pMenu, (void*)-1); interface_displayMenu(1); if (showinfo) { interface_showMessageBox(_T("PLEASE_WAIT"), thumbnail_info, 0); } if (appControlInfo.voipInfo.enabled) { system("/usr/local/etc/init.d/S95voip reload"); sleep(5); } else { system("/usr/local/etc/init.d/S95voip stop"); sleep(1); } if (showinfo) { interface_hideMessageBox(); } return 0; }