Skip to content

Commit

Permalink
[add] - add nfs to the "Add network location" dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Memphiz committed Jun 18, 2011
1 parent ec74a99 commit 300ecdb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
1 change: 1 addition & 0 deletions language/English/strings.xml
Expand Up @@ -1727,6 +1727,7 @@
<string id="20256">HTS Tvheadend client</string>
<string id="20257">VDR Streamdev client</string>
<string id="20258">MythTV client</string>
<string id="20259">Network Filesystem (NFS)</string>

<string id="20300">Web server directory (HTTP)</string>
<string id="20301">Web server directory (HTTPS)</string>
Expand Down
2 changes: 2 additions & 0 deletions language/German/strings.xml
Expand Up @@ -1764,6 +1764,8 @@
<string id="20255">Erster Login: Bearbeite dein Profil.</string>
<string id="20256">HTS Tvheadend Client</string>
<string id="20257">VDR Streamdev Client</string>

<string id="20259">Netzwerk Dateisystem (NFS)</string>

<string id="20300">Webserver-Verzeichnis (HTTP)</string>
<string id="20301">Webserver-Verzeichnis (HTTPS)</string>
Expand Down
28 changes: 21 additions & 7 deletions xbmc/network/GUIDialogNetworkSetup.cpp
Expand Up @@ -141,6 +141,7 @@ void CGUIDialogNetworkSetup::OnInitWindow()
pSpin->AddLabel(g_localizeStrings.Get(20174), NET_PROTOCOL_DAAP);
pSpin->AddLabel(g_localizeStrings.Get(20175), NET_PROTOCOL_UPNP);
pSpin->AddLabel(g_localizeStrings.Get(20304), NET_PROTOCOL_RSS);
pSpin->AddLabel(g_localizeStrings.Get(20259), NET_PROTOCOL_NFS);

This comment has been minimized.

Copy link
@topfs2

topfs2 Jun 19, 2011

Contributor

Might be good to put an ifdef guard here?


pSpin->SetValue(m_protocol);
OnProtocolChange();
Expand Down Expand Up @@ -205,6 +206,8 @@ void CGUIDialogNetworkSetup::OnProtocolChange()
m_port = "2004";
else if (m_protocol == NET_PROTOCOL_MYTH)
m_port = "6543";
else if (m_protocol == NET_PROTOCOL_NFS)
m_port = "2049";

UpdateButtons();
}
Expand Down Expand Up @@ -238,7 +241,8 @@ void CGUIDialogNetworkSetup::UpdateButtons()
m_protocol == NET_PROTOCOL_HTTPS ||
m_protocol == NET_PROTOCOL_RSS ||
m_protocol == NET_PROTOCOL_DAV ||
m_protocol == NET_PROTOCOL_DAVS)
m_protocol == NET_PROTOCOL_DAVS||
m_protocol == NET_PROTOCOL_NFS)
{
SET_CONTROL_LABEL(CONTROL_REMOTE_PATH, 1011); // Remote Path
}
Expand All @@ -252,7 +256,8 @@ void CGUIDialogNetworkSetup::UpdateButtons()
SET_CONTROL_LABEL2(CONTROL_USERNAME, m_username);
CONTROL_ENABLE_ON_CONDITION(CONTROL_USERNAME, m_protocol != NET_PROTOCOL_DAAP &&
m_protocol != NET_PROTOCOL_VTP &&
m_protocol != NET_PROTOCOL_UPNP);
m_protocol != NET_PROTOCOL_UPNP &&
m_protocol != NET_PROTOCOL_NFS);

SendMessage(GUI_MSG_SET_TYPE, CONTROL_USERNAME, CGUIEditControl::INPUT_TYPE_TEXT, 1019);

Expand All @@ -268,20 +273,22 @@ void CGUIDialogNetworkSetup::UpdateButtons()
m_protocol == NET_PROTOCOL_VTP ||
m_protocol == NET_PROTOCOL_MYTH ||
m_protocol == NET_PROTOCOL_RSS ||
m_protocol == NET_PROTOCOL_DAAP);
m_protocol == NET_PROTOCOL_DAAP ||
m_protocol == NET_PROTOCOL_NFS);

