diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index dc2a2c1b6..cac819112 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2100,8 +2100,12 @@ remotebox_add hinzufügen remotebox_channel_na Kanal auf Remote-Box nicht verfügbar remotebox_del löschen remotebox_head Remote-Boxen -remotebox_ip Remote-Box IP remotebox_mod bearbeiten +remotebox_user Benutzer +remotebox_pass Passwort +remotebox_port Port +remotebox_rbaddr Adresse +remotebox_rbname Anzeigename reset_all Werkseinstellungen und Reboot reset_channels Lösche Kanäle reset_confirm Sind Sie sich sicher? diff --git a/data/locale/english.locale b/data/locale/english.locale index 220663cbe..c2b581deb 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2100,8 +2100,12 @@ remotebox_add add remotebox_channel_na Channel not available on Remote-Box remotebox_del delete remotebox_head Remote-Boxes -remotebox_ip Remote-Box IP remotebox_mod modify +remotebox_user User +remotebox_pass Password +remotebox_port Port +remotebox_rbaddr Address +remotebox_rbname Screenname reset_all Factory reset and reboot reset_channels Delete all channels reset_confirm Are you sure ? diff --git a/lib/timerdclient/timerdtypes.h b/lib/timerdclient/timerdtypes.h index 040094c1e..76294f409 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -162,7 +162,7 @@ class CTimerd char pluginName[EXEC_PLUGIN_NAME_MAXLEN]; //only filled if applicable char recordingDir[RECORD_DIR_MAXLEN]; //only filled if applicable char epgTitle[EPG_TITLE_MAXLEN]; //only filled if applicable - char remotebox_ip[16]; + char remotebox_name[25]; int rem_pre; int rem_post; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 387371448..556a5030b 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -295,14 +295,36 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) const char * key = actionKey.c_str(); if(actionKey == "add_ip") { - std::string remoteip; - CIPInput remotebox_NetworkIP(LOCALE_REMOTEBOX_IP , &remoteip); - remotebox_NetworkIP.enableSaveScreen(true); - if ((remotebox_NetworkIP.exec(NULL,"") == true) && (!remoteip.empty())) { - remboxmenu->addItem(new CMenuForwarder(remoteip, true, NULL, this, "cha_ip")); - remotebox_NetworkIP.hide(); + std::string rbname,rbaddress,user,pass = ""; + std::string port = "80"; + CKeyboardInput remotebox_name(LOCALE_REMOTEBOX_RBNAME , &rbname, 25); + CKeyboardInput remotebox_address(LOCALE_REMOTEBOX_RBADDR , &rbaddress, 50); + CStringInput remotebox_port(LOCALE_REMOTEBOX_PORT , &port, 5); + CKeyboardInput remotebox_user(LOCALE_REMOTEBOX_USER , &user, 15); + CKeyboardInput remotebox_pass(LOCALE_REMOTEBOX_PASS , &pass, 15); + CMenuWidget * rbsetup = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBNAME, true, rbname, &remotebox_name)); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBADDR, true, rbaddress, &remotebox_address)); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_PORT, true, port, &remotebox_port)); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_USER, true, user, &remotebox_user)); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_PASS, true, pass, &remotebox_pass)); + rbsetup->enableSaveScreen(true); + if ((rbsetup->exec(NULL,"") == true) && (!rbaddress.empty())) { + remboxmenu->addItem(new CMenuForwarder(rbname, true, NULL, this, "cha_ip")); + rbsetup->hide(); remboxmenu->enableSaveScreen(false); remboxmenu->hide(); + timer_remotebox_item timer_rb; + timer_rb.rbaddress = rbaddress; + if (!timer_rb.rbaddress.empty()) { + timer_rb.port = atoi(port); + timer_rb.user = user; + timer_rb.pass = pass; + timer_rb.rbname = rbname; + if (timer_rb.rbname.empty()) + timer_rb.rbname = timer_rb.rbaddress; + g_settings.timer_remotebox_ip.push_back(timer_rb); + } changed = true; } return menu_return::RETURN_REPAINT; @@ -324,12 +346,25 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) bselected = remboxmenu->getSelected(); CMenuItem* item = remboxmenu->getItem(bselected); CMenuForwarder *f = static_cast(item); - std::string remoteip = f->getName(); - CIPInput remotebox_NetworkIP(LOCALE_REMOTEBOX_IP , &remoteip); - remotebox_NetworkIP.enableSaveScreen(true); - if (remotebox_NetworkIP.exec(NULL,"") == true) { - f->setName(remoteip); - remotebox_NetworkIP.hide(); + std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); + std::advance(it,bselected-item_offset); + std::string port = to_string(it->port); + CKeyboardInput remotebox_name(LOCALE_REMOTEBOX_RBNAME , &it->rbname, 25); + CKeyboardInput remotebox_address(LOCALE_REMOTEBOX_RBADDR , &it->rbaddress, 50); + CStringInput remotebox_port(LOCALE_REMOTEBOX_PORT , &port, 5); + CKeyboardInput remotebox_user(LOCALE_REMOTEBOX_USER , &it->user, 15); + CKeyboardInput remotebox_pass(LOCALE_REMOTEBOX_PASS , &it->pass, 15); + CMenuWidget * rbsetup = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBNAME, true, it->rbname, &remotebox_name)); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBADDR, true, it->rbaddress, &remotebox_address)); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_PORT, true, port, &remotebox_port)); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_USER, true, it->user, &remotebox_user)); + rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_PASS, true, it->pass, &remotebox_pass)); + rbsetup->enableSaveScreen(true); + if ((rbsetup->exec(NULL,"") == true) && (!it->rbaddress.empty())) { + it->port = atoi(port); + f->setName(it->rbname); + rbsetup->hide(); remboxmenu->enableSaveScreen(false); remboxmenu->hide(); changed = true; @@ -360,7 +395,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += timerlist[selected].remotebox_ip; + r_url += RemoteBoxConnectUrl(timerlist[selected].remotebox_name); r_url += "/control/timer?action=new&update=1"; r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime); r_url += "&stop=" + to_string((int)timerlist[selected].stopTime); @@ -381,12 +416,12 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) } return menu_return::RETURN_EXIT; } - else if ((strcmp(key, "send_remotetimer") == 0) && remoteChanExists(timerlist[selected].channel_id)) + else if ((strcmp(key, "send_remotetimer") == 0) && RemoteBoxChanExists(timerlist[selected].channel_id)) { CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += timerlist[selected].remotebox_ip; + r_url += RemoteBoxConnectUrl(timerlist[selected].remotebox_name); r_url += "/control/timer?action=new"; r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime + timerlist[selected].rem_pre); r_url += "&stop=" + to_string((int)timerlist[selected].stopTime - timerlist[selected].rem_post); @@ -400,11 +435,11 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) if (r_url=="ok") Timer->removeTimerEvent(timerlist[selected].eventID); } - else if ((strcmp(key, "fetch_remotetimer") == 0) && localChanExists(timerlist[selected].channel_id)) + else if ((strcmp(key, "fetch_remotetimer") == 0) && LocalBoxChanExists(timerlist[selected].channel_id)) { int pre,post; Timer->getRecordingSafety(pre,post); - std::string remotebox_ip = timerlist[selected].remotebox_ip; + std::string remotebox_name = timerlist[selected].remotebox_name; std::string eventID = to_string((int)timerlist[selected].eventID); int res = Timer->addRecordTimerEvent(timerlist[selected].channel_id, timerlist[selected].alarmTime + pre, @@ -426,7 +461,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += remotebox_ip; + r_url += RemoteBoxConnectUrl(remotebox_name); r_url += "/control/timer?action=remove"; r_url += "&id=" + eventID; //printf("[remotetimer] url:%s\n",r_url.c_str()); @@ -439,7 +474,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += timerlist[selected].remotebox_ip; + r_url += RemoteBoxConnectUrl(timerlist[selected].remotebox_name); r_url += "/control/timer?action=remove"; r_url += "&id=" + to_string((int)timerlist[selected].eventID); //printf("[remotetimer] url:%s\n",r_url.c_str()); @@ -451,7 +486,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += timerlist[selected].remotebox_ip; + r_url += RemoteBoxConnectUrl(timerlist[selected].remotebox_name); r_url += "/control/timer?action=new&update=1"; r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime); r_url += "&stop=" + to_string((int)timerlist[selected].stopTime); @@ -609,7 +644,7 @@ void CTimerList::updateEvents(void) { timerlist.clear(); Timer->getTimerList (timerlist); - remoteTimerList (timerlist); + RemoteBoxTimerList (timerlist); sort(timerlist.begin(), timerlist.end()); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); @@ -640,37 +675,37 @@ void CTimerList::updateEvents(void) y = getScreenStartY(height); } -void CTimerList::select_remotebox_ip() +void CTimerList::RemoteBoxSelect() { int select = 0; CMenuWidget *m = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); - for (std::list::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) - m->addItem(new CMenuForwarder(*it, true, NULL, selector, to_string(std::distance(g_settings.timer_remotebox_ip.begin(),it)).c_str())); + for (std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) + m->addItem(new CMenuForwarder(it->rbname, true, NULL, selector, to_string(std::distance(g_settings.timer_remotebox_ip.begin(),it)).c_str())); m->exec(NULL, ""); delete selector; - std::list::iterator it = g_settings.timer_remotebox_ip.begin(); + std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); std::advance(it,select); - if (askUserOnRemoteTimerConflict(timerlist[selected].announceTime, timerlist[selected].stopTime, (char*) it->c_str())) + if (askUserOnRemoteTimerConflict(timerlist[selected].announceTime, timerlist[selected].stopTime, (char*) it->rbname.c_str())) { - strncpy(timerlist[selected].remotebox_ip,it->c_str(),sizeof(timerlist[selected].remotebox_ip)); - timerlist[selected].remotebox_ip[sizeof(timerlist[selected].remotebox_ip) - 1] = 0; + strncpy(timerlist[selected].remotebox_name,it->rbname.c_str(),sizeof(timerlist[selected].remotebox_name)); + timerlist[selected].remotebox_name[sizeof(timerlist[selected].remotebox_name) - 1] = 0; } } -bool CTimerList::remoteChanExists(t_channel_id channel_id) +bool CTimerList::RemoteBoxChanExists(t_channel_id channel_id) { - if (strcmp(timerlist[selected].remotebox_ip,"") == 0) + if (strcmp(timerlist[selected].remotebox_name,"") == 0) return false; CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += timerlist[selected].remotebox_ip; + r_url += RemoteBoxConnectUrl(timerlist[selected].remotebox_name); r_url += "/control/getchannel?format=json&id="; r_url += string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id); r_url = httpTool.downloadString(r_url, -1, httpConnectTimeout); @@ -692,7 +727,7 @@ bool CTimerList::remoteChanExists(t_channel_id channel_id) return (r_url == "true"); } -bool CTimerList::localChanExists(t_channel_id channel_id) +bool CTimerList::LocalBoxChanExists(t_channel_id channel_id) { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if (channel) @@ -701,17 +736,33 @@ bool CTimerList::localChanExists(t_channel_id channel_id) return false; } -void CTimerList::remoteTimerList(CTimerd::TimerList &rtimerlist) +std::string CTimerList::RemoteBoxConnectUrl(std::string _rbname) +{ + std::string c_url = ""; + for (std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); + it != g_settings.timer_remotebox_ip.end(); ++it) { + if (it->rbname == _rbname) { + if (!it->user.empty() && !it->pass.empty()) + c_url += it->user + ":" + it->pass +"@"; + c_url += it->rbaddress; + c_url += ":" + to_string(it->port); + break; + } + } + return c_url; +} + +void CTimerList::RemoteBoxTimerList(CTimerd::TimerList &rtimerlist) { if (g_settings.timer_remotebox_ip.size() == 0) return; CHTTPTool httpTool; std::string r_url; - for (std::list::iterator it = g_settings.timer_remotebox_ip.begin(); + for (std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) { r_url = "http://"; - r_url += *it; + r_url += RemoteBoxConnectUrl(it->rbname); r_url += "/control/timer?format=json"; r_url = httpTool.downloadString(r_url, -1, httpConnectTimeout); //printf("[remotetimer] timers:%s\n",r_url.c_str()); @@ -735,8 +786,8 @@ void CTimerList::remoteTimerList(CTimerd::TimerList &rtimerlist) for (unsigned int i= 0; ic_str(),sizeof(rtimer.remotebox_ip)); - rtimer.remotebox_ip[sizeof(rtimer.remotebox_ip) - 1] = 0; + strncpy(rtimer.remotebox_name,it->rbname.c_str(),sizeof(rtimer.remotebox_name)); + rtimer.remotebox_name[sizeof(rtimer.remotebox_name) - 1] = 0; rtimer.rem_pre = rem_pre; rtimer.rem_post = rem_post; rtimer.eventID = atoi(remotetimers[i].get("id","").asString()); @@ -845,7 +896,7 @@ int CTimerList::show() else if ((msg == CRCInput::RC_play) && !(timerlist.empty()) && (g_settings.timer_remotebox_ip.size() > 0)) { if (timerlist[selected].eventType == CTimerd::TIMER_RECORD ) { - select_remotebox_ip(); + RemoteBoxSelect(); if (exec(this,"send_remotetimer")) { res=menu_return::RETURN_EXIT_ALL; @@ -911,7 +962,7 @@ int CTimerList::show() } else if (msg==CRCInput::RC_setup) { - update = enterRemoteBox(); + update = RemoteBoxSetup(); } else if (msg==CRCInput::RC_yellow) { @@ -975,7 +1026,7 @@ void CTimerList::hide() } } -bool CTimerList::enterRemoteBox() +bool CTimerList::RemoteBoxSetup() { bool ret = false; remboxmenu = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); @@ -985,20 +1036,24 @@ bool CTimerList::enterRemoteBox() remboxmenu->addIntroItems(); item_offset = remboxmenu->getItemsCount(); - for (std::list::iterator it = g_settings.timer_remotebox_ip.begin(); + for (std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) - remboxmenu->addItem(new CMenuForwarder(*it, true, NULL, this, "cha_ip")); + remboxmenu->addItem(new CMenuForwarder(it->rbname, true, NULL, this, "cha_ip")); remboxmenu->setFooter(RemoteBoxFooterButtons, RemoteBoxFooterButtonCount); remboxmenu->enableSaveScreen(true); remboxmenu->exec(NULL, ""); if (changed) { + std::vector old_timer_remotebox_ip = g_settings.timer_remotebox_ip; g_settings.timer_remotebox_ip.clear(); for (int i = item_offset; i < remboxmenu->getItemsCount(); i++) { CMenuItem *item = remboxmenu->getItem(i); CMenuForwarder *f = static_cast(item); - g_settings.timer_remotebox_ip.push_back(f->getName()); + for (std::vector::iterator it = old_timer_remotebox_ip.begin(); + it != old_timer_remotebox_ip.end(); ++it) + if (it->rbname == f->getName()) { + g_settings.timer_remotebox_ip.push_back(*it);} } changed = false; ret = true; @@ -1066,7 +1121,7 @@ void CTimerList::paintItem(int pos) sprintf(srepeatcount,"%ux",timer.repeatCount); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight); } - std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_ip) + ")" : convertTimerType2String(timer.eventType); + std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, t_type, color, fheight); // paint rec icon when recording in progress @@ -1148,7 +1203,7 @@ void CTimerList::paintItem(int pos) CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += std::string(timer.remotebox_ip); + r_url += RemoteBoxConnectUrl(timer.remotebox_name); r_url += "/control/getchannel?format=json&id="; r_url += string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer.channel_id); r_url = httpTool.downloadString(r_url, -1, httpConnectTimeout); @@ -1680,7 +1735,7 @@ int CTimerList::newTimer() return ret; } -bool CTimerList::askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTime, char * remotebox_ip) +bool CTimerList::askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTime, char * remotebox_name) { CTimerd::TimerList overlappingTimers; int pre,post; @@ -1690,7 +1745,7 @@ bool CTimerList::askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTi it != timerlist.end();++it) { - if (strcmp(it->remotebox_ip,remotebox_ip) == 0) { + if (strcmp(it->remotebox_name,remotebox_name) == 0) { if(it->stopTime != 0 && stopTime != 0) { diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 329a7fe55..32f2500ff 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -41,6 +41,7 @@ #include #include +#include class CTimerdClient; @@ -86,11 +87,12 @@ class CTimerList : public CMenuTarget, public CListHelpers int newTimer(); /* todo: properly import the enum CVFD::MODES */ int saved_dispmode; - void remoteTimerList(CTimerd::TimerList &timerlist); - bool enterRemoteBox(); - void select_remotebox_ip(); - bool remoteChanExists(t_channel_id channel_id); - bool localChanExists(t_channel_id channel_id); + void RemoteBoxTimerList(CTimerd::TimerList &timerlist); + bool RemoteBoxSetup(); + void RemoteBoxSelect(); + std::string RemoteBoxConnectUrl(std::string _rbname); + bool RemoteBoxChanExists(t_channel_id channel_id); + bool LocalBoxChanExists(t_channel_id channel_id); int rem_pre,rem_post; int item_offset; bool changed; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 07187bda3..a82795d94 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -459,14 +459,26 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); g_settings.timer_remotebox_ip.clear(); - int timer_remotebox_ip_count = configfile.getInt32("timer_remotebox_ip_count", 0); - if (timer_remotebox_ip_count) { - for (int i = 0; i < timer_remotebox_ip_count; i++) { - std::string k = "timer_remotebox_ip_" + to_string(i); - std::string timer_remotebox_ip = configfile.getString(k, ""); - if (timer_remotebox_ip.empty()) + int timer_remotebox_itemcount = configfile.getInt32("timer_remotebox_ip_count", 0); + if (timer_remotebox_itemcount) { + for (int i = 0; i < timer_remotebox_itemcount; i++) { + timer_remotebox_item timer_rb; + std::string k; + k = "timer_remotebox_ip_" + to_string(i); + timer_rb.rbaddress = configfile.getString(k, ""); + if (timer_rb.rbaddress.empty()) continue; - g_settings.timer_remotebox_ip.push_back(timer_remotebox_ip); + k = "timer_remotebox_port_" + to_string(i); + timer_rb.port = configfile.getInt32(k, 80); + k = "timer_remotebox_user_" + to_string(i); + timer_rb.user = configfile.getString(k, ""); + k = "timer_remotebox_pass_" + to_string(i); + timer_rb.pass = configfile.getString(k, ""); + k = "timer_remotebox_rbname_" + to_string(i); + timer_rb.rbname = configfile.getString(k, ""); + if (timer_rb.rbname.empty()) + timer_rb.rbname = timer_rb.rbaddress; + g_settings.timer_remotebox_ip.push_back(timer_rb); } } @@ -1056,11 +1068,20 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("shutdown_min" , g_settings.shutdown_min ); configfile.setInt32("sleeptimer_min", g_settings.sleeptimer_min); - int timer_remotebox_ip_count = 0; - for (std::list::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) { - std::string k = "timer_remotebox_ip_" + to_string(timer_remotebox_ip_count); - configfile.setString(k, *it); - timer_remotebox_ip_count++; + int timer_remotebox_itemcount = 0; + for (std::vector::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) { + std::string k; + k = "timer_remotebox_ip_" + to_string(timer_remotebox_itemcount); + configfile.setString(k, it->rbaddress); + k = "timer_remotebox_rbname_" + to_string(timer_remotebox_itemcount); + configfile.setString(k, it->rbname); + k = "timer_remotebox_user_" + to_string(timer_remotebox_itemcount); + configfile.setString(k, it->user); + k = "timer_remotebox_pass_" + to_string(timer_remotebox_itemcount); + configfile.setString(k, it->pass); + k = "timer_remotebox_port_" + to_string(timer_remotebox_itemcount); + configfile.setInt32(k, it->port); + timer_remotebox_itemcount++; } configfile.setInt32 ( "timer_remotebox_ip_count", g_settings.timer_remotebox_ip.size()); diff --git a/src/system/locals.h b/src/system/locals.h index f94923248..b705a9f65 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2127,8 +2127,12 @@ typedef enum LOCALE_REMOTEBOX_CHANNEL_NA, LOCALE_REMOTEBOX_DEL, LOCALE_REMOTEBOX_HEAD, - LOCALE_REMOTEBOX_IP, LOCALE_REMOTEBOX_MOD, + LOCALE_REMOTEBOX_USER, + LOCALE_REMOTEBOX_PASS, + LOCALE_REMOTEBOX_PORT, + LOCALE_REMOTEBOX_RBADDR, + LOCALE_REMOTEBOX_RBNAME, LOCALE_RESET_ALL, LOCALE_RESET_CHANNELS, LOCALE_RESET_CONFIRM, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 482e7d875..b0e4ade50 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2127,8 +2127,12 @@ const char * locale_real_names[] = "remotebox_channel_na", "remotebox_del", "remotebox_head", - "remotebox_ip", "remotebox_mod", + "remotebox_user", + "remotebox_pass", + "remotebox_port", + "remotebox_rbaddr", + "remotebox_rbname", "reset_all", "reset_channels", "reset_confirm", diff --git a/src/system/settings.h b/src/system/settings.h index 6744aaaae..60f322cbf 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -145,6 +145,15 @@ struct SNeutrinoTheme unsigned char clock_Digit_blue; }; +struct timer_remotebox_item +{ + unsigned int port; + std::string user; + std::string pass; + std::string rbname; + std::string rbaddress; +}; + struct SNeutrinoSettings { std::string version_pseudo; @@ -450,7 +459,7 @@ struct SNeutrinoSettings int recording_slow_warning; int recording_startstop_msg; int shutdown_timer_record_type; - std::list timer_remotebox_ip; + std::vector timer_remotebox_ip; std::string recording_filename_template; int recording_already_found_check;