mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 17:01:15 +02:00
nfs.cpp:Update mount icon after mounting, ported from tuxbox cvs
This commit is contained in:
@@ -149,10 +149,17 @@ int CNFSMountGui::exec( CMenuTarget* parent, const std::string & actionKey )
|
|||||||
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).c_str());
|
||||||
CFSMounter::mount(g_settings.network_nfs_ip[nr].c_str(), g_settings.network_nfs_dir[nr],
|
CFSMounter::MountRes mres = CFSMounter::mount(
|
||||||
|
g_settings.network_nfs_ip[nr].c_str(), g_settings.network_nfs_dir[nr],
|
||||||
g_settings.network_nfs_local_dir[nr], (CFSMounter::FSType) g_settings.network_nfs_type[nr],
|
g_settings.network_nfs_local_dir[nr], (CFSMounter::FSType) g_settings.network_nfs_type[nr],
|
||||||
g_settings.network_nfs_username[nr], g_settings.network_nfs_password[nr],
|
g_settings.network_nfs_username[nr], g_settings.network_nfs_password[nr],
|
||||||
g_settings.network_nfs_mount_options1[nr], g_settings.network_nfs_mount_options2[nr]);
|
g_settings.network_nfs_mount_options1[nr], g_settings.network_nfs_mount_options2[nr]);
|
||||||
|
|
||||||
|
if (mres == CFSMounter::MRES_OK || mres == CFSMounter::MRES_FS_ALREADY_MOUNTED)
|
||||||
|
mountMenuEntry[nr]->iconName = NEUTRINO_ICON_MOUNTED;
|
||||||
|
else
|
||||||
|
mountMenuEntry[nr]->iconName = NEUTRINO_ICON_NOT_MOUNTED;
|
||||||
|
|
||||||
// TODO show msg in case of error
|
// TODO show msg in case of error
|
||||||
returnval = menu_return::RETURN_EXIT;
|
returnval = menu_return::RETURN_EXIT;
|
||||||
}
|
}
|
||||||
@@ -176,15 +183,16 @@ int CNFSMountGui::menu()
|
|||||||
{
|
{
|
||||||
sprintf(s2,"mountentry%d",i);
|
sprintf(s2,"mountentry%d",i);
|
||||||
sprintf(ISO_8859_1_entry[i],ZapitTools::UTF8_to_Latin1(m_entry[i]).c_str());
|
sprintf(ISO_8859_1_entry[i],ZapitTools::UTF8_to_Latin1(m_entry[i]).c_str());
|
||||||
CMenuForwarderNonLocalized *forwarder = new CMenuForwarderNonLocalized(ISO_8859_1_entry[i], true, NULL, this, s2);
|
mountMenuEntry[i] = new CMenuForwarderNonLocalized("", true, ISO_8859_1_entry[i], this, s2);
|
||||||
|
|
||||||
if (CFSMounter::isMounted(g_settings.network_nfs_local_dir[i]))
|
if (CFSMounter::isMounted(g_settings.network_nfs_local_dir[i]))
|
||||||
{
|
{
|
||||||
forwarder->iconName = NEUTRINO_ICON_MOUNTED;
|
mountMenuEntry[i]->iconName = NEUTRINO_ICON_MOUNTED;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
forwarder->iconName = NEUTRINO_ICON_NOT_MOUNTED;
|
mountMenuEntry[i]->iconName = NEUTRINO_ICON_NOT_MOUNTED;
|
||||||
}
|
}
|
||||||
mountMenuW.addItem(forwarder);
|
mountMenuW.addItem(mountMenuEntry[i]);
|
||||||
}
|
}
|
||||||
int ret=mountMenuW.exec(this,"");
|
int ret=mountMenuW.exec(this,"");
|
||||||
return ret;
|
return ret;
|
||||||
|
@@ -46,7 +46,9 @@ class CNFSMountGui : public CMenuTarget
|
|||||||
int menuEntry(int nr);
|
int menuEntry(int nr);
|
||||||
|
|
||||||
char m_entry[NETWORK_NFS_NR_OF_ENTRIES][200];
|
char m_entry[NETWORK_NFS_NR_OF_ENTRIES][200];
|
||||||
char ISO_8859_1_entry[NETWORK_NFS_NR_OF_ENTRIES][200];
|
char ISO_8859_1_entry[NETWORK_NFS_NR_OF_ENTRIES][200];
|
||||||
|
|
||||||
|
CMenuForwarderNonLocalized* mountMenuEntry[NETWORK_NFS_NR_OF_ENTRIES];
|
||||||
|
|
||||||
CFSMounter::FS_Support m_nfs_sup;
|
CFSMounter::FS_Support m_nfs_sup;
|
||||||
CFSMounter::FS_Support m_cifs_sup;
|
CFSMounter::FS_Support m_cifs_sup;
|
||||||
|
Reference in New Issue
Block a user