bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *) { CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FONTSIZE_HINT)); // UTF-8 hintBox.paint(); CNeutrinoApp::getInstance()->SetupFonts(); hintBox.hide(); return true; }
// used in ./gui/osd_setup.cpp: bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *) { CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FONTSIZE_HINT)); // UTF-8 hintBox.paint(); CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT); hintBox.hide(); /* recalculate infoclock/muteicon/volumebar */ CVolumeHelper::getInstance()->refresh(); return true; }
//saves settings and apply void CNetworkSetup::applyNetworkSettings() { printf("[network setup] apply network settings...\n"); if (!checkForIP()) return; CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS)); // UTF-8 hintBox.paint(); networkConfig->stopNetwork(); saveNetworkSettings(); networkConfig->startNetwork(); hintBox.hide(); }
int CNetworkSetup::showWlanList() { int res = menu_return::RETURN_REPAINT; CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NETWORKMENU_SSID_SCAN_WAIT)); hintBox.paint(); std::vector<wlan_network> networks; bool found = get_wlan_list(g_settings.ifname, networks); hintBox.hide(); if (!found) { ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_NETWORKMENU_SSID_SCAN_ERROR), CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 return res; } CMenuWidget wlist(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width); wlist.addIntroItems(LOCALE_NETWORKMENU_SSID_SCAN); //intros char cnt[5]; int select = -1; CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); std::string option[networks.size()]; for (unsigned i = 0; i < networks.size(); ++i) { sprintf(cnt, "%d", i); option[i] = networks[i].qual; option[i] += ", "; option[i] += networks[i].channel; const char * icon = NULL; if (networks[i].encrypted) icon = NEUTRINO_ICON_LOCK; CMenuForwarder * net = new CMenuForwarder(networks[i].ssid.c_str(), true, option[i], selector, cnt, CRCInput::RC_nokey, NULL, icon); net->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true); wlist.addItem(net, networks[i].ssid == network_ssid); } res = wlist.exec(NULL, ""); delete selector; printf("CNetworkSetup::showWlanList: selected: %d\n", select); if (select >= 0) { network_ssid = networks[select].ssid; } return res; }
bool CFontSizeNotifier::changeNotify(const neutrino_locale_t OptionName, void * data) { if (data != NULL) { int xre = g_settings.screen_xres; int yre = g_settings.screen_yres; char dat[4]; char val[4]; sscanf((char*) data, "%hhu", &dat[0]); sprintf(val, "%hhu", dat[0]); if (ARE_LOCALES_EQUAL(OptionName, LOCALE_FONTMENU_SCALING_X)) { xre = atoi(val); //fallback for min/max bugs ;) if( xre < 50 || xre > 200 ) { xre = g_settings.screen_xres; snprintf((char *)data,sizeof(data), "%03d",g_settings.screen_xres); } } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_FONTMENU_SCALING_Y)) { yre = atoi(val); if( yre < 50 || yre > 200 ) { yre = g_settings.screen_yres; snprintf((char *)data,sizeof(data), "%03d",g_settings.screen_yres); } } if (xre != g_settings.screen_xres || yre != g_settings.screen_yres) { printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", xre, yre); g_settings.screen_xres = xre; g_settings.screen_yres = yre; } } CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FONTSIZE_HINT)); // UTF-8 hintBox.paint(); CNeutrinoApp::getInstance()->SetupFonts(); hintBox.hide(); return true; }