gui/nfs.cpp: fix merge

Origin commit data
------------------
Branch: ni/coolstream
Commit: f28a6892bc
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-09-15 (Mon, 15 Sep 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2014-09-15 14:51:30 +04:00
parent 3234f3b8e8
commit 52c2d7cc3d

View File

@@ -67,14 +67,6 @@ CNFSMountGui::CNFSMountGui()
width = w_max (50, 10); //% width = w_max (50, 10); //%
} }
const char * nfs_entry_printf_string[3] =
{
"NFS %s:%s -> %s auto: %4s",
"CIFS //%s/%s -> %s auto: %4s",
"FTPFS %s/%s -> %s auto: %4s"
};
std::string CNFSMountGui::getEntryString(int i) std::string CNFSMountGui::getEntryString(int i)
{ {
std::string res; std::string res;
@@ -134,7 +126,7 @@ int CNFSMountGui::exec( CMenuTarget* parent, const std::string & actionKey )
g_settings.network_nfs[i].mount_options2 = "nolock,rsize=8192,wsize=8192"; g_settings.network_nfs[i].mount_options2 = "nolock,rsize=8192,wsize=8192";
g_settings.network_nfs[i].mac = "11:22:33:44:55:66"; g_settings.network_nfs[i].mac = "11:22:33:44:55:66";
m_entry[i] = getEntryString(i); m_entry[i] = getEntryString(i);
ISO_8859_1_entry[i] = ZapitTools::UTF8_to_Latin1(m_entry[i].c_str()); ISO_8859_1_entry[i] = ZapitTools::UTF8_to_Latin1(m_entry[i]);
} }
} }
else if(actionKey.substr(0,10)=="refreshMAC") else if(actionKey.substr(0,10)=="refreshMAC")
@@ -166,12 +158,11 @@ int CNFSMountGui::exec( CMenuTarget* parent, const std::string & actionKey )
{ {
m_entry[i] = getEntryString(i); m_entry[i] = getEntryString(i);
ISO_8859_1_entry[i] = ZapitTools::UTF8_to_Latin1(m_entry[i]); ISO_8859_1_entry[i] = ZapitTools::UTF8_to_Latin1(m_entry[i]);
mountMenuEntry[i]->setOptionValue(ISO_8859_1_entry[i]);
} }
} }
else if(actionKey.substr(0,7)=="domount") else if(actionKey.substr(0,7)=="domount")
{ {
int nr=atoi(actionKey.substr(7,1).c_str()); int nr=atoi(actionKey.substr(7,1));
CFSMounter::MountRes mres = CFSMounter::mount( CFSMounter::MountRes mres = CFSMounter::mount(
g_settings.network_nfs[nr].ip, g_settings.network_nfs[nr].dir, g_settings.network_nfs[nr].ip, g_settings.network_nfs[nr].dir,
g_settings.network_nfs[nr].local_dir, (CFSMounter::FSType) g_settings.network_nfs[nr].type, g_settings.network_nfs[nr].local_dir, (CFSMounter::FSType) g_settings.network_nfs[nr].type,
@@ -189,7 +180,7 @@ int CNFSMountGui::exec( CMenuTarget* parent, const std::string & actionKey )
else if(actionKey.substr(0,3)=="dir") else if(actionKey.substr(0,3)=="dir")
{ {
parent->hide(); parent->hide();
int nr=atoi(actionKey.substr(3,1).c_str()); int nr=atoi(actionKey.substr(3,1));
chooserDir(g_settings.network_nfs[nr].local_dir, false, NULL); chooserDir(g_settings.network_nfs[nr].local_dir, false, NULL);
returnval = menu_return::RETURN_REPAINT; returnval = menu_return::RETURN_REPAINT;
} }
@@ -266,10 +257,10 @@ int CNFSMountGui::menuEntry(int nr)
CMenuOptionChooser *automountInput= new CMenuOptionChooser(LOCALE_NFS_AUTOMOUNT, &g_settings.network_nfs[nr].automount, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true); CMenuOptionChooser *automountInput= new CMenuOptionChooser(LOCALE_NFS_AUTOMOUNT, &g_settings.network_nfs[nr].automount, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true);
CStringInputSMS options1Input(LOCALE_NFS_MOUNT_OPTIONS, &g_settings.network_nfs[nr].mount_options1, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys); CStringInputSMS options1Input(LOCALE_NFS_MOUNT_OPTIONS, &g_settings.network_nfs[nr].mount_options1, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys);
CMenuForwarder *options1_fwd = new CMenuForwarder(LOCALE_NFS_MOUNT_OPTIONS, true, &g_settings.network_nfs[nr].mount_options1, &options1Input); CMenuForwarder *options1_fwd = new CMenuForwarder(LOCALE_NFS_MOUNT_OPTIONS, true, NULL, &options1Input);
CStringInputSMS options2Input(LOCALE_NFS_MOUNT_OPTIONS, &g_settings.network_nfs[nr].mount_options2, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys); CStringInputSMS options2Input(LOCALE_NFS_MOUNT_OPTIONS, &g_settings.network_nfs[nr].mount_options2, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys);
CMenuForwarder *options2_fwd = new CMenuForwarder(LOCALE_NFS_MOUNT_OPTIONS, true, &g_settings.network_nfs[nr].mount_options2, &options2Input); CMenuForwarder *options2_fwd = new CMenuForwarder(LOCALE_NFS_MOUNT_OPTIONS, true, NULL, &options2Input);
CStringInputSMS userInput(LOCALE_NFS_USERNAME, &g_settings.network_nfs[nr].username, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys); CStringInputSMS userInput(LOCALE_NFS_USERNAME, &g_settings.network_nfs[nr].username, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys);
CMenuForwarder *username_fwd = new CMenuForwarder(LOCALE_NFS_USERNAME, (g_settings.network_nfs[nr].type != (int)CFSMounter::NFS), NULL, &userInput); CMenuForwarder *username_fwd = new CMenuForwarder(LOCALE_NFS_USERNAME, (g_settings.network_nfs[nr].type != (int)CFSMounter::NFS), NULL, &userInput);
@@ -278,11 +269,11 @@ int CNFSMountGui::menuEntry(int nr)
CMenuForwarder *password_fwd = new CMenuForwarder(LOCALE_NFS_PASSWORD, (g_settings.network_nfs[nr].type != (int)CFSMounter::NFS), NULL, &passInput); CMenuForwarder *password_fwd = new CMenuForwarder(LOCALE_NFS_PASSWORD, (g_settings.network_nfs[nr].type != (int)CFSMounter::NFS), NULL, &passInput);
CMACInput macInput(LOCALE_RECORDINGMENU_SERVER_MAC, &g_settings.network_nfs[nr].mac, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2); CMACInput macInput(LOCALE_RECORDINGMENU_SERVER_MAC, &g_settings.network_nfs[nr].mac, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
CMenuForwarder *macInput_fwd = new CMenuForwarder(LOCALE_RECORDINGMENU_SERVER_MAC, true, g_settings.network_nfs[nr].mac, &macInput); CMenuForwarder *macInput_fwd = new CMenuForwarder(LOCALE_RECORDINGMENU_SERVER_MAC, true, NULL, &macInput);
CMenuForwarder *refreshMAC_fwd = new CMenuForwarder(LOCALE_NFS_REFRESH_MAC, true, NULL, this, ("refreshMAC" + to_string(nr)).c_str(), CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); CMenuForwarder *refreshMAC_fwd = new CMenuForwarder(LOCALE_NFS_REFRESH_MAC, true, NULL, this, ("refreshMAC" + to_string(nr)).c_str(), CRCInput::RC_yellow);
CMenuForwarder *mountnow_fwd = new CMenuForwarder(LOCALE_NFS_MOUNTNOW, !(CFSMounter::isMounted(g_settings.network_nfs[nr].local_dir)), NULL, this, ("domount" + to_string(nr)).c_str(), CRCInput::RC_red,NEUTRINO_ICON_BUTTON_RED); CMenuForwarder *mountnow_fwd = new CMenuForwarder(LOCALE_NFS_MOUNTNOW, !(CFSMounter::isMounted(g_settings.network_nfs[nr].local_dir)), NULL, this, ("domount" + to_string(nr)).c_str(), CRCInput::RC_red);
mountnow_fwd->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true); mountnow_fwd->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true);
COnOffNotifier notifier(CFSMounter::NFS); COnOffNotifier notifier(CFSMounter::NFS);
@@ -290,8 +281,8 @@ int CNFSMountGui::menuEntry(int nr)
notifier.addItem(password_fwd); notifier.addItem(password_fwd);
mountMenuEntryW.addItem(new CMenuOptionChooser(LOCALE_NFS_TYPE, &g_settings.network_nfs[nr].type, NFS_TYPE_OPTIONS, NFS_TYPE_OPTION_COUNT, typeEnabled, &notifier)); mountMenuEntryW.addItem(new CMenuOptionChooser(LOCALE_NFS_TYPE, &g_settings.network_nfs[nr].type, NFS_TYPE_OPTIONS, NFS_TYPE_OPTION_COUNT, typeEnabled, &notifier));
mountMenuEntryW.addItem(new CMenuForwarder(LOCALE_NFS_IP , true, g_settings.network_nfs[nr].ip, &ipInput )); mountMenuEntryW.addItem(new CMenuForwarder(LOCALE_NFS_IP , true, g_settings.network_nfs[nr].ip, &ipInput ));
mountMenuEntryW.addItem(new CMenuForwarder(LOCALE_NFS_DIR , true, g_settings.network_nfs[nr].dir, &dirInput )); mountMenuEntryW.addItem(new CMenuForwarder(LOCALE_NFS_DIR , true, g_settings.network_nfs[nr].dir, &dirInput));
mountMenuEntryW.addItem(new CMenuForwarder(LOCALE_NFS_LOCALDIR, true, g_settings.network_nfs[nr].local_dir, this, ("dir" + to_string(nr)).c_str())); mountMenuEntryW.addItem(new CMenuForwarder(LOCALE_NFS_LOCALDIR, true, g_settings.network_nfs[nr].local_dir, this, ("dir" + to_string(nr)).c_str()));
mountMenuEntryW.addItem(automountInput); mountMenuEntryW.addItem(automountInput);
mountMenuEntryW.addItem(options1_fwd); mountMenuEntryW.addItem(options1_fwd);
@@ -305,7 +296,7 @@ int CNFSMountGui::menuEntry(int nr)
int ret = mountMenuEntryW.exec(this,""); int ret = mountMenuEntryW.exec(this,"");
return menu_return::RETURN_REPAINT; return ret;
} }
int CNFSUmountGui::exec( CMenuTarget* parent, const std::string & actionKey ) int CNFSUmountGui::exec( CMenuTarget* parent, const std::string & actionKey )
@@ -346,7 +337,7 @@ int CNFSUmountGui::menu()
s1 += it->mountPoint; s1 += it->mountPoint;
std::string s2 = "doumount "; std::string s2 = "doumount ";
s2 += it->mountPoint; s2 += it->mountPoint;
CMenuForwarder *forwarder = new CMenuForwarder(s1.c_str(), true, NULL, this, s2.c_str()); CMenuForwarder *forwarder = new CMenuForwarder(s1, true, NULL, this, s2.c_str());
forwarder->iconName = NEUTRINO_ICON_MOUNTED; forwarder->iconName = NEUTRINO_ICON_MOUNTED;
umountMenu.addItem(forwarder); umountMenu.addItem(forwarder);
} }