[yast-commit] r39763 - in /trunk/packager: package/ src/clients/ src/include/ src/modules/
Author: jsrain Date: Mon Jul 30 12:47:35 2007 New Revision: 39763 URL: http://svn.opensuse.org/viewcvs/yast?rev=39763&view=rev Log: allow to display release notes while installing packages (Fate #302342) Added: trunk/packager/src/include/load_release_notes.ycp Modified: trunk/packager/package/yast2-packager.changes trunk/packager/src/clients/inst_source.ycp trunk/packager/src/include/Makefile.am trunk/packager/src/modules/Makefile.am trunk/packager/src/modules/Packages.ycp trunk/packager/src/modules/SlideShow.ycp Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=39763&r1=39762&r2=39763&view=diff ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Mon Jul 30 12:47:35 2007 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Jul 30 11:41:35 CEST 2007 - jsrain@suse.cz + +- allow to display release notes while installing packages + (Fate #302342) + +------------------------------------------------------------------- Fri Jul 27 14:15:40 CEST 2007 - locilka@suse.cz - Added new SCR agents ag_anyxml and ag_zypp_repos (FATE #301785). Modified: trunk/packager/src/clients/inst_source.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_source.ycp?rev=39763&r1=39762&r2=39763&view=diff ============================================================================== --- trunk/packager/src/clients/inst_source.ycp (original) +++ trunk/packager/src/clients/inst_source.ycp Mon Jul 30 12:47:35 2007 @@ -483,9 +483,12 @@ `Left (`Label ("Category:")) )), `VSpacing (0.4), + // label `Left (`Label (_("Properties"))), + // check box `Left (`CheckBox (`id (`enable), `opt (`notify), _("Enabled"))), - `Left (`CheckBox (`id (`autorefresh), `opt (`notify), _("Autorefresh"))), + // check box + `Left (`CheckBox (`id (`autorefresh), `opt (`notify), _("Automatically Refresh"))), `VSpacing (0.4), (have_rug) ? `Left (`CheckBox (`id (`zmdsync), Modified: trunk/packager/src/include/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/include/Makefile.am?rev=39763&r1=39762&r2=39763&view=diff ============================================================================== --- trunk/packager/src/include/Makefile.am (original) +++ trunk/packager/src/include/Makefile.am Mon Jul 30 12:47:35 2007 @@ -7,7 +7,8 @@ ynclude_DATA = \ inst_source_dialogs.ycp \ - storage_include.ycp + storage_include.ycp \ + load_release_notes.ycp EXTRA_DIST = $(ynclude_DATA) Added: trunk/packager/src/include/load_release_notes.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/include/load_release_notes.ycp?rev=39763&view=auto ============================================================================== --- trunk/packager/src/include/load_release_notes.ycp (added) +++ trunk/packager/src/include/load_release_notes.ycp Mon Jul 30 12:47:35 2007 @@ -0,0 +1,64 @@ +/** + * File: installation/include/load_release_notes.ycp + * Module: Installation + * Summary: Load release notes from media + * Authors: Arvin Schnell <arvin@suse.de> + * Jiri Srain <jsrain@suse.cz> + * + * Load release notes from media + * + * $Id: release_notes_popup.ycp 34411 2006-11-15 13:45:11Z locilka $ + */ + +{ + textdomain "installation"; + + import "Language"; + import "Report"; + import "Stage"; + + /* release notes */ + string media_text = ""; + + +// FIXME get rid of similar funciton in instlalation/clients/release_notes_popup.ycp + + /* function to load release notes */ + define boolean load_release_notes (integer source_id) + { + string path_to_relnotes = "/docu"; + string path_templ = path_to_relnotes + "/RELEASE-NOTES.%1.rtf"; + y2debug ("Path template: %1", path_templ); + string tmp = sformat (path_templ, Language::language); + y2debug ("Trying to get %1", tmp); + tmp = Pkg::SourceProvideOptionalFile (source_id, 1, tmp); + if (tmp == nil) + { + tmp = sformat (path_templ, substring (Language::language, 0, 2)); + y2debug ("Trying to get %1", tmp); + tmp = Pkg::SourceProvideOptionalFile (source_id, 1, tmp); + } + if (tmp == nil) + { + tmp = sformat (path_templ, "en"); + y2debug ("Trying to get %1", tmp); + tmp = Pkg::SourceProvideFile (source_id, 1, tmp); + } + if (tmp == nil) + return false; + + media_text = (string)SCR::Read (.target.string, [tmp, ""]); + if (media_text != "" && media_text != nil) + return true; + return false; + }; + + string media_prefix = +// beginning of the rich text with the release notes +_("<p><b>These are the release notes made for the first initial release. They are +part of the installation media. During installation, if a connection +to the Internet is available, you can download updated release notes +from the SUSE Linux Web server.</b></p>"); + +} + Modified: trunk/packager/src/modules/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Makefile.am?rev=39763&r1=39762&r2=39763&view=diff ============================================================================== --- trunk/packager/src/modules/Makefile.am (original) +++ trunk/packager/src/modules/Makefile.am Mon Jul 30 12:47:35 2007 @@ -1,5 +1,13 @@ # Makefile.am for packager/src/modules +YCPCFLAGS = -I . -M . + module_DATA = $(wildcard [A-Z]*.ycp [A-Z]*.pm) EXTRA_DIST = $(module_DATA) + +packager: + ln -sf ../include packager + +ycpchook = packager + include $(top_srcdir)/Makefile.am.common Modified: trunk/packager/src/modules/Packages.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Packages.ycp?rev=39763&r1=39762&r2=39763&view=diff ============================================================================== --- trunk/packager/src/modules/Packages.ycp (original) +++ trunk/packager/src/modules/Packages.ycp Mon Jul 30 12:47:35 2007 @@ -39,6 +39,8 @@ import "FileUtils"; import "PackageCallbacks"; +include "packager/load_release_notes.ycp"; + /** * Force full proposal routine next run */ @@ -823,6 +825,11 @@ y2milestone ("Setting up the slide directory local copy: %1", our_slidedir); SlideShow::SetSlideDir (our_slidedir); + if (load_release_notes (source)) + { + SlideShow::relnotes = media_prefix + media_text; + } + } integer IntegrateServicePack (boolean show_popup, string base_url) { Modified: trunk/packager/src/modules/SlideShow.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SlideShow.ycp?rev=39763&r1=39762&r2=39763&view=diff ============================================================================== --- trunk/packager/src/modules/SlideShow.ycp (original) +++ trunk/packager/src/modules/SlideShow.ycp Mon Jul 30 12:47:35 2007 @@ -70,6 +70,8 @@ boolean user_abort = false; + global string relnotes = nil; + /** * Constructor **/ @@ -147,6 +149,15 @@ return widgets_created && UI::WidgetExists(`slidesPage ); } + /** + * Check if currently the "Release Notes" page is shown + * @return true if showing details, false otherwise + **/ + boolean ShowingRelNotes() + { + return widgets_created && UI::WidgetExists(`relNotesPage); + } + /** * Sum up all list items @@ -1483,6 +1494,14 @@ return widgets; } + term RelNotesPageWidgets() { + term widgets = AddProgressWidgets (`relNotesPage, + `RichText (relnotes) + ); + y2debug( "widget term: \n%1", widgets ); + return widgets; + } + /** * Switch from the 'details' view to the 'slide show' view. @@ -1522,6 +1541,22 @@ UI::ChangeWidget(`instLog, `Value, inst_log ); } + /** + * Switch to the 'release notes' view. + **/ + global void SwitchToReleaseNotesView() + { + if ( ShowingRelNotes() ) + return; + + if ( UI::WidgetExists(`tabContents ) ) + { + UI::ChangeWidget(`dumbTab, `CurrentItem, `showRelNotes ); + UI::ReplaceWidget(`tabContents, RelNotesPageWidgets() ); + UpdateTotalProgress(false); + } + } + string HelpText() { @@ -1541,14 +1576,18 @@ if ( UI::HasSpecialWidget(`DumbTab) && HaveSlideSupport() && HaveSlides() ) { - contents = - `DumbTab(`id(`dumbTab ), - [ + list tabs = [ + // tab + `item(`id(`showSlide ), _("Slide Sho&w") ), + // tab + `item(`id(`showDetails ), _("&Details") ) + ]; + if (relnotes != nil && relnotes != "") // tab - `item(`id(`showSlide ), _("Slide Sho&w") ), - // tab - `item(`id(`showDetails ), _("&Details") ) - ], + tabs = add (tabs, `item (`id (`showRelNotes), _("Release &Notes"))); + + contents = + `DumbTab(`id(`dumbTab ), tabs, `VBox( `VSpacing( 0.4 ), `VWeight( 1, // lower layout priority @@ -1788,6 +1827,11 @@ UI::ChangeWidget(`dumbTab, `CurrentItem, `showDetails ); } } + else if ( button == `showRelNotes && ! ShowingRelNotes() ) + { + user_switched_to_details = false; + SwitchToReleaseNotesView(); + } else if ( button == `debugHotkey ) { debug = ! debug; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsrain@svn.opensuse.org