Skip to content

Commit

Permalink
Base server hostname combobox on existing values - bnc#547983
Browse files Browse the repository at this point in the history
Conflicts:

	package/yast2-nfs-client.changes
  • Loading branch information
mvidner committed Nov 22, 2012
1 parent 1d40282 commit e6749b7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
1 change: 1 addition & 0 deletions package/yast2-nfs-client.changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Mon Oct 15 08:28:10 UTC 2012 - mfilka@suse.com

- ported several old fixes from master branch:
- Base server hostname combobox on existing values - bnc#547983
- Fixed handling of return symbols (buggy patch for bnc#589541, now
bnc#608166)
- added fix for problem with OK button (bnc#589541)
Expand Down
31 changes: 16 additions & 15 deletions src/Nfs.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,23 @@
}
});

//Backwards compatibility: with FaTE#302031, we support nfsv4 mounts
//thus we need to keep info on nfs version (v3 vs. v4)
//But older AY profiles might not contain this element
//so let's assume nfsv3 in that case (#395850)
if ( !haskey(s, "vfstype") )
{
s["vfstype"] = "nfs";
} else {
if (s["vfstype"]:"nfs" == "nfs4")
{
nfs4_enabled = true;
}
}
//Backwards compatibility: with FaTE#302031, we support nfsv4 mounts
//thus we need to keep info on nfs version (v3 vs. v4)
//But older AY profiles might not contain this element
//so let's assume nfsv3 in that case (#395850)
if ( !haskey(s, "vfstype") )
{
s["vfstype"] = "nfs";
} else {
if (s["vfstype"]:"nfs" == "nfs4")
{
nfs4_enabled = true;
}
}
return s;

});

if (missing)
{
return false;
Expand Down Expand Up @@ -279,10 +280,10 @@
Progress::set(progress_orig);

portmapper = FindPortmapper();
//There is neither rpcbind nor portmap
//There is neither rpcbind nor portmap
if ( portmapper == "" )
{
//so let's install rpcbind (default since #423026)
//so let's install rpcbind (default since #423026)
required_packages = add( required_packages, "rpcbind" );
portmapper = "rpcbind";
}
Expand Down
28 changes: 24 additions & 4 deletions src/ui.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@

list<string> hosts = nil;

/**
* List of already defined nfs mount points
*/
list< map <string,any> > nfs_entries = Nfs::nfs_entries;

/**
* Let the user choose one of a list of items
* @param title selectionbox title
Expand Down Expand Up @@ -178,6 +183,7 @@
`Bottom (button)
);
}

/**
* Ask user for an entry.
* @param fstab_ent $["spec": "file": "mntops":] or nil
Expand Down Expand Up @@ -213,6 +219,19 @@
servers = [ proposed_server ];
}

// append already defined servers - bug #547983
foreach( map nfs_entry, nfs_entries,
{
term couple = SpecToServPath( nfs_entry[ "spec"]:"");
string known_server = couple[0]:"";

if( !contains( servers, known_server))
servers = add( servers, known_server);
});

servers = sort( servers);
//

UI::OpenDialog(
`opt(`decorated),
`HBox(
Expand All @@ -232,7 +251,8 @@
),
`HSpacing(0.5),
TextAndButton (
`TextEntry(`id(`pathent),
`InputField( `id(`pathent),
`opt(`hstretch),
// textentry label
_("&Remote Directory"), pth),
// pushbutton label,
Expand All @@ -245,7 +265,8 @@
`Left( `CheckBox(`id(`nfs4), _("NFS&v4 Share"), nfs4)),
`Left(
TextAndButton (
`TextEntry(`id(`mountent),
`InputField(`id(`mountent),
`opt(`hstretch),
// textentry label
_("&Mount Point (local)"), mount),
// button label
Expand All @@ -256,7 +277,7 @@
),
// textentry label
`VSpacing(0.2),
`TextEntry(`id(`optionsent), _("O&ptions"), options),
`InputField(`id(`optionsent), `opt( `hstretch), _("O&ptions"), options),
`VSpacing(0.2),
`ButtonBox(
`PushButton(`id(`ok), `opt(`default, `key_F10), Label::OKButton()),
Expand Down Expand Up @@ -468,7 +489,6 @@ read the man page mount(8).</p>");
];
map<string,any> fw_cwm_widget = CWMFirewallInterfaces::CreateOpenFirewallWidget (fw_settings);

list< map <string,any> > nfs_entries = Nfs::nfs_entries;
map <string, any> modify_line = $[];

// Help, part 1 of 3
Expand Down

0 comments on commit e6749b7

Please sign in to comment.