[yast-commit] r60578 - in /branches/SuSE-Code-11-SP1-Branch/packager: VERSION package/yast2-packager.changes src/modules/SourceDialogs.ycp
Author: lslezak Date: Wed Jan 27 16:46:13 2010 New Revision: 60578 URL: http://svn.opensuse.org/viewcvs/yast?rev=60578&view=rev Log: - repositories - added NFSv4 support (fate#306451), don't loose the current URL when switching between full and parsed view - 2.17.69 Modified: branches/SuSE-Code-11-SP1-Branch/packager/VERSION branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes branches/SuSE-Code-11-SP1-Branch/packager/src/modules/SourceDialogs.ycp Modified: branches/SuSE-Code-11-SP1-Branch/packager/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/VERSION?rev=60578&r1=60577&r2=60578&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/packager/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/packager/VERSION Wed Jan 27 16:46:13 2010 @@ -1 +1 @@ -2.17.68 +2.17.69 Modified: branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes?rev=60578&r1=60577&r2=60578&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/packager/package/yast2-packager.changes Wed Jan 27 16:46:13 2010 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Jan 27 15:41:46 UTC 2010 - lslezak@suse.cz + +- repositories - added NFSv4 support (fate#306451), don't loose + the current URL when switching between full and parsed view +- 2.17.69 + +------------------------------------------------------------------- Thu Jan 14 13:40:25 UTC 2010 - lslezak@suse.cz - install also xorg-x11-fonts package when remote X or VNC Modified: branches/SuSE-Code-11-SP1-Branch/packager/src/modules/SourceDialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/packager/src/modules/SourceDialogs.ycp?rev=60578&r1=60577&r2=60578&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/packager/src/modules/SourceDialogs.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/packager/src/modules/SourceDialogs.ycp Wed Jan 27 16:46:13 2010 @@ -424,7 +424,9 @@ ) ), // checkbox label - `Left (`CheckBox ( `id (`ch_iso), _("&ISO Image"))) + `Left (`CheckBox ( `id (`ch_iso), _("&ISO Image"))), + // checkbox label + `Left (`CheckBox ( `id (`ch_nfs4), _("N&FS v4 Protocol"))) ); term nfs_complete_content = `InputField(`id(`complete_url), `opt(`hstretch), _("URL of the Repository")); @@ -454,6 +456,13 @@ UI::ChangeWidget (`id (`dir), `Value, parsed["path"]:""); UI::ChangeWidget (`id (`ch_iso), `Value, iso); UI::SetFocus (`server); + + boolean nfs4 = tolower(parsed["scheme"]:"nfs") == "nfs4" || + URL::MakeMapFromParams(parsed["query"]:"")["type"]:"" == "nfs4"; + + y2milestone("NFSv4: %1", nfs4); + + UI::ChangeWidget (`id (`ch_nfs4), `Value, nfs4); } else { @@ -461,6 +470,48 @@ } } +void NFSStoreParts() +{ + map parsed = $[ + "scheme" : "nfs", + "host" : NormalizeHost ( + (string)UI::QueryWidget (`id (`server), `Value)), + "path" : (string)UI::QueryWidget (`id (`dir), `Value), + ]; + + boolean nfs4 = (boolean)UI::QueryWidget (`id (`ch_nfs4), `Value); + if (nfs4) + { + // keep nfs4:// if it is used in the original URL + if (tolower(URL::Parse(_url)["scheme"]:"") == "nfs4") + { + parsed["scheme"] = "nfs4"; + } + else + { + parsed["query"] = "type=nfs4"; + } + } + + _url = URL::Build (parsed); + boolean iso = (boolean)UI::QueryWidget (`id (`ch_iso), `Value); + + // workaround: URL::Build does not accept numbers in scheme, + // for nfs4 scheme it returns URL with no scheme (like "://foo/bar") + if(!regexpmatch(_url, "^nfs")) + { + _url = "nfs4" + _url; + } + + if (iso) + _url = PosprocessISOURL (_url); +} + +void NFSStoreComplete() +{ + _url = (string)UI::QueryWidget(`id(`complete_url), `Value); +} + /** * Store function of a widget * @param key string widget key @@ -472,20 +523,11 @@ if (current_type == `edit_url_parts) { - map parsed = $[ - "scheme" : "nfs", - "host" : NormalizeHost ( - (string)UI::QueryWidget (`id (`server), `Value)), - "path" : (string)UI::QueryWidget (`id (`dir), `Value), - ]; - _url = URL::Build (parsed); - boolean iso = (boolean)UI::QueryWidget (`id (`ch_iso), `Value); - if (iso) - _url = PosprocessISOURL (_url); + NFSStoreParts(); } else { - _url = (string)UI::QueryWidget(`id(`complete_url), `Value); + NFSStoreComplete(); } } @@ -523,7 +565,17 @@ } else if ((event["ID"]:nil == `edit_url_parts || event["ID"]:nil == `edit_complete_url) && event["EventReason"]:"" == "ValueChanged") { - y2milestone("Changing dialog type"); + y2milestone("Changing dialog type: %1", event["ID"]:nil); + + // store the current settings + if (event["ID"]:nil == `edit_url_parts) + { + NFSStoreComplete(); + } + else + { + NFSStoreParts(); + } // reinitialize the dialog (set the current values) NFSInit(nil); @@ -1196,6 +1248,7 @@ `ReplacePoint (`id (`server_rp), `Empty ()) ); +// input field label term complete_content = `InputField(`id(`complete_url), `opt(`hstretch), _("URL of the Repository")); void ServerStoreParts() @@ -1896,6 +1949,7 @@ else if ( _url == "https://" ) current = `https; else if ( _url == "smb://" ) current = `samba; else if ( _url == "nfs://" ) current = `nfs; + else if ( _url == "nfs4://" ) current = `nfs; else if ( _url == "cd:///" ) current = `cd; else if ( _url == "dvd:///" ) current = `dvd; else if ( _url == "hd://" ) current = `hd; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn.opensuse.org