SendMessage(GUI_MSG_SET_TYPE, CONTROL_PORT_NUMBER, CGUIEditControl::INPUT_TYPE_NUMBER, 1018);

// password
SET_CONTROL_LABEL2(CONTROL_PASSWORD, m_password);
CONTROL_ENABLE_ON_CONDITION(CONTROL_PASSWORD, m_protocol != NET_PROTOCOL_DAAP &&
m_protocol != NET_PROTOCOL_VTP &&
m_protocol != NET_PROTOCOL_UPNP);
m_protocol != NET_PROTOCOL_UPNP &&
m_protocol != NET_PROTOCOL_NFS);

SendMessage(GUI_MSG_SET_TYPE, CONTROL_PASSWORD, CGUIEditControl::INPUT_TYPE_PASSWORD, 12326);

// TODO: FIX BETTER DAAP SUPPORT
// server browse should be disabled if we are in DAAP, FTP, HTTP, HTTPS, RSS, HTSP, VTP, TUXBOX, DAV or DAVS
// server browse should be disabled if we are in DAAP, FTP, HTTP, HTTPS, RSS, HTSP, VTP, TUXBOX, DAV, NFS or DAVS
CONTROL_ENABLE_ON_CONDITION(CONTROL_SERVER_BROWSE, !m_server.IsEmpty() || !(m_protocol == NET_PROTOCOL_FTP ||
m_protocol == NET_PROTOCOL_HTTP ||
m_protocol == NET_PROTOCOL_HTTPS ||
Expand All @@ -292,7 +299,8 @@ void CGUIDialogNetworkSetup::UpdateButtons()
m_protocol == NET_PROTOCOL_HTSP ||
m_protocol == NET_PROTOCOL_VTP ||
m_protocol == NET_PROTOCOL_MYTH ||
m_protocol == NET_PROTOCOL_TUXBOX));
m_protocol == NET_PROTOCOL_TUXBOX||
m_protocol == NET_PROTOCOL_NFS));
}

CStdString CGUIDialogNetworkSetup::ConstructPath() const
Expand Down Expand Up @@ -324,6 +332,9 @@ CStdString CGUIDialogNetworkSetup::ConstructPath() const
url.SetProtocol("vtp");
else if (m_protocol == NET_PROTOCOL_MYTH)
url.SetProtocol("myth");
else if (m_protocol == NET_PROTOCOL_NFS)
url.SetProtocol("nfs");

if (!m_username.IsEmpty())
{
url.SetUserName(m_username);
Expand All @@ -342,7 +353,8 @@ CStdString CGUIDialogNetworkSetup::ConstructPath() const
(m_protocol == NET_PROTOCOL_HTSP) ||
(m_protocol == NET_PROTOCOL_VTP) ||
(m_protocol == NET_PROTOCOL_MYTH) ||
(m_protocol == NET_PROTOCOL_TUXBOX))
(m_protocol == NET_PROTOCOL_TUXBOX) ||
(m_protocol == NET_PROTOCOL_NFS))
&& !m_port.IsEmpty() && atoi(m_port.c_str()) > 0)
{
url.SetPort(atoi(m_port));
Expand Down Expand Up @@ -382,6 +394,8 @@ void CGUIDialogNetworkSetup::SetPath(const CStdString &path)
m_protocol = NET_PROTOCOL_MYTH;
else if (protocol == "rss")
m_protocol = NET_PROTOCOL_RSS;
else if (protocol == "nfs")
m_protocol = NET_PROTOCOL_NFS;
else
m_protocol = NET_PROTOCOL_SMB; // default to smb
m_username = url.GetUserName();
Expand Down
3 changes: 2 additions & 1 deletion xbmc/network/GUIDialogNetworkSetup.h
Expand Up @@ -40,7 +40,8 @@ class CGUIDialogNetworkSetup :
NET_PROTOCOL_HTSP,
NET_PROTOCOL_VTP,
NET_PROTOCOL_MYTH,
NET_PROTOCOL_TUXBOX};
NET_PROTOCOL_TUXBOX,
NET_PROTOCOL_NFS};
CGUIDialogNetworkSetup(void);
virtual ~CGUIDialogNetworkSetup(void);
virtual bool OnMessage(CGUIMessage& message);
Expand Down

0 comments on commit 300ecdb

Please sign in to comment.