[yast-commit] r51836 - in /trunk/packager/src: clients/repositories.ycp modules/SourceDialogs.ycp
Author: lslezak Date: Fri Oct 3 16:40:11 2008 New Revision: 51836 URL: http://svn.opensuse.org/viewcvs/yast?rev=51836&view=rev Log: - display "Service Name" label instead of "Repository Name" when editing a service Modified: trunk/packager/src/clients/repositories.ycp trunk/packager/src/modules/SourceDialogs.ycp Modified: trunk/packager/src/clients/repositories.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/repositories.ycp?rev=51836&r1=51835&r2=51836&view=diff ============================================================================== --- trunk/packager/src/clients/repositories.ycp (original) +++ trunk/packager/src/clients/repositories.ycp Fri Oct 3 16:40:11 2008 @@ -971,7 +971,7 @@ SourceDialogs::SetRepoName(service_info["name"]:""); do { - url = SourceDialogs::EditPopupType(url, false); + url = SourceDialogs::EditPopupService(url); if ( size( url ) == 0 ) break; if (url != old_url) Modified: trunk/packager/src/modules/SourceDialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SourceDialogs.ycp?rev=51836&r1=51835&r2=51836&view=diff ============================================================================== --- trunk/packager/src/modules/SourceDialogs.ycp (original) +++ trunk/packager/src/modules/SourceDialogs.ycp Fri Oct 3 16:40:11 2008 @@ -319,6 +319,23 @@ } +map<string,any> ServiceNameWidget() +{ + map<string,any> ret = RepoNameWidget(); + + ret["custom_widget"] = `VBox ( + // text entry + `InputField( `id( `repo_name ), `opt(`hstretch), _("&Service Name") ) + ); + + // help text + ret["help"] = _("<p><big><b>Service Name</b></big><br> +Use <b>Service Name</b> to specify the name of the service. If it is empty, YaST will use part of the service URL as the name.</p> +"); + + return ret; +} + // raw URL editation widget /** @@ -1938,6 +1955,7 @@ if (size (_widgets) == 0) _widgets = $[ "repo_name" : RepoNameWidget(), + "service_name" : ServiceNameWidget(), "url" : PlainURLWidget (), "nfs" : NFSWidget (), "cd" : CDWidget (), @@ -1996,12 +2014,12 @@ * @param proto string protocol to display popup for * @return term popup contents */ -term PopupContents (string proto) { +term PopupContents (string proto, boolean repository) { return `VBox ( `HSpacing (50), // label `Heading(_caption[proto]:""), - "repo_name", + repository ? "repo_name" : "service_name", `VSpacing(0.5), proto, `VSpacing(0.5), @@ -2009,14 +2027,15 @@ ); }; -string EditDisplay() +string EditDisplayInt(boolean repository) { string proto = URLScheme (_url); - y2milestone ("Displaying popup for protocol %1", proto); + y2milestone ("Displaying %1 popup for protocol %2", repository ? "repository" : "service", proto); - list<map<string,any> > w = CWM::CreateWidgets (["repo_name", proto], Widgets ()); - term contents = PopupContents (proto); + list<map<string,any> > w = CWM::CreateWidgets ([ (repository ? "repo_name" : "service_name"), proto], Widgets ()); + y2internal("w: %1", w); + term contents = PopupContents (proto, repository); contents = CWM::PrepareDialog (contents, w); UI::OpenDialog (contents); symbol ret = CWM::Run (w, $[]); @@ -2028,6 +2047,16 @@ return ""; } +string EditDisplay() +{ + return EditDisplayInt(true); +} + +string EditDisplayService() +{ + return EditDisplayInt(false); +} + /** * URL editation popup * @param url string url URL to edit @@ -2040,6 +2069,17 @@ } /** + * URL editation popup + * @param url string url URL to edit + * @return string modified URL or empty string if canceled + */ +global string EditPopupService (string url) { + SetURL (url); + + return EditDisplayService(); +} + +/** * URL editation popup, allows setting plaindir type * @param url string url URL to edit * @param plaindir_type set to true if the repository is plaindor @@ -2082,6 +2122,26 @@ "fallback_functions" : $[] ]); } + +/** + * Sample implementation of URL selection dialog + * @return symbol for wizard sequencer + */ +global symbol EditDialogProtocolService(string proto) +{ + y2milestone ("Displaying service dialog for protocol %1", proto); + string caption = _caption[proto]:""; + + return CWM::ShowAndRun ($[ + "widget_names" : ["service_name", proto], + "widget_descr" : Widgets (), + "contents" : `HVCenter(`MinWidth( 65, `VBox ("service_name", proto ) ) ), + "caption" : caption, + "back_button" : Label::BackButton (), + "next_button" : Label::NextButton (), + "fallback_functions" : $[] + ]); +} /** * Sample implementation of URL selection dialog * @return symbol for wizard sequencer @@ -2098,7 +2158,7 @@ */ global string TypePopup () { list<map<string,any> > w = CWM::CreateWidgets (["select"], Widgets ()); - term contents = PopupContents ("select"); + term contents = PopupContents ("select", true); contents = CWM::PrepareDialog (contents, w); UI::OpenDialog (contents); symbol ret = CWM::Run (w, $[]); -- 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