[yast-commit] r57033 - in /trunk/packager: package/yast2-packager.changes src/clients/repositories.ycp src/include/repositories_include.ycp
Author: lslezak Date: Wed Apr 29 14:52:50 2009 New Revision: 57033 URL: http://svn.opensuse.org/viewcvs/yast?rev=57033&view=rev Log: - replace only changed cells in the table after chaging repository URL - keep the current sorting order (bnc#475961), do not change the current item (bnc#411585) - preserve repository priority when changing URL - open create repository dialog in a new window, fixes broken UI caused by the previous fix (bnc#269034) Modified: trunk/packager/package/yast2-packager.changes trunk/packager/src/clients/repositories.ycp trunk/packager/src/include/repositories_include.ycp Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=57033&r1=57032&r2=57033&view=diff ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Wed Apr 29 14:52:50 2009 @@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Wed Apr 29 14:46:46 CEST 2009 - lslezak@suse.cz + +- replace only changed cells in the table after chaging repository + URL - keep the current sorting order (bnc#475961), do not change + the current item (bnc#411585) +- preserve repository priority when changing URL +- open create repository dialog in a new window, fixes broken UI + caused by the previous fix (bnc#269034) + +------------------------------------------------------------------- Tue Apr 28 16:33:41 CEST 2009 - lslezak@suse.cz - use URL.ycp for processing smb:// URLs (bnc#495109) Modified: trunk/packager/src/clients/repositories.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/repositories.ycp?rev=57033&r1=57032&r2=57033&view=diff ============================================================================== --- trunk/packager/src/clients/repositories.ycp (original) +++ trunk/packager/src/clients/repositories.ycp Wed Apr 29 14:52:50 2009 @@ -972,6 +972,8 @@ boolean same_url = (url == old_url); + y2debug("same_url: %1 (old: %2, new: %3)", same_url, old_url, url); + // special check for cd:// and dvd:// repositories if (!same_url) { @@ -1013,28 +1015,54 @@ boolean auto_refresh = sourceState["autorefresh"]:true; boolean keeppackages = sourceState["keeppackages"]:false; boolean enabled = sourceState["enabled"]:true; - y2milestone("Restoring the original properties: enabled: %1, autorefresh: %2, keeppackages: %3", enabled, auto_refresh, keeppackages); + integer priority = sourceState["priority"]:default_priority; + y2milestone("Restoring the original properties: enabled: %1, autorefresh: %2, keeppackages: %3, priority: %4", enabled, auto_refresh, keeppackages, priority); // set the original properties addedSource["autorefresh"] = auto_refresh; addedSource["keeppackages"] = keeppackages; addedSource["enabled"] = enabled; + addedSource["priority"] = priority; - sourceStatesOut[idx] = addedSource; - } + // get the ID of the old repo and mark it for removal + integer srcid = sourceStatesOut[global_current, "SrcId"]:-1; + if (srcid != -1) + { + sourcesToDelete = add (sourcesToDelete, srcid); + SourceManager::just_removed_sources = add (SourceManager::just_removed_sources, srcid); + } + + // replace the data + sourceStatesOut[global_current] = addedSource; - deleteSource( global_current ); - fillTable(repository_view, displayed_service); - fillCurrentRepoInfo(); + // refresh only the name and URL in the table + UI::ChangeWidget(`id(`table), `Cell( global_current, 3), addedSource["name"]:""); + UI::ChangeWidget(`id(`table), `Cell( global_current, 5), url); + + fillCurrentRepoInfo(); + } } } else { y2milestone ("URL is the same, not recreating the source"); - sourceState["name"] = SourceDialogs::GetRepoName (); - sourceStatesOut[ global_current ] = sourceState; - fillTable(repository_view, displayed_service); - fillCurrentRepoInfo(); + + string new_name = SourceDialogs::GetRepoName(); + if (new_name != sourceState["name"]:"") + { + sourceState["name"] = new_name; + sourceStatesOut[ global_current ] = sourceState; + + // update only the name cell in the table + UI::ChangeWidget(`id(`table), `Cell( global_current, 3), new_name); + + fillCurrentRepoInfo(); + } + else + { + y2milestone("The repository name has not been changed"); + } + createResult = `ok; } Modified: trunk/packager/src/include/repositories_include.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/include/repositories_include.ycp?rev=57033&r1=57032&r2=57033&view=diff ============================================================================== --- trunk/packager/src/include/repositories_include.ycp (original) +++ trunk/packager/src/include/repositories_include.ycp Wed Apr 29 14:52:50 2009 @@ -41,7 +41,8 @@ return ret; } - define symbol createSource( string url, boolean plaindir, boolean download, string preffered_name ) ``{ + define symbol createSourceImpl(string url, boolean plaindir, boolean download, string preffered_name) + { y2milestone("createSource: %1, plaindir: %2, download: %3, name: %4", URL::HidePassword(url), plaindir, download, preffered_name); if ( url != "" ) @@ -340,6 +341,15 @@ } } +// start createSource() function in extra wizard dialog +symbol createSource(string url, boolean plaindir, boolean download, string preffered_name) +{ + Wizard::CreateDialog(); + symbol ret = createSourceImpl(url, plaindir, download, preffered_name); + Wizard::CloseDialog(); + return ret; +} + symbol StoreSource () { string url = SourceDialogs::GetURL (); string name = SourceDialogs::GetRepoName (); -- 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